You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
b.an:4:5 error: 15 matching impls found for Print a
g n
/.../ante/stdlib/prelude.an:356:1 note: Candidate 1
impl Print u8 with printne x = print_unsigned (cast x)
/.../ante/stdlib/prelude.an:357:1 note: Candidate 2
impl Print u16 with printne x = print_unsigned (cast x)
/.../ante/stdlib/prelude.an:358:1 note: Candidate 3 (12 more hidden)
impl Print u32 with printne x = print_unsigned (cast x)
The Print a constraint arising from n: a given Int a to be solved at the scope of main - after the Print a constraint is tried so there is no defaulting to i32 yet. There are a few options here:
Default to i32 earlier (when?)
Delay the solving of Print a, this is the most attractive / seemingly correct option. Looking at the desugared form of the program without closures it is clear the closure environment can be generalized within the lambda:
Some midground, ad-hoc solution. E.g. When an error involves a defaulting type variable, keep some metadata to default it then and there to see if the error goes away. Any later uses of the variable would appear as i32.
Prompt the user for 'type annotations needed by this point' or similar. This could also be confusing, given f is in the process of typechecking we would likely issue this error for f, but it is n that needs a concrete type.
The text was updated successfully, but these errors were encountered:
The code
fails with:
The
Print a
constraint arising fromn: a
givenInt a
to be solved at the scope of main - after thePrint a
constraint is tried so there is no defaulting toi32
yet. There are a few options here:i32
earlier (when?)Print a
, this is the most attractive / seemingly correct option. Looking at the desugared form of the program without closures it is clear the closure environment can be generalized within the lambda:i32
.f
is in the process of typechecking we would likely issue this error forf
, but it isn
that needs a concrete type.The text was updated successfully, but these errors were encountered: