-
Notifications
You must be signed in to change notification settings - Fork 119
Fix persistent func typing to compile motoko-core
#5484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| persistent func h() : T { x }; | ||
| h; // TODO: non-eop should still typecheck here | ||
| }; | ||
| // don't allow `func() {}` to typecheck as `persistent() -> ()` for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I think anonymous lambdas can never be persistent in Luc's design
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They need a name, I have it in another test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think even just a name ain't enough. The name needs to be unique in the path (i.e. a declaration in a persistent context).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the same issue as the B.mo or the C.mo file in here: https://github.com/dfinity/motoko/pull/5354/files#diff-0e9e9083aa4cfa901cd7251a640e3a9b3f95eb13e0b10b34ed5bfeaa6b20ab1c
persistent func typing to compile motoko-core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Kamil. Much appreciated
persistent functo getmotoko-core(object-oriented branch) to compile (see the successful test run here)persistent functofuncin non-eop setting. This is probably less confusing route. We could revert to the "implicit conversion" way but we would need to add more of these conversions in the compiler where they were missing...