type A[T]:
i: T
impl[T1: ToStr] A[T1]:
fn test(self) =
printStr(self.i.toStr())
fn main() = A(i = 123i32).test()
Here type of A(i = 123i32) is A[I32], so we monomorphise A with T => I32 in the type map.
When we monmorphise A.test, we have T => I32 in the type map, but type of self.i is T1, not T, so monomorphiser crashes when trying to monomorphise type T1, which doesn't exist.
In the test
ImplBounds1
we have this:Here type of
A(i = 123i32)
isA[I32]
, so we monomorphiseA
withT => I32
in the type map.When we monmorphise
A.test
, we haveT => I32
in the type map, but type ofself.i
isT1
, notT
, so monomorphiser crashes when trying to monomorphise typeT1
, which doesn't exist.Not sure how to fix this best..