jfecher / ante

A safe, easy systems language
http://antelang.org
MIT License
1.9k stars 80 forks source link

`size_of` can query the size of generic types and cause a panic #154

Open PROMETHIA-27 opened 1 year ago

PROMETHIA-27 commented 1 year ago

Minimal repro:

type Generic t = 
    inner: t
print <| size_of <| MkType : Type Generic

This causes the following error: thread 'main' panicked at 'Kind error during llvm code generation', src\hir\monomorphisation.rs:278:9

This one seems like it'll require some actual design work to fix, unless it's a mistake that a generic type can be used like this in the first place.

jfecher commented 1 year ago

Yes, this looks like I'll need to add proper kind checking to resolve this