@@ -8053,7 +8053,6 @@ func (c *Checker) checkCallExpression(node *ast.Node, checkMode CheckMode) *Type
8053
8053
if !ast.IsDottedName(node.Expression()) {
8054
8054
c.error(node.Expression(), diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name)
8055
8055
} else if c.getEffectsSignature(node) == nil {
8056
- c.error(node.Expression(), diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation)
8057
8056
diagnostic := c.error(node.Expression(), diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation)
8058
8057
c.getTypeOfDottedName(node.Expression(), diagnostic)
8059
8058
}
@@ -18332,6 +18331,11 @@ func (c *Checker) getBaseTypes(t *Type) []*Type {
18332
18331
}
18333
18332
}
18334
18333
}
18334
+ // In general, base type resolution always precedes member resolution. However, it is possible
18335
+ // for resolution of type parameter defaults to cause circularity errors, possibly leaving
18336
+ // members partially resolved. Here we ensure any such partial resolution is reset.
18337
+ // See https://github.com/microsoft/TypeScript/issues/16861 for an example.
18338
+ t.objectFlags &^= ObjectFlagsMembersResolved
18335
18339
data.baseTypesResolved = true
18336
18340
}
18337
18341
return data.resolvedBaseTypes
@@ -18395,14 +18399,6 @@ func (c *Checker) resolveBaseTypesOfClass(t *Type) {
18395
18399
c.error(t.symbol.ValueDeclaration, diagnostics.Type_0_recursively_references_itself_as_a_base_type, c.TypeToString(t))
18396
18400
return
18397
18401
}
18398
- // !!! This logic is suspicious. We really shouldn't be un-resolving members after they've been resolved.
18399
- // if t.resolvedBaseTypes == resolvingEmptyArray {
18400
- // // Circular reference, likely through instantiation of default parameters
18401
- // // (otherwise there'd be an error from hasBaseType) - this is fine, but `.members` should be reset
18402
- // // as `getIndexedAccessType` via `instantiateType` via `getTypeFromClassOrInterfaceReference` forces a
18403
- // // partial instantiation of the members without the base types fully resolved
18404
- // t.members = nil
18405
- // }
18406
18402
t.AsInterfaceType().resolvedBaseTypes = []*Type{reducedBaseType}
18407
18403
}
18408
18404
0 commit comments