Fixup restrictive instantiations to actually erase type parameter constraints (#29592)

This commit is contained in:
Wesley Wigham
2019-01-25 15:18:07 -08:00
committed by GitHub
parent bd8c6259b9
commit 5f782bf58a
3 changed files with 7 additions and 6 deletions

View File

@@ -10636,7 +10636,11 @@ namespace ts {
}
function getRestrictiveTypeParameter(tp: TypeParameter) {
return !tp.constraint ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol));
return tp.constraint === unknownType ? tp : tp.restrictiveInstantiation || (
tp.restrictiveInstantiation = createTypeParameter(tp.symbol),
(tp.restrictiveInstantiation as TypeParameter).constraint = unknownType,
tp.restrictiveInstantiation
);
}
function restrictiveMapper(type: Type) {