Type checking fails when iterating over C types #757
Labels
accepting contributions
Issues that are suitable to be worked on by anybody, not just maintainers
bug
Defects, unintended behaviour, etc
compiler
Changes related to the compiler
Please describe the bug
Certain code patterns that involve C types, such as iterating over
Array[Int32]
, result in a type checking error such as illustrated by this code example:This produces the following compile-time error:
This error persists after adding an explicit type annotation to the
a
argument.Briefly poking around the code it seems we hit the following code:
inko/types/src/check.rs
Line 765 in 47907c4
Printing the value compared against it seems we're comparing against a type parameter. I'm a bit surprised by that because I figured we'd be comparing against a type placeholder instead. Perhaps we just add a case where it allows the type check if the type parameter doesn't define any requirements, but I'd first like to know why we're comparing against a type parameter in the first place.
Operating system
Fedora
Inko version
main
The text was updated successfully, but these errors were encountered: