File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -3357,7 +3357,7 @@ namespace ts {
3357
3357
// signatures, or if the property is actually declared in the type. In a union or intersection
3358
3358
// type, a property is considered known if it is known in any constituent type.
3359
3359
function isKnownProperty(type: Type, name: string): boolean {
3360
- if (type.flags & TypeFlags.ObjectType) {
3360
+ if (type.flags & TypeFlags.ObjectType && type !== globalObjectType ) {
3361
3361
var resolved = resolveStructuredTypeMembers(type);
3362
3362
return !!(resolved.properties.length === 0 ||
3363
3363
resolved.stringIndexType ||
@@ -3977,7 +3977,7 @@ namespace ts {
3977
3977
3978
3978
function isSubtypeOfAny(candidate: Type, types: Type[]): boolean {
3979
3979
for (let type of types) {
3980
- if (candidate !== type && isTypeSubtypeOf(candidate, type)) {
3980
+ if (candidate !== type && isTypeSubtypeOf(getRegularTypeOfObjectLiteral( candidate) , type)) {
3981
3981
return true;
3982
3982
}
3983
3983
}
You can’t perform that action at this time.
0 commit comments