Skip to content

feat: candid_service to specify actor type from Text#5878

Draft
ggreif wants to merge 29 commits intomasterfrom
gabor/candid-service
Draft

feat: candid_service to specify actor type from Text#5878
ggreif wants to merge 29 commits intomasterfrom
gabor/candid-service

Conversation

@ggreif
Copy link
Copy Markdown
Contributor

@ggreif ggreif commented Feb 25, 2026

I (for now) reused the from_candid token on the type plane.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 25, 2026

Comparing from 630cbbd to d2bf2cb:
The produced WebAssembly code seems to be completely unchanged.
In terms of gas, no changes are observed in 5 tests.
In terms of size, no changes are observed in 5 tests.

@ggreif ggreif force-pushed the gabor/candid-service branch from 77374de to 521387c Compare February 25, 2026 20:54
@ggreif ggreif force-pushed the gabor/candid-service branch from 521387c to c065ff8 Compare February 25, 2026 21:04
Comment thread src/mo_frontend/parser.mly Outdated
Comment thread test/fail/ok/candid-typ-error.tc.ok Outdated
@ggreif ggreif changed the title experiment: candid_service to specify actor type from Text feat: candid_service to specify actor type from Text Feb 27, 2026
Comment thread src/mo_frontend/typing.ml
let adorn = List.map (let open Diag in function
| {cat="syntax" as cat; _} as msg -> { msg with cat = "candid " ^ cat; code = "M0246" }
| {cat="type" as cat; _} as msg -> { msg with cat = "candid " ^ cat; code = "M0247" }
| msg -> msg) in
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is also file and import and whatnot...

Copy link
Copy Markdown
Contributor Author

@ggreif ggreif Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(cd test/idl/ok && git grep -e ": .* error") | grep -vE "(type|syntax) error"

ggreif and others added 3 commits March 2, 2026 13:29
Implements env-shim test demonstrating the new `from_candid` feature
that derives actor types from Candid service definitions. The test
includes a Backend module that reads an envvar, converts it to a
Principal, and casts it to a typed actor using `from_candid` with
inline Candid IDL syntax.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Use pipe operator |> with unwrapped underscore placeholders for
cleaner functional composition. Apply bash-style function call
syntax for envVar with single string argument.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ggreif ggreif self-assigned this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant