File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9781,15 +9781,15 @@ namespace ts {
9781
9781
return type.flags & TypeFlags.TypeParameter && !getConstraintFromTypeParameter(<TypeParameter>type);
9782
9782
}
9783
9783
9784
- function isTypeReferenceWithGenericArguments(type: Type) {
9785
- return getObjectFlags(type) & ObjectFlags.Reference && some((<TypeReference>type).typeArguments, isUnconstrainedTypeParameter);
9784
+ function isTypeReferenceWithGenericArguments(type: Type): boolean {
9785
+ return getObjectFlags(type) & ObjectFlags.Reference && some((<TypeReference>type).typeArguments, t => isUnconstrainedTypeParameter(t) || isTypeReferenceWithGenericArguments(t) );
9786
9786
}
9787
9787
9788
9788
/**
9789
9789
* getTypeReferenceId(A<T, number, U>) returns "111=0-12=1"
9790
9790
* where A.id=111 and number.id=12
9791
9791
*/
9792
- function getTypeReferenceId(type: TypeReference, typeParameters: Type[]) {
9792
+ function getTypeReferenceId(type: TypeReference, typeParameters: Type[], depth = 0 ) {
9793
9793
let result = "" + type.target.id;
9794
9794
for (const t of type.typeArguments) {
9795
9795
if (isUnconstrainedTypeParameter(t)) {
@@ -9800,6 +9800,9 @@ namespace ts {
9800
9800
}
9801
9801
result += "=" + index;
9802
9802
}
9803
+ else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) {
9804
+ result += "<" + getTypeReferenceId(t as TypeReference, typeParameters, depth + 1) + ">";
9805
+ }
9803
9806
else {
9804
9807
result += "-" + t.id;
9805
9808
}
You can’t perform that action at this time.
0 commit comments