-
Notifications
You must be signed in to change notification settings - Fork 28
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
Support for annotations #247
Conversation
# Conflicts: # hkmc2/shared/src/main/scala/hkmc2/codegen/Lowering.scala # hkmc2/shared/src/main/scala/hkmc2/semantics/Elaborator.scala # hkmc2/shared/src/main/scala/hkmc2/semantics/Term.scala
Summary
|
Please squash and merge after review. Thanks. |
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.
Thanks, it looks mostly good, but:
- You should probably warn about useless annotations in Lowering rather than Elaborator – indeed, the lowering will later make use of some annotations, like
@tailrec
. - Similarly, in Lowering, you should warn against useless annotations even on definitions (like class and value definitions).
hkmc2/shared/src/test/mlscript/syntax/annotations/Declarations.mls
Outdated
Show resolved
Hide resolved
Co-authored-by: Lionel Parreaux <lionel.parreaux@gmail.com>
It seems that there are still some warnings about unused annotations that need to be addressed in the elaborator, because by the time they reach the lowering phase, these trees are no longer present, such as |
Co-authored-by: Lionel Parreaux <lionel.parreaux@gmail.com>
Co-authored-by: Lionel Parreaux <lionel.parreaux@gmail.com>
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.
LGTM, thanks.
I'll merge after you the last conversation is resolved.
I'm trying to support annotations. As we discussed, recursive pattern normalization/compilation should be an opt-in feature and can be enabled by an annotation. For example,
I have only completed parsing as the first step. I am still not sure how it should be handled in the
Elaborator
, so I put this PR in draft status.