This ports a couple of tests from hindley-milner/src/__tests__/infer.tests.ts and fixes an issue with how we were doing substitution. The fix involves now creating new TCon instances in substitute(), instead mutating their .widened property directly. In a future PR we'll try replacing this approach by allow TCon and other types to be substituted instead of just TVars.
This ports a couple of tests from
hindley-milner/src/__tests__/infer.tests.ts
and fixes an issue with how we were doing substitution. The fix involves now creating newTCon
instances insubstitute()
, instead mutating their.widened
property directly. In a future PR we'll try replacing this approach by allowTCon
and other types to be substituted instead of justTVar
s.