-
Notifications
You must be signed in to change notification settings - Fork 24
Support modifies clauses #397
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
base: main
Are you sure you want to change the base?
Conversation
35ea24f to
938efc1
Compare
122c8f2 to
73bb97f
Compare
7b28966 to
72b81cb
Compare
| -- Pure field update returns the same type as the target | ||
| | .PureFieldUpdate target _ _ => computeExprType env types target | ||
| -- Calls — we don't track return types here, so fall back to TVoid | ||
| | .StaticCall _ _ => panic "Not supported StaticCall" |
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.
Given that this function will always need the option to fail (if given an ill-typed input), I'd prefer to prepare for that by making this function return Except ErrorType HighTypeMd, instead of using panic. I'll leave it up to you to choose what ErrorType should be. It could be a string or something more structured.
| def compositeTypeDecl : Core.Decl := .type (.con { name := "Composite", numargs := 0 }) | ||
|
|
||
| /-- The Box datatype with constructors for each Laurel primitive type + Composite -/ | ||
| def boxDatatype : Lambda.LDatatype Core.Visibility := |
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.
It would be great to move this to some sort of prelude file eventually, but that shouldn't block this PR.
Changes
Map Composite (Field Box)where Box is a datatype that can hold different values. This way, the translation of Laurel remains executable. The previous Heap encoding relied on axioms.Testing