-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/16 using definition #116
Conversation
The grammar rule is: USING Identifier = Type Refs sealangdotorg/sea#16
… to LHS Using cycles and not top-down ordered definitions are not handled at the moment. E.g. the following will fail because T1 depends on T2: ~~~ using T1 = T2; using T2 = ...; ~~~ This will be fixed by performing a top-sort of all "using definitions".
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.
overall nice PR and I'll approve it ASAP when the requested changes from casm-lang/libcasm-tc#21 are done!
Furthermore, in your PR description you are referencing a Refs #16
. Does this reference an issue from this libcasm-fe
repo or do you mean the feature issue sealangdotorg/sea#16 ?
@@ -502,6 +507,14 @@ Enumerators | |||
; | |||
|
|||
|
|||
UsingDefinition | |||
: USING Identifier EQUAL Type |
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.
finally 👍 🥇
Yes you are right, fixed! |
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.
really nice change
@@ -173,7 +182,8 @@ void TypeCheckVisitor::visit( BasicType& node ) | |||
{ | |||
m_log.error( | |||
{ node.sourceLocation() }, | |||
"cannot use " + symbol->description() + " '" + name + "' as type" ); | |||
"cannot use " + symbol->description() + " '" + name + "' as type", | |||
Code::TypeAnnotationInvalidBasicTypeName ); |
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.
well done 👍
Namespace aliasing doesn't work atm, e.g.:
This requires some changes in the namespace resolving procedure and will be fixed in another PR (next release) to avoid breakages.
Using cycles and not top-down ordered definitions are not handled at the moment.
E.g. the following will fail because T1 depends on T2:
This will be fixed by performing a top-sort of all "using definitions" in another PR (next release).
Refs sealangdotorg/sea#16
See casm-lang/libcasm-tc#21 for tests