Manually filter out type variables in type scheme that do nothing
This commit is contained in:
parent
d5e85869fb
commit
947b6d8740
1 changed files with 6 additions and 4 deletions
|
@ -838,10 +838,12 @@ class Forall extends SchemeBase {
|
||||||
public type: Type,
|
public type: Type,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
if (typeVars instanceof TVSet) {
|
this.typeVars = new TVSet();
|
||||||
this.typeVars = typeVars;
|
const allowed = new TVSet(type.getTypeVars());
|
||||||
} else {
|
for (const tv of typeVars) {
|
||||||
this.typeVars = new TVSet(typeVars);
|
if (allowed.has(tv)) {
|
||||||
|
this.typeVars.add(tv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue