File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -9927,9 +9927,9 @@ namespace ts {
9927
9927
}
9928
9928
9929
9929
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 ;
9933
9933
}
9934
9934
const prop = getPropertyOfType(apparentType, right.text);
9935
9935
if (!prop) {
@@ -11120,7 +11120,9 @@ namespace ts {
11120
11120
// types are provided for the argument expressions, and the result is always of type Any.
11121
11121
// We exclude union types because we may have a union of function types that happen to have
11122
11122
// 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))) {
11124
11126
// The unknownType indicates that an error already occurred (and was reported). No
11125
11127
// need to report another error in this case.
11126
11128
if (funcType !== unknownType && node.typeArguments) {
You can’t perform that action at this time.
0 commit comments