Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix class/interface merging issue + lint error
  • Loading branch information
ahejlsberg committed Aug 22, 2016
commit 201305859f9a9a9fc7e93de59238e647c49ced51
14 changes: 8 additions & 6 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3564,11 +3564,13 @@ namespace ts {
if (type.flags & TypeFlags.Tuple) {
type.resolvedBaseTypes = [createArrayType(getUnionType(type.typeParameters))];
}
else if (type.symbol.flags & SymbolFlags.Class) {
resolveBaseTypesOfClass(type);
}
else if (type.symbol.flags & SymbolFlags.Interface) {
resolveBaseTypesOfInterface(type);
else if (type.symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
if (type.symbol.flags & SymbolFlags.Class) {
resolveBaseTypesOfClass(type);
}
if (type.symbol.flags & SymbolFlags.Interface) {
resolveBaseTypesOfInterface(type);
}
}
else {
Debug.fail("type must be class or interface");
Expand Down Expand Up @@ -4972,7 +4974,7 @@ namespace ts {
}
Copy link
Copy Markdown
Member

@sandersn sandersn Aug 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloneTypeReference [](start = 17, length = 18)

Does this do anything meaningful for non-tuple types? #Resolved

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It clones any type reference, regardless of what it is a reference to. There's no particular use for that currently, but also no reason to special case for tuples.


function cloneTypeReference(source: TypeReference): TypeReference {
let type = <TypeReference>createObjectType(source.flags, source.symbol);
const type = <TypeReference>createObjectType(source.flags, source.symbol);
type.target = source.target;
type.typeArguments = source.typeArguments;
return type;
Expand Down