@@ -3810,7 +3810,7 @@ namespace ts {
3810
3810
}
3811
3811
3812
3812
function isConstructorType(type: Type): boolean {
3813
- return type.flags & TypeFlags.Object && getSignaturesOfType(type, SignatureKind.Construct).length > 0;
3813
+ return isValidBaseType( type) && getSignaturesOfType(type, SignatureKind.Construct).length > 0;
3814
3814
}
3815
3815
3816
3816
function getBaseTypeNodeOfClass(type: InterfaceType): ExpressionWithTypeArguments {
@@ -3849,7 +3849,7 @@ namespace ts {
3849
3849
return unknownType;
3850
3850
}
3851
3851
const baseConstructorType = checkExpression(baseTypeNode.expression);
3852
- if (baseConstructorType.flags & TypeFlags.Object) {
3852
+ if (baseConstructorType.flags & ( TypeFlags.Object | TypeFlags.Intersection) ) {
3853
3853
// Resolving the members of a class requires us to resolve the base class of that class.
3854
3854
// We force resolution here such that we catch circularities now.
3855
3855
resolveStructuredTypeMembers(<ObjectType>baseConstructorType);
@@ -3890,7 +3890,7 @@ namespace ts {
3890
3890
function resolveBaseTypesOfClass(type: InterfaceType): void {
3891
3891
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
3892
3892
const baseConstructorType = <ObjectType>getBaseConstructorTypeOfClass(type);
3893
- if (!(baseConstructorType.flags & TypeFlags.Object)) {
3893
+ if (!(baseConstructorType.flags & ( TypeFlags.Object | TypeFlags.Intersection) )) {
3894
3894
return;
3895
3895
}
3896
3896
const baseTypeNode = getBaseTypeNodeOfClass(type);
@@ -4591,9 +4591,9 @@ namespace ts {
4591
4591
constructSignatures = getDefaultConstructSignatures(classType);
4592
4592
}
4593
4593
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
4594
- if (baseConstructorType.flags & TypeFlags.Object) {
4594
+ if (baseConstructorType.flags & ( TypeFlags.Object | TypeFlags.Intersection) ) {
4595
4595
members = createSymbolTable(getNamedMembers(members));
4596
- addInheritedMembers(members, getPropertiesOfObjectType (baseConstructorType));
4596
+ addInheritedMembers(members, getPropertiesOfType (baseConstructorType));
4597
4597
}
4598
4598
}
4599
4599
const numberIndexInfo = symbol.flags & SymbolFlags.Enum ? enumNumberIndexInfo : undefined;
0 commit comments