mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
support generic variant setter (#55030)
This commit is contained in:
@@ -19098,10 +19098,16 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
|
||||
function instantiateSymbol(symbol: Symbol, mapper: TypeMapper): Symbol {
|
||||
const links = getSymbolLinks(symbol);
|
||||
// If the type of the symbol is already resolved, and if that type could not possibly
|
||||
// be affected by instantiation, simply return the symbol itself.
|
||||
if (links.type && !couldContainTypeVariables(links.type)) {
|
||||
// If the type of the symbol is already resolved, and if that type could not possibly
|
||||
// be affected by instantiation, simply return the symbol itself.
|
||||
return symbol;
|
||||
if (!(symbol.flags & SymbolFlags.SetAccessor)) {
|
||||
return symbol;
|
||||
}
|
||||
// If we're a setter, check writeType.
|
||||
if (links.writeType && !couldContainTypeVariables(links.writeType)) {
|
||||
return symbol;
|
||||
}
|
||||
}
|
||||
if (getCheckFlags(symbol) & CheckFlags.Instantiated) {
|
||||
// If symbol being instantiated is itself a instantiation, fetch the original target and combine the
|
||||
|
||||
Reference in New Issue
Block a user