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,
|
||||
) {
|
||||
super();
|
||||
if (typeVars instanceof TVSet) {
|
||||
this.typeVars = typeVars;
|
||||
} else {
|
||||
this.typeVars = new TVSet(typeVars);
|
||||
this.typeVars = new TVSet();
|
||||
const allowed = new TVSet(type.getTypeVars());
|
||||
for (const tv of typeVars) {
|
||||
if (allowed.has(tv)) {
|
||||
this.typeVars.add(tv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue