File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9927,9 +9927,9 @@ namespace ts {
99279927 }
99289928
99299929 const apparentType = getApparentType(getWidenedType(type));
9930- if (apparentType === unknownType) {
9931- // handle cases when type is Type parameter with invalid constraint
9932- return unknownType ;
9930+ if (apparentType === unknownType || (type.flags & TypeFlags.TypeParameter && isTypeAny(apparentType)) ) {
9931+ // handle cases when type is Type parameter with invalid or any constraint
9932+ return apparentType ;
99339933 }
99349934 const prop = getPropertyOfType(apparentType, right.text);
99359935 if (!prop) {
@@ -11120,7 +11120,9 @@ namespace ts {
1112011120 // types are provided for the argument expressions, and the result is always of type Any.
1112111121 // We exclude union types because we may have a union of function types that happen to have
1112211122 // no common signatures.
11123- if (isTypeAny(funcType) || (!callSignatures.length && !constructSignatures.length && !(funcType.flags & TypeFlags.Union) && isTypeAssignableTo(funcType, globalFunctionType))) {
11123+ if (isTypeAny(funcType) ||
11124+ (isTypeAny(apparentType) && funcType.flags & TypeFlags.TypeParameter) ||
11125+ (!callSignatures.length && !constructSignatures.length && !(funcType.flags & TypeFlags.Union) && isTypeAssignableTo(funcType, globalFunctionType))) {
1112411126 // The unknownType indicates that an error already occurred (and was reported). No
1112511127 // need to report another error in this case.
1112611128 if (funcType !== unknownType && node.typeArguments) {
You can’t perform that action at this time.
0 commit comments