inko
inko copied to clipboard
The compiler doesn't always emit an error if a type can't be fully inferred
Please describe the bug
When a type can't be fully inferred, the compiler is supposed to emit an error. This doesn't always happen though, such as for the following code snippet:
fn foo[T] -> Option[T] {
Option.None
}
class async Main {
fn async main {
foo
}
}
Since foo
isn't used in any meaningful way, its type isn't inferred. An error does pop up if we (for example) try to unwrap the Option
using foo.get
.
Operating system
Fedora
Inko version
main