forked from metaborg/pie
-
Notifications
You must be signed in to change notification settings - Fork 0
Value declaration compiles to unit #295
Copy link
Copy link
Open
Labels
Component: code generationSomething that concerns the generated codeSomething that concerns the generated codePriority: lowStatus: specifiedEnhancement that is ready to implementEnhancement that is ready to implementType: bugSomething isn't workingSomething isn't working
Description
Metadata
Metadata
Assignees
Labels
Component: code generationSomething that concerns the generated codeSomething that concerns the generated codePriority: lowStatus: specifiedEnhancement that is ready to implementEnhancement that is ready to implementType: bugSomething isn't workingSomething isn't working
Summary
The value of a value declaration is supposed to be its expression, but it compiles to
unitTodo
Reproduction
Given:
func valDec() -> int = val x = 7, run Spoofax > Generate > JavaExpected: generates
Actual: generates
Details
Value declarations used to have unit type and value. The intended semantics were changed to be the type and value of the expression that is assigned. Static analysis correctly gives no errors on the example function, but the compiler still generates
UnitLit()