Merge pull request #13604 from Microsoft/intersectionBaseTypes

Allow deriving from object and intersection types
This commit is contained in:
Anders Hejlsberg
2017-01-21 11:38:24 -10:00
committed by GitHub
17 changed files with 1474 additions and 62 deletions

View File

@@ -382,7 +382,7 @@ namespace ts {
getNumberIndexType(): Type {
return this.checker.getIndexTypeOfType(this, IndexKind.Number);
}
getBaseTypes(): ObjectType[] {
getBaseTypes(): BaseType[] {
return this.flags & TypeFlags.Object && this.objectFlags & (ObjectFlags.Class | ObjectFlags.Interface)
? this.checker.getBaseTypes(<InterfaceType><Type>this)
: undefined;

View File

@@ -33,7 +33,7 @@ namespace ts {
getConstructSignatures(): Signature[];
getStringIndexType(): Type;
getNumberIndexType(): Type;
getBaseTypes(): ObjectType[];
getBaseTypes(): BaseType[];
getNonNullableType(): Type;
}