The unary type is hacky and broken #84
Labels
area: AST
Issues which affect AST code
area: build
Construction of lower-level representation (i.e. LLVM modules)
area: identify
The "identify pass" - the ScopedId De Brujin index, or "ensure name exists in scope"
area: syntax
Syntactical changes to the language
issue: bug
Bug report
priority: low
Consider higher priority issues first
status: blocked
Cannot be done until other changes are made
The issue
There are several issues which cause ICEs around the unary/void/
()
type. The compiler may panic in a few ways with code that attempts to use the result of a function which ends with a return void/plainreturn
.The only place this type can be expressed in code is as a return type of a function without a
->
arrow. Consider the following definition:let x = foo()
, causes an error in the identifier as it doesn't know the type of()
forx
return foo()
also errors for different reasonsWhy we can't fix this
We can't represent the type of
()
in LLVM. Although #85 was able to fix the direct case offoo()
, we want the result of this to eventually be a real unary type()
in Snirk and emit LLVM code around this.Fixing these issues is blocked on an AST representation/pass that decouples the main AST from LLVM in order to handle these cases properly on the compilation side.
The text was updated successfully, but these errors were encountered: