Separate Ast Types from real Type
Champii opened this issue · 0 comments
Champii commented
We need a way to represent the types as written in the code, and another more concrete representation for the constaint/typechecking/generation phases
This will stop having unresolved Trait Foo
for types we don't know of, early in the compilation process.
It will also remove the need to keep struct names globally in the parser for the same reason.
We could have a generic-purpose struct Type(String)
that would be interpreted later on.
- What about user-defined primitive types ? In Rust, the 'builtin' types (i64, str, usize, ...) are not builtin, but rather defined in the
core
lib via various macros. This is an interesting approach that we should lookout