@@ -17774,9 +17774,9 @@ namespace ts {
1777417774 }
1777517775
1777617776 function getInstanceOfAliasOrReferenceWithMarker(input: Type, typeArguments: readonly Type[]) {
17777- const s = input.aliasSymbol ? getTypeAliasInstantiation(input.aliasSymbol, typeArguments) : createTypeReference((<TypeReference>input).target, typeArguments);
17777+ const s = input.aliasSymbol && !(getObjectFlags(input) & ObjectFlags.Reference) ? getTypeAliasInstantiation(input.aliasSymbol, typeArguments) : createTypeReference((<TypeReference>input).target, typeArguments);
1777817778 if (s.aliasSymbol) s.aliasTypeArgumentsContainsMarker = true;
17779- else (<TypeReference>s).objectFlags |= ObjectFlags.MarkerType;
17779+ if (getObjectFlags(s) & ObjectFlags.Reference) (<TypeReference>s).objectFlags |= ObjectFlags.MarkerType;
1778017780 return s;
1778117781 }
1778217782
@@ -17873,12 +17873,12 @@ namespace ts {
1787317873 // is some specialization or subtype of Q
1787417874 // This is difficult to detect generally, so we scan for prior comparisons of the same instantiated type, and match up matching
1787517875 // type arguments into sets to create a canonicalization based on those matches
17876- if (relation !== identityRelation && ((source.aliasSymbol && !source.aliasTypeArgumentsContainsMarker && source.aliasTypeArguments) || (getObjectFlags(source) & ObjectFlags.Reference && !!getTypeArguments(<TypeReference>source).length && !(getObjectFlags(source) & ObjectFlags.MarkerType))) &&
17877- ((target.aliasSymbol && !target.aliasTypeArgumentsContainsMarker && target.aliasTypeArguments) || (getObjectFlags(target) & ObjectFlags.Reference && !!getTypeArguments(<TypeReference>target).length && !(getObjectFlags(target) & ObjectFlags.MarkerType)))) {
17876+ if (relation !== identityRelation && ((source.aliasSymbol && !source.aliasTypeArgumentsContainsMarker && length( source.aliasTypeArguments) ) || (getObjectFlags(source) & ObjectFlags.Reference && !!getTypeArguments(<TypeReference>source).length && !(getObjectFlags(source) & ObjectFlags.MarkerType))) &&
17877+ ((target.aliasSymbol && !target.aliasTypeArgumentsContainsMarker && length( target.aliasTypeArguments) ) || (getObjectFlags(target) & ObjectFlags.Reference && !!getTypeArguments(<TypeReference>target).length && !(getObjectFlags(target) & ObjectFlags.MarkerType)))) {
1787817878 if (source.aliasSymbol || target.aliasSymbol || (<TypeReference>source).target !== (<TypeReference>target).target) { // ensure like symbols are just handled by standard variance analysis
17879- const sourceTypeArguments = source.aliasTypeArguments || getTypeArguments(<TypeReference>source);
17879+ const sourceTypeArguments = getObjectFlags( source) & ObjectFlags.Reference ? getTypeArguments(<TypeReference>source) : source.aliasTypeArguments! ;
1788017880 const sourceHasMarker = some(sourceTypeArguments, a => a === markerOtherType);
17881- const targetTypeArguments = target.aliasTypeArguments || getTypeArguments(<TypeReference>target);
17881+ const targetTypeArguments = getObjectFlags( target) & ObjectFlags.Reference ? getTypeArguments(<TypeReference>target) : target.aliasTypeArguments! ;
1788217882 const targetHasMarker = some(targetTypeArguments, a => a === markerOtherType);
1788317883 // We're using `markerOtherType` as an existential, so we can't use it again if it's already in use,
1788417884 // as we'd get spurious equivalencies - we'd need to use a second existential type, and once we're doing
0 commit comments