jakt icon indicating copy to clipboard operation
jakt copied to clipboard

selfhost/typechecker: Output type mismatch error after generic type p…

Open onsah opened this issue 3 years ago • 1 comments

…arameter number mismatch error

  • Output Type mismatch after mismatched number of generic parameters for T error
  • Extract Type mismatch error to a helper function

This gets us closer to pass constructor_with_different_generic_instance.jakt. But because currently unknown and void points to the same type the error message is not exactly as wanted. This change now additionally outputs

Error: Type mismatch: expected ‘B’, but got ‘[void]’
----- tests/typechecker/constructor_with_different_generic_instance.jakt:12:13
 11 | function main() { 
 12 |     mut a = A(b: []) 
                  ^- Type mismatch: expected ‘B’, but got ‘[void]’
 13 | } 
-----

The expected output is Type mismatch: expected ‘B’, but got ‘[unknown]’

onsah avatar Jul 11 '22 14:07 onsah

This has conflicts.

awesomekling avatar Jul 14 '22 11:07 awesomekling

Closing this since it's had conflicts for 2 months with no further work.

AtkinsSJ avatar Aug 31 '22 21:08 AtkinsSJ