mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-27 04:46:25 -05:00
Fix crash when circular reference in variance annotations (#48539)
* Fix crash when circular reference in variance annotations * chore: clean code
This commit is contained in:
@@ -20640,6 +20640,9 @@ namespace ts {
|
||||
function createMarkerType(symbol: Symbol, source: TypeParameter, target: Type) {
|
||||
const mapper = makeUnaryTypeMapper(source, target);
|
||||
const type = getDeclaredTypeOfSymbol(symbol);
|
||||
if (isErrorType(type)) {
|
||||
return type;
|
||||
}
|
||||
const result = symbol.flags & SymbolFlags.TypeAlias ?
|
||||
getTypeAliasInstantiation(symbol, instantiateTypes(getSymbolLinks(symbol).typeParameters!, mapper)) :
|
||||
createTypeReference(type as GenericType, instantiateTypes((type as GenericType).typeParameters, mapper));
|
||||
|
||||
Reference in New Issue
Block a user