inko icon indicating copy to clipboard operation
inko copied to clipboard

The compiler doesn't always emit an error if a type can't be fully inferred

Open yorickpeterse opened this issue 5 months ago • 0 comments

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

yorickpeterse avatar Sep 17 '24 01:09 yorickpeterse