diff --git a/bin/tsc.js b/bin/tsc.js
index 52ffd2b3b1b..b6cb0edc12c 100644
--- a/bin/tsc.js
+++ b/bin/tsc.js
@@ -600,10 +600,6 @@ var ts;
"\u2029": "\\u2029",
"\u0085": "\\u0085"
};
- function getDefaultLibFileName(options) {
- return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts";
- }
- ts.getDefaultLibFileName = getDefaultLibFileName;
function Symbol(flags, name) {
this.flags = flags;
this.name = name;
@@ -1076,6 +1072,12 @@ var ts;
Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." },
Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." },
A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." },
+ Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
+ Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
+ Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." },
Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@@ -1443,7 +1445,7 @@ var ts;
(function (ts) {
var textToToken = {
"any": 112,
- "as": 102,
+ "as": 111,
"boolean": 113,
"break": 66,
"case": 67,
@@ -1468,24 +1470,24 @@ var ts;
"function": 83,
"get": 116,
"if": 84,
- "implements": 103,
+ "implements": 102,
"import": 85,
"in": 86,
"instanceof": 87,
- "interface": 104,
- "let": 105,
+ "interface": 103,
+ "let": 104,
"module": 117,
"new": 88,
"null": 89,
"number": 119,
- "package": 106,
- "private": 107,
- "protected": 108,
- "public": 109,
+ "package": 105,
+ "private": 106,
+ "protected": 107,
+ "public": 108,
"require": 118,
"return": 90,
"set": 120,
- "static": 110,
+ "static": 109,
"string": 121,
"super": 91,
"switch": 92,
@@ -1500,7 +1502,7 @@ var ts;
"void": 99,
"while": 100,
"with": 101,
- "yield": 111,
+ "yield": 110,
"of": 125,
"{": 14,
"}": 15,
@@ -3383,7 +3385,7 @@ var ts;
scanner.setTextPos(pos);
scanner.scan();
var start = scanner.getTokenPos();
- return createTextSpanFromBounds(start, scanner.getTextPos());
+ return ts.createTextSpanFromBounds(start, scanner.getTextPos());
}
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForNode(sourceFile, node) {
@@ -3392,7 +3394,7 @@ var ts;
case 227:
var pos_1 = ts.skipTrivia(sourceFile.text, 0, false);
if (pos_1 === sourceFile.text.length) {
- return createTextSpan(0, 0);
+ return ts.createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos_1);
case 198:
@@ -3414,7 +3416,7 @@ var ts;
var pos = nodeIsMissing(errorNode)
? errorNode.pos
: ts.skipTrivia(sourceFile.text, errorNode.pos);
- return createTextSpanFromBounds(pos, errorNode.end);
+ return ts.createTextSpanFromBounds(pos, errorNode.end);
}
ts.getErrorSpanForNode = getErrorSpanForNode;
function isExternalModule(file) {
@@ -4008,7 +4010,7 @@ var ts;
}
ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement;
function getClassImplementsHeritageClauseElements(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 103);
+ var heritageClause = getHeritageClause(node.heritageClauses, 102);
return heritageClause ? heritageClause.types : undefined;
}
ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements;
@@ -4123,10 +4125,10 @@ var ts;
ts.isESSymbolIdentifier = isESSymbolIdentifier;
function isModifier(token) {
switch (token) {
- case 109:
- case 107:
case 108:
- case 110:
+ case 106:
+ case 107:
+ case 109:
case 78:
case 115:
case 70:
@@ -4136,115 +4138,6 @@ var ts;
return false;
}
ts.isModifier = isModifier;
- function textSpanEnd(span) {
- return span.start + span.length;
- }
- ts.textSpanEnd = textSpanEnd;
- function textSpanIsEmpty(span) {
- return span.length === 0;
- }
- ts.textSpanIsEmpty = textSpanIsEmpty;
- function textSpanContainsPosition(span, position) {
- return position >= span.start && position < textSpanEnd(span);
- }
- ts.textSpanContainsPosition = textSpanContainsPosition;
- function textSpanContainsTextSpan(span, other) {
- return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
- }
- ts.textSpanContainsTextSpan = textSpanContainsTextSpan;
- function textSpanOverlapsWith(span, other) {
- var overlapStart = Math.max(span.start, other.start);
- var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
- return overlapStart < overlapEnd;
- }
- ts.textSpanOverlapsWith = textSpanOverlapsWith;
- function textSpanOverlap(span1, span2) {
- var overlapStart = Math.max(span1.start, span2.start);
- var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
- if (overlapStart < overlapEnd) {
- return createTextSpanFromBounds(overlapStart, overlapEnd);
- }
- return undefined;
- }
- ts.textSpanOverlap = textSpanOverlap;
- function textSpanIntersectsWithTextSpan(span, other) {
- return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start;
- }
- ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan;
- function textSpanIntersectsWith(span, start, length) {
- var end = start + length;
- return start <= textSpanEnd(span) && end >= span.start;
- }
- ts.textSpanIntersectsWith = textSpanIntersectsWith;
- function textSpanIntersectsWithPosition(span, position) {
- return position <= textSpanEnd(span) && position >= span.start;
- }
- ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition;
- function textSpanIntersection(span1, span2) {
- var intersectStart = Math.max(span1.start, span2.start);
- var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
- if (intersectStart <= intersectEnd) {
- return createTextSpanFromBounds(intersectStart, intersectEnd);
- }
- return undefined;
- }
- ts.textSpanIntersection = textSpanIntersection;
- function createTextSpan(start, length) {
- if (start < 0) {
- throw new Error("start < 0");
- }
- if (length < 0) {
- throw new Error("length < 0");
- }
- return { start: start, length: length };
- }
- ts.createTextSpan = createTextSpan;
- function createTextSpanFromBounds(start, end) {
- return createTextSpan(start, end - start);
- }
- ts.createTextSpanFromBounds = createTextSpanFromBounds;
- function textChangeRangeNewSpan(range) {
- return createTextSpan(range.span.start, range.newLength);
- }
- ts.textChangeRangeNewSpan = textChangeRangeNewSpan;
- function textChangeRangeIsUnchanged(range) {
- return textSpanIsEmpty(range.span) && range.newLength === 0;
- }
- ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged;
- function createTextChangeRange(span, newLength) {
- if (newLength < 0) {
- throw new Error("newLength < 0");
- }
- return { span: span, newLength: newLength };
- }
- ts.createTextChangeRange = createTextChangeRange;
- ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
- function collapseTextChangeRangesAcrossMultipleVersions(changes) {
- if (changes.length === 0) {
- return ts.unchangedTextChangeRange;
- }
- if (changes.length === 1) {
- return changes[0];
- }
- var change0 = changes[0];
- var oldStartN = change0.span.start;
- var oldEndN = textSpanEnd(change0.span);
- var newEndN = oldStartN + change0.newLength;
- for (var i = 1; i < changes.length; i++) {
- var nextChange = changes[i];
- var oldStart1 = oldStartN;
- var oldEnd1 = oldEndN;
- var newEnd1 = newEndN;
- var oldStart2 = nextChange.span.start;
- var oldEnd2 = textSpanEnd(nextChange.span);
- var newEnd2 = oldStart2 + nextChange.newLength;
- oldStartN = Math.min(oldStart1, oldStart2);
- oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
- newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
- }
- return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
- }
- ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function nodeStartsNewLexicalEnvironment(n) {
return isFunctionLike(n) || n.kind === 205 || n.kind === 227;
}
@@ -4641,6 +4534,122 @@ var ts;
}
ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault;
})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ function getDefaultLibFileName(options) {
+ return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts";
+ }
+ ts.getDefaultLibFileName = getDefaultLibFileName;
+ function textSpanEnd(span) {
+ return span.start + span.length;
+ }
+ ts.textSpanEnd = textSpanEnd;
+ function textSpanIsEmpty(span) {
+ return span.length === 0;
+ }
+ ts.textSpanIsEmpty = textSpanIsEmpty;
+ function textSpanContainsPosition(span, position) {
+ return position >= span.start && position < textSpanEnd(span);
+ }
+ ts.textSpanContainsPosition = textSpanContainsPosition;
+ function textSpanContainsTextSpan(span, other) {
+ return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
+ }
+ ts.textSpanContainsTextSpan = textSpanContainsTextSpan;
+ function textSpanOverlapsWith(span, other) {
+ var overlapStart = Math.max(span.start, other.start);
+ var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
+ return overlapStart < overlapEnd;
+ }
+ ts.textSpanOverlapsWith = textSpanOverlapsWith;
+ function textSpanOverlap(span1, span2) {
+ var overlapStart = Math.max(span1.start, span2.start);
+ var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
+ if (overlapStart < overlapEnd) {
+ return createTextSpanFromBounds(overlapStart, overlapEnd);
+ }
+ return undefined;
+ }
+ ts.textSpanOverlap = textSpanOverlap;
+ function textSpanIntersectsWithTextSpan(span, other) {
+ return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start;
+ }
+ ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan;
+ function textSpanIntersectsWith(span, start, length) {
+ var end = start + length;
+ return start <= textSpanEnd(span) && end >= span.start;
+ }
+ ts.textSpanIntersectsWith = textSpanIntersectsWith;
+ function textSpanIntersectsWithPosition(span, position) {
+ return position <= textSpanEnd(span) && position >= span.start;
+ }
+ ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition;
+ function textSpanIntersection(span1, span2) {
+ var intersectStart = Math.max(span1.start, span2.start);
+ var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
+ if (intersectStart <= intersectEnd) {
+ return createTextSpanFromBounds(intersectStart, intersectEnd);
+ }
+ return undefined;
+ }
+ ts.textSpanIntersection = textSpanIntersection;
+ function createTextSpan(start, length) {
+ if (start < 0) {
+ throw new Error("start < 0");
+ }
+ if (length < 0) {
+ throw new Error("length < 0");
+ }
+ return { start: start, length: length };
+ }
+ ts.createTextSpan = createTextSpan;
+ function createTextSpanFromBounds(start, end) {
+ return createTextSpan(start, end - start);
+ }
+ ts.createTextSpanFromBounds = createTextSpanFromBounds;
+ function textChangeRangeNewSpan(range) {
+ return createTextSpan(range.span.start, range.newLength);
+ }
+ ts.textChangeRangeNewSpan = textChangeRangeNewSpan;
+ function textChangeRangeIsUnchanged(range) {
+ return textSpanIsEmpty(range.span) && range.newLength === 0;
+ }
+ ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged;
+ function createTextChangeRange(span, newLength) {
+ if (newLength < 0) {
+ throw new Error("newLength < 0");
+ }
+ return { span: span, newLength: newLength };
+ }
+ ts.createTextChangeRange = createTextChangeRange;
+ ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
+ function collapseTextChangeRangesAcrossMultipleVersions(changes) {
+ if (changes.length === 0) {
+ return ts.unchangedTextChangeRange;
+ }
+ if (changes.length === 1) {
+ return changes[0];
+ }
+ var change0 = changes[0];
+ var oldStartN = change0.span.start;
+ var oldEndN = textSpanEnd(change0.span);
+ var newEndN = oldStartN + change0.newLength;
+ for (var i = 1; i < changes.length; i++) {
+ var nextChange = changes[i];
+ var oldStart1 = oldStartN;
+ var oldEnd1 = oldEndN;
+ var newEnd1 = newEndN;
+ var oldStart2 = nextChange.span.start;
+ var oldEnd2 = textSpanEnd(nextChange.span);
+ var newEnd2 = oldStart2 + nextChange.newLength;
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+ return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
+ }
+ ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
+})(ts || (ts = {}));
///
///
var ts;
@@ -4979,10 +4988,10 @@ var ts;
;
function modifierToFlag(token) {
switch (token) {
- case 110: return 128;
- case 109: return 16;
- case 108: return 64;
- case 107: return 32;
+ case 109: return 128;
+ case 108: return 16;
+ case 107: return 64;
+ case 106: return 32;
case 78: return 1;
case 115: return 2;
case 70: return 8192;
@@ -5489,10 +5498,10 @@ var ts;
if (token === 65) {
return true;
}
- if (token === 111 && inYieldContext()) {
+ if (token === 110 && inYieldContext()) {
return false;
}
- return inStrictModeContext() ? token > 111 : token > 101;
+ return token > 101;
}
function parseExpected(kind, diagnosticMessage) {
if (token === kind) {
@@ -5586,6 +5595,9 @@ var ts;
identifierCount++;
if (isIdentifier) {
var node = createNode(65);
+ if (token !== 65) {
+ node.originalKeywordKind = token;
+ }
node.text = internIdentifier(scanner.getTokenValue());
nextToken();
return finishNode(node);
@@ -5722,7 +5734,7 @@ var ts;
ts.Debug.assert(token === 14);
if (nextToken() === 15) {
var next = nextToken();
- return next === 23 || next === 14 || next === 79 || next === 103;
+ return next === 23 || next === 14 || next === 79 || next === 102;
}
return true;
}
@@ -5731,7 +5743,7 @@ var ts;
return isIdentifier();
}
function isHeritageClauseExtendsOrImplementsKeyword() {
- if (token === 103 ||
+ if (token === 102 ||
token === 79) {
return lookAhead(nextTokenIsStartOfExpression);
}
@@ -5759,11 +5771,11 @@ var ts;
case 4:
return token === 15 || token === 67 || token === 73;
case 8:
- return token === 14 || token === 79 || token === 103;
+ return token === 14 || token === 79 || token === 102;
case 9:
return isVariableDeclaratorListTerminator();
case 16:
- return token === 25 || token === 16 || token === 14 || token === 79 || token === 103;
+ return token === 25 || token === 16 || token === 14 || token === 79 || token === 102;
case 12:
return token === 17 || token === 22;
case 14:
@@ -6567,7 +6579,7 @@ var ts;
case 38:
case 39:
case 24:
- case 111:
+ case 110:
return true;
default:
if (isBinaryOperator()) {
@@ -6637,7 +6649,7 @@ var ts;
return parseConditionalExpressionRest(expr);
}
function isYieldExpression() {
- if (token === 111) {
+ if (token === 110) {
if (inYieldContext()) {
return true;
}
@@ -7262,7 +7274,7 @@ var ts;
parseExpected(16);
var initializer = undefined;
if (token !== 22) {
- if (token === 98 || token === 105 || token === 70) {
+ if (token === 98 || token === 104 || token === 70) {
initializer = parseVariableDeclarationList(true);
}
else {
@@ -7423,7 +7435,7 @@ var ts;
return !inErrorRecovery;
case 14:
case 98:
- case 105:
+ case 104:
case 83:
case 69:
case 84:
@@ -7444,17 +7456,17 @@ var ts;
case 70:
var isConstEnum = lookAhead(nextTokenIsEnumKeyword);
return !isConstEnum;
- case 104:
+ case 103:
case 117:
case 77:
case 123:
if (isDeclarationStart()) {
return false;
}
- case 109:
- case 107:
case 108:
- case 110:
+ case 106:
+ case 107:
+ case 109:
if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) {
return false;
}
@@ -7509,7 +7521,7 @@ var ts;
return parseTryStatement();
case 72:
return parseDebuggerStatement();
- case 105:
+ case 104:
if (isLetDeclaration()) {
return parseVariableStatement(scanner.getStartPos(), undefined, undefined);
}
@@ -7534,7 +7546,7 @@ var ts;
return undefined;
}
return parseVariableStatement(start, decorators, modifiers);
- case 105:
+ case 104:
if (!isLetDeclaration()) {
return undefined;
}
@@ -7619,7 +7631,7 @@ var ts;
switch (token) {
case 98:
break;
- case 105:
+ case 104:
node.flags |= 4096;
break;
case 70:
@@ -7716,6 +7728,17 @@ var ts;
node.body = parseFunctionBlockOrSemicolon(false);
return finishNode(node);
}
+ function isClassMemberModifier(idToken) {
+ switch (idToken) {
+ case 108:
+ case 106:
+ case 107:
+ case 109:
+ return true;
+ default:
+ return false;
+ }
+ }
function isClassMemberStart() {
var idToken;
if (token === 52) {
@@ -7723,6 +7746,9 @@ var ts;
}
while (ts.isModifier(token)) {
idToken = token;
+ if (isClassMemberModifier(idToken)) {
+ return true;
+ }
nextToken();
}
if (token === 35) {
@@ -7870,7 +7896,7 @@ var ts;
return parseList(19, false, parseHeritageClause);
}
function parseHeritageClause() {
- if (token === 79 || token === 103) {
+ if (token === 79 || token === 102) {
var node = createNode(222);
node.token = token;
nextToken();
@@ -7888,7 +7914,7 @@ var ts;
return finishNode(node);
}
function isHeritageClause() {
- return token === 79 || token === 103;
+ return token === 79 || token === 102;
}
function parseClassMembers() {
return parseList(6, false, parseClassElement);
@@ -7897,7 +7923,7 @@ var ts;
var node = createNode(202, fullStart);
node.decorators = decorators;
setModifiers(node, modifiers);
- parseExpected(104);
+ parseExpected(103);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
node.heritageClauses = parseHeritageClauses(false);
@@ -8054,7 +8080,7 @@ var ts;
function parseNamespaceImport() {
var namespaceImport = createNode(211);
parseExpected(35);
- parseExpected(102);
+ parseExpected(111);
namespaceImport.name = parseIdentifier();
return finishNode(namespaceImport);
}
@@ -8075,9 +8101,9 @@ var ts;
var checkIdentifierStart = scanner.getTokenPos();
var checkIdentifierEnd = scanner.getTextPos();
var identifierName = parseIdentifierName();
- if (token === 102) {
+ if (token === 111) {
node.propertyName = identifierName;
- parseExpected(102);
+ parseExpected(111);
checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier();
checkIdentifierStart = scanner.getTokenPos();
checkIdentifierEnd = scanner.getTextPos();
@@ -8131,10 +8157,10 @@ var ts;
case 70:
case 83:
return true;
- case 105:
+ case 104:
return isLetDeclaration();
case 69:
- case 104:
+ case 103:
case 77:
case 123:
return lookAhead(nextTokenIsIdentifierOrKeyword);
@@ -8145,10 +8171,10 @@ var ts;
case 78:
return lookAhead(nextTokenCanFollowExportKeyword);
case 115:
- case 109:
- case 107:
case 108:
- case 110:
+ case 106:
+ case 107:
+ case 109:
return lookAhead(nextTokenIsDeclarationStart);
case 52:
return !followsModifier;
@@ -8180,7 +8206,7 @@ var ts;
return isDeclarationStart(true);
}
function nextTokenIsAsKeyword() {
- return nextToken() === 102;
+ return nextToken() === 111;
}
function parseDeclaration() {
var fullStart = getNodePos();
@@ -8197,14 +8223,14 @@ var ts;
}
switch (token) {
case 98:
- case 105:
+ case 104:
case 70:
return parseVariableStatement(fullStart, decorators, modifiers);
case 83:
return parseFunctionDeclaration(fullStart, decorators, modifiers);
case 69:
return parseClassDeclaration(fullStart, decorators, modifiers);
- case 104:
+ case 103:
return parseInterfaceDeclaration(fullStart, decorators, modifiers);
case 123:
return parseTypeAliasDeclaration(fullStart, decorators, modifiers);
@@ -10710,12 +10736,13 @@ var ts;
return result;
}
function getPropertiesOfType(type) {
- if (type.flags & 16384) {
- return getPropertiesOfUnionType(type);
- }
- return getPropertiesOfObjectType(getApparentType(type));
+ type = getApparentType(type);
+ return type.flags & 16384 ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type);
}
function getApparentType(type) {
+ if (type.flags & 16384) {
+ type = getReducedTypeOfUnionType(type);
+ }
if (type.flags & 512) {
do {
type = getConstraintOfTypeParameter(type);
@@ -10784,28 +10811,27 @@ var ts;
return property;
}
function getPropertyOfType(type, name) {
+ type = getApparentType(type);
+ if (type.flags & 48128) {
+ var resolved = resolveObjectOrUnionTypeMembers(type);
+ if (ts.hasProperty(resolved.members, name)) {
+ var symbol = resolved.members[name];
+ if (symbolIsValue(symbol)) {
+ return symbol;
+ }
+ }
+ if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
+ var symbol = getPropertyOfObjectType(globalFunctionType, name);
+ if (symbol) {
+ return symbol;
+ }
+ }
+ return getPropertyOfObjectType(globalObjectType, name);
+ }
if (type.flags & 16384) {
return getPropertyOfUnionType(type, name);
}
- if (!(type.flags & 48128)) {
- type = getApparentType(type);
- if (!(type.flags & 48128)) {
- return undefined;
- }
- }
- var resolved = resolveObjectOrUnionTypeMembers(type);
- if (ts.hasProperty(resolved.members, name)) {
- var symbol = resolved.members[name];
- if (symbolIsValue(symbol)) {
- return symbol;
- }
- }
- if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
- var symbol = getPropertyOfObjectType(globalFunctionType, name);
- if (symbol)
- return symbol;
- }
- return getPropertyOfObjectType(globalObjectType, name);
+ return undefined;
}
function getSignaturesOfObjectOrUnionType(type, kind) {
if (type.flags & (48128 | 16384)) {
@@ -11311,9 +11337,16 @@ var ts;
if (!type) {
type = unionTypes[id] = createObjectType(16384 | getWideningFlagsOfTypes(sortedTypes));
type.types = sortedTypes;
+ type.reducedType = noSubtypeReduction ? undefined : type;
}
return type;
}
+ function getReducedTypeOfUnionType(type) {
+ if (!type.reducedType) {
+ type.reducedType = getUnionType(type.types, false);
+ }
+ return type.reducedType;
+ }
function getTypeFromUnionTypeNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
@@ -14170,7 +14203,7 @@ var ts;
}
function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) {
ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node));
- var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
+ var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node);
if (!hasGrammarError && node.kind === 162) {
checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node);
}
@@ -14207,7 +14240,7 @@ var ts;
}
function checkFunctionExpressionOrObjectLiteralMethodBody(node) {
ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node));
- if (node.type) {
+ if (node.type && !node.asteriskToken) {
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type));
}
if (node.body) {
@@ -14678,6 +14711,7 @@ var ts;
return type;
}
function checkExpression(node, contextualMapper) {
+ checkGrammarIdentifierInStrictMode(node);
return checkExpressionOrQualifiedName(node, contextualMapper);
}
function checkExpressionOrQualifiedName(node, contextualMapper) {
@@ -14772,6 +14806,7 @@ var ts;
return unknownType;
}
function checkTypeParameter(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
if (node.expression) {
grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected);
}
@@ -14974,9 +15009,11 @@ var ts;
checkDecorators(node);
}
function checkTypeReferenceNode(node) {
+ checkGrammarTypeReferenceInStrictMode(node.typeName);
return checkTypeReferenceOrHeritageClauseElement(node);
}
function checkHeritageClauseElement(node) {
+ checkGrammarHeritageClauseElementInStrictMode(node.expression);
return checkTypeReferenceOrHeritageClauseElement(node);
}
function checkTypeReferenceOrHeritageClauseElement(node) {
@@ -15379,6 +15416,7 @@ var ts;
}
}
function checkFunctionLikeDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
checkDecorators(node);
checkSignatureDeclaration(node);
if (node.name && node.name.kind === 127) {
@@ -15398,7 +15436,7 @@ var ts;
}
}
checkSourceElement(node.body);
- if (node.type && !isAccessor(node.kind)) {
+ if (node.type && !isAccessor(node.kind) && !node.asteriskToken) {
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type));
}
if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !node.type && !isPrivateWithinAmbient(node)) {
@@ -15564,6 +15602,7 @@ var ts;
}
}
function checkVariableLikeDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
checkDecorators(node);
checkSourceElement(node.type);
if (node.name.kind === 127) {
@@ -15748,7 +15787,10 @@ var ts;
return checkElementTypeOfArrayOrString(inputType, errorNode);
}
if (isArrayLikeType(inputType)) {
- return getIndexTypeOfType(inputType, 1);
+ var indexType = getIndexTypeOfType(inputType, 1);
+ if (indexType) {
+ return indexType;
+ }
}
error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType));
return unknownType;
@@ -16087,6 +16129,7 @@ var ts;
return unknownType;
}
function checkClassDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
if (node.parent.kind !== 206 && node.parent.kind !== 227) {
grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration);
}
@@ -16275,7 +16318,7 @@ var ts;
return ok;
}
function checkInterfaceDeclaration(node) {
- checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node);
checkTypeParameters(node.typeParameters);
if (produceDiagnostics) {
checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0);
@@ -16461,7 +16504,7 @@ var ts;
if (!produceDiagnostics) {
return;
}
- checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node);
checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0);
checkCollisionWithCapturedThisVariable(node, node.name);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
@@ -16514,7 +16557,7 @@ var ts;
}
function checkModuleDeclaration(node) {
if (produceDiagnostics) {
- if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) {
+ if (!checkGrammarDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node)) {
if (!ts.isInAmbientContext(node) && node.name.kind === 8) {
grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names);
}
@@ -16603,7 +16646,7 @@ var ts;
checkAliasSymbol(node);
}
function checkImportDeclaration(node) {
- if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) {
+ if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) {
grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers);
}
if (checkExternalImportOrExportDeclaration(node)) {
@@ -16624,7 +16667,7 @@ var ts;
}
}
function checkImportEqualsDeclaration(node) {
- checkGrammarDecorators(node) || checkGrammarModifiers(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node);
if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
checkImportBinding(node);
if (node.flags & 1) {
@@ -16925,6 +16968,8 @@ var ts;
if (!(links.flags & 1)) {
checkGrammarSourceFile(node);
emitExtends = false;
+ emitDecorate = false;
+ emitParam = false;
potentialThisCollisions.length = 0;
ts.forEach(node.statements, checkSourceElement);
checkFunctionExpressionBodies(node);
@@ -17732,6 +17777,105 @@ var ts;
}
anyArrayType = createArrayType(anyType);
}
+ function isReservedwordInStrictMode(node) {
+ return (node.parserContextFlags & 1) &&
+ (node.originalKeywordKind >= 102 && node.originalKeywordKind <= 110);
+ }
+ function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) {
+ if (ts.getAncestor(identifier, 201) || ts.getAncestor(identifier, 174)) {
+ return grammarErrorOnNode(identifier, message, arg0);
+ }
+ return false;
+ }
+ function checkGrammarImportDeclarationNameInStrictMode(node) {
+ if (node.importClause) {
+ var impotClause = node.importClause;
+ if (impotClause.namedBindings) {
+ var nameBindings = impotClause.namedBindings;
+ if (nameBindings.kind === 211) {
+ var name_11 = nameBindings.name;
+ if (name_11.originalKeywordKind) {
+ var nameText = ts.declarationNameToString(name_11);
+ return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ else if (nameBindings.kind === 212) {
+ var reportError = false;
+ for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) {
+ var element = _a[_i];
+ var name_12 = element.name;
+ if (name_12.originalKeywordKind) {
+ var nameText = ts.declarationNameToString(name_12);
+ reportError = reportError || grammarErrorOnNode(name_12, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ return reportError;
+ }
+ }
+ }
+ return false;
+ }
+ function checkGrammarDeclarationNameInStrictMode(node) {
+ var name = node.name;
+ if (name && name.kind === 65 && isReservedwordInStrictMode(name)) {
+ var nameText = ts.declarationNameToString(name);
+ switch (node.kind) {
+ case 129:
+ case 198:
+ case 200:
+ case 128:
+ case 152:
+ case 202:
+ case 203:
+ case 204:
+ return checkGrammarIdentifierInStrictMode(name);
+ case 201:
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText);
+ case 205:
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ case 208:
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ return false;
+ }
+ function checkGrammarTypeReferenceInStrictMode(typeName) {
+ if (typeName.kind === 65) {
+ checkGrammarTypeNameInStrictMode(typeName);
+ }
+ else if (typeName.kind === 126) {
+ checkGrammarTypeNameInStrictMode(typeName.right);
+ checkGrammarTypeReferenceInStrictMode(typeName.left);
+ }
+ }
+ function checkGrammarHeritageClauseElementInStrictMode(expression) {
+ if (expression && expression.kind === 65) {
+ return checkGrammarIdentifierInStrictMode(expression);
+ }
+ else if (expression && expression.kind === 155) {
+ checkGrammarHeritageClauseElementInStrictMode(expression.expression);
+ }
+ }
+ function checkGrammarIdentifierInStrictMode(node, nameText) {
+ if (node && node.kind === 65 && isReservedwordInStrictMode(node)) {
+ if (!nameText) {
+ nameText = ts.declarationNameToString(node);
+ }
+ var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) ||
+ grammarErrorOnNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ return errorReport;
+ }
+ return false;
+ }
+ function checkGrammarTypeNameInStrictMode(node) {
+ if (node && node.kind === 65 && isReservedwordInStrictMode(node)) {
+ var nameText = ts.declarationNameToString(node);
+ var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) ||
+ grammarErrorOnNode(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ return errorReport;
+ }
+ return false;
+ }
function checkGrammarDecorators(node) {
if (!node.decorators) {
return false;
@@ -17784,14 +17928,14 @@ var ts;
for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
switch (modifier.kind) {
- case 109:
case 108:
case 107:
+ case 106:
var text = void 0;
- if (modifier.kind === 109) {
+ if (modifier.kind === 108) {
text = "public";
}
- else if (modifier.kind === 108) {
+ else if (modifier.kind === 107) {
text = "protected";
lastProtected = modifier;
}
@@ -17810,7 +17954,7 @@ var ts;
}
flags |= ts.modifierToFlag(modifier.kind);
break;
- case 110:
+ case 109:
if (flags & 128) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static");
}
@@ -18040,7 +18184,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 103);
+ ts.Debug.assert(heritageClause.token === 102);
if (seenImplementsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen);
}
@@ -18062,7 +18206,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 103);
+ ts.Debug.assert(heritageClause.token === 102);
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);
}
checkGrammarHeritageClause(heritageClause);
@@ -18101,17 +18245,17 @@ var ts;
var inStrictMode = (node.parserContextFlags & 1) !== 0;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- var name_11 = prop.name;
+ var name_13 = prop.name;
if (prop.kind === 175 ||
- name_11.kind === 127) {
- checkGrammarComputedPropertyName(name_11);
+ name_13.kind === 127) {
+ checkGrammarComputedPropertyName(name_13);
continue;
}
var currentKind = void 0;
if (prop.kind === 224 || prop.kind === 225) {
checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
- if (name_11.kind === 7) {
- checkGrammarNumbericLiteral(name_11);
+ if (name_13.kind === 7) {
+ checkGrammarNumbericLiteral(name_13);
}
currentKind = Property;
}
@@ -18127,26 +18271,26 @@ var ts;
else {
ts.Debug.fail("Unexpected syntax kind:" + prop.kind);
}
- if (!ts.hasProperty(seen, name_11.text)) {
- seen[name_11.text] = currentKind;
+ if (!ts.hasProperty(seen, name_13.text)) {
+ seen[name_13.text] = currentKind;
}
else {
- var existingKind = seen[name_11.text];
+ var existingKind = seen[name_13.text];
if (currentKind === Property && existingKind === Property) {
if (inStrictMode) {
- grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode);
+ grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode);
}
}
else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) {
if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) {
- seen[name_11.text] = currentKind | existingKind;
+ seen[name_13.text] = currentKind | existingKind;
}
else {
- return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
+ return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
}
}
else {
- return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
+ return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
}
}
}
@@ -18465,12 +18609,11 @@ var ts;
var identifier = name;
if (contextNode && (contextNode.parserContextFlags & 1) && ts.isEvalOrArgumentsIdentifier(identifier)) {
var nameText = ts.declarationNameToString(identifier);
- if (ts.getAncestor(name, 201) || ts.getAncestor(name, 174)) {
- return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText);
- }
- else {
+ var reportErrorInClassDeclaration = reportStrictModeGrammarErrorInClassDeclaration(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText);
+ if (!reportErrorInClassDeclaration) {
return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText);
}
+ return reportErrorInClassDeclaration;
}
}
}
@@ -18919,9 +19062,9 @@ var ts;
}
var count = 0;
while (true) {
- var name_12 = baseName + "_" + (++count);
- if (!ts.hasProperty(currentSourceFile.identifiers, name_12)) {
- return name_12;
+ var name_14 = baseName + "_" + (++count);
+ if (!ts.hasProperty(currentSourceFile.identifiers, name_14)) {
+ return name_14;
}
}
}
@@ -20003,9 +20146,9 @@ var ts;
var count = tempFlags & 268435455;
tempFlags++;
if (count !== 8 && count !== 13) {
- var name_13 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26);
- if (isUniqueName(name_13)) {
- return name_13;
+ var name_15 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26);
+ if (isUniqueName(name_15)) {
+ return name_15;
}
}
}
@@ -20033,8 +20176,8 @@ var ts;
}
function generateNameForModuleOrEnum(node) {
if (node.name.kind === 65) {
- var name_14 = node.name.text;
- assignGeneratedName(node, isUniqueLocalName(name_14, node) ? name_14 : makeUniqueName(name_14));
+ var name_16 = node.name.text;
+ assignGeneratedName(node, isUniqueLocalName(name_16, node) ? name_16 : makeUniqueName(name_16));
}
}
function generateNameForImportOrExportDeclaration(node) {
@@ -20214,8 +20357,8 @@ var ts;
if (scopeName) {
var parentIndex = getSourceMapNameIndex();
if (parentIndex !== -1) {
- var name_15 = node.name;
- if (!name_15 || name_15.kind !== 127) {
+ var name_17 = node.name;
+ if (!name_17 || name_17.kind !== 127) {
scopeName = "." + scopeName;
}
scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName;
@@ -20242,9 +20385,9 @@ var ts;
node.kind === 201 ||
node.kind === 204) {
if (node.name) {
- var name_16 = node.name;
- scopeName = name_16.kind === 127
- ? ts.getTextOfNode(name_16)
+ var name_18 = node.name;
+ scopeName = name_18.kind === 127
+ ? ts.getTextOfNode(name_18)
: node.name.text;
}
recordScopeNameStart(scopeName);
@@ -20657,6 +20800,7 @@ var ts;
default:
return -1;
}
+ case 172:
case 170:
return -1;
default:
@@ -20828,6 +20972,16 @@ var ts;
write("...");
emit(node.expression);
}
+ function emitYieldExpression(node) {
+ write(ts.tokenToString(110));
+ if (node.asteriskToken) {
+ write("*");
+ }
+ if (node.expression) {
+ write(" ");
+ emit(node.expression);
+ }
+ }
function needsParenthesisForPropertyAccessOrInvocation(node) {
switch (node.kind) {
case 65:
@@ -21069,6 +21223,9 @@ var ts;
write("]");
}
function emitMethod(node) {
+ if (languageVersion >= 2 && node.asteriskToken) {
+ write("*");
+ }
emit(node.name, false);
if (languageVersion < 2) {
write(": function ");
@@ -21440,7 +21597,7 @@ var ts;
var tokenKind = 98;
if (decl && languageVersion >= 2) {
if (ts.isLet(decl)) {
- tokenKind = 105;
+ tokenKind = 104;
}
else if (ts.isConst(decl)) {
tokenKind = 70;
@@ -21453,7 +21610,7 @@ var ts;
switch (tokenKind) {
case 98:
return write("var ");
- case 105:
+ case 104:
return write("let ");
case 70:
return write("const ");
@@ -22054,12 +22211,12 @@ var ts;
function emitParameter(node) {
if (languageVersion < 2) {
if (ts.isBindingPattern(node.name)) {
- var name_17 = createTempVariable(0);
+ var name_19 = createTempVariable(0);
if (!tempParameters) {
tempParameters = [];
}
- tempParameters.push(name_17);
- emit(name_17);
+ tempParameters.push(name_19);
+ emit(name_19);
}
else {
emit(node.name);
@@ -22178,7 +22335,11 @@ var ts;
write("default ");
}
}
- write("function ");
+ write("function");
+ if (languageVersion >= 2 && node.asteriskToken) {
+ write("*");
+ }
+ write(" ");
}
if (shouldEmitFunctionName(node)) {
emitDeclarationName(node);
@@ -22510,6 +22671,9 @@ var ts;
else if (member.kind === 137) {
write("set ");
}
+ if (member.asteriskToken) {
+ write("*");
+ }
emit(member.name);
emitSignatureAndBody(member);
emitEnd(member);
@@ -23475,8 +23639,8 @@ var ts;
else {
for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) {
var specifier = _d[_c];
- var name_18 = (specifier.propertyName || specifier.name).text;
- (exportSpecifiers[name_18] || (exportSpecifiers[name_18] = [])).push(specifier);
+ var name_20 = (specifier.propertyName || specifier.name).text;
+ (exportSpecifiers[name_20] || (exportSpecifiers[name_20] = [])).push(specifier);
}
}
break;
@@ -23787,6 +23951,8 @@ var ts;
return emitConditionalExpression(node);
case 173:
return emitSpreadElementExpression(node);
+ case 172:
+ return emitYieldExpression(node);
case 175:
return;
case 179:
diff --git a/bin/tsserver.js b/bin/tsserver.js
index ba3c349c046..1067c4f3150 100644
--- a/bin/tsserver.js
+++ b/bin/tsserver.js
@@ -600,10 +600,6 @@ var ts;
"\u2029": "\\u2029",
"\u0085": "\\u0085"
};
- function getDefaultLibFileName(options) {
- return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts";
- }
- ts.getDefaultLibFileName = getDefaultLibFileName;
function Symbol(flags, name) {
this.flags = flags;
this.name = name;
@@ -1076,6 +1072,12 @@ var ts;
Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." },
Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." },
A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." },
+ Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
+ Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
+ Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." },
Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@@ -1443,7 +1445,7 @@ var ts;
(function (ts) {
var textToToken = {
"any": 112,
- "as": 102,
+ "as": 111,
"boolean": 113,
"break": 66,
"case": 67,
@@ -1468,24 +1470,24 @@ var ts;
"function": 83,
"get": 116,
"if": 84,
- "implements": 103,
+ "implements": 102,
"import": 85,
"in": 86,
"instanceof": 87,
- "interface": 104,
- "let": 105,
+ "interface": 103,
+ "let": 104,
"module": 117,
"new": 88,
"null": 89,
"number": 119,
- "package": 106,
- "private": 107,
- "protected": 108,
- "public": 109,
+ "package": 105,
+ "private": 106,
+ "protected": 107,
+ "public": 108,
"require": 118,
"return": 90,
"set": 120,
- "static": 110,
+ "static": 109,
"string": 121,
"super": 91,
"switch": 92,
@@ -1500,7 +1502,7 @@ var ts;
"void": 99,
"while": 100,
"with": 101,
- "yield": 111,
+ "yield": 110,
"of": 125,
"{": 14,
"}": 15,
@@ -3217,7 +3219,7 @@ var ts;
scanner.setTextPos(pos);
scanner.scan();
var start = scanner.getTokenPos();
- return createTextSpanFromBounds(start, scanner.getTextPos());
+ return ts.createTextSpanFromBounds(start, scanner.getTextPos());
}
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForNode(sourceFile, node) {
@@ -3226,7 +3228,7 @@ var ts;
case 227:
var pos_1 = ts.skipTrivia(sourceFile.text, 0, false);
if (pos_1 === sourceFile.text.length) {
- return createTextSpan(0, 0);
+ return ts.createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos_1);
case 198:
@@ -3248,7 +3250,7 @@ var ts;
var pos = nodeIsMissing(errorNode)
? errorNode.pos
: ts.skipTrivia(sourceFile.text, errorNode.pos);
- return createTextSpanFromBounds(pos, errorNode.end);
+ return ts.createTextSpanFromBounds(pos, errorNode.end);
}
ts.getErrorSpanForNode = getErrorSpanForNode;
function isExternalModule(file) {
@@ -3842,7 +3844,7 @@ var ts;
}
ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement;
function getClassImplementsHeritageClauseElements(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 103);
+ var heritageClause = getHeritageClause(node.heritageClauses, 102);
return heritageClause ? heritageClause.types : undefined;
}
ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements;
@@ -3957,10 +3959,10 @@ var ts;
ts.isESSymbolIdentifier = isESSymbolIdentifier;
function isModifier(token) {
switch (token) {
- case 109:
- case 107:
case 108:
- case 110:
+ case 106:
+ case 107:
+ case 109:
case 78:
case 115:
case 70:
@@ -3970,115 +3972,6 @@ var ts;
return false;
}
ts.isModifier = isModifier;
- function textSpanEnd(span) {
- return span.start + span.length;
- }
- ts.textSpanEnd = textSpanEnd;
- function textSpanIsEmpty(span) {
- return span.length === 0;
- }
- ts.textSpanIsEmpty = textSpanIsEmpty;
- function textSpanContainsPosition(span, position) {
- return position >= span.start && position < textSpanEnd(span);
- }
- ts.textSpanContainsPosition = textSpanContainsPosition;
- function textSpanContainsTextSpan(span, other) {
- return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
- }
- ts.textSpanContainsTextSpan = textSpanContainsTextSpan;
- function textSpanOverlapsWith(span, other) {
- var overlapStart = Math.max(span.start, other.start);
- var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
- return overlapStart < overlapEnd;
- }
- ts.textSpanOverlapsWith = textSpanOverlapsWith;
- function textSpanOverlap(span1, span2) {
- var overlapStart = Math.max(span1.start, span2.start);
- var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
- if (overlapStart < overlapEnd) {
- return createTextSpanFromBounds(overlapStart, overlapEnd);
- }
- return undefined;
- }
- ts.textSpanOverlap = textSpanOverlap;
- function textSpanIntersectsWithTextSpan(span, other) {
- return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start;
- }
- ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan;
- function textSpanIntersectsWith(span, start, length) {
- var end = start + length;
- return start <= textSpanEnd(span) && end >= span.start;
- }
- ts.textSpanIntersectsWith = textSpanIntersectsWith;
- function textSpanIntersectsWithPosition(span, position) {
- return position <= textSpanEnd(span) && position >= span.start;
- }
- ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition;
- function textSpanIntersection(span1, span2) {
- var intersectStart = Math.max(span1.start, span2.start);
- var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
- if (intersectStart <= intersectEnd) {
- return createTextSpanFromBounds(intersectStart, intersectEnd);
- }
- return undefined;
- }
- ts.textSpanIntersection = textSpanIntersection;
- function createTextSpan(start, length) {
- if (start < 0) {
- throw new Error("start < 0");
- }
- if (length < 0) {
- throw new Error("length < 0");
- }
- return { start: start, length: length };
- }
- ts.createTextSpan = createTextSpan;
- function createTextSpanFromBounds(start, end) {
- return createTextSpan(start, end - start);
- }
- ts.createTextSpanFromBounds = createTextSpanFromBounds;
- function textChangeRangeNewSpan(range) {
- return createTextSpan(range.span.start, range.newLength);
- }
- ts.textChangeRangeNewSpan = textChangeRangeNewSpan;
- function textChangeRangeIsUnchanged(range) {
- return textSpanIsEmpty(range.span) && range.newLength === 0;
- }
- ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged;
- function createTextChangeRange(span, newLength) {
- if (newLength < 0) {
- throw new Error("newLength < 0");
- }
- return { span: span, newLength: newLength };
- }
- ts.createTextChangeRange = createTextChangeRange;
- ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
- function collapseTextChangeRangesAcrossMultipleVersions(changes) {
- if (changes.length === 0) {
- return ts.unchangedTextChangeRange;
- }
- if (changes.length === 1) {
- return changes[0];
- }
- var change0 = changes[0];
- var oldStartN = change0.span.start;
- var oldEndN = textSpanEnd(change0.span);
- var newEndN = oldStartN + change0.newLength;
- for (var i = 1; i < changes.length; i++) {
- var nextChange = changes[i];
- var oldStart1 = oldStartN;
- var oldEnd1 = oldEndN;
- var newEnd1 = newEndN;
- var oldStart2 = nextChange.span.start;
- var oldEnd2 = textSpanEnd(nextChange.span);
- var newEnd2 = oldStart2 + nextChange.newLength;
- oldStartN = Math.min(oldStart1, oldStart2);
- oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
- newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
- }
- return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
- }
- ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function nodeStartsNewLexicalEnvironment(n) {
return isFunctionLike(n) || n.kind === 205 || n.kind === 227;
}
@@ -4475,6 +4368,122 @@ var ts;
}
ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault;
})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ function getDefaultLibFileName(options) {
+ return options.target === 2 ? "lib.es6.d.ts" : "lib.d.ts";
+ }
+ ts.getDefaultLibFileName = getDefaultLibFileName;
+ function textSpanEnd(span) {
+ return span.start + span.length;
+ }
+ ts.textSpanEnd = textSpanEnd;
+ function textSpanIsEmpty(span) {
+ return span.length === 0;
+ }
+ ts.textSpanIsEmpty = textSpanIsEmpty;
+ function textSpanContainsPosition(span, position) {
+ return position >= span.start && position < textSpanEnd(span);
+ }
+ ts.textSpanContainsPosition = textSpanContainsPosition;
+ function textSpanContainsTextSpan(span, other) {
+ return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
+ }
+ ts.textSpanContainsTextSpan = textSpanContainsTextSpan;
+ function textSpanOverlapsWith(span, other) {
+ var overlapStart = Math.max(span.start, other.start);
+ var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
+ return overlapStart < overlapEnd;
+ }
+ ts.textSpanOverlapsWith = textSpanOverlapsWith;
+ function textSpanOverlap(span1, span2) {
+ var overlapStart = Math.max(span1.start, span2.start);
+ var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
+ if (overlapStart < overlapEnd) {
+ return createTextSpanFromBounds(overlapStart, overlapEnd);
+ }
+ return undefined;
+ }
+ ts.textSpanOverlap = textSpanOverlap;
+ function textSpanIntersectsWithTextSpan(span, other) {
+ return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start;
+ }
+ ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan;
+ function textSpanIntersectsWith(span, start, length) {
+ var end = start + length;
+ return start <= textSpanEnd(span) && end >= span.start;
+ }
+ ts.textSpanIntersectsWith = textSpanIntersectsWith;
+ function textSpanIntersectsWithPosition(span, position) {
+ return position <= textSpanEnd(span) && position >= span.start;
+ }
+ ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition;
+ function textSpanIntersection(span1, span2) {
+ var intersectStart = Math.max(span1.start, span2.start);
+ var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
+ if (intersectStart <= intersectEnd) {
+ return createTextSpanFromBounds(intersectStart, intersectEnd);
+ }
+ return undefined;
+ }
+ ts.textSpanIntersection = textSpanIntersection;
+ function createTextSpan(start, length) {
+ if (start < 0) {
+ throw new Error("start < 0");
+ }
+ if (length < 0) {
+ throw new Error("length < 0");
+ }
+ return { start: start, length: length };
+ }
+ ts.createTextSpan = createTextSpan;
+ function createTextSpanFromBounds(start, end) {
+ return createTextSpan(start, end - start);
+ }
+ ts.createTextSpanFromBounds = createTextSpanFromBounds;
+ function textChangeRangeNewSpan(range) {
+ return createTextSpan(range.span.start, range.newLength);
+ }
+ ts.textChangeRangeNewSpan = textChangeRangeNewSpan;
+ function textChangeRangeIsUnchanged(range) {
+ return textSpanIsEmpty(range.span) && range.newLength === 0;
+ }
+ ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged;
+ function createTextChangeRange(span, newLength) {
+ if (newLength < 0) {
+ throw new Error("newLength < 0");
+ }
+ return { span: span, newLength: newLength };
+ }
+ ts.createTextChangeRange = createTextChangeRange;
+ ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
+ function collapseTextChangeRangesAcrossMultipleVersions(changes) {
+ if (changes.length === 0) {
+ return ts.unchangedTextChangeRange;
+ }
+ if (changes.length === 1) {
+ return changes[0];
+ }
+ var change0 = changes[0];
+ var oldStartN = change0.span.start;
+ var oldEndN = textSpanEnd(change0.span);
+ var newEndN = oldStartN + change0.newLength;
+ for (var i = 1; i < changes.length; i++) {
+ var nextChange = changes[i];
+ var oldStart1 = oldStartN;
+ var oldEnd1 = oldEndN;
+ var newEnd1 = newEndN;
+ var oldStart2 = nextChange.span.start;
+ var oldEnd2 = textSpanEnd(nextChange.span);
+ var newEnd2 = oldStart2 + nextChange.newLength;
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+ return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
+ }
+ ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
+})(ts || (ts = {}));
///
///
var ts;
@@ -4813,10 +4822,10 @@ var ts;
;
function modifierToFlag(token) {
switch (token) {
- case 110: return 128;
- case 109: return 16;
- case 108: return 64;
- case 107: return 32;
+ case 109: return 128;
+ case 108: return 16;
+ case 107: return 64;
+ case 106: return 32;
case 78: return 1;
case 115: return 2;
case 70: return 8192;
@@ -5323,10 +5332,10 @@ var ts;
if (token === 65) {
return true;
}
- if (token === 111 && inYieldContext()) {
+ if (token === 110 && inYieldContext()) {
return false;
}
- return inStrictModeContext() ? token > 111 : token > 101;
+ return token > 101;
}
function parseExpected(kind, diagnosticMessage) {
if (token === kind) {
@@ -5420,6 +5429,9 @@ var ts;
identifierCount++;
if (isIdentifier) {
var node = createNode(65);
+ if (token !== 65) {
+ node.originalKeywordKind = token;
+ }
node.text = internIdentifier(scanner.getTokenValue());
nextToken();
return finishNode(node);
@@ -5556,7 +5568,7 @@ var ts;
ts.Debug.assert(token === 14);
if (nextToken() === 15) {
var next = nextToken();
- return next === 23 || next === 14 || next === 79 || next === 103;
+ return next === 23 || next === 14 || next === 79 || next === 102;
}
return true;
}
@@ -5565,7 +5577,7 @@ var ts;
return isIdentifier();
}
function isHeritageClauseExtendsOrImplementsKeyword() {
- if (token === 103 ||
+ if (token === 102 ||
token === 79) {
return lookAhead(nextTokenIsStartOfExpression);
}
@@ -5593,11 +5605,11 @@ var ts;
case 4:
return token === 15 || token === 67 || token === 73;
case 8:
- return token === 14 || token === 79 || token === 103;
+ return token === 14 || token === 79 || token === 102;
case 9:
return isVariableDeclaratorListTerminator();
case 16:
- return token === 25 || token === 16 || token === 14 || token === 79 || token === 103;
+ return token === 25 || token === 16 || token === 14 || token === 79 || token === 102;
case 12:
return token === 17 || token === 22;
case 14:
@@ -6401,7 +6413,7 @@ var ts;
case 38:
case 39:
case 24:
- case 111:
+ case 110:
return true;
default:
if (isBinaryOperator()) {
@@ -6471,7 +6483,7 @@ var ts;
return parseConditionalExpressionRest(expr);
}
function isYieldExpression() {
- if (token === 111) {
+ if (token === 110) {
if (inYieldContext()) {
return true;
}
@@ -7096,7 +7108,7 @@ var ts;
parseExpected(16);
var initializer = undefined;
if (token !== 22) {
- if (token === 98 || token === 105 || token === 70) {
+ if (token === 98 || token === 104 || token === 70) {
initializer = parseVariableDeclarationList(true);
}
else {
@@ -7257,7 +7269,7 @@ var ts;
return !inErrorRecovery;
case 14:
case 98:
- case 105:
+ case 104:
case 83:
case 69:
case 84:
@@ -7278,17 +7290,17 @@ var ts;
case 70:
var isConstEnum = lookAhead(nextTokenIsEnumKeyword);
return !isConstEnum;
- case 104:
+ case 103:
case 117:
case 77:
case 123:
if (isDeclarationStart()) {
return false;
}
- case 109:
- case 107:
case 108:
- case 110:
+ case 106:
+ case 107:
+ case 109:
if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) {
return false;
}
@@ -7343,7 +7355,7 @@ var ts;
return parseTryStatement();
case 72:
return parseDebuggerStatement();
- case 105:
+ case 104:
if (isLetDeclaration()) {
return parseVariableStatement(scanner.getStartPos(), undefined, undefined);
}
@@ -7368,7 +7380,7 @@ var ts;
return undefined;
}
return parseVariableStatement(start, decorators, modifiers);
- case 105:
+ case 104:
if (!isLetDeclaration()) {
return undefined;
}
@@ -7453,7 +7465,7 @@ var ts;
switch (token) {
case 98:
break;
- case 105:
+ case 104:
node.flags |= 4096;
break;
case 70:
@@ -7550,6 +7562,17 @@ var ts;
node.body = parseFunctionBlockOrSemicolon(false);
return finishNode(node);
}
+ function isClassMemberModifier(idToken) {
+ switch (idToken) {
+ case 108:
+ case 106:
+ case 107:
+ case 109:
+ return true;
+ default:
+ return false;
+ }
+ }
function isClassMemberStart() {
var idToken;
if (token === 52) {
@@ -7557,6 +7580,9 @@ var ts;
}
while (ts.isModifier(token)) {
idToken = token;
+ if (isClassMemberModifier(idToken)) {
+ return true;
+ }
nextToken();
}
if (token === 35) {
@@ -7704,7 +7730,7 @@ var ts;
return parseList(19, false, parseHeritageClause);
}
function parseHeritageClause() {
- if (token === 79 || token === 103) {
+ if (token === 79 || token === 102) {
var node = createNode(222);
node.token = token;
nextToken();
@@ -7722,7 +7748,7 @@ var ts;
return finishNode(node);
}
function isHeritageClause() {
- return token === 79 || token === 103;
+ return token === 79 || token === 102;
}
function parseClassMembers() {
return parseList(6, false, parseClassElement);
@@ -7731,7 +7757,7 @@ var ts;
var node = createNode(202, fullStart);
node.decorators = decorators;
setModifiers(node, modifiers);
- parseExpected(104);
+ parseExpected(103);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
node.heritageClauses = parseHeritageClauses(false);
@@ -7888,7 +7914,7 @@ var ts;
function parseNamespaceImport() {
var namespaceImport = createNode(211);
parseExpected(35);
- parseExpected(102);
+ parseExpected(111);
namespaceImport.name = parseIdentifier();
return finishNode(namespaceImport);
}
@@ -7909,9 +7935,9 @@ var ts;
var checkIdentifierStart = scanner.getTokenPos();
var checkIdentifierEnd = scanner.getTextPos();
var identifierName = parseIdentifierName();
- if (token === 102) {
+ if (token === 111) {
node.propertyName = identifierName;
- parseExpected(102);
+ parseExpected(111);
checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier();
checkIdentifierStart = scanner.getTokenPos();
checkIdentifierEnd = scanner.getTextPos();
@@ -7965,10 +7991,10 @@ var ts;
case 70:
case 83:
return true;
- case 105:
+ case 104:
return isLetDeclaration();
case 69:
- case 104:
+ case 103:
case 77:
case 123:
return lookAhead(nextTokenIsIdentifierOrKeyword);
@@ -7979,10 +8005,10 @@ var ts;
case 78:
return lookAhead(nextTokenCanFollowExportKeyword);
case 115:
- case 109:
- case 107:
case 108:
- case 110:
+ case 106:
+ case 107:
+ case 109:
return lookAhead(nextTokenIsDeclarationStart);
case 52:
return !followsModifier;
@@ -8014,7 +8040,7 @@ var ts;
return isDeclarationStart(true);
}
function nextTokenIsAsKeyword() {
- return nextToken() === 102;
+ return nextToken() === 111;
}
function parseDeclaration() {
var fullStart = getNodePos();
@@ -8031,14 +8057,14 @@ var ts;
}
switch (token) {
case 98:
- case 105:
+ case 104:
case 70:
return parseVariableStatement(fullStart, decorators, modifiers);
case 83:
return parseFunctionDeclaration(fullStart, decorators, modifiers);
case 69:
return parseClassDeclaration(fullStart, decorators, modifiers);
- case 104:
+ case 103:
return parseInterfaceDeclaration(fullStart, decorators, modifiers);
case 123:
return parseTypeAliasDeclaration(fullStart, decorators, modifiers);
@@ -11053,12 +11079,13 @@ var ts;
return result;
}
function getPropertiesOfType(type) {
- if (type.flags & 16384) {
- return getPropertiesOfUnionType(type);
- }
- return getPropertiesOfObjectType(getApparentType(type));
+ type = getApparentType(type);
+ return type.flags & 16384 ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type);
}
function getApparentType(type) {
+ if (type.flags & 16384) {
+ type = getReducedTypeOfUnionType(type);
+ }
if (type.flags & 512) {
do {
type = getConstraintOfTypeParameter(type);
@@ -11127,28 +11154,27 @@ var ts;
return property;
}
function getPropertyOfType(type, name) {
+ type = getApparentType(type);
+ if (type.flags & 48128) {
+ var resolved = resolveObjectOrUnionTypeMembers(type);
+ if (ts.hasProperty(resolved.members, name)) {
+ var symbol = resolved.members[name];
+ if (symbolIsValue(symbol)) {
+ return symbol;
+ }
+ }
+ if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
+ var symbol = getPropertyOfObjectType(globalFunctionType, name);
+ if (symbol) {
+ return symbol;
+ }
+ }
+ return getPropertyOfObjectType(globalObjectType, name);
+ }
if (type.flags & 16384) {
return getPropertyOfUnionType(type, name);
}
- if (!(type.flags & 48128)) {
- type = getApparentType(type);
- if (!(type.flags & 48128)) {
- return undefined;
- }
- }
- var resolved = resolveObjectOrUnionTypeMembers(type);
- if (ts.hasProperty(resolved.members, name)) {
- var symbol = resolved.members[name];
- if (symbolIsValue(symbol)) {
- return symbol;
- }
- }
- if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
- var symbol = getPropertyOfObjectType(globalFunctionType, name);
- if (symbol)
- return symbol;
- }
- return getPropertyOfObjectType(globalObjectType, name);
+ return undefined;
}
function getSignaturesOfObjectOrUnionType(type, kind) {
if (type.flags & (48128 | 16384)) {
@@ -11654,9 +11680,16 @@ var ts;
if (!type) {
type = unionTypes[id] = createObjectType(16384 | getWideningFlagsOfTypes(sortedTypes));
type.types = sortedTypes;
+ type.reducedType = noSubtypeReduction ? undefined : type;
}
return type;
}
+ function getReducedTypeOfUnionType(type) {
+ if (!type.reducedType) {
+ type.reducedType = getUnionType(type.types, false);
+ }
+ return type.reducedType;
+ }
function getTypeFromUnionTypeNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
@@ -14513,7 +14546,7 @@ var ts;
}
function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) {
ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node));
- var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
+ var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node);
if (!hasGrammarError && node.kind === 162) {
checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node);
}
@@ -14550,7 +14583,7 @@ var ts;
}
function checkFunctionExpressionOrObjectLiteralMethodBody(node) {
ts.Debug.assert(node.kind !== 134 || ts.isObjectLiteralMethod(node));
- if (node.type) {
+ if (node.type && !node.asteriskToken) {
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type));
}
if (node.body) {
@@ -15021,6 +15054,7 @@ var ts;
return type;
}
function checkExpression(node, contextualMapper) {
+ checkGrammarIdentifierInStrictMode(node);
return checkExpressionOrQualifiedName(node, contextualMapper);
}
function checkExpressionOrQualifiedName(node, contextualMapper) {
@@ -15115,6 +15149,7 @@ var ts;
return unknownType;
}
function checkTypeParameter(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
if (node.expression) {
grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected);
}
@@ -15317,9 +15352,11 @@ var ts;
checkDecorators(node);
}
function checkTypeReferenceNode(node) {
+ checkGrammarTypeReferenceInStrictMode(node.typeName);
return checkTypeReferenceOrHeritageClauseElement(node);
}
function checkHeritageClauseElement(node) {
+ checkGrammarHeritageClauseElementInStrictMode(node.expression);
return checkTypeReferenceOrHeritageClauseElement(node);
}
function checkTypeReferenceOrHeritageClauseElement(node) {
@@ -15722,6 +15759,7 @@ var ts;
}
}
function checkFunctionLikeDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
checkDecorators(node);
checkSignatureDeclaration(node);
if (node.name && node.name.kind === 127) {
@@ -15741,7 +15779,7 @@ var ts;
}
}
checkSourceElement(node.body);
- if (node.type && !isAccessor(node.kind)) {
+ if (node.type && !isAccessor(node.kind) && !node.asteriskToken) {
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type));
}
if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !node.type && !isPrivateWithinAmbient(node)) {
@@ -15907,6 +15945,7 @@ var ts;
}
}
function checkVariableLikeDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
checkDecorators(node);
checkSourceElement(node.type);
if (node.name.kind === 127) {
@@ -16091,7 +16130,10 @@ var ts;
return checkElementTypeOfArrayOrString(inputType, errorNode);
}
if (isArrayLikeType(inputType)) {
- return getIndexTypeOfType(inputType, 1);
+ var indexType = getIndexTypeOfType(inputType, 1);
+ if (indexType) {
+ return indexType;
+ }
}
error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType));
return unknownType;
@@ -16430,6 +16472,7 @@ var ts;
return unknownType;
}
function checkClassDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
if (node.parent.kind !== 206 && node.parent.kind !== 227) {
grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration);
}
@@ -16618,7 +16661,7 @@ var ts;
return ok;
}
function checkInterfaceDeclaration(node) {
- checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node);
checkTypeParameters(node.typeParameters);
if (produceDiagnostics) {
checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0);
@@ -16804,7 +16847,7 @@ var ts;
if (!produceDiagnostics) {
return;
}
- checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node);
checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0);
checkCollisionWithCapturedThisVariable(node, node.name);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
@@ -16857,7 +16900,7 @@ var ts;
}
function checkModuleDeclaration(node) {
if (produceDiagnostics) {
- if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) {
+ if (!checkGrammarDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node)) {
if (!ts.isInAmbientContext(node) && node.name.kind === 8) {
grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names);
}
@@ -16946,7 +16989,7 @@ var ts;
checkAliasSymbol(node);
}
function checkImportDeclaration(node) {
- if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) {
+ if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499)) {
grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers);
}
if (checkExternalImportOrExportDeclaration(node)) {
@@ -16967,7 +17010,7 @@ var ts;
}
}
function checkImportEqualsDeclaration(node) {
- checkGrammarDecorators(node) || checkGrammarModifiers(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node);
if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
checkImportBinding(node);
if (node.flags & 1) {
@@ -17268,6 +17311,8 @@ var ts;
if (!(links.flags & 1)) {
checkGrammarSourceFile(node);
emitExtends = false;
+ emitDecorate = false;
+ emitParam = false;
potentialThisCollisions.length = 0;
ts.forEach(node.statements, checkSourceElement);
checkFunctionExpressionBodies(node);
@@ -18075,6 +18120,105 @@ var ts;
}
anyArrayType = createArrayType(anyType);
}
+ function isReservedwordInStrictMode(node) {
+ return (node.parserContextFlags & 1) &&
+ (node.originalKeywordKind >= 102 && node.originalKeywordKind <= 110);
+ }
+ function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) {
+ if (ts.getAncestor(identifier, 201) || ts.getAncestor(identifier, 174)) {
+ return grammarErrorOnNode(identifier, message, arg0);
+ }
+ return false;
+ }
+ function checkGrammarImportDeclarationNameInStrictMode(node) {
+ if (node.importClause) {
+ var impotClause = node.importClause;
+ if (impotClause.namedBindings) {
+ var nameBindings = impotClause.namedBindings;
+ if (nameBindings.kind === 211) {
+ var name_11 = nameBindings.name;
+ if (name_11.originalKeywordKind) {
+ var nameText = ts.declarationNameToString(name_11);
+ return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ else if (nameBindings.kind === 212) {
+ var reportError = false;
+ for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) {
+ var element = _a[_i];
+ var name_12 = element.name;
+ if (name_12.originalKeywordKind) {
+ var nameText = ts.declarationNameToString(name_12);
+ reportError = reportError || grammarErrorOnNode(name_12, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ return reportError;
+ }
+ }
+ }
+ return false;
+ }
+ function checkGrammarDeclarationNameInStrictMode(node) {
+ var name = node.name;
+ if (name && name.kind === 65 && isReservedwordInStrictMode(name)) {
+ var nameText = ts.declarationNameToString(name);
+ switch (node.kind) {
+ case 129:
+ case 198:
+ case 200:
+ case 128:
+ case 152:
+ case 202:
+ case 203:
+ case 204:
+ return checkGrammarIdentifierInStrictMode(name);
+ case 201:
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText);
+ case 205:
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ case 208:
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ return false;
+ }
+ function checkGrammarTypeReferenceInStrictMode(typeName) {
+ if (typeName.kind === 65) {
+ checkGrammarTypeNameInStrictMode(typeName);
+ }
+ else if (typeName.kind === 126) {
+ checkGrammarTypeNameInStrictMode(typeName.right);
+ checkGrammarTypeReferenceInStrictMode(typeName.left);
+ }
+ }
+ function checkGrammarHeritageClauseElementInStrictMode(expression) {
+ if (expression && expression.kind === 65) {
+ return checkGrammarIdentifierInStrictMode(expression);
+ }
+ else if (expression && expression.kind === 155) {
+ checkGrammarHeritageClauseElementInStrictMode(expression.expression);
+ }
+ }
+ function checkGrammarIdentifierInStrictMode(node, nameText) {
+ if (node && node.kind === 65 && isReservedwordInStrictMode(node)) {
+ if (!nameText) {
+ nameText = ts.declarationNameToString(node);
+ }
+ var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) ||
+ grammarErrorOnNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ return errorReport;
+ }
+ return false;
+ }
+ function checkGrammarTypeNameInStrictMode(node) {
+ if (node && node.kind === 65 && isReservedwordInStrictMode(node)) {
+ var nameText = ts.declarationNameToString(node);
+ var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) ||
+ grammarErrorOnNode(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ return errorReport;
+ }
+ return false;
+ }
function checkGrammarDecorators(node) {
if (!node.decorators) {
return false;
@@ -18127,14 +18271,14 @@ var ts;
for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
switch (modifier.kind) {
- case 109:
case 108:
case 107:
+ case 106:
var text = void 0;
- if (modifier.kind === 109) {
+ if (modifier.kind === 108) {
text = "public";
}
- else if (modifier.kind === 108) {
+ else if (modifier.kind === 107) {
text = "protected";
lastProtected = modifier;
}
@@ -18153,7 +18297,7 @@ var ts;
}
flags |= ts.modifierToFlag(modifier.kind);
break;
- case 110:
+ case 109:
if (flags & 128) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static");
}
@@ -18383,7 +18527,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 103);
+ ts.Debug.assert(heritageClause.token === 102);
if (seenImplementsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen);
}
@@ -18405,7 +18549,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 103);
+ ts.Debug.assert(heritageClause.token === 102);
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);
}
checkGrammarHeritageClause(heritageClause);
@@ -18444,17 +18588,17 @@ var ts;
var inStrictMode = (node.parserContextFlags & 1) !== 0;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- var name_11 = prop.name;
+ var name_13 = prop.name;
if (prop.kind === 175 ||
- name_11.kind === 127) {
- checkGrammarComputedPropertyName(name_11);
+ name_13.kind === 127) {
+ checkGrammarComputedPropertyName(name_13);
continue;
}
var currentKind = void 0;
if (prop.kind === 224 || prop.kind === 225) {
checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
- if (name_11.kind === 7) {
- checkGrammarNumbericLiteral(name_11);
+ if (name_13.kind === 7) {
+ checkGrammarNumbericLiteral(name_13);
}
currentKind = Property;
}
@@ -18470,26 +18614,26 @@ var ts;
else {
ts.Debug.fail("Unexpected syntax kind:" + prop.kind);
}
- if (!ts.hasProperty(seen, name_11.text)) {
- seen[name_11.text] = currentKind;
+ if (!ts.hasProperty(seen, name_13.text)) {
+ seen[name_13.text] = currentKind;
}
else {
- var existingKind = seen[name_11.text];
+ var existingKind = seen[name_13.text];
if (currentKind === Property && existingKind === Property) {
if (inStrictMode) {
- grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode);
+ grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode);
}
}
else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) {
if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) {
- seen[name_11.text] = currentKind | existingKind;
+ seen[name_13.text] = currentKind | existingKind;
}
else {
- return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
+ return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
}
}
else {
- return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
+ return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
}
}
}
@@ -18808,12 +18952,11 @@ var ts;
var identifier = name;
if (contextNode && (contextNode.parserContextFlags & 1) && ts.isEvalOrArgumentsIdentifier(identifier)) {
var nameText = ts.declarationNameToString(identifier);
- if (ts.getAncestor(name, 201) || ts.getAncestor(name, 174)) {
- return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText);
- }
- else {
+ var reportErrorInClassDeclaration = reportStrictModeGrammarErrorInClassDeclaration(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText);
+ if (!reportErrorInClassDeclaration) {
return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText);
}
+ return reportErrorInClassDeclaration;
}
}
}
@@ -19262,9 +19405,9 @@ var ts;
}
var count = 0;
while (true) {
- var name_12 = baseName + "_" + (++count);
- if (!ts.hasProperty(currentSourceFile.identifiers, name_12)) {
- return name_12;
+ var name_14 = baseName + "_" + (++count);
+ if (!ts.hasProperty(currentSourceFile.identifiers, name_14)) {
+ return name_14;
}
}
}
@@ -20346,9 +20489,9 @@ var ts;
var count = tempFlags & 268435455;
tempFlags++;
if (count !== 8 && count !== 13) {
- var name_13 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26);
- if (isUniqueName(name_13)) {
- return name_13;
+ var name_15 = count < 26 ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26);
+ if (isUniqueName(name_15)) {
+ return name_15;
}
}
}
@@ -20376,8 +20519,8 @@ var ts;
}
function generateNameForModuleOrEnum(node) {
if (node.name.kind === 65) {
- var name_14 = node.name.text;
- assignGeneratedName(node, isUniqueLocalName(name_14, node) ? name_14 : makeUniqueName(name_14));
+ var name_16 = node.name.text;
+ assignGeneratedName(node, isUniqueLocalName(name_16, node) ? name_16 : makeUniqueName(name_16));
}
}
function generateNameForImportOrExportDeclaration(node) {
@@ -20557,8 +20700,8 @@ var ts;
if (scopeName) {
var parentIndex = getSourceMapNameIndex();
if (parentIndex !== -1) {
- var name_15 = node.name;
- if (!name_15 || name_15.kind !== 127) {
+ var name_17 = node.name;
+ if (!name_17 || name_17.kind !== 127) {
scopeName = "." + scopeName;
}
scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName;
@@ -20585,9 +20728,9 @@ var ts;
node.kind === 201 ||
node.kind === 204) {
if (node.name) {
- var name_16 = node.name;
- scopeName = name_16.kind === 127
- ? ts.getTextOfNode(name_16)
+ var name_18 = node.name;
+ scopeName = name_18.kind === 127
+ ? ts.getTextOfNode(name_18)
: node.name.text;
}
recordScopeNameStart(scopeName);
@@ -21000,6 +21143,7 @@ var ts;
default:
return -1;
}
+ case 172:
case 170:
return -1;
default:
@@ -21171,6 +21315,16 @@ var ts;
write("...");
emit(node.expression);
}
+ function emitYieldExpression(node) {
+ write(ts.tokenToString(110));
+ if (node.asteriskToken) {
+ write("*");
+ }
+ if (node.expression) {
+ write(" ");
+ emit(node.expression);
+ }
+ }
function needsParenthesisForPropertyAccessOrInvocation(node) {
switch (node.kind) {
case 65:
@@ -21412,6 +21566,9 @@ var ts;
write("]");
}
function emitMethod(node) {
+ if (languageVersion >= 2 && node.asteriskToken) {
+ write("*");
+ }
emit(node.name, false);
if (languageVersion < 2) {
write(": function ");
@@ -21783,7 +21940,7 @@ var ts;
var tokenKind = 98;
if (decl && languageVersion >= 2) {
if (ts.isLet(decl)) {
- tokenKind = 105;
+ tokenKind = 104;
}
else if (ts.isConst(decl)) {
tokenKind = 70;
@@ -21796,7 +21953,7 @@ var ts;
switch (tokenKind) {
case 98:
return write("var ");
- case 105:
+ case 104:
return write("let ");
case 70:
return write("const ");
@@ -22397,12 +22554,12 @@ var ts;
function emitParameter(node) {
if (languageVersion < 2) {
if (ts.isBindingPattern(node.name)) {
- var name_17 = createTempVariable(0);
+ var name_19 = createTempVariable(0);
if (!tempParameters) {
tempParameters = [];
}
- tempParameters.push(name_17);
- emit(name_17);
+ tempParameters.push(name_19);
+ emit(name_19);
}
else {
emit(node.name);
@@ -22521,7 +22678,11 @@ var ts;
write("default ");
}
}
- write("function ");
+ write("function");
+ if (languageVersion >= 2 && node.asteriskToken) {
+ write("*");
+ }
+ write(" ");
}
if (shouldEmitFunctionName(node)) {
emitDeclarationName(node);
@@ -22853,6 +23014,9 @@ var ts;
else if (member.kind === 137) {
write("set ");
}
+ if (member.asteriskToken) {
+ write("*");
+ }
emit(member.name);
emitSignatureAndBody(member);
emitEnd(member);
@@ -23818,8 +23982,8 @@ var ts;
else {
for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) {
var specifier = _d[_c];
- var name_18 = (specifier.propertyName || specifier.name).text;
- (exportSpecifiers[name_18] || (exportSpecifiers[name_18] = [])).push(specifier);
+ var name_20 = (specifier.propertyName || specifier.name).text;
+ (exportSpecifiers[name_20] || (exportSpecifiers[name_20] = [])).push(specifier);
}
}
break;
@@ -24130,6 +24294,8 @@ var ts;
return emitConditionalExpression(node);
case 173:
return emitSpreadElementExpression(node);
+ case 172:
+ return emitYieldExpression(node);
case 175:
return;
case 179:
@@ -25308,28 +25474,30 @@ var ts;
var rawItems = [];
ts.forEach(program.getSourceFiles(), function (sourceFile) {
cancellationToken.throwIfCancellationRequested();
- var declarations = sourceFile.getNamedDeclarations();
- for (var _i = 0; _i < declarations.length; _i++) {
- var declaration = declarations[_i];
- var name = getDeclarationName(declaration);
- if (name !== undefined) {
- var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name);
+ var nameToDeclarations = sourceFile.getNamedDeclarations();
+ for (var name_21 in nameToDeclarations) {
+ var declarations = ts.getProperty(nameToDeclarations, name_21);
+ if (declarations) {
+ var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_21);
if (!matches) {
continue;
}
- if (patternMatcher.patternContainsDots) {
- var containers = getContainers(declaration);
- if (!containers) {
- return undefined;
- }
- matches = patternMatcher.getMatches(containers, name);
- if (!matches) {
- continue;
+ for (var _i = 0; _i < declarations.length; _i++) {
+ var declaration = declarations[_i];
+ if (patternMatcher.patternContainsDots) {
+ var containers = getContainers(declaration);
+ if (!containers) {
+ return undefined;
+ }
+ matches = patternMatcher.getMatches(containers, name_21);
+ if (!matches) {
+ continue;
+ }
}
+ var fileName = sourceFile.fileName;
+ var matchKind = bestMatchKind(matches);
+ rawItems.push({ name: name_21, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration });
}
- var fileName = sourceFile.fileName;
- var matchKind = bestMatchKind(matches);
- rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration });
}
}
});
@@ -25349,25 +25517,13 @@ var ts;
}
return true;
}
- function getDeclarationName(declaration) {
- var result = getTextOfIdentifierOrLiteral(declaration.name);
- if (result !== undefined) {
- return result;
- }
- if (declaration.name.kind === 127) {
- var expr = declaration.name.expression;
- if (expr.kind === 155) {
- return expr.name.text;
- }
- return getTextOfIdentifierOrLiteral(expr);
- }
- return undefined;
- }
function getTextOfIdentifierOrLiteral(node) {
- if (node.kind === 65 ||
- node.kind === 8 ||
- node.kind === 7) {
- return node.text;
+ if (node) {
+ if (node.kind === 65 ||
+ node.kind === 8 ||
+ node.kind === 7) {
+ return node.text;
+ }
}
return undefined;
}
@@ -25670,9 +25826,9 @@ var ts;
case 198:
case 152:
var variableDeclarationNode;
- var name_19;
+ var name_22;
if (node.kind === 152) {
- name_19 = node.name;
+ name_22 = node.name;
variableDeclarationNode = node;
while (variableDeclarationNode && variableDeclarationNode.kind !== 198) {
variableDeclarationNode = variableDeclarationNode.parent;
@@ -25682,16 +25838,16 @@ var ts;
else {
ts.Debug.assert(!ts.isBindingPattern(node.name));
variableDeclarationNode = node;
- name_19 = node.name;
+ name_22 = node.name;
}
if (ts.isConst(variableDeclarationNode)) {
- return createItem(node, getTextOfNode(name_19), ts.ScriptElementKind.constElement);
+ return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.constElement);
}
else if (ts.isLet(variableDeclarationNode)) {
- return createItem(node, getTextOfNode(name_19), ts.ScriptElementKind.letElement);
+ return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.letElement);
}
else {
- return createItem(node, getTextOfNode(name_19), ts.ScriptElementKind.variableElement);
+ return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.variableElement);
}
case 135:
return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement);
@@ -26283,7 +26439,8 @@ var ts;
var SignatureHelp;
(function (SignatureHelp) {
var emptyArray = [];
- function getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken) {
+ function getSignatureHelpItems(program, sourceFile, position, cancellationToken) {
+ var typeChecker = program.getTypeChecker();
var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position);
if (!startingToken) {
return undefined;
@@ -26295,12 +26452,51 @@ var ts;
}
var call = argumentInfo.invocation;
var candidates = [];
- var resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates);
+ var resolvedSignature = typeChecker.getResolvedSignature(call, candidates);
cancellationToken.throwIfCancellationRequested();
if (!candidates.length) {
+ if (ts.isJavaScript(sourceFile.fileName)) {
+ return createJavaScriptSignatureHelpItems(argumentInfo);
+ }
return undefined;
}
return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo);
+ function createJavaScriptSignatureHelpItems(argumentInfo) {
+ if (argumentInfo.invocation.kind !== 157) {
+ return undefined;
+ }
+ var callExpression = argumentInfo.invocation;
+ var expression = callExpression.expression;
+ var name = expression.kind === 65
+ ? expression
+ : expression.kind === 155
+ ? expression.name
+ : undefined;
+ if (!name || !name.text) {
+ return undefined;
+ }
+ var typeChecker = program.getTypeChecker();
+ for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
+ var sourceFile_1 = _a[_i];
+ var nameToDeclarations = sourceFile_1.getNamedDeclarations();
+ var declarations = ts.getProperty(nameToDeclarations, name.text);
+ if (declarations) {
+ for (var _b = 0; _b < declarations.length; _b++) {
+ var declaration = declarations[_b];
+ var symbol = declaration.symbol;
+ if (symbol) {
+ var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration);
+ if (type) {
+ var callSignatures = type.getCallSignatures();
+ if (callSignatures && callSignatures.length) {
+ return createSignatureHelpItems(callSignatures, callSignatures[0], argumentInfo);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
function getImmediatelyContainingArgumentInfo(node) {
if (node.parent.kind === 157 || node.parent.kind === 158) {
var callExpression = node.parent;
@@ -26462,8 +26658,8 @@ var ts;
var isTypeParameterList = argumentListInfo.kind === 0;
var invocation = argumentListInfo.invocation;
var callTarget = ts.getInvokedExpression(invocation);
- var callTargetSymbol = typeInfoResolver.getSymbolAtLocation(callTarget);
- var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined);
+ var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget);
+ var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, undefined, undefined);
var items = ts.map(candidates, function (candidateSignature) {
var signatureHelpParameters;
var prefixDisplayParts = [];
@@ -26477,13 +26673,13 @@ var ts;
signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray;
suffixDisplayParts.push(ts.punctuationPart(25));
var parameterParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation);
});
suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts);
}
else {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation);
});
prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts);
prefixDisplayParts.push(ts.punctuationPart(16));
@@ -26492,7 +26688,7 @@ var ts;
suffixDisplayParts.push(ts.punctuationPart(17));
}
var returnTypeParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation);
});
suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts);
return {
@@ -26520,7 +26716,7 @@ var ts;
};
function createSignatureHelpParameterForParameter(parameter) {
var displayParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation);
});
var isOptional = ts.hasQuestionToken(parameter.valueDeclaration);
return {
@@ -26532,7 +26728,7 @@ var ts;
}
function createSignatureHelpParameterForTypeParameter(typeParameter) {
var displayParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation);
});
return {
name: typeParameter.symbol.name,
@@ -26918,9 +27114,9 @@ var ts;
ts.isInsideTemplateLiteral = isInsideTemplateLiteral;
function isAccessibilityModifier(kind) {
switch (kind) {
- case 109:
- case 107:
case 108:
+ case 106:
+ case 107:
return true;
}
return false;
@@ -27110,6 +27306,10 @@ var ts;
});
}
ts.signatureToDisplayParts = signatureToDisplayParts;
+ function isJavaScript(fileName) {
+ return ts.fileExtensionIs(fileName, ".js");
+ }
+ ts.isJavaScript = isJavaScript;
})(ts || (ts = {}));
///
///
@@ -27538,7 +27738,7 @@ var ts;
this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34, 39), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2));
this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8));
this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([98, 94, 88, 74, 90, 97]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2));
- this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([105, 70]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2));
+ this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104, 70]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2));
this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8));
this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(83, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2));
this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8));
@@ -27551,8 +27751,8 @@ var ts;
this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2));
this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(114, 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8));
this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117, 118]), 16), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8));
- this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69, 115, 77, 78, 79, 116, 103, 85, 104, 117, 107, 109, 120, 110]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2));
- this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79, 103])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2));
+ this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69, 115, 77, 78, 79, 116, 102, 85, 103, 117, 106, 108, 120, 109]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2));
+ this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79, 102])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2));
this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8, 14), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2));
this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(32, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2));
this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21, 65), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8));
@@ -27565,7 +27765,7 @@ var ts;
this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14, 15), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8));
this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 52), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2));
this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(52, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8));
- this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65, 78, 73, 69, 110, 109, 107, 108, 116, 120, 18, 35])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2));
+ this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65, 78, 73, 69, 109, 108, 106, 107, 116, 120, 18, 35])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2));
this.HighPriorityCommonRules =
[
this.IgnoreBeforeComment, this.IgnoreAfterLineComment,
@@ -27639,9 +27839,9 @@ var ts;
}
Rules.prototype.getRuleName = function (rule) {
var o = this;
- for (var name_20 in o) {
- if (o[name_20] === rule) {
- return name_20;
+ for (var name_23 in o) {
+ if (o[name_23] === rule) {
+ return name_23;
}
}
throw new Error("Unknown rule");
@@ -28453,7 +28653,7 @@ var ts;
}
switch (node.kind) {
case 201: return 69;
- case 202: return 104;
+ case 202: return 103;
case 200: return 83;
case 204: return 204;
case 136: return 116;
@@ -29772,26 +29972,62 @@ var ts;
return this.namedDeclarations;
};
SourceFileObject.prototype.computeNamedDeclarations = function () {
- var namedDeclarations = [];
+ var result = {};
ts.forEachChild(this, visit);
- return namedDeclarations;
+ return result;
+ function addDeclaration(declaration) {
+ var name = getDeclarationName(declaration);
+ if (name) {
+ var declarations = getDeclarations(name);
+ declarations.push(declaration);
+ }
+ }
+ function getDeclarations(name) {
+ return ts.getProperty(result, name) || (result[name] = []);
+ }
+ function getDeclarationName(declaration) {
+ if (declaration.name) {
+ var result_2 = getTextOfIdentifierOrLiteral(declaration.name);
+ if (result_2 !== undefined) {
+ return result_2;
+ }
+ if (declaration.name.kind === 127) {
+ var expr = declaration.name.expression;
+ if (expr.kind === 155) {
+ return expr.name.text;
+ }
+ return getTextOfIdentifierOrLiteral(expr);
+ }
+ }
+ return undefined;
+ }
+ function getTextOfIdentifierOrLiteral(node) {
+ if (node) {
+ if (node.kind === 65 ||
+ node.kind === 8 ||
+ node.kind === 7) {
+ return node.text;
+ }
+ }
+ return undefined;
+ }
function visit(node) {
switch (node.kind) {
case 200:
case 134:
case 133:
var functionDeclaration = node;
- if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) {
- var lastDeclaration = namedDeclarations.length > 0 ?
- namedDeclarations[namedDeclarations.length - 1] :
- undefined;
- if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) {
+ var declarationName = getDeclarationName(functionDeclaration);
+ if (declarationName) {
+ var declarations = getDeclarations(declarationName);
+ var lastDeclaration = ts.lastOrUndefined(declarations);
+ if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) {
if (functionDeclaration.body && !lastDeclaration.body) {
- namedDeclarations[namedDeclarations.length - 1] = functionDeclaration;
+ declarations[declarations.length - 1] = functionDeclaration;
}
}
else {
- namedDeclarations.push(functionDeclaration);
+ declarations.push(functionDeclaration);
}
ts.forEachChild(node, visit);
}
@@ -29810,9 +30046,7 @@ var ts;
case 136:
case 137:
case 145:
- if (node.name) {
- namedDeclarations.push(node);
- }
+ addDeclaration(node);
case 135:
case 180:
case 199:
@@ -29839,7 +30073,7 @@ var ts;
case 226:
case 132:
case 131:
- namedDeclarations.push(node);
+ addDeclaration(node);
break;
case 215:
if (node.exportClause) {
@@ -29850,11 +30084,11 @@ var ts;
var importClause = node.importClause;
if (importClause) {
if (importClause.name) {
- namedDeclarations.push(importClause);
+ addDeclaration(importClause);
}
if (importClause.namedBindings) {
if (importClause.namedBindings.kind === 211) {
- namedDeclarations.push(importClause.namedBindings);
+ addDeclaration(importClause.namedBindings);
}
else {
ts.forEach(importClause.namedBindings.elements, visit);
@@ -30340,7 +30574,7 @@ var ts;
}
else if (token === 35) {
token = scanner.scan();
- if (token === 102) {
+ if (token === 111) {
token = scanner.scan();
if (token === 65) {
token = scanner.scan();
@@ -30578,7 +30812,6 @@ var ts;
var syntaxTreeCache = new SyntaxTreeCache(host);
var ruleProvider;
var program;
- var typeInfoResolver;
var useCaseSensitivefileNames = false;
var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken());
if (!ts.localizedDiagnosticMessages && host.getLocalizedDiagnosticMessages) {
@@ -30636,7 +30869,7 @@ var ts;
}
}
program = newProgram;
- typeInfoResolver = program.getTypeChecker();
+ program.getTypeChecker();
return;
function getOrCreateSourceFile(fileName) {
var hostFileInformation = hostCache.getOrCreateEntry(fileName);
@@ -30676,9 +30909,6 @@ var ts;
return program;
}
function cleanupSemanticCache() {
- if (program) {
- typeInfoResolver = program.getTypeChecker();
- }
}
function dispose() {
if (program) {
@@ -30691,13 +30921,10 @@ var ts;
synchronizeHostData();
return program.getSyntacticDiagnostics(getValidSourceFile(fileName));
}
- function isJavaScript(fileName) {
- return ts.fileExtensionIs(fileName, ".js");
- }
function getSemanticDiagnostics(fileName) {
synchronizeHostData();
var targetSourceFile = getValidSourceFile(fileName);
- if (isJavaScript(fileName)) {
+ if (ts.isJavaScript(fileName)) {
return getJavaScriptSemanticDiagnostics(targetSourceFile);
}
var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile);
@@ -30731,7 +30958,7 @@ var ts;
break;
case 222:
var heritageClause = node;
- if (heritageClause.token === 103) {
+ if (heritageClause.token === 102) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file));
return true;
}
@@ -30834,13 +31061,13 @@ var ts;
for (var _i = 0; _i < modifiers.length; _i++) {
var modifier = modifiers[_i];
switch (modifier.kind) {
- case 109:
- case 107:
case 108:
+ case 106:
+ case 107:
case 115:
diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
return true;
- case 110:
+ case 109:
case 78:
case 70:
case 73:
@@ -30895,19 +31122,8 @@ var ts;
}
return ts.unescapeIdentifier(displayName);
}
- function createCompletionEntry(symbol, typeChecker, location) {
- var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, true);
- if (!displayName) {
- return undefined;
- }
- return {
- name: displayName,
- kind: getSymbolKind(symbol, typeChecker, location),
- kindModifiers: getSymbolModifiers(symbol),
- sortText: "0"
- };
- }
function getCompletionData(fileName, position) {
+ var typeChecker = program.getTypeChecker();
var syntacticStart = new Date().getTime();
var sourceFile = getValidSourceFile(fileName);
var start = new Date().getTime();
@@ -30963,23 +31179,23 @@ var ts;
isMemberCompletion = true;
isNewIdentifierLocation = false;
if (node.kind === 65 || node.kind === 126 || node.kind === 155) {
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
if (symbol && symbol.flags & 8388608) {
- symbol = typeInfoResolver.getAliasedSymbol(symbol);
+ symbol = typeChecker.getAliasedSymbol(symbol);
}
if (symbol && symbol.flags & 1952) {
- var exportedSymbols = typeInfoResolver.getExportsOfModule(symbol);
+ var exportedSymbols = typeChecker.getExportsOfModule(symbol);
ts.forEach(exportedSymbols, function (symbol) {
- if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) {
+ if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) {
symbols.push(symbol);
}
});
}
}
- var type = typeInfoResolver.getTypeAtLocation(node);
+ var type = typeChecker.getTypeAtLocation(node);
if (type) {
ts.forEach(type.getApparentProperties(), function (symbol) {
- if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) {
+ if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) {
symbols.push(symbol);
}
});
@@ -30990,11 +31206,11 @@ var ts;
if (containingObjectLiteral) {
isMemberCompletion = true;
isNewIdentifierLocation = true;
- var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral);
+ var contextualType = typeChecker.getContextualType(containingObjectLiteral);
if (!contextualType) {
return false;
}
- var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType);
+ var contextualTypeMembers = typeChecker.getPropertiesOfType(contextualType);
if (contextualTypeMembers && contextualTypeMembers.length > 0) {
symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties);
}
@@ -31007,9 +31223,9 @@ var ts;
ts.Debug.assert(importDeclaration !== undefined);
var exports_2;
if (importDeclaration.moduleSpecifier) {
- var moduleSpecifierSymbol = typeInfoResolver.getSymbolAtLocation(importDeclaration.moduleSpecifier);
+ var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier);
if (moduleSpecifierSymbol) {
- exports_2 = typeInfoResolver.getExportsOfModule(moduleSpecifierSymbol);
+ exports_2 = typeChecker.getExportsOfModule(moduleSpecifierSymbol);
}
}
symbols = exports_2 ? filterModuleExports(exports_2, importDeclaration) : emptyArray;
@@ -31026,7 +31242,7 @@ var ts;
position;
var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile;
var symbolMeanings = 793056 | 107455 | 1536 | 8388608;
- symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings);
+ symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);
}
return true;
}
@@ -31083,9 +31299,9 @@ var ts;
return containingNodeKind === 171;
case 12:
return containingNodeKind === 176;
- case 109:
- case 107:
case 108:
+ case 106:
+ case 107:
return containingNodeKind === 132;
}
switch (previousToken.getText()) {
@@ -31172,6 +31388,7 @@ var ts;
containingNodeKind === 150;
case 22:
return containingNodeKind === 131 &&
+ previousToken.parent && previousToken.parent.parent &&
(previousToken.parent.parent.kind === 202 ||
previousToken.parent.parent.kind === 145);
case 24:
@@ -31179,27 +31396,28 @@ var ts;
containingNodeKind === 200 ||
containingNodeKind === 202 ||
isFunction(containingNodeKind);
- case 110:
+ case 109:
return containingNodeKind === 132;
case 21:
return containingNodeKind === 129 ||
containingNodeKind === 135 ||
- (previousToken.parent.parent.kind === 151);
- case 109:
- case 107:
+ (previousToken.parent && previousToken.parent.parent &&
+ previousToken.parent.parent.kind === 151);
case 108:
+ case 106:
+ case 107:
return containingNodeKind === 129;
case 69:
case 77:
- case 104:
+ case 103:
case 83:
case 98:
case 116:
case 120:
case 85:
- case 105:
+ case 104:
case 70:
- case 111:
+ case 110:
return true;
}
switch (previousToken.getText()) {
@@ -31272,7 +31490,7 @@ var ts;
}
var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot;
var entries;
- if (isRightOfDot && isJavaScript(fileName)) {
+ if (isRightOfDot && ts.isJavaScript(fileName)) {
entries = getCompletionEntriesFromSymbols(symbols);
ts.addRange(entries, getJavaScriptCompletionEntries());
}
@@ -31293,10 +31511,10 @@ var ts;
for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
var sourceFile = _a[_i];
var nameTable = getNameTable(sourceFile);
- for (var name_21 in nameTable) {
- if (!allNames[name_21]) {
- allNames[name_21] = name_21;
- var displayName = getCompletionEntryDisplayName(name_21, target, true);
+ for (var name_24 in nameTable) {
+ if (!allNames[name_24]) {
+ allNames[name_24] = name_24;
+ var displayName = getCompletionEntryDisplayName(name_24, target, true);
if (displayName) {
var entry = {
name: displayName,
@@ -31311,6 +31529,18 @@ var ts;
}
return entries;
}
+ function createCompletionEntry(symbol, location) {
+ var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, true);
+ if (!displayName) {
+ return undefined;
+ }
+ return {
+ name: displayName,
+ kind: getSymbolKind(symbol, location),
+ kindModifiers: getSymbolModifiers(symbol),
+ sortText: "0"
+ };
+ }
function getCompletionEntriesFromSymbols(symbols) {
var start = new Date().getTime();
var entries = [];
@@ -31318,7 +31548,7 @@ var ts;
var nameToSymbol = {};
for (var _i = 0; _i < symbols.length; _i++) {
var symbol = symbols[_i];
- var entry = createCompletionEntry(symbol, typeInfoResolver, location);
+ var entry = createCompletionEntry(symbol, location);
if (entry) {
var id = ts.escapeIdentifier(entry.name);
if (!ts.lookUp(nameToSymbol, id)) {
@@ -31340,7 +31570,7 @@ var ts;
var target = program.getCompilerOptions().target;
var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, false) === entryName ? s : undefined; });
if (symbol) {
- var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, typeInfoResolver, location_2, 7);
+ var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, location_2, 7);
return {
name: entryName,
kind: displayPartsDocumentationsAndSymbolKind.symbolKind,
@@ -31362,7 +31592,7 @@ var ts;
}
return undefined;
}
- function getSymbolKind(symbol, typeResolver, location) {
+ function getSymbolKind(symbol, location) {
var flags = symbol.getFlags();
if (flags & 32)
return ScriptElementKind.classElement;
@@ -31374,7 +31604,7 @@ var ts;
return ScriptElementKind.interfaceElement;
if (flags & 262144)
return ScriptElementKind.typeParameterElement;
- var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location);
+ var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location);
if (result === ScriptElementKind.unknown) {
if (flags & 262144)
return ScriptElementKind.typeParameterElement;
@@ -31387,11 +31617,12 @@ var ts;
}
return result;
}
- function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location) {
- if (typeResolver.isUndefinedSymbol(symbol)) {
+ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location) {
+ var typeChecker = program.getTypeChecker();
+ if (typeChecker.isUndefinedSymbol(symbol)) {
return ScriptElementKind.variableElement;
}
- if (typeResolver.isArgumentsSymbol(symbol)) {
+ if (typeChecker.isArgumentsSymbol(symbol)) {
return ScriptElementKind.localVariableElement;
}
if (flags & 3) {
@@ -31418,7 +31649,7 @@ var ts;
return ScriptElementKind.constructorImplementationElement;
if (flags & 4) {
if (flags & 268435456) {
- var unionPropertyKind = ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) {
+ var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) {
var rootSymbolFlags = rootSymbol.getFlags();
if (rootSymbolFlags & (98308 | 3)) {
return ScriptElementKind.memberVariableElement;
@@ -31426,7 +31657,7 @@ var ts;
ts.Debug.assert(!!(rootSymbolFlags & 8192));
});
if (!unionPropertyKind) {
- var typeOfUnionProperty = typeInfoResolver.getTypeOfSymbolAtLocation(symbol, location);
+ var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (typeOfUnionProperty.getCallSignatures().length) {
return ScriptElementKind.memberFunctionElement;
}
@@ -31459,12 +31690,13 @@ var ts;
? ts.getNodeModifiers(symbol.declarations[0])
: ScriptElementKindModifier.none;
}
- function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location, semanticMeaning) {
+ function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) {
if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); }
+ var typeChecker = program.getTypeChecker();
var displayParts = [];
var documentation;
var symbolFlags = symbol.flags;
- var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location);
+ var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location);
var hasAddedSymbolInfo;
var type;
if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 || symbolFlags & 8388608) {
@@ -31472,7 +31704,7 @@ var ts;
symbolKind = ScriptElementKind.memberVariableElement;
}
var signature;
- type = typeResolver.getTypeOfSymbolAtLocation(symbol, location);
+ type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (type) {
if (location.parent && location.parent.kind === 155) {
var right = location.parent.name;
@@ -31489,7 +31721,7 @@ var ts;
}
if (callExpression) {
var candidateSignatures = [];
- signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures);
+ signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures);
if (!signature && candidateSignatures.length) {
signature = candidateSignatures[0];
}
@@ -31530,7 +31762,7 @@ var ts;
displayParts.push(ts.spacePart());
}
if (!(type.flags & 32768)) {
- displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, undefined, 1));
+ displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1));
}
addSignatureDisplayParts(signature, allSignatures, 8);
break;
@@ -31544,8 +31776,8 @@ var ts;
(location.kind === 114 && location.parent.kind === 135)) {
var functionDeclaration = location.parent;
var allSignatures = functionDeclaration.kind === 135 ? type.getConstructSignatures() : type.getCallSignatures();
- if (!typeResolver.isImplementationOfOverload(functionDeclaration)) {
- signature = typeResolver.getSignatureFromDeclaration(functionDeclaration);
+ if (!typeChecker.isImplementationOfOverload(functionDeclaration)) {
+ signature = typeChecker.getSignatureFromDeclaration(functionDeclaration);
}
else {
signature = allSignatures[0];
@@ -31571,7 +31803,7 @@ var ts;
}
if ((symbolFlags & 64) && (semanticMeaning & 2)) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.keywordPart(104));
+ displayParts.push(ts.keywordPart(103));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
writeTypeParametersOfSymbol(symbol, sourceFile);
@@ -31584,7 +31816,7 @@ var ts;
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(53));
displayParts.push(ts.spacePart());
- displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
+ displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
}
if (symbolFlags & 384) {
addNewLineIfDisplayPartsExist();
@@ -31618,7 +31850,7 @@ var ts;
}
else {
var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128).parent;
- var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration);
+ var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration);
if (signatureDeclaration.kind === 139) {
displayParts.push(ts.keywordPart(88));
displayParts.push(ts.spacePart());
@@ -31626,14 +31858,14 @@ var ts;
else if (signatureDeclaration.kind !== 138 && signatureDeclaration.name) {
addFullSymbolName(signatureDeclaration.symbol);
}
- displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32));
+ displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32));
}
}
if (symbolFlags & 8) {
addPrefixForAnyFunctionOrVar(symbol, "enum member");
var declaration = symbol.declarations[0];
if (declaration.kind === 226) {
- var constantValue = typeResolver.getConstantValue(declaration);
+ var constantValue = typeChecker.getConstantValue(declaration);
if (constantValue !== undefined) {
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(53));
@@ -31660,7 +31892,7 @@ var ts;
displayParts.push(ts.punctuationPart(17));
}
else {
- var internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
+ var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
if (internalAliasSymbol) {
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(53));
@@ -31683,12 +31915,12 @@ var ts;
displayParts.push(ts.spacePart());
if (type.symbol && type.symbol.flags & 262144) {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
- typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration);
+ typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration);
});
displayParts.push.apply(displayParts, typeParameterParts);
}
else {
- displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, type, enclosingDeclaration));
+ displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, type, enclosingDeclaration));
}
}
else if (symbolFlags & 16 ||
@@ -31703,7 +31935,7 @@ var ts;
}
}
else {
- symbolKind = getSymbolKind(symbol, typeResolver, location);
+ symbolKind = getSymbolKind(symbol, location);
}
}
if (!documentation) {
@@ -31716,7 +31948,7 @@ var ts;
}
}
function addFullSymbolName(symbol, enclosingDeclaration) {
- var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, undefined, 1 | 2);
+ var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, undefined, 1 | 2);
displayParts.push.apply(displayParts, fullSymbolDisplayParts);
}
function addPrefixForAnyFunctionOrVar(symbol, symbolKind) {
@@ -31744,7 +31976,7 @@ var ts;
}
}
function addSignatureDisplayParts(signature, allSignatures, flags) {
- displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32));
+ displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32));
if (allSignatures.length > 1) {
displayParts.push(ts.spacePart());
displayParts.push(ts.punctuationPart(16));
@@ -31758,7 +31990,7 @@ var ts;
}
function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
- typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
+ typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
});
displayParts.push.apply(displayParts, typeParameterParts);
}
@@ -31770,7 +32002,11 @@ var ts;
if (!node) {
return undefined;
}
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ if (isLabelName(node)) {
+ return undefined;
+ }
+ var typeChecker = program.getTypeChecker();
+ var symbol = typeChecker.getSymbolAtLocation(node);
if (!symbol) {
switch (node.kind) {
case 65:
@@ -31778,20 +32014,20 @@ var ts;
case 126:
case 93:
case 91:
- var type = typeInfoResolver.getTypeAtLocation(node);
+ var type = typeChecker.getTypeAtLocation(node);
if (type) {
return {
kind: ScriptElementKind.unknown,
kindModifiers: ScriptElementKindModifier.none,
textSpan: ts.createTextSpan(node.getStart(), node.getWidth()),
- displayParts: ts.typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)),
+ displayParts: ts.typeToDisplayParts(typeChecker, type, getContainerNode(node)),
documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined
};
}
}
return undefined;
}
- var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node);
+ var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node);
return {
kind: displayPartsDocumentationsAndKind.symbolKind,
kindModifiers: getSymbolModifiers(symbol),
@@ -31837,33 +32073,34 @@ var ts;
}
return undefined;
}
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var typeChecker = program.getTypeChecker();
+ var symbol = typeChecker.getSymbolAtLocation(node);
if (!symbol) {
return undefined;
}
if (symbol.flags & 8388608) {
var declaration = symbol.declarations[0];
if (node.kind === 65 && node.parent === declaration) {
- symbol = typeInfoResolver.getAliasedSymbol(symbol);
+ symbol = typeChecker.getAliasedSymbol(symbol);
}
}
if (node.parent.kind === 225) {
- var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
+ var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
if (!shorthandSymbol) {
return [];
}
var shorthandDeclarations = shorthandSymbol.getDeclarations();
- var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node);
- var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol);
- var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node);
+ var shorthandSymbolKind = getSymbolKind(shorthandSymbol, node);
+ var shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol);
+ var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node);
return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); });
}
var result = [];
var declarations = symbol.getDeclarations();
- var symbolName = typeInfoResolver.symbolToString(symbol);
- var symbolKind = getSymbolKind(symbol, typeInfoResolver, node);
+ var symbolName = typeChecker.symbolToString(symbol);
+ var symbolKind = getSymbolKind(symbol, node);
var containerSymbol = symbol.parent;
- var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : "";
+ var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : "";
if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) &&
!tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) {
ts.forEach(declarations, function (declaration) {
@@ -31913,7 +32150,7 @@ var ts;
var results = getOccurrencesAtPositionCore(fileName, position);
if (results) {
var sourceFile = getCanonicalFileName(ts.normalizeSlashes(fileName));
- results = ts.filter(results, function (r) { return r.fileName === fileName; });
+ results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile; });
}
return results;
}
@@ -32158,7 +32395,7 @@ var ts;
return undefined;
}
}
- else if (modifier === 110) {
+ else if (modifier === 109) {
if (container.kind !== 201) {
return undefined;
}
@@ -32204,13 +32441,13 @@ var ts;
return ts.map(keywords, getHighlightSpanForNode);
function getFlagFromModifier(modifier) {
switch (modifier) {
- case 109:
- return 16;
- case 107:
- return 32;
case 108:
+ return 16;
+ case 106:
+ return 32;
+ case 107:
return 64;
- case 110:
+ case 109:
return 128;
case 78:
return 1;
@@ -32453,6 +32690,7 @@ var ts;
return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments);
}
function getReferencedSymbolsForNodes(node, sourceFiles, findInStrings, findInComments) {
+ var typeChecker = program.getTypeChecker();
if (isLabelName(node)) {
if (isJumpStatementTarget(node)) {
var labelDefinition = getTargetLabel(node.parent, node.text);
@@ -32468,7 +32706,7 @@ var ts;
if (node.kind === 91) {
return getReferencesForSuperKeyword(node);
}
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
if (!symbol) {
return undefined;
}
@@ -32499,7 +32737,7 @@ var ts;
}
return result;
function getDefinition(symbol) {
- var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), typeInfoResolver, node);
+ var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node);
var name = ts.map(info.displayParts, function (p) { return p.text; }).join("");
var declarations = symbol.declarations;
if (!declarations || declarations.length === 0) {
@@ -32533,7 +32771,7 @@ var ts;
if (isImportOrExportSpecifierName(location)) {
return location.getText();
}
- name = typeInfoResolver.symbolToString(symbol);
+ name = typeChecker.symbolToString(symbol);
return stripQuotes(name);
}
function getInternedName(symbol, location, declarations) {
@@ -32681,10 +32919,10 @@ var ts;
if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) {
return;
}
- var referenceSymbol = typeInfoResolver.getSymbolAtLocation(referenceLocation);
+ var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation);
if (referenceSymbol) {
var referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
- var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
+ var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
var relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation);
if (relatedSymbol) {
var referencedSymbol = getReferencedSymbol(relatedSymbol);
@@ -32857,18 +33095,18 @@ var ts;
function populateSearchSymbolSet(symbol, location) {
var result = [symbol];
if (isImportOrExportSpecifierImportSymbol(symbol)) {
- result.push(typeInfoResolver.getAliasedSymbol(symbol));
+ result.push(typeChecker.getAliasedSymbol(symbol));
}
if (isNameOfPropertyAssignment(location)) {
ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) {
- result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol));
+ result.push.apply(result, typeChecker.getRootSymbols(contextualSymbol));
});
- var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent);
+ var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent);
if (shorthandValueSymbol) {
result.push(shorthandValueSymbol);
}
}
- ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) {
+ ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) {
if (rootSymbol !== symbol) {
result.push(rootSymbol);
}
@@ -32893,9 +33131,9 @@ var ts;
return;
function getPropertySymbolFromTypeReference(typeReference) {
if (typeReference) {
- var type = typeInfoResolver.getTypeAtLocation(typeReference);
+ var type = typeChecker.getTypeAtLocation(typeReference);
if (type) {
- var propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName);
+ var propertySymbol = typeChecker.getPropertyOfType(type, propertyName);
if (propertySymbol) {
result.push(propertySymbol);
}
@@ -32909,24 +33147,24 @@ var ts;
return referenceSymbol;
}
if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) {
- var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol);
+ var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol);
if (searchSymbols.indexOf(aliasedSymbol) >= 0) {
return aliasedSymbol;
}
}
if (isNameOfPropertyAssignment(referenceLocation)) {
return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) {
- return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
+ return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
});
}
- return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) {
+ return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) {
if (searchSymbols.indexOf(rootSymbol) >= 0) {
return rootSymbol;
}
if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) {
- var result_2 = [];
- getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_2);
- return ts.forEach(result_2, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
+ var result_3 = [];
+ getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3);
+ return ts.forEach(result_3, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
}
return undefined;
});
@@ -32934,27 +33172,27 @@ var ts;
function getPropertySymbolsFromContextualType(node) {
if (isNameOfPropertyAssignment(node)) {
var objectLiteral = node.parent.parent;
- var contextualType = typeInfoResolver.getContextualType(objectLiteral);
- var name_22 = node.text;
+ var contextualType = typeChecker.getContextualType(objectLiteral);
+ var name_25 = node.text;
if (contextualType) {
if (contextualType.flags & 16384) {
- var unionProperty = contextualType.getProperty(name_22);
+ var unionProperty = contextualType.getProperty(name_25);
if (unionProperty) {
return [unionProperty];
}
else {
- var result_3 = [];
+ var result_4 = [];
ts.forEach(contextualType.types, function (t) {
- var symbol = t.getProperty(name_22);
+ var symbol = t.getProperty(name_25);
if (symbol) {
- result_3.push(symbol);
+ result_4.push(symbol);
}
});
- return result_3;
+ return result_4;
}
}
else {
- var symbol_1 = contextualType.getProperty(name_22);
+ var symbol_1 = contextualType.getProperty(name_25);
if (symbol_1) {
return [symbol_1];
}
@@ -33104,7 +33342,7 @@ var ts;
}
if (!isLastClause && root.parent.kind === 177 && root.parent.parent.kind === 222) {
var decl = root.parent.parent.parent;
- return (decl.kind === 201 && root.parent.parent.token === 103) ||
+ return (decl.kind === 201 && root.parent.parent.token === 102) ||
(decl.kind === 202 && root.parent.parent.token === 79);
}
return false;
@@ -33158,7 +33396,7 @@ var ts;
function getSignatureHelpItems(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
- return ts.SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken);
+ return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken);
}
function getSourceFile(fileName) {
return syntaxTreeCache.getCurrentSourceFile(fileName);
@@ -33214,6 +33452,7 @@ var ts;
function getSemanticClassifications(fileName, span) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
+ var typeChecker = program.getTypeChecker();
var result = [];
processNode(sourceFile);
return result;
@@ -33252,7 +33491,7 @@ var ts;
function processNode(node) {
if (node && ts.textSpanIntersectsWith(span, node.getStart(), node.getWidth())) {
if (node.kind === 65 && node.getWidth() > 0) {
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
if (symbol) {
var type = classifySymbol(symbol, getMeaningFromLocation(node));
if (type) {
@@ -33576,9 +33815,10 @@ var ts;
function getRenameInfo(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
+ var typeChecker = program.getTypeChecker();
var node = ts.getTouchingWord(sourceFile, position);
if (node && node.kind === 65) {
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
if (symbol) {
var declarations = symbol.getDeclarations();
if (declarations && declarations.length > 0) {
@@ -33586,19 +33826,19 @@ var ts;
if (defaultLibFileName) {
for (var _i = 0; _i < declarations.length; _i++) {
var current = declarations[_i];
- var sourceFile_1 = current.getSourceFile();
- if (sourceFile_1 && getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) {
+ var sourceFile_2 = current.getSourceFile();
+ if (sourceFile_2 && getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) {
return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key));
}
}
}
- var kind = getSymbolKind(symbol, typeInfoResolver, node);
+ var kind = getSymbolKind(symbol, node);
if (kind) {
return {
canRename: true,
localizedErrorMessage: undefined,
displayName: symbol.name,
- fullDisplayName: typeInfoResolver.getFullyQualifiedName(symbol),
+ fullDisplayName: typeChecker.getFullyQualifiedName(symbol),
kind: kind,
kindModifiers: getSymbolModifiers(symbol),
triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth())
@@ -33712,7 +33952,7 @@ var ts;
if (keyword2 === 116 ||
keyword2 === 120 ||
keyword2 === 114 ||
- keyword2 === 110) {
+ keyword2 === 109) {
return true;
}
return false;
@@ -34230,8 +34470,7 @@ var ts;
this.errorTimer = setTimeout(checkOne, ms);
}
};
- Session.prototype.getDefinition = function (_a) {
- var line = _a.line, offset = _a.offset, fileName = _a.file;
+ Session.prototype.getDefinition = function (line, offset, fileName) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34249,8 +34488,7 @@ var ts;
end: compilerService.host.positionToLineOffset(def.fileName, ts.textSpanEnd(def.textSpan))
}); });
};
- Session.prototype.getOccurrences = function (_a) {
- var line = _a.line, offset = _a.offset, fileName = _a.file;
+ Session.prototype.getOccurrences = function (line, offset, fileName) {
fileName = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(fileName);
if (!project) {
@@ -34274,8 +34512,7 @@ var ts;
};
});
};
- Session.prototype.getRenameLocations = function (_a) {
- var line = _a.line, offset = _a.offset, fileName = _a.file, findInComments = _a.findInComments, findInStrings = _a.findInStrings;
+ Session.prototype.getRenameLocations = function (line, offset, fileName, findInComments, findInStrings) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34336,8 +34573,7 @@ var ts;
}, []);
return { info: renameInfo, locs: bakedRenameLocs };
};
- Session.prototype.getReferences = function (_a) {
- var line = _a.line, offset = _a.offset, fileName = _a.file;
+ Session.prototype.getReferences = function (line, offset, fileName) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34377,13 +34613,11 @@ var ts;
symbolDisplayString: displayString
};
};
- Session.prototype.openClientFile = function (_a) {
- var fileName = _a.file;
+ Session.prototype.openClientFile = function (fileName) {
var file = ts.normalizePath(fileName);
this.projectService.openClientFile(file);
};
- Session.prototype.getQuickInfo = function (_a) {
- var line = _a.line, offset = _a.offset, fileName = _a.file;
+ Session.prototype.getQuickInfo = function (line, offset, fileName) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34406,8 +34640,7 @@ var ts;
documentation: docString
};
};
- Session.prototype.getFormattingEditsForRange = function (_a) {
- var line = _a.line, offset = _a.offset, endLine = _a.endLine, endOffset = _a.endOffset, fileName = _a.file;
+ Session.prototype.getFormattingEditsForRange = function (line, offset, endLine, endOffset, fileName) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34428,8 +34661,7 @@ var ts;
};
});
};
- Session.prototype.getFormattingEditsAfterKeystroke = function (_a) {
- var line = _a.line, offset = _a.offset, key = _a.key, fileName = _a.file;
+ Session.prototype.getFormattingEditsAfterKeystroke = function (line, offset, key, fileName) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34486,8 +34718,7 @@ var ts;
};
});
};
- Session.prototype.getCompletions = function (_a) {
- var line = _a.line, offset = _a.offset, prefix = _a.prefix, fileName = _a.file;
+ Session.prototype.getCompletions = function (line, offset, prefix, fileName) {
if (!prefix) {
prefix = "";
}
@@ -34509,8 +34740,7 @@ var ts;
return result;
}, []).sort(function (a, b) { return a.name.localeCompare(b.name); });
};
- Session.prototype.getCompletionEntryDetails = function (_a) {
- var line = _a.line, offset = _a.offset, entryNames = _a.entryNames, fileName = _a.file;
+ Session.prototype.getCompletionEntryDetails = function (line, offset, entryNames, fileName) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34526,8 +34756,7 @@ var ts;
return accum;
}, []);
};
- Session.prototype.getSignatureHelpItems = function (_a) {
- var line = _a.line, offset = _a.offset, fileName = _a.file;
+ Session.prototype.getSignatureHelpItems = function (line, offset, fileName) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34552,9 +34781,8 @@ var ts;
};
return result;
};
- Session.prototype.getDiagnostics = function (_a) {
+ Session.prototype.getDiagnostics = function (delay, fileNames) {
var _this = this;
- var delay = _a.delay, fileNames = _a.files;
var checkList = fileNames.reduce(function (accum, fileName) {
fileName = ts.normalizePath(fileName);
var project = _this.projectService.getProjectForFile(fileName);
@@ -34567,9 +34795,8 @@ var ts;
this.updateErrorCheck(checkList, this.changeSeq, function (n) { return n == _this.changeSeq; }, delay);
}
};
- Session.prototype.change = function (_a) {
+ Session.prototype.change = function (line, offset, endLine, endOffset, insertString, fileName) {
var _this = this;
- var line = _a.line, offset = _a.offset, endLine = _a.endLine, endOffset = _a.endOffset, insertString = _a.insertString, fileName = _a.file;
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (project) {
@@ -34583,9 +34810,8 @@ var ts;
this.updateProjectStructure(this.changeSeq, function (n) { return n == _this.changeSeq; });
}
};
- Session.prototype.reload = function (_a, reqSeq) {
+ Session.prototype.reload = function (fileName, tempFileName, reqSeq) {
var _this = this;
- var fileName = _a.file, tempFileName = _a.tmpfile;
if (reqSeq === void 0) { reqSeq = 0; }
var file = ts.normalizePath(fileName);
var tmpfile = ts.normalizePath(tempFileName);
@@ -34597,8 +34823,7 @@ var ts;
});
}
};
- Session.prototype.saveToTmp = function (_a) {
- var fileName = _a.file, tempFileName = _a.tmpfile;
+ Session.prototype.saveToTmp = function (fileName, tempFileName) {
var file = ts.normalizePath(fileName);
var tmpfile = ts.normalizePath(tempFileName);
var project = this.projectService.getProjectForFile(file);
@@ -34606,8 +34831,7 @@ var ts;
project.compilerService.host.saveTo(file, tmpfile);
}
};
- Session.prototype.closeClientFile = function (_a) {
- var fileName = _a.file;
+ Session.prototype.closeClientFile = function (fileName) {
var file = ts.normalizePath(fileName);
this.projectService.closeClientFile(file);
};
@@ -34628,8 +34852,7 @@ var ts;
childItems: _this.decorateNavigationBarItem(project, fileName, item.childItems)
}); });
};
- Session.prototype.getNavigationBarItems = function (_a) {
- var fileName = _a.file;
+ Session.prototype.getNavigationBarItems = function (fileName) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34642,8 +34865,7 @@ var ts;
}
return this.decorateNavigationBarItem(project, fileName, items);
};
- Session.prototype.getNavigateToItems = function (_a) {
- var searchValue = _a.searchValue, fileName = _a.file, maxResultCount = _a.maxResultCount;
+ Session.prototype.getNavigateToItems = function (searchValue, fileName, maxResultCount) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34679,8 +34901,7 @@ var ts;
return bakedItem;
});
};
- Session.prototype.getBraceMatching = function (_a) {
- var line = _a.line, offset = _a.offset, fileName = _a.file;
+ Session.prototype.getBraceMatching = function (line, offset, fileName) {
var file = ts.normalizePath(fileName);
var project = this.projectService.getProjectForFile(file);
if (!project) {
@@ -34716,91 +34937,112 @@ var ts;
break;
}
case CommandNames.Definition: {
- response = this.getDefinition(request.arguments);
+ var defArgs = request.arguments;
+ response = this.getDefinition(defArgs.line, defArgs.offset, defArgs.file);
break;
}
case CommandNames.References: {
- response = this.getReferences(request.arguments);
+ var refArgs = request.arguments;
+ response = this.getReferences(refArgs.line, refArgs.offset, refArgs.file);
break;
}
case CommandNames.Rename: {
- response = this.getRenameLocations(request.arguments);
+ var renameArgs = request.arguments;
+ response = this.getRenameLocations(renameArgs.line, renameArgs.offset, renameArgs.file, renameArgs.findInComments, renameArgs.findInStrings);
break;
}
case CommandNames.Open: {
- this.openClientFile(request.arguments);
+ var openArgs = request.arguments;
+ this.openClientFile(openArgs.file);
responseRequired = false;
break;
}
case CommandNames.Quickinfo: {
- response = this.getQuickInfo(request.arguments);
+ var quickinfoArgs = request.arguments;
+ response = this.getQuickInfo(quickinfoArgs.line, quickinfoArgs.offset, quickinfoArgs.file);
break;
}
case CommandNames.Format: {
- response = this.getFormattingEditsForRange(request.arguments);
+ var formatArgs = request.arguments;
+ response = this.getFormattingEditsForRange(formatArgs.line, formatArgs.offset, formatArgs.endLine, formatArgs.endOffset, formatArgs.file);
break;
}
case CommandNames.Formatonkey: {
- response = this.getFormattingEditsAfterKeystroke(request.arguments);
+ var formatOnKeyArgs = request.arguments;
+ response = this.getFormattingEditsAfterKeystroke(formatOnKeyArgs.line, formatOnKeyArgs.offset, formatOnKeyArgs.key, formatOnKeyArgs.file);
break;
}
case CommandNames.Completions: {
- response = this.getCompletions(request.arguments);
+ var completionsArgs = request.arguments;
+ response = this.getCompletions(completionsArgs.line, completionsArgs.offset, completionsArgs.prefix, completionsArgs.file);
break;
}
case CommandNames.CompletionDetails: {
- response = this.getCompletionEntryDetails(request.arguments);
+ var completionDetailsArgs = request.arguments;
+ response =
+ this.getCompletionEntryDetails(completionDetailsArgs.line, completionDetailsArgs.offset, completionDetailsArgs.entryNames, completionDetailsArgs.file);
break;
}
case CommandNames.SignatureHelp: {
- response = this.getSignatureHelpItems(request.arguments);
+ var signatureHelpArgs = request.arguments;
+ response = this.getSignatureHelpItems(signatureHelpArgs.line, signatureHelpArgs.offset, signatureHelpArgs.file);
break;
}
case CommandNames.Geterr: {
- this.getDiagnostics(request.arguments);
+ var geterrArgs = request.arguments;
+ response = this.getDiagnostics(geterrArgs.delay, geterrArgs.files);
responseRequired = false;
break;
}
case CommandNames.Change: {
- this.change(request.arguments);
+ var changeArgs = request.arguments;
+ this.change(changeArgs.line, changeArgs.offset, changeArgs.endLine, changeArgs.endOffset, changeArgs.insertString, changeArgs.file);
responseRequired = false;
break;
}
case CommandNames.Configure: {
- this.projectService.setHostConfiguration(request.arguments);
+ var configureArgs = request.arguments;
+ this.projectService.setHostConfiguration(configureArgs);
this.output(undefined, CommandNames.Configure, request.seq);
responseRequired = false;
break;
}
case CommandNames.Reload: {
- this.reload(request.arguments);
+ var reloadArgs = request.arguments;
+ this.reload(reloadArgs.file, reloadArgs.tmpfile, request.seq);
responseRequired = false;
break;
}
case CommandNames.Saveto: {
- this.saveToTmp(request.arguments);
+ var savetoArgs = request.arguments;
+ this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile);
responseRequired = false;
break;
}
case CommandNames.Close: {
- this.closeClientFile(request.arguments);
+ var closeArgs = request.arguments;
+ this.closeClientFile(closeArgs.file);
responseRequired = false;
break;
}
case CommandNames.Navto: {
- response = this.getNavigateToItems(request.arguments);
+ var navtoArgs = request.arguments;
+ response = this.getNavigateToItems(navtoArgs.searchValue, navtoArgs.file, navtoArgs.maxResultCount);
break;
}
case CommandNames.Brace: {
- response = this.getBraceMatching(request.arguments);
+ var braceArguments = request.arguments;
+ response = this.getBraceMatching(braceArguments.line, braceArguments.offset, braceArguments.file);
break;
}
case CommandNames.NavBar: {
- response = this.getNavigationBarItems(request.arguments);
+ var navBarArgs = request.arguments;
+ response = this.getNavigationBarItems(navBarArgs.file);
break;
}
case CommandNames.Occurrences: {
- response = this.getOccurrences(request.arguments);
+ var _a = request.arguments, line = _a.line, offset = _a.offset, fileName = _a.file;
+ response = this.getOccurrences(line, offset, fileName);
break;
}
default: {
diff --git a/bin/typescript.d.ts b/bin/typescript.d.ts
index a16bff2a862..19f7ff11b4f 100644
--- a/bin/typescript.d.ts
+++ b/bin/typescript.d.ts
@@ -124,16 +124,16 @@ declare module "typescript" {
VoidKeyword = 99,
WhileKeyword = 100,
WithKeyword = 101,
- AsKeyword = 102,
- ImplementsKeyword = 103,
- InterfaceKeyword = 104,
- LetKeyword = 105,
- PackageKeyword = 106,
- PrivateKeyword = 107,
- ProtectedKeyword = 108,
- PublicKeyword = 109,
- StaticKeyword = 110,
- YieldKeyword = 111,
+ ImplementsKeyword = 102,
+ InterfaceKeyword = 103,
+ LetKeyword = 104,
+ PackageKeyword = 105,
+ PrivateKeyword = 106,
+ ProtectedKeyword = 107,
+ PublicKeyword = 108,
+ StaticKeyword = 109,
+ YieldKeyword = 110,
+ AsKeyword = 111,
AnyKeyword = 112,
BooleanKeyword = 113,
ConstructorKeyword = 114,
@@ -258,8 +258,8 @@ declare module "typescript" {
LastReservedWord = 101,
FirstKeyword = 66,
LastKeyword = 125,
- FirstFutureReservedWord = 103,
- LastFutureReservedWord = 111,
+ FirstFutureReservedWord = 102,
+ LastFutureReservedWord = 110,
FirstTypeNode = 141,
LastTypeNode = 149,
FirstPunctuation = 14,
@@ -310,6 +310,7 @@ declare module "typescript" {
}
interface Identifier extends PrimaryExpression {
text: string;
+ originalKeywordKind?: SyntaxKind;
}
interface QualifiedName extends Node {
left: EntityName;
@@ -1181,6 +1182,34 @@ declare module "typescript" {
function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean;
function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean;
}
+declare module "typescript" {
+ function getDefaultLibFileName(options: CompilerOptions): string;
+ function textSpanEnd(span: TextSpan): number;
+ function textSpanIsEmpty(span: TextSpan): boolean;
+ function textSpanContainsPosition(span: TextSpan, position: number): boolean;
+ function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
+ function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
+ function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan;
+ function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
+ function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
+ function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
+ function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan;
+ function createTextSpan(start: number, length: number): TextSpan;
+ function createTextSpanFromBounds(start: number, end: number): TextSpan;
+ function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
+ function textChangeRangeIsUnchanged(range: TextChangeRange): boolean;
+ function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange;
+ let unchangedTextChangeRange: TextChangeRange;
+ /**
+ * Called to merge all the changes that occurred across several versions of a script snapshot
+ * into a single change. i.e. if a user keeps making successive edits to a script we will
+ * have a text change from V1 to V2, V2 to V3, ..., Vn.
+ *
+ * This function will then merge those changes into a single change range valid between V1 and
+ * Vn.
+ */
+ function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
+}
declare module "typescript" {
function getNodeConstructor(kind: SyntaxKind): new () => Node;
function createNode(kind: SyntaxKind): Node;
@@ -1260,7 +1289,6 @@ declare module "typescript" {
getDocumentationComment(): SymbolDisplayPart[];
}
interface SourceFile {
- getNamedDeclarations(): Declaration[];
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
getLineStarts(): number[];
getPositionOfLineAndCharacter(line: number, character: number): number;
diff --git a/bin/typescript.js b/bin/typescript.js
index 1c749f0d94a..57271ad41ac 100644
--- a/bin/typescript.js
+++ b/bin/typescript.js
@@ -128,17 +128,17 @@ var ts;
SyntaxKind[SyntaxKind["WhileKeyword"] = 100] = "WhileKeyword";
SyntaxKind[SyntaxKind["WithKeyword"] = 101] = "WithKeyword";
// Strict mode reserved words
- SyntaxKind[SyntaxKind["AsKeyword"] = 102] = "AsKeyword";
- SyntaxKind[SyntaxKind["ImplementsKeyword"] = 103] = "ImplementsKeyword";
- SyntaxKind[SyntaxKind["InterfaceKeyword"] = 104] = "InterfaceKeyword";
- SyntaxKind[SyntaxKind["LetKeyword"] = 105] = "LetKeyword";
- SyntaxKind[SyntaxKind["PackageKeyword"] = 106] = "PackageKeyword";
- SyntaxKind[SyntaxKind["PrivateKeyword"] = 107] = "PrivateKeyword";
- SyntaxKind[SyntaxKind["ProtectedKeyword"] = 108] = "ProtectedKeyword";
- SyntaxKind[SyntaxKind["PublicKeyword"] = 109] = "PublicKeyword";
- SyntaxKind[SyntaxKind["StaticKeyword"] = 110] = "StaticKeyword";
- SyntaxKind[SyntaxKind["YieldKeyword"] = 111] = "YieldKeyword";
+ SyntaxKind[SyntaxKind["ImplementsKeyword"] = 102] = "ImplementsKeyword";
+ SyntaxKind[SyntaxKind["InterfaceKeyword"] = 103] = "InterfaceKeyword";
+ SyntaxKind[SyntaxKind["LetKeyword"] = 104] = "LetKeyword";
+ SyntaxKind[SyntaxKind["PackageKeyword"] = 105] = "PackageKeyword";
+ SyntaxKind[SyntaxKind["PrivateKeyword"] = 106] = "PrivateKeyword";
+ SyntaxKind[SyntaxKind["ProtectedKeyword"] = 107] = "ProtectedKeyword";
+ SyntaxKind[SyntaxKind["PublicKeyword"] = 108] = "PublicKeyword";
+ SyntaxKind[SyntaxKind["StaticKeyword"] = 109] = "StaticKeyword";
+ SyntaxKind[SyntaxKind["YieldKeyword"] = 110] = "YieldKeyword";
// Contextual keywords
+ SyntaxKind[SyntaxKind["AsKeyword"] = 111] = "AsKeyword";
SyntaxKind[SyntaxKind["AnyKeyword"] = 112] = "AnyKeyword";
SyntaxKind[SyntaxKind["BooleanKeyword"] = 113] = "BooleanKeyword";
SyntaxKind[SyntaxKind["ConstructorKeyword"] = 114] = "ConstructorKeyword";
@@ -280,8 +280,8 @@ var ts;
SyntaxKind[SyntaxKind["LastReservedWord"] = 101] = "LastReservedWord";
SyntaxKind[SyntaxKind["FirstKeyword"] = 66] = "FirstKeyword";
SyntaxKind[SyntaxKind["LastKeyword"] = 125] = "LastKeyword";
- SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 103] = "FirstFutureReservedWord";
- SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 111] = "LastFutureReservedWord";
+ SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 102] = "FirstFutureReservedWord";
+ SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 110] = "LastFutureReservedWord";
SyntaxKind[SyntaxKind["FirstTypeNode"] = 141] = "FirstTypeNode";
SyntaxKind[SyntaxKind["LastTypeNode"] = 149] = "LastTypeNode";
SyntaxKind[SyntaxKind["FirstPunctuation"] = 14] = "FirstPunctuation";
@@ -1308,10 +1308,6 @@ var ts;
"\u2029": "\\u2029",
"\u0085": "\\u0085" // nextLine
};
- function getDefaultLibFileName(options) {
- return options.target === 2 /* ES6 */ ? "lib.es6.d.ts" : "lib.d.ts";
- }
- ts.getDefaultLibFileName = getDefaultLibFileName;
function Symbol(flags, name) {
this.flags = flags;
this.name = name;
@@ -1809,6 +1805,12 @@ var ts;
Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." },
Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." },
A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." },
+ Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
+ Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
+ Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." },
Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@@ -2176,7 +2178,7 @@ var ts;
(function (ts) {
var textToToken = {
"any": 112 /* AnyKeyword */,
- "as": 102 /* AsKeyword */,
+ "as": 111 /* AsKeyword */,
"boolean": 113 /* BooleanKeyword */,
"break": 66 /* BreakKeyword */,
"case": 67 /* CaseKeyword */,
@@ -2201,24 +2203,24 @@ var ts;
"function": 83 /* FunctionKeyword */,
"get": 116 /* GetKeyword */,
"if": 84 /* IfKeyword */,
- "implements": 103 /* ImplementsKeyword */,
+ "implements": 102 /* ImplementsKeyword */,
"import": 85 /* ImportKeyword */,
"in": 86 /* InKeyword */,
"instanceof": 87 /* InstanceOfKeyword */,
- "interface": 104 /* InterfaceKeyword */,
- "let": 105 /* LetKeyword */,
+ "interface": 103 /* InterfaceKeyword */,
+ "let": 104 /* LetKeyword */,
"module": 117 /* ModuleKeyword */,
"new": 88 /* NewKeyword */,
"null": 89 /* NullKeyword */,
"number": 119 /* NumberKeyword */,
- "package": 106 /* PackageKeyword */,
- "private": 107 /* PrivateKeyword */,
- "protected": 108 /* ProtectedKeyword */,
- "public": 109 /* PublicKeyword */,
+ "package": 105 /* PackageKeyword */,
+ "private": 106 /* PrivateKeyword */,
+ "protected": 107 /* ProtectedKeyword */,
+ "public": 108 /* PublicKeyword */,
"require": 118 /* RequireKeyword */,
"return": 90 /* ReturnKeyword */,
"set": 120 /* SetKeyword */,
- "static": 110 /* StaticKeyword */,
+ "static": 109 /* StaticKeyword */,
"string": 121 /* StringKeyword */,
"super": 91 /* SuperKeyword */,
"switch": 92 /* SwitchKeyword */,
@@ -2233,7 +2235,7 @@ var ts;
"void": 99 /* VoidKeyword */,
"while": 100 /* WhileKeyword */,
"with": 101 /* WithKeyword */,
- "yield": 111 /* YieldKeyword */,
+ "yield": 110 /* YieldKeyword */,
"of": 125 /* OfKeyword */,
"{": 14 /* OpenBraceToken */,
"}": 15 /* CloseBraceToken */,
@@ -4331,13 +4333,12 @@ var ts;
};
}
ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain;
- /* @internal */
function getSpanOfTokenAtPosition(sourceFile, pos) {
var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text);
scanner.setTextPos(pos);
scanner.scan();
var start = scanner.getTokenPos();
- return createTextSpanFromBounds(start, scanner.getTextPos());
+ return ts.createTextSpanFromBounds(start, scanner.getTextPos());
}
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForNode(sourceFile, node) {
@@ -4347,7 +4348,7 @@ var ts;
var pos_1 = ts.skipTrivia(sourceFile.text, 0, false);
if (pos_1 === sourceFile.text.length) {
// file is empty - return span for the beginning of the file
- return createTextSpan(0, 0);
+ return ts.createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos_1);
// This list is a work in progress. Add missing node kinds to improve their error
@@ -4373,7 +4374,7 @@ var ts;
var pos = nodeIsMissing(errorNode)
? errorNode.pos
: ts.skipTrivia(sourceFile.text, errorNode.pos);
- return createTextSpanFromBounds(pos, errorNode.end);
+ return ts.createTextSpanFromBounds(pos, errorNode.end);
}
ts.getErrorSpanForNode = getErrorSpanForNode;
function isExternalModule(file) {
@@ -4482,7 +4483,6 @@ var ts;
}
}
ts.forEachReturnStatement = forEachReturnStatement;
- /* @internal */
function isVariableLike(node) {
if (node) {
switch (node.kind) {
@@ -5027,7 +5027,7 @@ var ts;
}
ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement;
function getClassImplementsHeritageClauseElements(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 103 /* ImplementsKeyword */);
+ var heritageClause = getHeritageClause(node.heritageClauses, 102 /* ImplementsKeyword */);
return heritageClause ? heritageClause.types : undefined;
}
ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements;
@@ -5157,10 +5157,10 @@ var ts;
ts.isESSymbolIdentifier = isESSymbolIdentifier;
function isModifier(token) {
switch (token) {
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
- case 110 /* StaticKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
+ case 109 /* StaticKeyword */:
case 78 /* ExportKeyword */:
case 115 /* DeclareKeyword */:
case 70 /* ConstKeyword */:
@@ -5170,205 +5170,6 @@ var ts;
return false;
}
ts.isModifier = isModifier;
- function textSpanEnd(span) {
- return span.start + span.length;
- }
- ts.textSpanEnd = textSpanEnd;
- function textSpanIsEmpty(span) {
- return span.length === 0;
- }
- ts.textSpanIsEmpty = textSpanIsEmpty;
- function textSpanContainsPosition(span, position) {
- return position >= span.start && position < textSpanEnd(span);
- }
- ts.textSpanContainsPosition = textSpanContainsPosition;
- // Returns true if 'span' contains 'other'.
- function textSpanContainsTextSpan(span, other) {
- return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
- }
- ts.textSpanContainsTextSpan = textSpanContainsTextSpan;
- function textSpanOverlapsWith(span, other) {
- var overlapStart = Math.max(span.start, other.start);
- var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
- return overlapStart < overlapEnd;
- }
- ts.textSpanOverlapsWith = textSpanOverlapsWith;
- function textSpanOverlap(span1, span2) {
- var overlapStart = Math.max(span1.start, span2.start);
- var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
- if (overlapStart < overlapEnd) {
- return createTextSpanFromBounds(overlapStart, overlapEnd);
- }
- return undefined;
- }
- ts.textSpanOverlap = textSpanOverlap;
- function textSpanIntersectsWithTextSpan(span, other) {
- return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start;
- }
- ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan;
- function textSpanIntersectsWith(span, start, length) {
- var end = start + length;
- return start <= textSpanEnd(span) && end >= span.start;
- }
- ts.textSpanIntersectsWith = textSpanIntersectsWith;
- function textSpanIntersectsWithPosition(span, position) {
- return position <= textSpanEnd(span) && position >= span.start;
- }
- ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition;
- function textSpanIntersection(span1, span2) {
- var intersectStart = Math.max(span1.start, span2.start);
- var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
- if (intersectStart <= intersectEnd) {
- return createTextSpanFromBounds(intersectStart, intersectEnd);
- }
- return undefined;
- }
- ts.textSpanIntersection = textSpanIntersection;
- function createTextSpan(start, length) {
- if (start < 0) {
- throw new Error("start < 0");
- }
- if (length < 0) {
- throw new Error("length < 0");
- }
- return { start: start, length: length };
- }
- ts.createTextSpan = createTextSpan;
- function createTextSpanFromBounds(start, end) {
- return createTextSpan(start, end - start);
- }
- ts.createTextSpanFromBounds = createTextSpanFromBounds;
- function textChangeRangeNewSpan(range) {
- return createTextSpan(range.span.start, range.newLength);
- }
- ts.textChangeRangeNewSpan = textChangeRangeNewSpan;
- function textChangeRangeIsUnchanged(range) {
- return textSpanIsEmpty(range.span) && range.newLength === 0;
- }
- ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged;
- function createTextChangeRange(span, newLength) {
- if (newLength < 0) {
- throw new Error("newLength < 0");
- }
- return { span: span, newLength: newLength };
- }
- ts.createTextChangeRange = createTextChangeRange;
- ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
- /**
- * Called to merge all the changes that occurred across several versions of a script snapshot
- * into a single change. i.e. if a user keeps making successive edits to a script we will
- * have a text change from V1 to V2, V2 to V3, ..., Vn.
- *
- * This function will then merge those changes into a single change range valid between V1 and
- * Vn.
- */
- function collapseTextChangeRangesAcrossMultipleVersions(changes) {
- if (changes.length === 0) {
- return ts.unchangedTextChangeRange;
- }
- if (changes.length === 1) {
- return changes[0];
- }
- // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd }
- // as it makes things much easier to reason about.
- var change0 = changes[0];
- var oldStartN = change0.span.start;
- var oldEndN = textSpanEnd(change0.span);
- var newEndN = oldStartN + change0.newLength;
- for (var i = 1; i < changes.length; i++) {
- var nextChange = changes[i];
- // Consider the following case:
- // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting
- // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }.
- // i.e. the span starting at 30 with length 30 is increased to length 40.
- //
- // 0 10 20 30 40 50 60 70 80 90 100
- // -------------------------------------------------------------------------------------------------------
- // | /
- // | /----
- // T1 | /----
- // | /----
- // | /----
- // -------------------------------------------------------------------------------------------------------
- // | \
- // | \
- // T2 | \
- // | \
- // | \
- // -------------------------------------------------------------------------------------------------------
- //
- // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial
- // it's just the min of the old and new starts. i.e.:
- //
- // 0 10 20 30 40 50 60 70 80 90 100
- // ------------------------------------------------------------*------------------------------------------
- // | /
- // | /----
- // T1 | /----
- // | /----
- // | /----
- // ----------------------------------------$-------------------$------------------------------------------
- // . | \
- // . | \
- // T2 . | \
- // . | \
- // . | \
- // ----------------------------------------------------------------------*--------------------------------
- //
- // (Note the dots represent the newly inferrred start.
- // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the
- // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see
- // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that
- // means:
- //
- // 0 10 20 30 40 50 60 70 80 90 100
- // --------------------------------------------------------------------------------*----------------------
- // | /
- // | /----
- // T1 | /----
- // | /----
- // | /----
- // ------------------------------------------------------------$------------------------------------------
- // . | \
- // . | \
- // T2 . | \
- // . | \
- // . | \
- // ----------------------------------------------------------------------*--------------------------------
- //
- // In other words (in this case), we're recognizing that the second edit happened after where the first edit
- // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started
- // that's the same as if we started at char 80 instead of 60.
- //
- // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter
- // than pusing the first edit forward to match the second, we'll push the second edit forward to match the
- // first.
- //
- // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange
- // semantics: { { start: 10, length: 70 }, newLength: 60 }
- //
- // The math then works out as follows.
- // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the
- // final result like so:
- //
- // {
- // oldStart3: Min(oldStart1, oldStart2),
- // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)),
- // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2))
- // }
- var oldStart1 = oldStartN;
- var oldEnd1 = oldEndN;
- var newEnd1 = newEndN;
- var oldStart2 = nextChange.span.start;
- var oldEnd2 = textSpanEnd(nextChange.span);
- var newEnd2 = oldStart2 + nextChange.newLength;
- oldStartN = Math.min(oldStart1, oldStart2);
- oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
- newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
- }
- return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
- }
- ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function nodeStartsNewLexicalEnvironment(n) {
return isFunctionLike(n) || n.kind === 205 /* ModuleDeclaration */ || n.kind === 227 /* SourceFile */;
}
@@ -5385,7 +5186,6 @@ var ts;
return node;
}
ts.createSynthesizedNode = createSynthesizedNode;
- /* @internal */
function createDiagnosticCollection() {
var nonFileDiagnostics = [];
var fileDiagnostics = {};
@@ -5807,6 +5607,212 @@ var ts;
}
ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault;
})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ function getDefaultLibFileName(options) {
+ return options.target === 2 /* ES6 */ ? "lib.es6.d.ts" : "lib.d.ts";
+ }
+ ts.getDefaultLibFileName = getDefaultLibFileName;
+ function textSpanEnd(span) {
+ return span.start + span.length;
+ }
+ ts.textSpanEnd = textSpanEnd;
+ function textSpanIsEmpty(span) {
+ return span.length === 0;
+ }
+ ts.textSpanIsEmpty = textSpanIsEmpty;
+ function textSpanContainsPosition(span, position) {
+ return position >= span.start && position < textSpanEnd(span);
+ }
+ ts.textSpanContainsPosition = textSpanContainsPosition;
+ // Returns true if 'span' contains 'other'.
+ function textSpanContainsTextSpan(span, other) {
+ return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
+ }
+ ts.textSpanContainsTextSpan = textSpanContainsTextSpan;
+ function textSpanOverlapsWith(span, other) {
+ var overlapStart = Math.max(span.start, other.start);
+ var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
+ return overlapStart < overlapEnd;
+ }
+ ts.textSpanOverlapsWith = textSpanOverlapsWith;
+ function textSpanOverlap(span1, span2) {
+ var overlapStart = Math.max(span1.start, span2.start);
+ var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
+ if (overlapStart < overlapEnd) {
+ return createTextSpanFromBounds(overlapStart, overlapEnd);
+ }
+ return undefined;
+ }
+ ts.textSpanOverlap = textSpanOverlap;
+ function textSpanIntersectsWithTextSpan(span, other) {
+ return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start;
+ }
+ ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan;
+ function textSpanIntersectsWith(span, start, length) {
+ var end = start + length;
+ return start <= textSpanEnd(span) && end >= span.start;
+ }
+ ts.textSpanIntersectsWith = textSpanIntersectsWith;
+ function textSpanIntersectsWithPosition(span, position) {
+ return position <= textSpanEnd(span) && position >= span.start;
+ }
+ ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition;
+ function textSpanIntersection(span1, span2) {
+ var intersectStart = Math.max(span1.start, span2.start);
+ var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
+ if (intersectStart <= intersectEnd) {
+ return createTextSpanFromBounds(intersectStart, intersectEnd);
+ }
+ return undefined;
+ }
+ ts.textSpanIntersection = textSpanIntersection;
+ function createTextSpan(start, length) {
+ if (start < 0) {
+ throw new Error("start < 0");
+ }
+ if (length < 0) {
+ throw new Error("length < 0");
+ }
+ return { start: start, length: length };
+ }
+ ts.createTextSpan = createTextSpan;
+ function createTextSpanFromBounds(start, end) {
+ return createTextSpan(start, end - start);
+ }
+ ts.createTextSpanFromBounds = createTextSpanFromBounds;
+ function textChangeRangeNewSpan(range) {
+ return createTextSpan(range.span.start, range.newLength);
+ }
+ ts.textChangeRangeNewSpan = textChangeRangeNewSpan;
+ function textChangeRangeIsUnchanged(range) {
+ return textSpanIsEmpty(range.span) && range.newLength === 0;
+ }
+ ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged;
+ function createTextChangeRange(span, newLength) {
+ if (newLength < 0) {
+ throw new Error("newLength < 0");
+ }
+ return { span: span, newLength: newLength };
+ }
+ ts.createTextChangeRange = createTextChangeRange;
+ ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
+ /**
+ * Called to merge all the changes that occurred across several versions of a script snapshot
+ * into a single change. i.e. if a user keeps making successive edits to a script we will
+ * have a text change from V1 to V2, V2 to V3, ..., Vn.
+ *
+ * This function will then merge those changes into a single change range valid between V1 and
+ * Vn.
+ */
+ function collapseTextChangeRangesAcrossMultipleVersions(changes) {
+ if (changes.length === 0) {
+ return ts.unchangedTextChangeRange;
+ }
+ if (changes.length === 1) {
+ return changes[0];
+ }
+ // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd }
+ // as it makes things much easier to reason about.
+ var change0 = changes[0];
+ var oldStartN = change0.span.start;
+ var oldEndN = textSpanEnd(change0.span);
+ var newEndN = oldStartN + change0.newLength;
+ for (var i = 1; i < changes.length; i++) {
+ var nextChange = changes[i];
+ // Consider the following case:
+ // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting
+ // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }.
+ // i.e. the span starting at 30 with length 30 is increased to length 40.
+ //
+ // 0 10 20 30 40 50 60 70 80 90 100
+ // -------------------------------------------------------------------------------------------------------
+ // | /
+ // | /----
+ // T1 | /----
+ // | /----
+ // | /----
+ // -------------------------------------------------------------------------------------------------------
+ // | \
+ // | \
+ // T2 | \
+ // | \
+ // | \
+ // -------------------------------------------------------------------------------------------------------
+ //
+ // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial
+ // it's just the min of the old and new starts. i.e.:
+ //
+ // 0 10 20 30 40 50 60 70 80 90 100
+ // ------------------------------------------------------------*------------------------------------------
+ // | /
+ // | /----
+ // T1 | /----
+ // | /----
+ // | /----
+ // ----------------------------------------$-------------------$------------------------------------------
+ // . | \
+ // . | \
+ // T2 . | \
+ // . | \
+ // . | \
+ // ----------------------------------------------------------------------*--------------------------------
+ //
+ // (Note the dots represent the newly inferrred start.
+ // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the
+ // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see
+ // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that
+ // means:
+ //
+ // 0 10 20 30 40 50 60 70 80 90 100
+ // --------------------------------------------------------------------------------*----------------------
+ // | /
+ // | /----
+ // T1 | /----
+ // | /----
+ // | /----
+ // ------------------------------------------------------------$------------------------------------------
+ // . | \
+ // . | \
+ // T2 . | \
+ // . | \
+ // . | \
+ // ----------------------------------------------------------------------*--------------------------------
+ //
+ // In other words (in this case), we're recognizing that the second edit happened after where the first edit
+ // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started
+ // that's the same as if we started at char 80 instead of 60.
+ //
+ // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter
+ // than pusing the first edit forward to match the second, we'll push the second edit forward to match the
+ // first.
+ //
+ // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange
+ // semantics: { { start: 10, length: 70 }, newLength: 60 }
+ //
+ // The math then works out as follows.
+ // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the
+ // final result like so:
+ //
+ // {
+ // oldStart3: Min(oldStart1, oldStart2),
+ // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)),
+ // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2))
+ // }
+ var oldStart1 = oldStartN;
+ var oldEnd1 = oldEndN;
+ var newEnd1 = newEndN;
+ var oldStart2 = nextChange.span.start;
+ var oldEnd2 = textSpanEnd(nextChange.span);
+ var newEnd2 = oldStart2 + nextChange.newLength;
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+ return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
+ }
+ ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
+})(ts || (ts = {}));
///
///
var ts;
@@ -6183,10 +6189,10 @@ var ts;
;
function modifierToFlag(token) {
switch (token) {
- case 110 /* StaticKeyword */: return 128 /* Static */;
- case 109 /* PublicKeyword */: return 16 /* Public */;
- case 108 /* ProtectedKeyword */: return 64 /* Protected */;
- case 107 /* PrivateKeyword */: return 32 /* Private */;
+ case 109 /* StaticKeyword */: return 128 /* Static */;
+ case 108 /* PublicKeyword */: return 16 /* Public */;
+ case 107 /* ProtectedKeyword */: return 64 /* Protected */;
+ case 106 /* PrivateKeyword */: return 32 /* Private */;
case 78 /* ExportKeyword */: return 1 /* Export */;
case 115 /* DeclareKeyword */: return 2 /* Ambient */;
case 70 /* ConstKeyword */: return 8192 /* Const */;
@@ -6995,16 +7001,17 @@ var ts;
function tryParse(callback) {
return speculationHelper(callback, false);
}
+ // Ignore strict mode flag because we will report an error in type checker instead.
function isIdentifier() {
if (token === 65 /* Identifier */) {
return true;
}
// If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is
// considered a keyword and is not an identifier.
- if (token === 111 /* YieldKeyword */ && inYieldContext()) {
+ if (token === 110 /* YieldKeyword */ && inYieldContext()) {
return false;
}
- return inStrictModeContext() ? token > 111 /* LastFutureReservedWord */ : token > 101 /* LastReservedWord */;
+ return token > 101 /* LastReservedWord */;
}
function parseExpected(kind, diagnosticMessage) {
if (token === kind) {
@@ -7108,6 +7115,10 @@ var ts;
identifierCount++;
if (isIdentifier) {
var node = createNode(65 /* Identifier */);
+ // Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
+ if (token !== 65 /* Identifier */) {
+ node.originalKeywordKind = token;
+ }
node.text = internIdentifier(scanner.getTokenValue());
nextToken();
return finishNode(node);
@@ -7275,7 +7286,7 @@ var ts;
// extends {} extends
// extends {} implements
var next = nextToken();
- return next === 23 /* CommaToken */ || next === 14 /* OpenBraceToken */ || next === 79 /* ExtendsKeyword */ || next === 103 /* ImplementsKeyword */;
+ return next === 23 /* CommaToken */ || next === 14 /* OpenBraceToken */ || next === 79 /* ExtendsKeyword */ || next === 102 /* ImplementsKeyword */;
}
return true;
}
@@ -7284,7 +7295,7 @@ var ts;
return isIdentifier();
}
function isHeritageClauseExtendsOrImplementsKeyword() {
- if (token === 103 /* ImplementsKeyword */ ||
+ if (token === 102 /* ImplementsKeyword */ ||
token === 79 /* ExtendsKeyword */) {
return lookAhead(nextTokenIsStartOfExpression);
}
@@ -7314,12 +7325,12 @@ var ts;
case 4 /* SwitchClauseStatements */:
return token === 15 /* CloseBraceToken */ || token === 67 /* CaseKeyword */ || token === 73 /* DefaultKeyword */;
case 8 /* HeritageClauseElement */:
- return token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 103 /* ImplementsKeyword */;
+ return token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */;
case 9 /* VariableDeclarations */:
return isVariableDeclaratorListTerminator();
case 16 /* TypeParameters */:
// Tokens other than '>' are here for better error recovery
- return token === 25 /* GreaterThanToken */ || token === 16 /* OpenParenToken */ || token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 103 /* ImplementsKeyword */;
+ return token === 25 /* GreaterThanToken */ || token === 16 /* OpenParenToken */ || token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */;
case 12 /* ArgumentExpressions */:
// Tokens other than ')' are here for better error recovery
return token === 17 /* CloseParenToken */ || token === 22 /* SemicolonToken */;
@@ -8356,7 +8367,7 @@ var ts;
case 38 /* PlusPlusToken */:
case 39 /* MinusMinusToken */:
case 24 /* LessThanToken */:
- case 111 /* YieldKeyword */:
+ case 110 /* YieldKeyword */:
// Yield always starts an expression. Either it is an identifier (in which case
// it is definitely an expression). Or it's a keyword (either because we're in
// a generator, or in strict mode (or both)) and it started a yield expression.
@@ -8471,7 +8482,7 @@ var ts;
return parseConditionalExpressionRest(expr);
}
function isYieldExpression() {
- if (token === 111 /* YieldKeyword */) {
+ if (token === 110 /* YieldKeyword */) {
// If we have a 'yield' keyword, and htis is a context where yield expressions are
// allowed, then definitely parse out a yield expression.
if (inYieldContext()) {
@@ -9312,7 +9323,7 @@ var ts;
parseExpected(16 /* OpenParenToken */);
var initializer = undefined;
if (token !== 22 /* SemicolonToken */) {
- if (token === 98 /* VarKeyword */ || token === 105 /* LetKeyword */ || token === 70 /* ConstKeyword */) {
+ if (token === 98 /* VarKeyword */ || token === 104 /* LetKeyword */ || token === 70 /* ConstKeyword */) {
initializer = parseVariableDeclarationList(true);
}
else {
@@ -9496,7 +9507,7 @@ var ts;
return !inErrorRecovery;
case 14 /* OpenBraceToken */:
case 98 /* VarKeyword */:
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
case 83 /* FunctionKeyword */:
case 69 /* ClassKeyword */:
case 84 /* IfKeyword */:
@@ -9522,7 +9533,7 @@ var ts;
// In ES 6 'enum' is a future reserved keyword, so it should not be used as identifier
var isConstEnum = lookAhead(nextTokenIsEnumKeyword);
return !isConstEnum;
- case 104 /* InterfaceKeyword */:
+ case 103 /* InterfaceKeyword */:
case 117 /* ModuleKeyword */:
case 77 /* EnumKeyword */:
case 123 /* TypeKeyword */:
@@ -9531,10 +9542,10 @@ var ts;
if (isDeclarationStart()) {
return false;
}
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
- case 110 /* StaticKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
+ case 109 /* StaticKeyword */:
// When followed by an identifier or keyword, these do not start a statement but
// might instead be following type members
if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) {
@@ -9593,7 +9604,7 @@ var ts;
return parseTryStatement();
case 72 /* DebuggerKeyword */:
return parseDebuggerStatement();
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
// If let follows identifier on the same line, it is declaration parse it as variable statement
if (isLetDeclaration()) {
return parseVariableStatement(scanner.getStartPos(), undefined, undefined);
@@ -9628,7 +9639,7 @@ var ts;
return undefined;
}
return parseVariableStatement(start, decorators, modifiers);
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
if (!isLetDeclaration()) {
return undefined;
}
@@ -9715,7 +9726,7 @@ var ts;
switch (token) {
case 98 /* VarKeyword */:
break;
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
node.flags |= 4096 /* Let */;
break;
case 70 /* ConstKeyword */:
@@ -9823,6 +9834,17 @@ var ts;
node.body = parseFunctionBlockOrSemicolon(false);
return finishNode(node);
}
+ function isClassMemberModifier(idToken) {
+ switch (idToken) {
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
+ case 109 /* StaticKeyword */:
+ return true;
+ default:
+ return false;
+ }
+ }
function isClassMemberStart() {
var idToken;
if (token === 52 /* AtToken */) {
@@ -9831,6 +9853,15 @@ var ts;
// Eat up all modifiers, but hold on to the last one in case it is actually an identifier.
while (ts.isModifier(token)) {
idToken = token;
+ // If the idToken is a class modifier (protected, private, public, and static), it is
+ // certain that we are starting to parse class member. This allows better error recovery
+ // Example:
+ // public foo() ... // true
+ // public @dec blah ... // true; we will then report an error later
+ // export public ... // true; we will then report an error later
+ if (isClassMemberModifier(idToken)) {
+ return true;
+ }
nextToken();
}
if (token === 35 /* AsteriskToken */) {
@@ -10001,7 +10032,7 @@ var ts;
return parseList(19 /* HeritageClauses */, false, parseHeritageClause);
}
function parseHeritageClause() {
- if (token === 79 /* ExtendsKeyword */ || token === 103 /* ImplementsKeyword */) {
+ if (token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */) {
var node = createNode(222 /* HeritageClause */);
node.token = token;
nextToken();
@@ -10019,7 +10050,7 @@ var ts;
return finishNode(node);
}
function isHeritageClause() {
- return token === 79 /* ExtendsKeyword */ || token === 103 /* ImplementsKeyword */;
+ return token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */;
}
function parseClassMembers() {
return parseList(6 /* ClassMembers */, false, parseClassElement);
@@ -10028,7 +10059,7 @@ var ts;
var node = createNode(202 /* InterfaceDeclaration */, fullStart);
node.decorators = decorators;
setModifiers(node, modifiers);
- parseExpected(104 /* InterfaceKeyword */);
+ parseExpected(103 /* InterfaceKeyword */);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
node.heritageClauses = parseHeritageClauses(false);
@@ -10207,7 +10238,7 @@ var ts;
// * as ImportedBinding
var namespaceImport = createNode(211 /* NamespaceImport */);
parseExpected(35 /* AsteriskToken */);
- parseExpected(102 /* AsKeyword */);
+ parseExpected(111 /* AsKeyword */);
namespaceImport.name = parseIdentifier();
return finishNode(namespaceImport);
}
@@ -10241,9 +10272,9 @@ var ts;
var checkIdentifierStart = scanner.getTokenPos();
var checkIdentifierEnd = scanner.getTextPos();
var identifierName = parseIdentifierName();
- if (token === 102 /* AsKeyword */) {
+ if (token === 111 /* AsKeyword */) {
node.propertyName = identifierName;
- parseExpected(102 /* AsKeyword */);
+ parseExpected(111 /* AsKeyword */);
checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier();
checkIdentifierStart = scanner.getTokenPos();
checkIdentifierEnd = scanner.getTextPos();
@@ -10300,10 +10331,10 @@ var ts;
case 70 /* ConstKeyword */:
case 83 /* FunctionKeyword */:
return true;
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
return isLetDeclaration();
case 69 /* ClassKeyword */:
- case 104 /* InterfaceKeyword */:
+ case 103 /* InterfaceKeyword */:
case 77 /* EnumKeyword */:
case 123 /* TypeKeyword */:
// Not true keywords so ensure an identifier follows
@@ -10318,10 +10349,10 @@ var ts;
// Check for export assignment or modifier on source element
return lookAhead(nextTokenCanFollowExportKeyword);
case 115 /* DeclareKeyword */:
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
- case 110 /* StaticKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
+ case 109 /* StaticKeyword */:
// Check for modifier on source element
return lookAhead(nextTokenIsDeclarationStart);
case 52 /* AtToken */:
@@ -10356,7 +10387,7 @@ var ts;
return isDeclarationStart(true);
}
function nextTokenIsAsKeyword() {
- return nextToken() === 102 /* AsKeyword */;
+ return nextToken() === 111 /* AsKeyword */;
}
function parseDeclaration() {
var fullStart = getNodePos();
@@ -10373,14 +10404,14 @@ var ts;
}
switch (token) {
case 98 /* VarKeyword */:
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
case 70 /* ConstKeyword */:
return parseVariableStatement(fullStart, decorators, modifiers);
case 83 /* FunctionKeyword */:
return parseFunctionDeclaration(fullStart, decorators, modifiers);
case 69 /* ClassKeyword */:
return parseClassDeclaration(fullStart, decorators, modifiers);
- case 104 /* InterfaceKeyword */:
+ case 103 /* InterfaceKeyword */:
return parseInterfaceDeclaration(fullStart, decorators, modifiers);
case 123 /* TypeKeyword */:
return parseTypeAliasDeclaration(fullStart, decorators, modifiers);
@@ -13201,15 +13232,16 @@ var ts;
return result;
}
function getPropertiesOfType(type) {
- if (type.flags & 16384 /* Union */) {
- return getPropertiesOfUnionType(type);
- }
- return getPropertiesOfObjectType(getApparentType(type));
+ type = getApparentType(type);
+ return type.flags & 16384 /* Union */ ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type);
}
// For a type parameter, return the base constraint of the type parameter. For the string, number,
// boolean, and symbol primitive types, return the corresponding object types. Otherwise return the
// type itself. Note that the apparent type of a union type is the union type itself.
function getApparentType(type) {
+ if (type.flags & 16384 /* Union */) {
+ type = getReducedTypeOfUnionType(type);
+ }
if (type.flags & 512 /* TypeParameter */) {
do {
type = getConstraintOfTypeParameter(type);
@@ -13281,28 +13313,27 @@ var ts;
// necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from
// Object and Function as appropriate.
function getPropertyOfType(type, name) {
+ type = getApparentType(type);
+ if (type.flags & 48128 /* ObjectType */) {
+ var resolved = resolveObjectOrUnionTypeMembers(type);
+ if (ts.hasProperty(resolved.members, name)) {
+ var symbol = resolved.members[name];
+ if (symbolIsValue(symbol)) {
+ return symbol;
+ }
+ }
+ if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
+ var symbol = getPropertyOfObjectType(globalFunctionType, name);
+ if (symbol) {
+ return symbol;
+ }
+ }
+ return getPropertyOfObjectType(globalObjectType, name);
+ }
if (type.flags & 16384 /* Union */) {
return getPropertyOfUnionType(type, name);
}
- if (!(type.flags & 48128 /* ObjectType */)) {
- type = getApparentType(type);
- if (!(type.flags & 48128 /* ObjectType */)) {
- return undefined;
- }
- }
- var resolved = resolveObjectOrUnionTypeMembers(type);
- if (ts.hasProperty(resolved.members, name)) {
- var symbol = resolved.members[name];
- if (symbolIsValue(symbol)) {
- return symbol;
- }
- }
- if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
- var symbol = getPropertyOfObjectType(globalFunctionType, name);
- if (symbol)
- return symbol;
- }
- return getPropertyOfObjectType(globalObjectType, name);
+ return undefined;
}
function getSignaturesOfObjectOrUnionType(type, kind) {
if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) {
@@ -13825,6 +13856,10 @@ var ts;
}
}
}
+ // The noSubtypeReduction flag is there because it isn't possible to always do subtype reduction. The flag
+ // is true when creating a union type from a type node and when instantiating a union type. In both of those
+ // cases subtype reduction has to be deferred to properly support recursive union types. For example, a
+ // type alias of the form "type Item = string | (() => Item)" cannot be reduced during its declaration.
function getUnionType(types, noSubtypeReduction) {
if (types.length === 0) {
return emptyObjectType;
@@ -13849,9 +13884,17 @@ var ts;
if (!type) {
type = unionTypes[id] = createObjectType(16384 /* Union */ | getWideningFlagsOfTypes(sortedTypes));
type.types = sortedTypes;
+ type.reducedType = noSubtypeReduction ? undefined : type;
}
return type;
}
+ function getReducedTypeOfUnionType(type) {
+ // If union type was created without subtype reduction, perform the deferred reduction now
+ if (!type.reducedType) {
+ type.reducedType = getUnionType(type.types, false);
+ }
+ return type.reducedType;
+ }
function getTypeFromUnionTypeNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
@@ -17230,7 +17273,7 @@ var ts;
function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) {
ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
// Grammar checking
- var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
+ var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node);
if (!hasGrammarError && node.kind === 162 /* FunctionExpression */) {
checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node);
}
@@ -17272,7 +17315,7 @@ var ts;
}
function checkFunctionExpressionOrObjectLiteralMethodBody(node) {
ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
- if (node.type) {
+ if (node.type && !node.asteriskToken) {
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type));
}
if (node.body) {
@@ -17834,6 +17877,7 @@ var ts;
return type;
}
function checkExpression(node, contextualMapper) {
+ checkGrammarIdentifierInStrictMode(node);
return checkExpressionOrQualifiedName(node, contextualMapper);
}
// Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When
@@ -17941,6 +17985,7 @@ var ts;
}
// DECLARATION AND STATEMENT TYPE CHECKING
function checkTypeParameter(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
// Grammar Checking
if (node.expression) {
grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected);
@@ -18172,9 +18217,11 @@ var ts;
checkDecorators(node);
}
function checkTypeReferenceNode(node) {
+ checkGrammarTypeReferenceInStrictMode(node.typeName);
return checkTypeReferenceOrHeritageClauseElement(node);
}
function checkHeritageClauseElement(node) {
+ checkGrammarHeritageClauseElementInStrictMode(node.expression);
return checkTypeReferenceOrHeritageClauseElement(node);
}
function checkTypeReferenceOrHeritageClauseElement(node) {
@@ -18648,6 +18695,7 @@ var ts;
}
}
function checkFunctionLikeDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
checkDecorators(node);
checkSignatureDeclaration(node);
// Do not use hasDynamicName here, because that returns false for well known symbols.
@@ -18678,7 +18726,7 @@ var ts;
}
}
checkSourceElement(node.body);
- if (node.type && !isAccessor(node.kind)) {
+ if (node.type && !isAccessor(node.kind) && !node.asteriskToken) {
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type));
}
// Report an implicit any error if there is no body, no explicit return type, and node is not a private method
@@ -18891,6 +18939,7 @@ var ts;
}
// Check variable, parameter, or property declaration
function checkVariableLikeDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
checkDecorators(node);
checkSourceElement(node.type);
// For a computed property, just check the initializer and exit
@@ -19120,7 +19169,10 @@ var ts;
return checkElementTypeOfArrayOrString(inputType, errorNode);
}
if (isArrayLikeType(inputType)) {
- return getIndexTypeOfType(inputType, 1 /* Number */);
+ var indexType = getIndexTypeOfType(inputType, 1 /* Number */);
+ if (indexType) {
+ return indexType;
+ }
}
error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType));
return unknownType;
@@ -19521,6 +19573,7 @@ var ts;
return unknownType;
}
function checkClassDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
// Grammar checking
if (node.parent.kind !== 206 /* ModuleBlock */ && node.parent.kind !== 227 /* SourceFile */) {
grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration);
@@ -19721,7 +19774,7 @@ var ts;
}
function checkInterfaceDeclaration(node) {
// Grammar checking
- checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node);
checkTypeParameters(node.typeParameters);
if (produceDiagnostics) {
checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0);
@@ -19921,7 +19974,7 @@ var ts;
return;
}
// Grammar checking
- checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node);
checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0);
checkCollisionWithCapturedThisVariable(node, node.name);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
@@ -19983,7 +20036,7 @@ var ts;
function checkModuleDeclaration(node) {
if (produceDiagnostics) {
// Grammar checking
- if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) {
+ if (!checkGrammarDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node)) {
if (!ts.isInAmbientContext(node) && node.name.kind === 8 /* StringLiteral */) {
grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names);
}
@@ -20078,7 +20131,7 @@ var ts;
checkAliasSymbol(node);
}
function checkImportDeclaration(node) {
- if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) {
+ if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) {
grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers);
}
if (checkExternalImportOrExportDeclaration(node)) {
@@ -20099,7 +20152,7 @@ var ts;
}
}
function checkImportEqualsDeclaration(node) {
- checkGrammarDecorators(node) || checkGrammarModifiers(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node);
if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
checkImportBinding(node);
if (node.flags & 1 /* Export */) {
@@ -20418,6 +20471,8 @@ var ts;
// Grammar checking
checkGrammarSourceFile(node);
emitExtends = false;
+ emitDecorate = false;
+ emitParam = false;
potentialThisCollisions.length = 0;
ts.forEach(node.statements, checkSourceElement);
checkFunctionExpressionBodies(node);
@@ -21346,6 +21401,137 @@ var ts;
anyArrayType = createArrayType(anyType);
}
// GRAMMAR CHECKING
+ function isReservedwordInStrictMode(node) {
+ // Check that originalKeywordKind is less than LastFurtureReservedWord to see if an Identifier is a strict-mode reserved word
+ return (node.parserContextFlags & 1 /* StrictMode */) &&
+ (node.originalKeywordKind >= 102 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 110 /* LastFutureReservedWord */);
+ }
+ function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) {
+ // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.)
+ // if so, we would like to give more explicit invalid usage error.
+ if (ts.getAncestor(identifier, 201 /* ClassDeclaration */) || ts.getAncestor(identifier, 174 /* ClassExpression */)) {
+ return grammarErrorOnNode(identifier, message, arg0);
+ }
+ return false;
+ }
+ function checkGrammarImportDeclarationNameInStrictMode(node) {
+ // Check if the import declaration used strict-mode reserved word in its names bindings
+ if (node.importClause) {
+ var impotClause = node.importClause;
+ if (impotClause.namedBindings) {
+ var nameBindings = impotClause.namedBindings;
+ if (nameBindings.kind === 211 /* NamespaceImport */) {
+ var name_11 = nameBindings.name;
+ if (name_11.originalKeywordKind) {
+ var nameText = ts.declarationNameToString(name_11);
+ return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ else if (nameBindings.kind === 212 /* NamedImports */) {
+ var reportError = false;
+ for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) {
+ var element = _a[_i];
+ var name_12 = element.name;
+ if (name_12.originalKeywordKind) {
+ var nameText = ts.declarationNameToString(name_12);
+ reportError = reportError || grammarErrorOnNode(name_12, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ return reportError;
+ }
+ }
+ }
+ return false;
+ }
+ function checkGrammarDeclarationNameInStrictMode(node) {
+ var name = node.name;
+ if (name && name.kind === 65 /* Identifier */ && isReservedwordInStrictMode(name)) {
+ var nameText = ts.declarationNameToString(name);
+ switch (node.kind) {
+ case 129 /* Parameter */:
+ case 198 /* VariableDeclaration */:
+ case 200 /* FunctionDeclaration */:
+ case 128 /* TypeParameter */:
+ case 152 /* BindingElement */:
+ case 202 /* InterfaceDeclaration */:
+ case 203 /* TypeAliasDeclaration */:
+ case 204 /* EnumDeclaration */:
+ return checkGrammarIdentifierInStrictMode(name);
+ case 201 /* ClassDeclaration */:
+ // Report an error if the class declaration uses strict-mode reserved word.
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText);
+ case 205 /* ModuleDeclaration */:
+ // Report an error if the module declaration uses strict-mode reserved word.
+ // TODO(yuisu): fix this when having external module in strict mode
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ case 208 /* ImportEqualsDeclaration */:
+ // TODO(yuisu): fix this when having external module in strict mode
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ return false;
+ }
+ function checkGrammarTypeReferenceInStrictMode(typeName) {
+ // Check if the type reference is using strict mode keyword
+ // Example:
+ // class C {
+ // foo(x: public){} // Error.
+ // }
+ if (typeName.kind === 65 /* Identifier */) {
+ checkGrammarTypeNameInStrictMode(typeName);
+ }
+ else if (typeName.kind === 126 /* QualifiedName */) {
+ // Walk from right to left and report a possible error at each Identifier in QualifiedName
+ // Example:
+ // x1: public.private.package // error at public and private
+ checkGrammarTypeNameInStrictMode(typeName.right);
+ checkGrammarTypeReferenceInStrictMode(typeName.left);
+ }
+ }
+ // This function will report an error for every identifier in property access expression
+ // whether it violates strict mode reserved words.
+ // Example:
+ // public // error at public
+ // public.private.package // error at public
+ // B.private.B // no error
+ function checkGrammarHeritageClauseElementInStrictMode(expression) {
+ // Example:
+ // class C extends public // error at public
+ if (expression && expression.kind === 65 /* Identifier */) {
+ return checkGrammarIdentifierInStrictMode(expression);
+ }
+ else if (expression && expression.kind === 155 /* PropertyAccessExpression */) {
+ // Walk from left to right in PropertyAccessExpression until we are at the left most expression
+ // in PropertyAccessExpression. According to grammar production of MemberExpression,
+ // the left component expression is a PrimaryExpression (i.e. Identifier) while the other
+ // component after dots can be IdentifierName.
+ checkGrammarHeritageClauseElementInStrictMode(expression.expression);
+ }
+ }
+ // The function takes an identifier itself or an expression which has SyntaxKind.Identifier.
+ function checkGrammarIdentifierInStrictMode(node, nameText) {
+ if (node && node.kind === 65 /* Identifier */ && isReservedwordInStrictMode(node)) {
+ if (!nameText) {
+ nameText = ts.declarationNameToString(node);
+ }
+ // TODO (yuisu): Fix when module is a strict mode
+ var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) ||
+ grammarErrorOnNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ return errorReport;
+ }
+ return false;
+ }
+ // The function takes an identifier when uses as a typeName in TypeReferenceNode
+ function checkGrammarTypeNameInStrictMode(node) {
+ if (node && node.kind === 65 /* Identifier */ && isReservedwordInStrictMode(node)) {
+ var nameText = ts.declarationNameToString(node);
+ // TODO (yuisu): Fix when module is a strict mode
+ var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) ||
+ grammarErrorOnNode(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ return errorReport;
+ }
+ return false;
+ }
function checkGrammarDecorators(node) {
if (!node.decorators) {
return false;
@@ -21398,14 +21584,14 @@ var ts;
for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
switch (modifier.kind) {
- case 109 /* PublicKeyword */:
- case 108 /* ProtectedKeyword */:
- case 107 /* PrivateKeyword */:
+ case 108 /* PublicKeyword */:
+ case 107 /* ProtectedKeyword */:
+ case 106 /* PrivateKeyword */:
var text = void 0;
- if (modifier.kind === 109 /* PublicKeyword */) {
+ if (modifier.kind === 108 /* PublicKeyword */) {
text = "public";
}
- else if (modifier.kind === 108 /* ProtectedKeyword */) {
+ else if (modifier.kind === 107 /* ProtectedKeyword */) {
text = "protected";
lastProtected = modifier;
}
@@ -21424,7 +21610,7 @@ var ts;
}
flags |= ts.modifierToFlag(modifier.kind);
break;
- case 110 /* StaticKeyword */:
+ case 109 /* StaticKeyword */:
if (flags & 128 /* Static */) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static");
}
@@ -21656,7 +21842,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 103 /* ImplementsKeyword */);
+ ts.Debug.assert(heritageClause.token === 102 /* ImplementsKeyword */);
if (seenImplementsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen);
}
@@ -21679,7 +21865,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 103 /* ImplementsKeyword */);
+ ts.Debug.assert(heritageClause.token === 102 /* ImplementsKeyword */);
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);
}
// Grammar checking heritageClause inside class declaration
@@ -21721,11 +21907,11 @@ var ts;
var inStrictMode = (node.parserContextFlags & 1 /* StrictMode */) !== 0;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- var name_11 = prop.name;
+ var name_13 = prop.name;
if (prop.kind === 175 /* OmittedExpression */ ||
- name_11.kind === 127 /* ComputedPropertyName */) {
+ name_13.kind === 127 /* ComputedPropertyName */) {
// If the name is not a ComputedPropertyName, the grammar checking will skip it
- checkGrammarComputedPropertyName(name_11);
+ checkGrammarComputedPropertyName(name_13);
continue;
}
// ECMA-262 11.1.5 Object Initialiser
@@ -21740,8 +21926,8 @@ var ts;
if (prop.kind === 224 /* PropertyAssignment */ || prop.kind === 225 /* ShorthandPropertyAssignment */) {
// Grammar checking for computedPropertName and shorthandPropertyAssignment
checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
- if (name_11.kind === 7 /* NumericLiteral */) {
- checkGrammarNumbericLiteral(name_11);
+ if (name_13.kind === 7 /* NumericLiteral */) {
+ checkGrammarNumbericLiteral(name_13);
}
currentKind = Property;
}
@@ -21757,26 +21943,26 @@ var ts;
else {
ts.Debug.fail("Unexpected syntax kind:" + prop.kind);
}
- if (!ts.hasProperty(seen, name_11.text)) {
- seen[name_11.text] = currentKind;
+ if (!ts.hasProperty(seen, name_13.text)) {
+ seen[name_13.text] = currentKind;
}
else {
- var existingKind = seen[name_11.text];
+ var existingKind = seen[name_13.text];
if (currentKind === Property && existingKind === Property) {
if (inStrictMode) {
- grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode);
+ grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode);
}
}
else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) {
if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) {
- seen[name_11.text] = currentKind | existingKind;
+ seen[name_13.text] = currentKind | existingKind;
}
else {
- return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
+ return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
}
}
else {
- return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
+ return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
}
}
}
@@ -22124,15 +22310,14 @@ var ts;
var identifier = name;
if (contextNode && (contextNode.parserContextFlags & 1 /* StrictMode */) && ts.isEvalOrArgumentsIdentifier(identifier)) {
var nameText = ts.declarationNameToString(identifier);
- // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.)
- // if so, we would like to give more explicit invalid usage error.
- // This will be particularly helpful in the case of "arguments" as such case is very common mistake.
- if (ts.getAncestor(name, 201 /* ClassDeclaration */) || ts.getAncestor(name, 174 /* ClassExpression */)) {
- return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText);
- }
- else {
+ // We check first if the name is inside class declaration or class expression; if so give explicit message
+ // otherwise report generic error message.
+ // reportGrammarErrorInClassDeclaration only return true if grammar error is successfully reported and false otherwise
+ var reportErrorInClassDeclaration = reportStrictModeGrammarErrorInClassDeclaration(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText);
+ if (!reportErrorInClassDeclaration) {
return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText);
}
+ return reportErrorInClassDeclaration;
}
}
}
@@ -22631,9 +22816,9 @@ var ts;
}
var count = 0;
while (true) {
- var name_12 = baseName + "_" + (++count);
- if (!ts.hasProperty(currentSourceFile.identifiers, name_12)) {
- return name_12;
+ var name_14 = baseName + "_" + (++count);
+ if (!ts.hasProperty(currentSourceFile.identifiers, name_14)) {
+ return name_14;
}
}
}
@@ -23835,9 +24020,9 @@ var ts;
tempFlags++;
// Skip over 'i' and 'n'
if (count !== 8 && count !== 13) {
- var name_13 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26);
- if (isUniqueName(name_13)) {
- return name_13;
+ var name_15 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26);
+ if (isUniqueName(name_15)) {
+ return name_15;
}
}
}
@@ -23870,9 +24055,9 @@ var ts;
}
function generateNameForModuleOrEnum(node) {
if (node.name.kind === 65 /* Identifier */) {
- var name_14 = node.name.text;
+ var name_16 = node.name.text;
// Use module/enum name itself if it is unique, otherwise make a unique variation
- assignGeneratedName(node, isUniqueLocalName(name_14, node) ? name_14 : makeUniqueName(name_14));
+ assignGeneratedName(node, isUniqueLocalName(name_16, node) ? name_16 : makeUniqueName(name_16));
}
}
function generateNameForImportOrExportDeclaration(node) {
@@ -24085,8 +24270,8 @@ var ts;
// Child scopes are always shown with a dot (even if they have no name),
// unless it is a computed property. Then it is shown with brackets,
// but the brackets are included in the name.
- var name_15 = node.name;
- if (!name_15 || name_15.kind !== 127 /* ComputedPropertyName */) {
+ var name_17 = node.name;
+ if (!name_17 || name_17.kind !== 127 /* ComputedPropertyName */) {
scopeName = "." + scopeName;
}
scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName;
@@ -24115,10 +24300,10 @@ var ts;
node.kind === 204 /* EnumDeclaration */) {
// Declaration and has associated name use it
if (node.name) {
- var name_16 = node.name;
+ var name_18 = node.name;
// For computed property names, the text will include the brackets
- scopeName = name_16.kind === 127 /* ComputedPropertyName */
- ? ts.getTextOfNode(name_16)
+ scopeName = name_18.kind === 127 /* ComputedPropertyName */
+ ? ts.getTextOfNode(name_18)
: node.name.text;
}
recordScopeNameStart(scopeName);
@@ -24592,6 +24777,7 @@ var ts;
default:
return -1 /* LessThan */;
}
+ case 172 /* YieldExpression */:
case 170 /* ConditionalExpression */:
return -1 /* LessThan */;
default:
@@ -24779,6 +24965,16 @@ var ts;
write("...");
emit(node.expression);
}
+ function emitYieldExpression(node) {
+ write(ts.tokenToString(110 /* YieldKeyword */));
+ if (node.asteriskToken) {
+ write("*");
+ }
+ if (node.expression) {
+ write(" ");
+ emit(node.expression);
+ }
+ }
function needsParenthesisForPropertyAccessOrInvocation(node) {
switch (node.kind) {
case 65 /* Identifier */:
@@ -25037,6 +25233,9 @@ var ts;
write("]");
}
function emitMethod(node) {
+ if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) {
+ write("*");
+ }
emit(node.name, false);
if (languageVersion < 2 /* ES6 */) {
write(": function ");
@@ -25458,7 +25657,7 @@ var ts;
var tokenKind = 98 /* VarKeyword */;
if (decl && languageVersion >= 2 /* ES6 */) {
if (ts.isLet(decl)) {
- tokenKind = 105 /* LetKeyword */;
+ tokenKind = 104 /* LetKeyword */;
}
else if (ts.isConst(decl)) {
tokenKind = 70 /* ConstKeyword */;
@@ -25471,7 +25670,7 @@ var ts;
switch (tokenKind) {
case 98 /* VarKeyword */:
return write("var ");
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
return write("let ");
case 70 /* ConstKeyword */:
return write("const ");
@@ -26140,12 +26339,12 @@ var ts;
function emitParameter(node) {
if (languageVersion < 2 /* ES6 */) {
if (ts.isBindingPattern(node.name)) {
- var name_17 = createTempVariable(0 /* Auto */);
+ var name_19 = createTempVariable(0 /* Auto */);
if (!tempParameters) {
tempParameters = [];
}
- tempParameters.push(name_17);
- emit(name_17);
+ tempParameters.push(name_19);
+ emit(name_19);
}
else {
emit(node.name);
@@ -26269,7 +26468,11 @@ var ts;
write("default ");
}
}
- write("function ");
+ write("function");
+ if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) {
+ write("*");
+ }
+ write(" ");
}
if (shouldEmitFunctionName(node)) {
emitDeclarationName(node);
@@ -26616,6 +26819,9 @@ var ts;
else if (member.kind === 137 /* SetAccessor */) {
write("set ");
}
+ if (member.asteriskToken) {
+ write("*");
+ }
emit(member.name);
emitSignatureAndBody(member);
emitEnd(member);
@@ -27761,8 +27967,8 @@ var ts;
// export { x, y }
for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) {
var specifier = _d[_c];
- var name_18 = (specifier.propertyName || specifier.name).text;
- (exportSpecifiers[name_18] || (exportSpecifiers[name_18] = [])).push(specifier);
+ var name_20 = (specifier.propertyName || specifier.name).text;
+ (exportSpecifiers[name_20] || (exportSpecifiers[name_20] = [])).push(specifier);
}
}
break;
@@ -28094,6 +28300,8 @@ var ts;
return emitConditionalExpression(node);
case 173 /* SpreadElementExpression */:
return emitSpreadElementExpression(node);
+ case 172 /* YieldExpression */:
+ return emitYieldExpression(node);
case 175 /* OmittedExpression */:
return;
case 179 /* Block */:
@@ -29334,32 +29542,34 @@ var ts;
// Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[]
ts.forEach(program.getSourceFiles(), function (sourceFile) {
cancellationToken.throwIfCancellationRequested();
- var declarations = sourceFile.getNamedDeclarations();
- for (var _i = 0; _i < declarations.length; _i++) {
- var declaration = declarations[_i];
- var name = getDeclarationName(declaration);
- if (name !== undefined) {
+ var nameToDeclarations = sourceFile.getNamedDeclarations();
+ for (var name_21 in nameToDeclarations) {
+ var declarations = ts.getProperty(nameToDeclarations, name_21);
+ if (declarations) {
// First do a quick check to see if the name of the declaration matches the
// last portion of the (possibly) dotted name they're searching for.
- var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name);
+ var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_21);
if (!matches) {
continue;
}
- // It was a match! If the pattern has dots in it, then also see if the
- // declaration container matches as well.
- if (patternMatcher.patternContainsDots) {
- var containers = getContainers(declaration);
- if (!containers) {
- return undefined;
- }
- matches = patternMatcher.getMatches(containers, name);
- if (!matches) {
- continue;
+ for (var _i = 0; _i < declarations.length; _i++) {
+ var declaration = declarations[_i];
+ // It was a match! If the pattern has dots in it, then also see if the
+ // declaration container matches as well.
+ if (patternMatcher.patternContainsDots) {
+ var containers = getContainers(declaration);
+ if (!containers) {
+ return undefined;
+ }
+ matches = patternMatcher.getMatches(containers, name_21);
+ if (!matches) {
+ continue;
+ }
}
+ var fileName = sourceFile.fileName;
+ var matchKind = bestMatchKind(matches);
+ rawItems.push({ name: name_21, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration });
}
- var fileName = sourceFile.fileName;
- var matchKind = bestMatchKind(matches);
- rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration });
}
}
});
@@ -29380,25 +29590,13 @@ var ts;
}
return true;
}
- function getDeclarationName(declaration) {
- var result = getTextOfIdentifierOrLiteral(declaration.name);
- if (result !== undefined) {
- return result;
- }
- if (declaration.name.kind === 127 /* ComputedPropertyName */) {
- var expr = declaration.name.expression;
- if (expr.kind === 155 /* PropertyAccessExpression */) {
- return expr.name.text;
- }
- return getTextOfIdentifierOrLiteral(expr);
- }
- return undefined;
- }
function getTextOfIdentifierOrLiteral(node) {
- if (node.kind === 65 /* Identifier */ ||
- node.kind === 8 /* StringLiteral */ ||
- node.kind === 7 /* NumericLiteral */) {
- return node.text;
+ if (node) {
+ if (node.kind === 65 /* Identifier */ ||
+ node.kind === 8 /* StringLiteral */ ||
+ node.kind === 7 /* NumericLiteral */) {
+ return node.text;
+ }
}
return undefined;
}
@@ -29753,9 +29951,9 @@ var ts;
case 198 /* VariableDeclaration */:
case 152 /* BindingElement */:
var variableDeclarationNode;
- var name_19;
+ var name_22;
if (node.kind === 152 /* BindingElement */) {
- name_19 = node.name;
+ name_22 = node.name;
variableDeclarationNode = node;
// binding elements are added only for variable declarations
// bubble up to the containing variable declaration
@@ -29767,16 +29965,16 @@ var ts;
else {
ts.Debug.assert(!ts.isBindingPattern(node.name));
variableDeclarationNode = node;
- name_19 = node.name;
+ name_22 = node.name;
}
if (ts.isConst(variableDeclarationNode)) {
- return createItem(node, getTextOfNode(name_19), ts.ScriptElementKind.constElement);
+ return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.constElement);
}
else if (ts.isLet(variableDeclarationNode)) {
- return createItem(node, getTextOfNode(name_19), ts.ScriptElementKind.letElement);
+ return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.letElement);
}
else {
- return createItem(node, getTextOfNode(name_19), ts.ScriptElementKind.variableElement);
+ return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.variableElement);
}
case 135 /* Constructor */:
return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement);
@@ -30675,7 +30873,8 @@ var ts;
ArgumentListKind[ArgumentListKind["CallArguments"] = 1] = "CallArguments";
ArgumentListKind[ArgumentListKind["TaggedTemplateArguments"] = 2] = "TaggedTemplateArguments";
})(ArgumentListKind || (ArgumentListKind = {}));
- function getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken) {
+ function getSignatureHelpItems(program, sourceFile, position, cancellationToken) {
+ var typeChecker = program.getTypeChecker();
// Decide whether to show signature help
var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position);
if (!startingToken) {
@@ -30690,12 +30889,54 @@ var ts;
}
var call = argumentInfo.invocation;
var candidates = [];
- var resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates);
+ var resolvedSignature = typeChecker.getResolvedSignature(call, candidates);
cancellationToken.throwIfCancellationRequested();
if (!candidates.length) {
+ // We didn't have any sig help items produced by the TS compiler. If this is a JS
+ // file, then see if we can figure out anything better.
+ if (ts.isJavaScript(sourceFile.fileName)) {
+ return createJavaScriptSignatureHelpItems(argumentInfo);
+ }
return undefined;
}
return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo);
+ function createJavaScriptSignatureHelpItems(argumentInfo) {
+ if (argumentInfo.invocation.kind !== 157 /* CallExpression */) {
+ return undefined;
+ }
+ // See if we can find some symbol with the call expression name that has call signatures.
+ var callExpression = argumentInfo.invocation;
+ var expression = callExpression.expression;
+ var name = expression.kind === 65 /* Identifier */
+ ? expression
+ : expression.kind === 155 /* PropertyAccessExpression */
+ ? expression.name
+ : undefined;
+ if (!name || !name.text) {
+ return undefined;
+ }
+ var typeChecker = program.getTypeChecker();
+ for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
+ var sourceFile_1 = _a[_i];
+ var nameToDeclarations = sourceFile_1.getNamedDeclarations();
+ var declarations = ts.getProperty(nameToDeclarations, name.text);
+ if (declarations) {
+ for (var _b = 0; _b < declarations.length; _b++) {
+ var declaration = declarations[_b];
+ var symbol = declaration.symbol;
+ if (symbol) {
+ var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration);
+ if (type) {
+ var callSignatures = type.getCallSignatures();
+ if (callSignatures && callSignatures.length) {
+ return createSignatureHelpItems(callSignatures, callSignatures[0], argumentInfo);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
/**
* Returns relevant information for the argument list and the current argument if we are
* in the argument of an invocation; returns undefined otherwise.
@@ -30949,8 +31190,8 @@ var ts;
var isTypeParameterList = argumentListInfo.kind === 0 /* TypeArguments */;
var invocation = argumentListInfo.invocation;
var callTarget = ts.getInvokedExpression(invocation);
- var callTargetSymbol = typeInfoResolver.getSymbolAtLocation(callTarget);
- var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined);
+ var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget);
+ var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, undefined, undefined);
var items = ts.map(candidates, function (candidateSignature) {
var signatureHelpParameters;
var prefixDisplayParts = [];
@@ -30964,13 +31205,13 @@ var ts;
signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray;
suffixDisplayParts.push(ts.punctuationPart(25 /* GreaterThanToken */));
var parameterParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation);
});
suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts);
}
else {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation);
});
prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts);
prefixDisplayParts.push(ts.punctuationPart(16 /* OpenParenToken */));
@@ -30979,7 +31220,7 @@ var ts;
suffixDisplayParts.push(ts.punctuationPart(17 /* CloseParenToken */));
}
var returnTypeParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation);
});
suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts);
return {
@@ -31008,7 +31249,7 @@ var ts;
};
function createSignatureHelpParameterForParameter(parameter) {
var displayParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation);
});
var isOptional = ts.hasQuestionToken(parameter.valueDeclaration);
return {
@@ -31020,7 +31261,7 @@ var ts;
}
function createSignatureHelpParameterForTypeParameter(typeParameter) {
var displayParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation);
});
return {
name: typeParameter.symbol.name,
@@ -31468,9 +31709,9 @@ var ts;
ts.isInsideTemplateLiteral = isInsideTemplateLiteral;
function isAccessibilityModifier(kind) {
switch (kind) {
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
return true;
}
return false;
@@ -31662,6 +31903,10 @@ var ts;
});
}
ts.signatureToDisplayParts = signatureToDisplayParts;
+ function isJavaScript(fileName) {
+ return ts.fileExtensionIs(fileName, ".js");
+ }
+ ts.isJavaScript = isJavaScript;
})(ts || (ts = {}));
///
///
@@ -32183,7 +32428,7 @@ var ts;
this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34 /* MinusToken */, 39 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */));
this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23 /* CommaToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([98 /* VarKeyword */, 94 /* ThrowKeyword */, 88 /* NewKeyword */, 74 /* DeleteKeyword */, 90 /* ReturnKeyword */, 97 /* TypeOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
- this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([105 /* LetKeyword */, 70 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */));
+ this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104 /* LetKeyword */, 70 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */));
this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8 /* Delete */));
this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(83 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */));
this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */));
@@ -32206,8 +32451,8 @@ var ts;
// Use of module as a function call. e.g.: import m2 = module("m2");
this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117 /* ModuleKeyword */, 118 /* RequireKeyword */]), 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
// Add a space around certain TypeScript keywords
- this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 103 /* ImplementsKeyword */, 85 /* ImportKeyword */, 104 /* InterfaceKeyword */, 117 /* ModuleKeyword */, 107 /* PrivateKeyword */, 109 /* PublicKeyword */, 120 /* SetKeyword */, 110 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
- this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79 /* ExtendsKeyword */, 103 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
+ this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 102 /* ImplementsKeyword */, 85 /* ImportKeyword */, 103 /* InterfaceKeyword */, 117 /* ModuleKeyword */, 106 /* PrivateKeyword */, 108 /* PublicKeyword */, 120 /* SetKeyword */, 109 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
+ this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79 /* ExtendsKeyword */, 102 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
// Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" {
this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8 /* StringLiteral */, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */));
// Lambda expressions
@@ -32226,7 +32471,7 @@ var ts;
// decorators
this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 52 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(52 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
- this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 110 /* StaticKeyword */, 109 /* PublicKeyword */, 107 /* PrivateKeyword */, 108 /* ProtectedKeyword */, 116 /* GetKeyword */, 120 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */));
+ this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 109 /* StaticKeyword */, 108 /* PublicKeyword */, 106 /* PrivateKeyword */, 107 /* ProtectedKeyword */, 116 /* GetKeyword */, 120 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */));
// These rules are higher in priority than user-configurable rules.
this.HighPriorityCommonRules =
[
@@ -32316,9 +32561,9 @@ var ts;
}
Rules.prototype.getRuleName = function (rule) {
var o = this;
- for (var name_20 in o) {
- if (o[name_20] === rule) {
- return name_20;
+ for (var name_23 in o) {
+ if (o[name_23] === rule) {
+ return name_23;
}
}
throw new Error("Unknown rule");
@@ -33243,7 +33488,7 @@ var ts;
}
switch (node.kind) {
case 201 /* ClassDeclaration */: return 69 /* ClassKeyword */;
- case 202 /* InterfaceDeclaration */: return 104 /* InterfaceKeyword */;
+ case 202 /* InterfaceDeclaration */: return 103 /* InterfaceKeyword */;
case 200 /* FunctionDeclaration */: return 83 /* FunctionKeyword */;
case 204 /* EnumDeclaration */: return 204 /* EnumDeclaration */;
case 136 /* GetAccessor */: return 116 /* GetKeyword */;
@@ -34716,29 +34961,65 @@ var ts;
return this.namedDeclarations;
};
SourceFileObject.prototype.computeNamedDeclarations = function () {
- var namedDeclarations = [];
+ var result = {};
ts.forEachChild(this, visit);
- return namedDeclarations;
+ return result;
+ function addDeclaration(declaration) {
+ var name = getDeclarationName(declaration);
+ if (name) {
+ var declarations = getDeclarations(name);
+ declarations.push(declaration);
+ }
+ }
+ function getDeclarations(name) {
+ return ts.getProperty(result, name) || (result[name] = []);
+ }
+ function getDeclarationName(declaration) {
+ if (declaration.name) {
+ var result_2 = getTextOfIdentifierOrLiteral(declaration.name);
+ if (result_2 !== undefined) {
+ return result_2;
+ }
+ if (declaration.name.kind === 127 /* ComputedPropertyName */) {
+ var expr = declaration.name.expression;
+ if (expr.kind === 155 /* PropertyAccessExpression */) {
+ return expr.name.text;
+ }
+ return getTextOfIdentifierOrLiteral(expr);
+ }
+ }
+ return undefined;
+ }
+ function getTextOfIdentifierOrLiteral(node) {
+ if (node) {
+ if (node.kind === 65 /* Identifier */ ||
+ node.kind === 8 /* StringLiteral */ ||
+ node.kind === 7 /* NumericLiteral */) {
+ return node.text;
+ }
+ }
+ return undefined;
+ }
function visit(node) {
switch (node.kind) {
case 200 /* FunctionDeclaration */:
case 134 /* MethodDeclaration */:
case 133 /* MethodSignature */:
var functionDeclaration = node;
- if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) {
- var lastDeclaration = namedDeclarations.length > 0 ?
- namedDeclarations[namedDeclarations.length - 1] :
- undefined;
+ var declarationName = getDeclarationName(functionDeclaration);
+ if (declarationName) {
+ var declarations = getDeclarations(declarationName);
+ var lastDeclaration = ts.lastOrUndefined(declarations);
// Check whether this declaration belongs to an "overload group".
- if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) {
+ if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) {
// Overwrite the last declaration if it was an overload
// and this one is an implementation.
if (functionDeclaration.body && !lastDeclaration.body) {
- namedDeclarations[namedDeclarations.length - 1] = functionDeclaration;
+ declarations[declarations.length - 1] = functionDeclaration;
}
}
else {
- namedDeclarations.push(functionDeclaration);
+ declarations.push(functionDeclaration);
}
ts.forEachChild(node, visit);
}
@@ -34757,9 +35038,7 @@ var ts;
case 136 /* GetAccessor */:
case 137 /* SetAccessor */:
case 145 /* TypeLiteral */:
- if (node.name) {
- namedDeclarations.push(node);
- }
+ addDeclaration(node);
// fall through
case 135 /* Constructor */:
case 180 /* VariableStatement */:
@@ -34789,7 +35068,7 @@ var ts;
case 226 /* EnumMember */:
case 132 /* PropertyDeclaration */:
case 131 /* PropertySignature */:
- namedDeclarations.push(node);
+ addDeclaration(node);
break;
case 215 /* ExportDeclaration */:
// Handle named exports case e.g.:
@@ -34804,14 +35083,14 @@ var ts;
// Handle default import case e.g.:
// import d from "mod";
if (importClause.name) {
- namedDeclarations.push(importClause);
+ addDeclaration(importClause);
}
// Handle named bindings in imports e.g.:
// import * as NS from "mod";
// import {a, b as B} from "mod";
if (importClause.namedBindings) {
if (importClause.namedBindings.kind === 211 /* NamespaceImport */) {
- namedDeclarations.push(importClause.namedBindings);
+ addDeclaration(importClause.namedBindings);
}
else {
ts.forEach(importClause.namedBindings.elements, visit);
@@ -35400,7 +35679,7 @@ var ts;
}
else if (token === 35 /* AsteriskToken */) {
token = scanner.scan();
- if (token === 102 /* AsKeyword */) {
+ if (token === 111 /* AsKeyword */) {
token = scanner.scan();
if (token === 65 /* Identifier */) {
token = scanner.scan();
@@ -35671,8 +35950,6 @@ var ts;
var syntaxTreeCache = new SyntaxTreeCache(host);
var ruleProvider;
var program;
- // this checker is used to answer all LS questions except errors
- var typeInfoResolver;
var useCaseSensitivefileNames = false;
var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken());
// Check if the localized messages json is set, otherwise query the host for it
@@ -35742,7 +36019,9 @@ var ts;
}
}
program = newProgram;
- typeInfoResolver = program.getTypeChecker();
+ // Make sure all the nodes in the program are both bound, and have their parent
+ // pointers set property.
+ program.getTypeChecker();
return;
function getOrCreateSourceFile(fileName) {
// The program is asking for this file, check first if the host can locate it.
@@ -35814,15 +36093,8 @@ var ts;
synchronizeHostData();
return program;
}
- /**
- * Clean up any semantic caches that are not needed.
- * The host can call this method if it wants to jettison unused memory.
- * We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches.
- */
function cleanupSemanticCache() {
- if (program) {
- typeInfoResolver = program.getTypeChecker();
- }
+ // TODO: Should we jettison the program (or it's type checker) here?
}
function dispose() {
if (program) {
@@ -35836,9 +36108,6 @@ var ts;
synchronizeHostData();
return program.getSyntacticDiagnostics(getValidSourceFile(fileName));
}
- function isJavaScript(fileName) {
- return ts.fileExtensionIs(fileName, ".js");
- }
/**
* getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors
* If '-d' enabled, report both semantic and emitter errors
@@ -35849,7 +36118,7 @@ var ts;
// For JavaScript files, we don't want to report the normal typescript semantic errors.
// Instead, we just report errors for using TypeScript-only constructs from within a
// JavaScript file.
- if (isJavaScript(fileName)) {
+ if (ts.isJavaScript(fileName)) {
return getJavaScriptSemanticDiagnostics(targetSourceFile);
}
// Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file.
@@ -35886,7 +36155,7 @@ var ts;
break;
case 222 /* HeritageClause */:
var heritageClause = node;
- if (heritageClause.token === 103 /* ImplementsKeyword */) {
+ if (heritageClause.token === 102 /* ImplementsKeyword */) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file));
return true;
}
@@ -35989,14 +36258,14 @@ var ts;
for (var _i = 0; _i < modifiers.length; _i++) {
var modifier = modifiers[_i];
switch (modifier.kind) {
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
case 115 /* DeclareKeyword */:
diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
return true;
// These are all legal modifiers.
- case 110 /* StaticKeyword */:
+ case 109 /* StaticKeyword */:
case 78 /* ExportKeyword */:
case 70 /* ConstKeyword */:
case 73 /* DefaultKeyword */:
@@ -36058,29 +36327,8 @@ var ts;
}
return ts.unescapeIdentifier(displayName);
}
- function createCompletionEntry(symbol, typeChecker, location) {
- // Try to get a valid display name for this symbol, if we could not find one, then ignore it.
- // We would like to only show things that can be added after a dot, so for instance numeric properties can
- // not be accessed with a dot (a.1 <- invalid)
- var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, true);
- if (!displayName) {
- return undefined;
- }
- // TODO(drosen): Right now we just permit *all* semantic meanings when calling
- // 'getSymbolKind' which is permissible given that it is backwards compatible; but
- // really we should consider passing the meaning for the node so that we don't report
- // that a suggestion for a value is an interface. We COULD also just do what
- // 'getSymbolModifiers' does, which is to use the first declaration.
- // Use a 'sortText' of 0' so that all symbol completion entries come before any other
- // entries (like JavaScript identifier entries).
- return {
- name: displayName,
- kind: getSymbolKind(symbol, typeChecker, location),
- kindModifiers: getSymbolModifiers(symbol),
- sortText: "0"
- };
- }
function getCompletionData(fileName, position) {
+ var typeChecker = program.getTypeChecker();
var syntacticStart = new Date().getTime();
var sourceFile = getValidSourceFile(fileName);
var start = new Date().getTime();
@@ -36149,26 +36397,26 @@ var ts;
isMemberCompletion = true;
isNewIdentifierLocation = false;
if (node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */ || node.kind === 155 /* PropertyAccessExpression */) {
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
// This is an alias, follow what it aliases
if (symbol && symbol.flags & 8388608 /* Alias */) {
- symbol = typeInfoResolver.getAliasedSymbol(symbol);
+ symbol = typeChecker.getAliasedSymbol(symbol);
}
if (symbol && symbol.flags & 1952 /* HasExports */) {
// Extract module or enum members
- var exportedSymbols = typeInfoResolver.getExportsOfModule(symbol);
+ var exportedSymbols = typeChecker.getExportsOfModule(symbol);
ts.forEach(exportedSymbols, function (symbol) {
- if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) {
+ if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) {
symbols.push(symbol);
}
});
}
}
- var type = typeInfoResolver.getTypeAtLocation(node);
+ var type = typeChecker.getTypeAtLocation(node);
if (type) {
// Filter private properties
ts.forEach(type.getApparentProperties(), function (symbol) {
- if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) {
+ if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) {
symbols.push(symbol);
}
});
@@ -36180,11 +36428,11 @@ var ts;
// Object literal expression, look up possible property names from contextual type
isMemberCompletion = true;
isNewIdentifierLocation = true;
- var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral);
+ var contextualType = typeChecker.getContextualType(containingObjectLiteral);
if (!contextualType) {
return false;
}
- var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType);
+ var contextualTypeMembers = typeChecker.getPropertiesOfType(contextualType);
if (contextualTypeMembers && contextualTypeMembers.length > 0) {
// Add filtered items to the completion list
symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties);
@@ -36200,9 +36448,9 @@ var ts;
ts.Debug.assert(importDeclaration !== undefined);
var exports;
if (importDeclaration.moduleSpecifier) {
- var moduleSpecifierSymbol = typeInfoResolver.getSymbolAtLocation(importDeclaration.moduleSpecifier);
+ var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier);
if (moduleSpecifierSymbol) {
- exports = typeInfoResolver.getExportsOfModule(moduleSpecifierSymbol);
+ exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol);
}
}
//let exports = typeInfoResolver.getExportsOfImportDeclaration(importDeclaration);
@@ -36247,7 +36495,7 @@ var ts;
var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile;
/// TODO filter meaning based on the current context
var symbolMeanings = 793056 /* Type */ | 107455 /* Value */ | 1536 /* Namespace */ | 8388608 /* Alias */;
- symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings);
+ symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);
}
return true;
}
@@ -36310,9 +36558,9 @@ var ts;
return containingNodeKind === 171 /* TemplateExpression */; // `aa ${|
case 12 /* TemplateMiddle */:
return containingNodeKind === 176 /* TemplateSpan */; // `aa ${10} dd ${|
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
return containingNodeKind === 132 /* PropertyDeclaration */; // class A{ public |
}
// Previous token may have been a keyword that was converted to an identifier.
@@ -36402,6 +36650,7 @@ var ts;
containingNodeKind === 150 /* ObjectBindingPattern */; // function func({ x|
case 22 /* SemicolonToken */:
return containingNodeKind === 131 /* PropertySignature */ &&
+ previousToken.parent && previousToken.parent.parent &&
(previousToken.parent.parent.kind === 202 /* InterfaceDeclaration */ ||
previousToken.parent.parent.kind === 145 /* TypeLiteral */); // let x : { a; |
case 24 /* LessThanToken */:
@@ -36409,27 +36658,28 @@ var ts;
containingNodeKind === 200 /* FunctionDeclaration */ ||
containingNodeKind === 202 /* InterfaceDeclaration */ ||
isFunction(containingNodeKind);
- case 110 /* StaticKeyword */:
+ case 109 /* StaticKeyword */:
return containingNodeKind === 132 /* PropertyDeclaration */;
case 21 /* DotDotDotToken */:
return containingNodeKind === 129 /* Parameter */ ||
containingNodeKind === 135 /* Constructor */ ||
- (previousToken.parent.parent.kind === 151 /* ArrayBindingPattern */); // var [ ...z|
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
+ (previousToken.parent && previousToken.parent.parent &&
+ previousToken.parent.parent.kind === 151 /* ArrayBindingPattern */); // var [ ...z|
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
return containingNodeKind === 129 /* Parameter */;
case 69 /* ClassKeyword */:
case 77 /* EnumKeyword */:
- case 104 /* InterfaceKeyword */:
+ case 103 /* InterfaceKeyword */:
case 83 /* FunctionKeyword */:
case 98 /* VarKeyword */:
case 116 /* GetKeyword */:
case 120 /* SetKeyword */:
case 85 /* ImportKeyword */:
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
case 70 /* ConstKeyword */:
- case 111 /* YieldKeyword */:
+ case 110 /* YieldKeyword */:
return true;
}
// Previous token may have been a keyword that was converted to an identifier.
@@ -36506,7 +36756,7 @@ var ts;
}
var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot;
var entries;
- if (isRightOfDot && isJavaScript(fileName)) {
+ if (isRightOfDot && ts.isJavaScript(fileName)) {
entries = getCompletionEntriesFromSymbols(symbols);
ts.addRange(entries, getJavaScriptCompletionEntries());
}
@@ -36528,10 +36778,10 @@ var ts;
for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
var sourceFile = _a[_i];
var nameTable = getNameTable(sourceFile);
- for (var name_21 in nameTable) {
- if (!allNames[name_21]) {
- allNames[name_21] = name_21;
- var displayName = getCompletionEntryDisplayName(name_21, target, true);
+ for (var name_24 in nameTable) {
+ if (!allNames[name_24]) {
+ allNames[name_24] = name_24;
+ var displayName = getCompletionEntryDisplayName(name_24, target, true);
if (displayName) {
var entry = {
name: displayName,
@@ -36546,6 +36796,28 @@ var ts;
}
return entries;
}
+ function createCompletionEntry(symbol, location) {
+ // Try to get a valid display name for this symbol, if we could not find one, then ignore it.
+ // We would like to only show things that can be added after a dot, so for instance numeric properties can
+ // not be accessed with a dot (a.1 <- invalid)
+ var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, true);
+ if (!displayName) {
+ return undefined;
+ }
+ // TODO(drosen): Right now we just permit *all* semantic meanings when calling
+ // 'getSymbolKind' which is permissible given that it is backwards compatible; but
+ // really we should consider passing the meaning for the node so that we don't report
+ // that a suggestion for a value is an interface. We COULD also just do what
+ // 'getSymbolModifiers' does, which is to use the first declaration.
+ // Use a 'sortText' of 0' so that all symbol completion entries come before any other
+ // entries (like JavaScript identifier entries).
+ return {
+ name: displayName,
+ kind: getSymbolKind(symbol, location),
+ kindModifiers: getSymbolModifiers(symbol),
+ sortText: "0"
+ };
+ }
function getCompletionEntriesFromSymbols(symbols) {
var start = new Date().getTime();
var entries = [];
@@ -36553,7 +36825,7 @@ var ts;
var nameToSymbol = {};
for (var _i = 0; _i < symbols.length; _i++) {
var symbol = symbols[_i];
- var entry = createCompletionEntry(symbol, typeInfoResolver, location);
+ var entry = createCompletionEntry(symbol, location);
if (entry) {
var id = ts.escapeIdentifier(entry.name);
if (!ts.lookUp(nameToSymbol, id)) {
@@ -36580,7 +36852,7 @@ var ts;
// completion entry.
var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, false) === entryName ? s : undefined; });
if (symbol) {
- var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, typeInfoResolver, location_2, 7 /* All */);
+ var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, location_2, 7 /* All */);
return {
name: entryName,
kind: displayPartsDocumentationsAndSymbolKind.symbolKind,
@@ -36604,7 +36876,7 @@ var ts;
return undefined;
}
// TODO(drosen): use contextual SemanticMeaning.
- function getSymbolKind(symbol, typeResolver, location) {
+ function getSymbolKind(symbol, location) {
var flags = symbol.getFlags();
if (flags & 32 /* Class */)
return ScriptElementKind.classElement;
@@ -36616,7 +36888,7 @@ var ts;
return ScriptElementKind.interfaceElement;
if (flags & 262144 /* TypeParameter */)
return ScriptElementKind.typeParameterElement;
- var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location);
+ var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location);
if (result === ScriptElementKind.unknown) {
if (flags & 262144 /* TypeParameter */)
return ScriptElementKind.typeParameterElement;
@@ -36629,11 +36901,12 @@ var ts;
}
return result;
}
- function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location) {
- if (typeResolver.isUndefinedSymbol(symbol)) {
+ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location) {
+ var typeChecker = program.getTypeChecker();
+ if (typeChecker.isUndefinedSymbol(symbol)) {
return ScriptElementKind.variableElement;
}
- if (typeResolver.isArgumentsSymbol(symbol)) {
+ if (typeChecker.isArgumentsSymbol(symbol)) {
return ScriptElementKind.localVariableElement;
}
if (flags & 3 /* Variable */) {
@@ -36661,7 +36934,7 @@ var ts;
if (flags & 4 /* Property */) {
if (flags & 268435456 /* UnionProperty */) {
// If union property is result of union of non method (property/accessors/variables), it is labeled as property
- var unionPropertyKind = ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) {
+ var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) {
var rootSymbolFlags = rootSymbol.getFlags();
if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) {
return ScriptElementKind.memberVariableElement;
@@ -36671,7 +36944,7 @@ var ts;
if (!unionPropertyKind) {
// If this was union of all methods,
//make sure it has call signatures before we can label it as method
- var typeOfUnionProperty = typeInfoResolver.getTypeOfSymbolAtLocation(symbol, location);
+ var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (typeOfUnionProperty.getCallSignatures().length) {
return ScriptElementKind.memberFunctionElement;
}
@@ -36704,14 +36977,14 @@ var ts;
? ts.getNodeModifiers(symbol.declarations[0])
: ScriptElementKindModifier.none;
}
- function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location,
- // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
- semanticMeaning) {
+ // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
+ function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) {
if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); }
+ var typeChecker = program.getTypeChecker();
var displayParts = [];
var documentation;
var symbolFlags = symbol.flags;
- var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location);
+ var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location);
var hasAddedSymbolInfo;
var type;
// Class at constructor site need to be shown as constructor apart from property,method, vars
@@ -36721,7 +36994,7 @@ var ts;
symbolKind = ScriptElementKind.memberVariableElement;
}
var signature;
- type = typeResolver.getTypeOfSymbolAtLocation(symbol, location);
+ type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (type) {
if (location.parent && location.parent.kind === 155 /* PropertyAccessExpression */) {
var right = location.parent.name;
@@ -36740,7 +37013,7 @@ var ts;
}
if (callExpression) {
var candidateSignatures = [];
- signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures);
+ signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures);
if (!signature && candidateSignatures.length) {
// Use the first candidate:
signature = candidateSignatures[0];
@@ -36785,7 +37058,7 @@ var ts;
displayParts.push(ts.spacePart());
}
if (!(type.flags & 32768 /* Anonymous */)) {
- displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, undefined, 1 /* WriteTypeParametersOrArguments */));
+ displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1 /* WriteTypeParametersOrArguments */));
}
addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */);
break;
@@ -36801,8 +37074,8 @@ var ts;
// get the signature from the declaration and write it
var functionDeclaration = location.parent;
var allSignatures = functionDeclaration.kind === 135 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures();
- if (!typeResolver.isImplementationOfOverload(functionDeclaration)) {
- signature = typeResolver.getSignatureFromDeclaration(functionDeclaration);
+ if (!typeChecker.isImplementationOfOverload(functionDeclaration)) {
+ signature = typeChecker.getSignatureFromDeclaration(functionDeclaration);
}
else {
signature = allSignatures[0];
@@ -36830,7 +37103,7 @@ var ts;
}
if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.keywordPart(104 /* InterfaceKeyword */));
+ displayParts.push(ts.keywordPart(103 /* InterfaceKeyword */));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
writeTypeParametersOfSymbol(symbol, sourceFile);
@@ -36843,7 +37116,7 @@ var ts;
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(53 /* EqualsToken */));
displayParts.push(ts.spacePart());
- displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
+ displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
}
if (symbolFlags & 384 /* Enum */) {
addNewLineIfDisplayPartsExist();
@@ -36879,7 +37152,7 @@ var ts;
else {
// Method/function type parameter
var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128 /* TypeParameter */).parent;
- var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration);
+ var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration);
if (signatureDeclaration.kind === 139 /* ConstructSignature */) {
displayParts.push(ts.keywordPart(88 /* NewKeyword */));
displayParts.push(ts.spacePart());
@@ -36887,14 +37160,14 @@ var ts;
else if (signatureDeclaration.kind !== 138 /* CallSignature */ && signatureDeclaration.name) {
addFullSymbolName(signatureDeclaration.symbol);
}
- displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */));
+ displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */));
}
}
if (symbolFlags & 8 /* EnumMember */) {
addPrefixForAnyFunctionOrVar(symbol, "enum member");
var declaration = symbol.declarations[0];
if (declaration.kind === 226 /* EnumMember */) {
- var constantValue = typeResolver.getConstantValue(declaration);
+ var constantValue = typeChecker.getConstantValue(declaration);
if (constantValue !== undefined) {
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(53 /* EqualsToken */));
@@ -36921,7 +37194,7 @@ var ts;
displayParts.push(ts.punctuationPart(17 /* CloseParenToken */));
}
else {
- var internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
+ var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
if (internalAliasSymbol) {
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(53 /* EqualsToken */));
@@ -36946,12 +37219,12 @@ var ts;
// If the type is type parameter, format it specially
if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
- typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration);
+ typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration);
});
displayParts.push.apply(displayParts, typeParameterParts);
}
else {
- displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, type, enclosingDeclaration));
+ displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, type, enclosingDeclaration));
}
}
else if (symbolFlags & 16 /* Function */ ||
@@ -36966,7 +37239,7 @@ var ts;
}
}
else {
- symbolKind = getSymbolKind(symbol, typeResolver, location);
+ symbolKind = getSymbolKind(symbol, location);
}
}
if (!documentation) {
@@ -36979,7 +37252,7 @@ var ts;
}
}
function addFullSymbolName(symbol, enclosingDeclaration) {
- var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */);
+ var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */);
displayParts.push.apply(displayParts, fullSymbolDisplayParts);
}
function addPrefixForAnyFunctionOrVar(symbol, symbolKind) {
@@ -37007,7 +37280,7 @@ var ts;
}
}
function addSignatureDisplayParts(signature, allSignatures, flags) {
- displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */));
+ displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */));
if (allSignatures.length > 1) {
displayParts.push(ts.spacePart());
displayParts.push(ts.punctuationPart(16 /* OpenParenToken */));
@@ -37021,7 +37294,7 @@ var ts;
}
function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
- typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
+ typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
});
displayParts.push.apply(displayParts, typeParameterParts);
}
@@ -37033,7 +37306,11 @@ var ts;
if (!node) {
return undefined;
}
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ if (isLabelName(node)) {
+ return undefined;
+ }
+ var typeChecker = program.getTypeChecker();
+ var symbol = typeChecker.getSymbolAtLocation(node);
if (!symbol) {
// Try getting just type at this position and show
switch (node.kind) {
@@ -37043,20 +37320,20 @@ var ts;
case 93 /* ThisKeyword */:
case 91 /* SuperKeyword */:
// For the identifiers/this/super etc get the type at position
- var type = typeInfoResolver.getTypeAtLocation(node);
+ var type = typeChecker.getTypeAtLocation(node);
if (type) {
return {
kind: ScriptElementKind.unknown,
kindModifiers: ScriptElementKindModifier.none,
textSpan: ts.createTextSpan(node.getStart(), node.getWidth()),
- displayParts: ts.typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)),
+ displayParts: ts.typeToDisplayParts(typeChecker, type, getContainerNode(node)),
documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined
};
}
}
return undefined;
}
- var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node);
+ var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node);
return {
kind: displayPartsDocumentationsAndKind.symbolKind,
kindModifiers: getSymbolModifiers(symbol),
@@ -37105,7 +37382,8 @@ var ts;
}
return undefined;
}
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var typeChecker = program.getTypeChecker();
+ var symbol = typeChecker.getSymbolAtLocation(node);
// Could not find a symbol e.g. node is string or number keyword,
// or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol
if (!symbol) {
@@ -37118,7 +37396,7 @@ var ts;
if (symbol.flags & 8388608 /* Alias */) {
var declaration = symbol.declarations[0];
if (node.kind === 65 /* Identifier */ && node.parent === declaration) {
- symbol = typeInfoResolver.getAliasedSymbol(symbol);
+ symbol = typeChecker.getAliasedSymbol(symbol);
}
}
// Because name in short-hand property assignment has two different meanings: property name and property value,
@@ -37127,22 +37405,22 @@ var ts;
// is performed at the location of property access, we would like to go to definition of the property in the short-hand
// assignment. This case and others are handled by the following code.
if (node.parent.kind === 225 /* ShorthandPropertyAssignment */) {
- var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
+ var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
if (!shorthandSymbol) {
return [];
}
var shorthandDeclarations = shorthandSymbol.getDeclarations();
- var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node);
- var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol);
- var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node);
+ var shorthandSymbolKind = getSymbolKind(shorthandSymbol, node);
+ var shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol);
+ var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node);
return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); });
}
var result = [];
var declarations = symbol.getDeclarations();
- var symbolName = typeInfoResolver.symbolToString(symbol); // Do not get scoped name, just the name of the symbol
- var symbolKind = getSymbolKind(symbol, typeInfoResolver, node);
+ var symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol
+ var symbolKind = getSymbolKind(symbol, node);
var containerSymbol = symbol.parent;
- var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : "";
+ var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : "";
if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) &&
!tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) {
// Just add all the declarations.
@@ -37197,7 +37475,7 @@ var ts;
var sourceFile = getCanonicalFileName(ts.normalizeSlashes(fileName));
// Get occurrences only supports reporting occurrences for the file queried. So
// filter down to that list.
- results = ts.filter(results, function (r) { return r.fileName === fileName; });
+ results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile; });
}
return results;
}
@@ -37460,7 +37738,7 @@ var ts;
return undefined;
}
}
- else if (modifier === 110 /* StaticKeyword */) {
+ else if (modifier === 109 /* StaticKeyword */) {
if (container.kind !== 201 /* ClassDeclaration */) {
return undefined;
}
@@ -37509,13 +37787,13 @@ var ts;
return ts.map(keywords, getHighlightSpanForNode);
function getFlagFromModifier(modifier) {
switch (modifier) {
- case 109 /* PublicKeyword */:
+ case 108 /* PublicKeyword */:
return 16 /* Public */;
- case 107 /* PrivateKeyword */:
+ case 106 /* PrivateKeyword */:
return 32 /* Private */;
- case 108 /* ProtectedKeyword */:
+ case 107 /* ProtectedKeyword */:
return 64 /* Protected */;
- case 110 /* StaticKeyword */:
+ case 109 /* StaticKeyword */:
return 128 /* Static */;
case 78 /* ExportKeyword */:
return 1 /* Export */;
@@ -37776,6 +38054,7 @@ var ts;
return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments);
}
function getReferencedSymbolsForNodes(node, sourceFiles, findInStrings, findInComments) {
+ var typeChecker = program.getTypeChecker();
// Labels
if (isLabelName(node)) {
if (isJumpStatementTarget(node)) {
@@ -37795,7 +38074,7 @@ var ts;
if (node.kind === 91 /* SuperKeyword */) {
return getReferencesForSuperKeyword(node);
}
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
// Could not find a symbol e.g. unknown identifier
if (!symbol) {
// Can't have references to something that we have no symbol for.
@@ -37834,7 +38113,7 @@ var ts;
}
return result;
function getDefinition(symbol) {
- var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), typeInfoResolver, node);
+ var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node);
var name = ts.map(info.displayParts, function (p) { return p.text; }).join("");
var declarations = symbol.declarations;
if (!declarations || declarations.length === 0) {
@@ -37877,7 +38156,7 @@ var ts;
if (isImportOrExportSpecifierName(location)) {
return location.getText();
}
- name = typeInfoResolver.symbolToString(symbol);
+ name = typeChecker.symbolToString(symbol);
return stripQuotes(name);
}
function getInternedName(symbol, location, declarations) {
@@ -38065,10 +38344,10 @@ var ts;
if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) {
return;
}
- var referenceSymbol = typeInfoResolver.getSymbolAtLocation(referenceLocation);
+ var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation);
if (referenceSymbol) {
var referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
- var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
+ var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
var relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation);
if (relatedSymbol) {
var referencedSymbol = getReferencedSymbol(relatedSymbol);
@@ -38257,14 +38536,14 @@ var ts;
var result = [symbol];
// If the symbol is an alias, add what it alaises to the list
if (isImportOrExportSpecifierImportSymbol(symbol)) {
- result.push(typeInfoResolver.getAliasedSymbol(symbol));
+ result.push(typeChecker.getAliasedSymbol(symbol));
}
// If the location is in a context sensitive location (i.e. in an object literal) try
// to get a contextual type for it, and add the property symbol from the contextual
// type to the search set
if (isNameOfPropertyAssignment(location)) {
ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) {
- result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol));
+ result.push.apply(result, typeChecker.getRootSymbols(contextualSymbol));
});
/* Because in short-hand property assignment, location has two meaning : property name and as value of the property
* When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of
@@ -38277,14 +38556,14 @@ var ts;
* so that when matching with potential reference symbol, both symbols from property declaration and variable declaration
* will be included correctly.
*/
- var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent);
+ var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent);
if (shorthandValueSymbol) {
result.push(shorthandValueSymbol);
}
}
// If this is a union property, add all the symbols from all its source symbols in all unioned types.
// If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list
- ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) {
+ ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) {
if (rootSymbol !== symbol) {
result.push(rootSymbol);
}
@@ -38310,9 +38589,9 @@ var ts;
return;
function getPropertySymbolFromTypeReference(typeReference) {
if (typeReference) {
- var type = typeInfoResolver.getTypeAtLocation(typeReference);
+ var type = typeChecker.getTypeAtLocation(typeReference);
if (type) {
- var propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName);
+ var propertySymbol = typeChecker.getPropertyOfType(type, propertyName);
if (propertySymbol) {
result.push(propertySymbol);
}
@@ -38329,7 +38608,7 @@ var ts;
// If the reference symbol is an alias, check if what it is aliasing is one of the search
// symbols.
if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) {
- var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol);
+ var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol);
if (searchSymbols.indexOf(aliasedSymbol) >= 0) {
return aliasedSymbol;
}
@@ -38339,12 +38618,12 @@ var ts;
// compare to our searchSymbol
if (isNameOfPropertyAssignment(referenceLocation)) {
return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) {
- return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
+ return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
});
}
// Unwrap symbols to get to the root (e.g. transient symbols as a result of widening)
// Or a union property, use its underlying unioned symbols
- return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) {
+ return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) {
// if it is in the list, then we are done
if (searchSymbols.indexOf(rootSymbol) >= 0) {
return rootSymbol;
@@ -38352,9 +38631,9 @@ var ts;
// Finally, try all properties with the same name in any type the containing type extended or implemented, and
// see if any is in the list
if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) {
- var result_2 = [];
- getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_2);
- return ts.forEach(result_2, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
+ var result_3 = [];
+ getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3);
+ return ts.forEach(result_3, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
}
return undefined;
});
@@ -38362,29 +38641,29 @@ var ts;
function getPropertySymbolsFromContextualType(node) {
if (isNameOfPropertyAssignment(node)) {
var objectLiteral = node.parent.parent;
- var contextualType = typeInfoResolver.getContextualType(objectLiteral);
- var name_22 = node.text;
+ var contextualType = typeChecker.getContextualType(objectLiteral);
+ var name_25 = node.text;
if (contextualType) {
if (contextualType.flags & 16384 /* Union */) {
// This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types)
// if not, search the constituent types for the property
- var unionProperty = contextualType.getProperty(name_22);
+ var unionProperty = contextualType.getProperty(name_25);
if (unionProperty) {
return [unionProperty];
}
else {
- var result_3 = [];
+ var result_4 = [];
ts.forEach(contextualType.types, function (t) {
- var symbol = t.getProperty(name_22);
+ var symbol = t.getProperty(name_25);
if (symbol) {
- result_3.push(symbol);
+ result_4.push(symbol);
}
});
- return result_3;
+ return result_4;
}
}
else {
- var symbol_1 = contextualType.getProperty(name_22);
+ var symbol_1 = contextualType.getProperty(name_25);
if (symbol_1) {
return [symbol_1];
}
@@ -38549,7 +38828,7 @@ var ts;
}
if (!isLastClause && root.parent.kind === 177 /* HeritageClauseElement */ && root.parent.parent.kind === 222 /* HeritageClause */) {
var decl = root.parent.parent.parent;
- return (decl.kind === 201 /* ClassDeclaration */ && root.parent.parent.token === 103 /* ImplementsKeyword */) ||
+ return (decl.kind === 201 /* ClassDeclaration */ && root.parent.parent.token === 102 /* ImplementsKeyword */) ||
(decl.kind === 202 /* InterfaceDeclaration */ && root.parent.parent.token === 79 /* ExtendsKeyword */);
}
return false;
@@ -38610,7 +38889,7 @@ var ts;
function getSignatureHelpItems(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
- return ts.SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken);
+ return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken);
}
/// Syntactic features
function getSourceFile(fileName) {
@@ -38677,6 +38956,7 @@ var ts;
function getSemanticClassifications(fileName, span) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
+ var typeChecker = program.getTypeChecker();
var result = [];
processNode(sourceFile);
return result;
@@ -38722,7 +39002,7 @@ var ts;
// Only walk into nodes that intersect the requested span.
if (node && ts.textSpanIntersectsWith(span, node.getStart(), node.getWidth())) {
if (node.kind === 65 /* Identifier */ && node.getWidth() > 0) {
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
if (symbol) {
var type = classifySymbol(symbol, getMeaningFromLocation(node));
if (type) {
@@ -39134,10 +39414,11 @@ var ts;
function getRenameInfo(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
+ var typeChecker = program.getTypeChecker();
var node = ts.getTouchingWord(sourceFile, position);
// Can only rename an identifier.
if (node && node.kind === 65 /* Identifier */) {
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
// Only allow a symbol to be renamed if it actually has at least one declaration.
if (symbol) {
var declarations = symbol.getDeclarations();
@@ -39147,19 +39428,19 @@ var ts;
if (defaultLibFileName) {
for (var _i = 0; _i < declarations.length; _i++) {
var current = declarations[_i];
- var sourceFile_1 = current.getSourceFile();
- if (sourceFile_1 && getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) {
+ var sourceFile_2 = current.getSourceFile();
+ if (sourceFile_2 && getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) {
return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key));
}
}
}
- var kind = getSymbolKind(symbol, typeInfoResolver, node);
+ var kind = getSymbolKind(symbol, node);
if (kind) {
return {
canRename: true,
localizedErrorMessage: undefined,
displayName: symbol.name,
- fullDisplayName: typeInfoResolver.getFullyQualifiedName(symbol),
+ fullDisplayName: typeChecker.getFullyQualifiedName(symbol),
kind: kind,
kindModifiers: getSymbolModifiers(symbol),
triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth())
@@ -39304,7 +39585,7 @@ var ts;
if (keyword2 === 116 /* GetKeyword */ ||
keyword2 === 120 /* SetKeyword */ ||
keyword2 === 114 /* ConstructorKeyword */ ||
- keyword2 === 110 /* StaticKeyword */) {
+ keyword2 === 109 /* StaticKeyword */) {
// Allow things like "public get", "public constructor" and "public static".
// These are all legal.
return true;
diff --git a/bin/typescriptServices.d.ts b/bin/typescriptServices.d.ts
index d988810fd3b..8903e33391b 100644
--- a/bin/typescriptServices.d.ts
+++ b/bin/typescriptServices.d.ts
@@ -124,16 +124,16 @@ declare module ts {
VoidKeyword = 99,
WhileKeyword = 100,
WithKeyword = 101,
- AsKeyword = 102,
- ImplementsKeyword = 103,
- InterfaceKeyword = 104,
- LetKeyword = 105,
- PackageKeyword = 106,
- PrivateKeyword = 107,
- ProtectedKeyword = 108,
- PublicKeyword = 109,
- StaticKeyword = 110,
- YieldKeyword = 111,
+ ImplementsKeyword = 102,
+ InterfaceKeyword = 103,
+ LetKeyword = 104,
+ PackageKeyword = 105,
+ PrivateKeyword = 106,
+ ProtectedKeyword = 107,
+ PublicKeyword = 108,
+ StaticKeyword = 109,
+ YieldKeyword = 110,
+ AsKeyword = 111,
AnyKeyword = 112,
BooleanKeyword = 113,
ConstructorKeyword = 114,
@@ -258,8 +258,8 @@ declare module ts {
LastReservedWord = 101,
FirstKeyword = 66,
LastKeyword = 125,
- FirstFutureReservedWord = 103,
- LastFutureReservedWord = 111,
+ FirstFutureReservedWord = 102,
+ LastFutureReservedWord = 110,
FirstTypeNode = 141,
LastTypeNode = 149,
FirstPunctuation = 14,
@@ -310,6 +310,7 @@ declare module ts {
}
interface Identifier extends PrimaryExpression {
text: string;
+ originalKeywordKind?: SyntaxKind;
}
interface QualifiedName extends Node {
left: EntityName;
@@ -1181,6 +1182,34 @@ declare module ts {
function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean;
function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean;
}
+declare module ts {
+ function getDefaultLibFileName(options: CompilerOptions): string;
+ function textSpanEnd(span: TextSpan): number;
+ function textSpanIsEmpty(span: TextSpan): boolean;
+ function textSpanContainsPosition(span: TextSpan, position: number): boolean;
+ function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean;
+ function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean;
+ function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan;
+ function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean;
+ function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean;
+ function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean;
+ function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan;
+ function createTextSpan(start: number, length: number): TextSpan;
+ function createTextSpanFromBounds(start: number, end: number): TextSpan;
+ function textChangeRangeNewSpan(range: TextChangeRange): TextSpan;
+ function textChangeRangeIsUnchanged(range: TextChangeRange): boolean;
+ function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange;
+ let unchangedTextChangeRange: TextChangeRange;
+ /**
+ * Called to merge all the changes that occurred across several versions of a script snapshot
+ * into a single change. i.e. if a user keeps making successive edits to a script we will
+ * have a text change from V1 to V2, V2 to V3, ..., Vn.
+ *
+ * This function will then merge those changes into a single change range valid between V1 and
+ * Vn.
+ */
+ function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange;
+}
declare module ts {
function getNodeConstructor(kind: SyntaxKind): new () => Node;
function createNode(kind: SyntaxKind): Node;
@@ -1260,7 +1289,6 @@ declare module ts {
getDocumentationComment(): SymbolDisplayPart[];
}
interface SourceFile {
- getNamedDeclarations(): Declaration[];
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
getLineStarts(): number[];
getPositionOfLineAndCharacter(line: number, character: number): number;
diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js
index 1c749f0d94a..57271ad41ac 100644
--- a/bin/typescriptServices.js
+++ b/bin/typescriptServices.js
@@ -128,17 +128,17 @@ var ts;
SyntaxKind[SyntaxKind["WhileKeyword"] = 100] = "WhileKeyword";
SyntaxKind[SyntaxKind["WithKeyword"] = 101] = "WithKeyword";
// Strict mode reserved words
- SyntaxKind[SyntaxKind["AsKeyword"] = 102] = "AsKeyword";
- SyntaxKind[SyntaxKind["ImplementsKeyword"] = 103] = "ImplementsKeyword";
- SyntaxKind[SyntaxKind["InterfaceKeyword"] = 104] = "InterfaceKeyword";
- SyntaxKind[SyntaxKind["LetKeyword"] = 105] = "LetKeyword";
- SyntaxKind[SyntaxKind["PackageKeyword"] = 106] = "PackageKeyword";
- SyntaxKind[SyntaxKind["PrivateKeyword"] = 107] = "PrivateKeyword";
- SyntaxKind[SyntaxKind["ProtectedKeyword"] = 108] = "ProtectedKeyword";
- SyntaxKind[SyntaxKind["PublicKeyword"] = 109] = "PublicKeyword";
- SyntaxKind[SyntaxKind["StaticKeyword"] = 110] = "StaticKeyword";
- SyntaxKind[SyntaxKind["YieldKeyword"] = 111] = "YieldKeyword";
+ SyntaxKind[SyntaxKind["ImplementsKeyword"] = 102] = "ImplementsKeyword";
+ SyntaxKind[SyntaxKind["InterfaceKeyword"] = 103] = "InterfaceKeyword";
+ SyntaxKind[SyntaxKind["LetKeyword"] = 104] = "LetKeyword";
+ SyntaxKind[SyntaxKind["PackageKeyword"] = 105] = "PackageKeyword";
+ SyntaxKind[SyntaxKind["PrivateKeyword"] = 106] = "PrivateKeyword";
+ SyntaxKind[SyntaxKind["ProtectedKeyword"] = 107] = "ProtectedKeyword";
+ SyntaxKind[SyntaxKind["PublicKeyword"] = 108] = "PublicKeyword";
+ SyntaxKind[SyntaxKind["StaticKeyword"] = 109] = "StaticKeyword";
+ SyntaxKind[SyntaxKind["YieldKeyword"] = 110] = "YieldKeyword";
// Contextual keywords
+ SyntaxKind[SyntaxKind["AsKeyword"] = 111] = "AsKeyword";
SyntaxKind[SyntaxKind["AnyKeyword"] = 112] = "AnyKeyword";
SyntaxKind[SyntaxKind["BooleanKeyword"] = 113] = "BooleanKeyword";
SyntaxKind[SyntaxKind["ConstructorKeyword"] = 114] = "ConstructorKeyword";
@@ -280,8 +280,8 @@ var ts;
SyntaxKind[SyntaxKind["LastReservedWord"] = 101] = "LastReservedWord";
SyntaxKind[SyntaxKind["FirstKeyword"] = 66] = "FirstKeyword";
SyntaxKind[SyntaxKind["LastKeyword"] = 125] = "LastKeyword";
- SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 103] = "FirstFutureReservedWord";
- SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 111] = "LastFutureReservedWord";
+ SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 102] = "FirstFutureReservedWord";
+ SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 110] = "LastFutureReservedWord";
SyntaxKind[SyntaxKind["FirstTypeNode"] = 141] = "FirstTypeNode";
SyntaxKind[SyntaxKind["LastTypeNode"] = 149] = "LastTypeNode";
SyntaxKind[SyntaxKind["FirstPunctuation"] = 14] = "FirstPunctuation";
@@ -1308,10 +1308,6 @@ var ts;
"\u2029": "\\u2029",
"\u0085": "\\u0085" // nextLine
};
- function getDefaultLibFileName(options) {
- return options.target === 2 /* ES6 */ ? "lib.es6.d.ts" : "lib.d.ts";
- }
- ts.getDefaultLibFileName = getDefaultLibFileName;
function Symbol(flags, name) {
this.flags = flags;
this.name = name;
@@ -1809,6 +1805,12 @@ var ts;
Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." },
Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." },
A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
+ Identifier_expected_0_is_a_reserved_word_in_strict_mode_External_Module_is_automatically_in_strict_mode: { code: 1214, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. External Module is automatically in strict mode." },
+ Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
+ Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
+ Type_expected_0_is_a_reserved_word_in_strict_mode_Module_is_automatically_in_strict_mode: { code: 1217, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Module is automatically in strict mode." },
Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@@ -2176,7 +2178,7 @@ var ts;
(function (ts) {
var textToToken = {
"any": 112 /* AnyKeyword */,
- "as": 102 /* AsKeyword */,
+ "as": 111 /* AsKeyword */,
"boolean": 113 /* BooleanKeyword */,
"break": 66 /* BreakKeyword */,
"case": 67 /* CaseKeyword */,
@@ -2201,24 +2203,24 @@ var ts;
"function": 83 /* FunctionKeyword */,
"get": 116 /* GetKeyword */,
"if": 84 /* IfKeyword */,
- "implements": 103 /* ImplementsKeyword */,
+ "implements": 102 /* ImplementsKeyword */,
"import": 85 /* ImportKeyword */,
"in": 86 /* InKeyword */,
"instanceof": 87 /* InstanceOfKeyword */,
- "interface": 104 /* InterfaceKeyword */,
- "let": 105 /* LetKeyword */,
+ "interface": 103 /* InterfaceKeyword */,
+ "let": 104 /* LetKeyword */,
"module": 117 /* ModuleKeyword */,
"new": 88 /* NewKeyword */,
"null": 89 /* NullKeyword */,
"number": 119 /* NumberKeyword */,
- "package": 106 /* PackageKeyword */,
- "private": 107 /* PrivateKeyword */,
- "protected": 108 /* ProtectedKeyword */,
- "public": 109 /* PublicKeyword */,
+ "package": 105 /* PackageKeyword */,
+ "private": 106 /* PrivateKeyword */,
+ "protected": 107 /* ProtectedKeyword */,
+ "public": 108 /* PublicKeyword */,
"require": 118 /* RequireKeyword */,
"return": 90 /* ReturnKeyword */,
"set": 120 /* SetKeyword */,
- "static": 110 /* StaticKeyword */,
+ "static": 109 /* StaticKeyword */,
"string": 121 /* StringKeyword */,
"super": 91 /* SuperKeyword */,
"switch": 92 /* SwitchKeyword */,
@@ -2233,7 +2235,7 @@ var ts;
"void": 99 /* VoidKeyword */,
"while": 100 /* WhileKeyword */,
"with": 101 /* WithKeyword */,
- "yield": 111 /* YieldKeyword */,
+ "yield": 110 /* YieldKeyword */,
"of": 125 /* OfKeyword */,
"{": 14 /* OpenBraceToken */,
"}": 15 /* CloseBraceToken */,
@@ -4331,13 +4333,12 @@ var ts;
};
}
ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain;
- /* @internal */
function getSpanOfTokenAtPosition(sourceFile, pos) {
var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text);
scanner.setTextPos(pos);
scanner.scan();
var start = scanner.getTokenPos();
- return createTextSpanFromBounds(start, scanner.getTextPos());
+ return ts.createTextSpanFromBounds(start, scanner.getTextPos());
}
ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition;
function getErrorSpanForNode(sourceFile, node) {
@@ -4347,7 +4348,7 @@ var ts;
var pos_1 = ts.skipTrivia(sourceFile.text, 0, false);
if (pos_1 === sourceFile.text.length) {
// file is empty - return span for the beginning of the file
- return createTextSpan(0, 0);
+ return ts.createTextSpan(0, 0);
}
return getSpanOfTokenAtPosition(sourceFile, pos_1);
// This list is a work in progress. Add missing node kinds to improve their error
@@ -4373,7 +4374,7 @@ var ts;
var pos = nodeIsMissing(errorNode)
? errorNode.pos
: ts.skipTrivia(sourceFile.text, errorNode.pos);
- return createTextSpanFromBounds(pos, errorNode.end);
+ return ts.createTextSpanFromBounds(pos, errorNode.end);
}
ts.getErrorSpanForNode = getErrorSpanForNode;
function isExternalModule(file) {
@@ -4482,7 +4483,6 @@ var ts;
}
}
ts.forEachReturnStatement = forEachReturnStatement;
- /* @internal */
function isVariableLike(node) {
if (node) {
switch (node.kind) {
@@ -5027,7 +5027,7 @@ var ts;
}
ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement;
function getClassImplementsHeritageClauseElements(node) {
- var heritageClause = getHeritageClause(node.heritageClauses, 103 /* ImplementsKeyword */);
+ var heritageClause = getHeritageClause(node.heritageClauses, 102 /* ImplementsKeyword */);
return heritageClause ? heritageClause.types : undefined;
}
ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements;
@@ -5157,10 +5157,10 @@ var ts;
ts.isESSymbolIdentifier = isESSymbolIdentifier;
function isModifier(token) {
switch (token) {
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
- case 110 /* StaticKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
+ case 109 /* StaticKeyword */:
case 78 /* ExportKeyword */:
case 115 /* DeclareKeyword */:
case 70 /* ConstKeyword */:
@@ -5170,205 +5170,6 @@ var ts;
return false;
}
ts.isModifier = isModifier;
- function textSpanEnd(span) {
- return span.start + span.length;
- }
- ts.textSpanEnd = textSpanEnd;
- function textSpanIsEmpty(span) {
- return span.length === 0;
- }
- ts.textSpanIsEmpty = textSpanIsEmpty;
- function textSpanContainsPosition(span, position) {
- return position >= span.start && position < textSpanEnd(span);
- }
- ts.textSpanContainsPosition = textSpanContainsPosition;
- // Returns true if 'span' contains 'other'.
- function textSpanContainsTextSpan(span, other) {
- return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
- }
- ts.textSpanContainsTextSpan = textSpanContainsTextSpan;
- function textSpanOverlapsWith(span, other) {
- var overlapStart = Math.max(span.start, other.start);
- var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
- return overlapStart < overlapEnd;
- }
- ts.textSpanOverlapsWith = textSpanOverlapsWith;
- function textSpanOverlap(span1, span2) {
- var overlapStart = Math.max(span1.start, span2.start);
- var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
- if (overlapStart < overlapEnd) {
- return createTextSpanFromBounds(overlapStart, overlapEnd);
- }
- return undefined;
- }
- ts.textSpanOverlap = textSpanOverlap;
- function textSpanIntersectsWithTextSpan(span, other) {
- return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start;
- }
- ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan;
- function textSpanIntersectsWith(span, start, length) {
- var end = start + length;
- return start <= textSpanEnd(span) && end >= span.start;
- }
- ts.textSpanIntersectsWith = textSpanIntersectsWith;
- function textSpanIntersectsWithPosition(span, position) {
- return position <= textSpanEnd(span) && position >= span.start;
- }
- ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition;
- function textSpanIntersection(span1, span2) {
- var intersectStart = Math.max(span1.start, span2.start);
- var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
- if (intersectStart <= intersectEnd) {
- return createTextSpanFromBounds(intersectStart, intersectEnd);
- }
- return undefined;
- }
- ts.textSpanIntersection = textSpanIntersection;
- function createTextSpan(start, length) {
- if (start < 0) {
- throw new Error("start < 0");
- }
- if (length < 0) {
- throw new Error("length < 0");
- }
- return { start: start, length: length };
- }
- ts.createTextSpan = createTextSpan;
- function createTextSpanFromBounds(start, end) {
- return createTextSpan(start, end - start);
- }
- ts.createTextSpanFromBounds = createTextSpanFromBounds;
- function textChangeRangeNewSpan(range) {
- return createTextSpan(range.span.start, range.newLength);
- }
- ts.textChangeRangeNewSpan = textChangeRangeNewSpan;
- function textChangeRangeIsUnchanged(range) {
- return textSpanIsEmpty(range.span) && range.newLength === 0;
- }
- ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged;
- function createTextChangeRange(span, newLength) {
- if (newLength < 0) {
- throw new Error("newLength < 0");
- }
- return { span: span, newLength: newLength };
- }
- ts.createTextChangeRange = createTextChangeRange;
- ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
- /**
- * Called to merge all the changes that occurred across several versions of a script snapshot
- * into a single change. i.e. if a user keeps making successive edits to a script we will
- * have a text change from V1 to V2, V2 to V3, ..., Vn.
- *
- * This function will then merge those changes into a single change range valid between V1 and
- * Vn.
- */
- function collapseTextChangeRangesAcrossMultipleVersions(changes) {
- if (changes.length === 0) {
- return ts.unchangedTextChangeRange;
- }
- if (changes.length === 1) {
- return changes[0];
- }
- // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd }
- // as it makes things much easier to reason about.
- var change0 = changes[0];
- var oldStartN = change0.span.start;
- var oldEndN = textSpanEnd(change0.span);
- var newEndN = oldStartN + change0.newLength;
- for (var i = 1; i < changes.length; i++) {
- var nextChange = changes[i];
- // Consider the following case:
- // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting
- // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }.
- // i.e. the span starting at 30 with length 30 is increased to length 40.
- //
- // 0 10 20 30 40 50 60 70 80 90 100
- // -------------------------------------------------------------------------------------------------------
- // | /
- // | /----
- // T1 | /----
- // | /----
- // | /----
- // -------------------------------------------------------------------------------------------------------
- // | \
- // | \
- // T2 | \
- // | \
- // | \
- // -------------------------------------------------------------------------------------------------------
- //
- // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial
- // it's just the min of the old and new starts. i.e.:
- //
- // 0 10 20 30 40 50 60 70 80 90 100
- // ------------------------------------------------------------*------------------------------------------
- // | /
- // | /----
- // T1 | /----
- // | /----
- // | /----
- // ----------------------------------------$-------------------$------------------------------------------
- // . | \
- // . | \
- // T2 . | \
- // . | \
- // . | \
- // ----------------------------------------------------------------------*--------------------------------
- //
- // (Note the dots represent the newly inferrred start.
- // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the
- // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see
- // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that
- // means:
- //
- // 0 10 20 30 40 50 60 70 80 90 100
- // --------------------------------------------------------------------------------*----------------------
- // | /
- // | /----
- // T1 | /----
- // | /----
- // | /----
- // ------------------------------------------------------------$------------------------------------------
- // . | \
- // . | \
- // T2 . | \
- // . | \
- // . | \
- // ----------------------------------------------------------------------*--------------------------------
- //
- // In other words (in this case), we're recognizing that the second edit happened after where the first edit
- // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started
- // that's the same as if we started at char 80 instead of 60.
- //
- // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter
- // than pusing the first edit forward to match the second, we'll push the second edit forward to match the
- // first.
- //
- // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange
- // semantics: { { start: 10, length: 70 }, newLength: 60 }
- //
- // The math then works out as follows.
- // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the
- // final result like so:
- //
- // {
- // oldStart3: Min(oldStart1, oldStart2),
- // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)),
- // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2))
- // }
- var oldStart1 = oldStartN;
- var oldEnd1 = oldEndN;
- var newEnd1 = newEndN;
- var oldStart2 = nextChange.span.start;
- var oldEnd2 = textSpanEnd(nextChange.span);
- var newEnd2 = oldStart2 + nextChange.newLength;
- oldStartN = Math.min(oldStart1, oldStart2);
- oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
- newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
- }
- return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
- }
- ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
function nodeStartsNewLexicalEnvironment(n) {
return isFunctionLike(n) || n.kind === 205 /* ModuleDeclaration */ || n.kind === 227 /* SourceFile */;
}
@@ -5385,7 +5186,6 @@ var ts;
return node;
}
ts.createSynthesizedNode = createSynthesizedNode;
- /* @internal */
function createDiagnosticCollection() {
var nonFileDiagnostics = [];
var fileDiagnostics = {};
@@ -5807,6 +5607,212 @@ var ts;
}
ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault;
})(ts || (ts = {}));
+var ts;
+(function (ts) {
+ function getDefaultLibFileName(options) {
+ return options.target === 2 /* ES6 */ ? "lib.es6.d.ts" : "lib.d.ts";
+ }
+ ts.getDefaultLibFileName = getDefaultLibFileName;
+ function textSpanEnd(span) {
+ return span.start + span.length;
+ }
+ ts.textSpanEnd = textSpanEnd;
+ function textSpanIsEmpty(span) {
+ return span.length === 0;
+ }
+ ts.textSpanIsEmpty = textSpanIsEmpty;
+ function textSpanContainsPosition(span, position) {
+ return position >= span.start && position < textSpanEnd(span);
+ }
+ ts.textSpanContainsPosition = textSpanContainsPosition;
+ // Returns true if 'span' contains 'other'.
+ function textSpanContainsTextSpan(span, other) {
+ return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
+ }
+ ts.textSpanContainsTextSpan = textSpanContainsTextSpan;
+ function textSpanOverlapsWith(span, other) {
+ var overlapStart = Math.max(span.start, other.start);
+ var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
+ return overlapStart < overlapEnd;
+ }
+ ts.textSpanOverlapsWith = textSpanOverlapsWith;
+ function textSpanOverlap(span1, span2) {
+ var overlapStart = Math.max(span1.start, span2.start);
+ var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
+ if (overlapStart < overlapEnd) {
+ return createTextSpanFromBounds(overlapStart, overlapEnd);
+ }
+ return undefined;
+ }
+ ts.textSpanOverlap = textSpanOverlap;
+ function textSpanIntersectsWithTextSpan(span, other) {
+ return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start;
+ }
+ ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan;
+ function textSpanIntersectsWith(span, start, length) {
+ var end = start + length;
+ return start <= textSpanEnd(span) && end >= span.start;
+ }
+ ts.textSpanIntersectsWith = textSpanIntersectsWith;
+ function textSpanIntersectsWithPosition(span, position) {
+ return position <= textSpanEnd(span) && position >= span.start;
+ }
+ ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition;
+ function textSpanIntersection(span1, span2) {
+ var intersectStart = Math.max(span1.start, span2.start);
+ var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
+ if (intersectStart <= intersectEnd) {
+ return createTextSpanFromBounds(intersectStart, intersectEnd);
+ }
+ return undefined;
+ }
+ ts.textSpanIntersection = textSpanIntersection;
+ function createTextSpan(start, length) {
+ if (start < 0) {
+ throw new Error("start < 0");
+ }
+ if (length < 0) {
+ throw new Error("length < 0");
+ }
+ return { start: start, length: length };
+ }
+ ts.createTextSpan = createTextSpan;
+ function createTextSpanFromBounds(start, end) {
+ return createTextSpan(start, end - start);
+ }
+ ts.createTextSpanFromBounds = createTextSpanFromBounds;
+ function textChangeRangeNewSpan(range) {
+ return createTextSpan(range.span.start, range.newLength);
+ }
+ ts.textChangeRangeNewSpan = textChangeRangeNewSpan;
+ function textChangeRangeIsUnchanged(range) {
+ return textSpanIsEmpty(range.span) && range.newLength === 0;
+ }
+ ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged;
+ function createTextChangeRange(span, newLength) {
+ if (newLength < 0) {
+ throw new Error("newLength < 0");
+ }
+ return { span: span, newLength: newLength };
+ }
+ ts.createTextChangeRange = createTextChangeRange;
+ ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
+ /**
+ * Called to merge all the changes that occurred across several versions of a script snapshot
+ * into a single change. i.e. if a user keeps making successive edits to a script we will
+ * have a text change from V1 to V2, V2 to V3, ..., Vn.
+ *
+ * This function will then merge those changes into a single change range valid between V1 and
+ * Vn.
+ */
+ function collapseTextChangeRangesAcrossMultipleVersions(changes) {
+ if (changes.length === 0) {
+ return ts.unchangedTextChangeRange;
+ }
+ if (changes.length === 1) {
+ return changes[0];
+ }
+ // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd }
+ // as it makes things much easier to reason about.
+ var change0 = changes[0];
+ var oldStartN = change0.span.start;
+ var oldEndN = textSpanEnd(change0.span);
+ var newEndN = oldStartN + change0.newLength;
+ for (var i = 1; i < changes.length; i++) {
+ var nextChange = changes[i];
+ // Consider the following case:
+ // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting
+ // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }.
+ // i.e. the span starting at 30 with length 30 is increased to length 40.
+ //
+ // 0 10 20 30 40 50 60 70 80 90 100
+ // -------------------------------------------------------------------------------------------------------
+ // | /
+ // | /----
+ // T1 | /----
+ // | /----
+ // | /----
+ // -------------------------------------------------------------------------------------------------------
+ // | \
+ // | \
+ // T2 | \
+ // | \
+ // | \
+ // -------------------------------------------------------------------------------------------------------
+ //
+ // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial
+ // it's just the min of the old and new starts. i.e.:
+ //
+ // 0 10 20 30 40 50 60 70 80 90 100
+ // ------------------------------------------------------------*------------------------------------------
+ // | /
+ // | /----
+ // T1 | /----
+ // | /----
+ // | /----
+ // ----------------------------------------$-------------------$------------------------------------------
+ // . | \
+ // . | \
+ // T2 . | \
+ // . | \
+ // . | \
+ // ----------------------------------------------------------------------*--------------------------------
+ //
+ // (Note the dots represent the newly inferrred start.
+ // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the
+ // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see
+ // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that
+ // means:
+ //
+ // 0 10 20 30 40 50 60 70 80 90 100
+ // --------------------------------------------------------------------------------*----------------------
+ // | /
+ // | /----
+ // T1 | /----
+ // | /----
+ // | /----
+ // ------------------------------------------------------------$------------------------------------------
+ // . | \
+ // . | \
+ // T2 . | \
+ // . | \
+ // . | \
+ // ----------------------------------------------------------------------*--------------------------------
+ //
+ // In other words (in this case), we're recognizing that the second edit happened after where the first edit
+ // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started
+ // that's the same as if we started at char 80 instead of 60.
+ //
+ // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter
+ // than pusing the first edit forward to match the second, we'll push the second edit forward to match the
+ // first.
+ //
+ // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange
+ // semantics: { { start: 10, length: 70 }, newLength: 60 }
+ //
+ // The math then works out as follows.
+ // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the
+ // final result like so:
+ //
+ // {
+ // oldStart3: Min(oldStart1, oldStart2),
+ // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)),
+ // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2))
+ // }
+ var oldStart1 = oldStartN;
+ var oldEnd1 = oldEndN;
+ var newEnd1 = newEndN;
+ var oldStart2 = nextChange.span.start;
+ var oldEnd2 = textSpanEnd(nextChange.span);
+ var newEnd2 = oldStart2 + nextChange.newLength;
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+ return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
+ }
+ ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions;
+})(ts || (ts = {}));
///
///
var ts;
@@ -6183,10 +6189,10 @@ var ts;
;
function modifierToFlag(token) {
switch (token) {
- case 110 /* StaticKeyword */: return 128 /* Static */;
- case 109 /* PublicKeyword */: return 16 /* Public */;
- case 108 /* ProtectedKeyword */: return 64 /* Protected */;
- case 107 /* PrivateKeyword */: return 32 /* Private */;
+ case 109 /* StaticKeyword */: return 128 /* Static */;
+ case 108 /* PublicKeyword */: return 16 /* Public */;
+ case 107 /* ProtectedKeyword */: return 64 /* Protected */;
+ case 106 /* PrivateKeyword */: return 32 /* Private */;
case 78 /* ExportKeyword */: return 1 /* Export */;
case 115 /* DeclareKeyword */: return 2 /* Ambient */;
case 70 /* ConstKeyword */: return 8192 /* Const */;
@@ -6995,16 +7001,17 @@ var ts;
function tryParse(callback) {
return speculationHelper(callback, false);
}
+ // Ignore strict mode flag because we will report an error in type checker instead.
function isIdentifier() {
if (token === 65 /* Identifier */) {
return true;
}
// If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is
// considered a keyword and is not an identifier.
- if (token === 111 /* YieldKeyword */ && inYieldContext()) {
+ if (token === 110 /* YieldKeyword */ && inYieldContext()) {
return false;
}
- return inStrictModeContext() ? token > 111 /* LastFutureReservedWord */ : token > 101 /* LastReservedWord */;
+ return token > 101 /* LastReservedWord */;
}
function parseExpected(kind, diagnosticMessage) {
if (token === kind) {
@@ -7108,6 +7115,10 @@ var ts;
identifierCount++;
if (isIdentifier) {
var node = createNode(65 /* Identifier */);
+ // Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
+ if (token !== 65 /* Identifier */) {
+ node.originalKeywordKind = token;
+ }
node.text = internIdentifier(scanner.getTokenValue());
nextToken();
return finishNode(node);
@@ -7275,7 +7286,7 @@ var ts;
// extends {} extends
// extends {} implements
var next = nextToken();
- return next === 23 /* CommaToken */ || next === 14 /* OpenBraceToken */ || next === 79 /* ExtendsKeyword */ || next === 103 /* ImplementsKeyword */;
+ return next === 23 /* CommaToken */ || next === 14 /* OpenBraceToken */ || next === 79 /* ExtendsKeyword */ || next === 102 /* ImplementsKeyword */;
}
return true;
}
@@ -7284,7 +7295,7 @@ var ts;
return isIdentifier();
}
function isHeritageClauseExtendsOrImplementsKeyword() {
- if (token === 103 /* ImplementsKeyword */ ||
+ if (token === 102 /* ImplementsKeyword */ ||
token === 79 /* ExtendsKeyword */) {
return lookAhead(nextTokenIsStartOfExpression);
}
@@ -7314,12 +7325,12 @@ var ts;
case 4 /* SwitchClauseStatements */:
return token === 15 /* CloseBraceToken */ || token === 67 /* CaseKeyword */ || token === 73 /* DefaultKeyword */;
case 8 /* HeritageClauseElement */:
- return token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 103 /* ImplementsKeyword */;
+ return token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */;
case 9 /* VariableDeclarations */:
return isVariableDeclaratorListTerminator();
case 16 /* TypeParameters */:
// Tokens other than '>' are here for better error recovery
- return token === 25 /* GreaterThanToken */ || token === 16 /* OpenParenToken */ || token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 103 /* ImplementsKeyword */;
+ return token === 25 /* GreaterThanToken */ || token === 16 /* OpenParenToken */ || token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */;
case 12 /* ArgumentExpressions */:
// Tokens other than ')' are here for better error recovery
return token === 17 /* CloseParenToken */ || token === 22 /* SemicolonToken */;
@@ -8356,7 +8367,7 @@ var ts;
case 38 /* PlusPlusToken */:
case 39 /* MinusMinusToken */:
case 24 /* LessThanToken */:
- case 111 /* YieldKeyword */:
+ case 110 /* YieldKeyword */:
// Yield always starts an expression. Either it is an identifier (in which case
// it is definitely an expression). Or it's a keyword (either because we're in
// a generator, or in strict mode (or both)) and it started a yield expression.
@@ -8471,7 +8482,7 @@ var ts;
return parseConditionalExpressionRest(expr);
}
function isYieldExpression() {
- if (token === 111 /* YieldKeyword */) {
+ if (token === 110 /* YieldKeyword */) {
// If we have a 'yield' keyword, and htis is a context where yield expressions are
// allowed, then definitely parse out a yield expression.
if (inYieldContext()) {
@@ -9312,7 +9323,7 @@ var ts;
parseExpected(16 /* OpenParenToken */);
var initializer = undefined;
if (token !== 22 /* SemicolonToken */) {
- if (token === 98 /* VarKeyword */ || token === 105 /* LetKeyword */ || token === 70 /* ConstKeyword */) {
+ if (token === 98 /* VarKeyword */ || token === 104 /* LetKeyword */ || token === 70 /* ConstKeyword */) {
initializer = parseVariableDeclarationList(true);
}
else {
@@ -9496,7 +9507,7 @@ var ts;
return !inErrorRecovery;
case 14 /* OpenBraceToken */:
case 98 /* VarKeyword */:
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
case 83 /* FunctionKeyword */:
case 69 /* ClassKeyword */:
case 84 /* IfKeyword */:
@@ -9522,7 +9533,7 @@ var ts;
// In ES 6 'enum' is a future reserved keyword, so it should not be used as identifier
var isConstEnum = lookAhead(nextTokenIsEnumKeyword);
return !isConstEnum;
- case 104 /* InterfaceKeyword */:
+ case 103 /* InterfaceKeyword */:
case 117 /* ModuleKeyword */:
case 77 /* EnumKeyword */:
case 123 /* TypeKeyword */:
@@ -9531,10 +9542,10 @@ var ts;
if (isDeclarationStart()) {
return false;
}
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
- case 110 /* StaticKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
+ case 109 /* StaticKeyword */:
// When followed by an identifier or keyword, these do not start a statement but
// might instead be following type members
if (lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine)) {
@@ -9593,7 +9604,7 @@ var ts;
return parseTryStatement();
case 72 /* DebuggerKeyword */:
return parseDebuggerStatement();
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
// If let follows identifier on the same line, it is declaration parse it as variable statement
if (isLetDeclaration()) {
return parseVariableStatement(scanner.getStartPos(), undefined, undefined);
@@ -9628,7 +9639,7 @@ var ts;
return undefined;
}
return parseVariableStatement(start, decorators, modifiers);
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
if (!isLetDeclaration()) {
return undefined;
}
@@ -9715,7 +9726,7 @@ var ts;
switch (token) {
case 98 /* VarKeyword */:
break;
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
node.flags |= 4096 /* Let */;
break;
case 70 /* ConstKeyword */:
@@ -9823,6 +9834,17 @@ var ts;
node.body = parseFunctionBlockOrSemicolon(false);
return finishNode(node);
}
+ function isClassMemberModifier(idToken) {
+ switch (idToken) {
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
+ case 109 /* StaticKeyword */:
+ return true;
+ default:
+ return false;
+ }
+ }
function isClassMemberStart() {
var idToken;
if (token === 52 /* AtToken */) {
@@ -9831,6 +9853,15 @@ var ts;
// Eat up all modifiers, but hold on to the last one in case it is actually an identifier.
while (ts.isModifier(token)) {
idToken = token;
+ // If the idToken is a class modifier (protected, private, public, and static), it is
+ // certain that we are starting to parse class member. This allows better error recovery
+ // Example:
+ // public foo() ... // true
+ // public @dec blah ... // true; we will then report an error later
+ // export public ... // true; we will then report an error later
+ if (isClassMemberModifier(idToken)) {
+ return true;
+ }
nextToken();
}
if (token === 35 /* AsteriskToken */) {
@@ -10001,7 +10032,7 @@ var ts;
return parseList(19 /* HeritageClauses */, false, parseHeritageClause);
}
function parseHeritageClause() {
- if (token === 79 /* ExtendsKeyword */ || token === 103 /* ImplementsKeyword */) {
+ if (token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */) {
var node = createNode(222 /* HeritageClause */);
node.token = token;
nextToken();
@@ -10019,7 +10050,7 @@ var ts;
return finishNode(node);
}
function isHeritageClause() {
- return token === 79 /* ExtendsKeyword */ || token === 103 /* ImplementsKeyword */;
+ return token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */;
}
function parseClassMembers() {
return parseList(6 /* ClassMembers */, false, parseClassElement);
@@ -10028,7 +10059,7 @@ var ts;
var node = createNode(202 /* InterfaceDeclaration */, fullStart);
node.decorators = decorators;
setModifiers(node, modifiers);
- parseExpected(104 /* InterfaceKeyword */);
+ parseExpected(103 /* InterfaceKeyword */);
node.name = parseIdentifier();
node.typeParameters = parseTypeParameters();
node.heritageClauses = parseHeritageClauses(false);
@@ -10207,7 +10238,7 @@ var ts;
// * as ImportedBinding
var namespaceImport = createNode(211 /* NamespaceImport */);
parseExpected(35 /* AsteriskToken */);
- parseExpected(102 /* AsKeyword */);
+ parseExpected(111 /* AsKeyword */);
namespaceImport.name = parseIdentifier();
return finishNode(namespaceImport);
}
@@ -10241,9 +10272,9 @@ var ts;
var checkIdentifierStart = scanner.getTokenPos();
var checkIdentifierEnd = scanner.getTextPos();
var identifierName = parseIdentifierName();
- if (token === 102 /* AsKeyword */) {
+ if (token === 111 /* AsKeyword */) {
node.propertyName = identifierName;
- parseExpected(102 /* AsKeyword */);
+ parseExpected(111 /* AsKeyword */);
checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier();
checkIdentifierStart = scanner.getTokenPos();
checkIdentifierEnd = scanner.getTextPos();
@@ -10300,10 +10331,10 @@ var ts;
case 70 /* ConstKeyword */:
case 83 /* FunctionKeyword */:
return true;
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
return isLetDeclaration();
case 69 /* ClassKeyword */:
- case 104 /* InterfaceKeyword */:
+ case 103 /* InterfaceKeyword */:
case 77 /* EnumKeyword */:
case 123 /* TypeKeyword */:
// Not true keywords so ensure an identifier follows
@@ -10318,10 +10349,10 @@ var ts;
// Check for export assignment or modifier on source element
return lookAhead(nextTokenCanFollowExportKeyword);
case 115 /* DeclareKeyword */:
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
- case 110 /* StaticKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
+ case 109 /* StaticKeyword */:
// Check for modifier on source element
return lookAhead(nextTokenIsDeclarationStart);
case 52 /* AtToken */:
@@ -10356,7 +10387,7 @@ var ts;
return isDeclarationStart(true);
}
function nextTokenIsAsKeyword() {
- return nextToken() === 102 /* AsKeyword */;
+ return nextToken() === 111 /* AsKeyword */;
}
function parseDeclaration() {
var fullStart = getNodePos();
@@ -10373,14 +10404,14 @@ var ts;
}
switch (token) {
case 98 /* VarKeyword */:
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
case 70 /* ConstKeyword */:
return parseVariableStatement(fullStart, decorators, modifiers);
case 83 /* FunctionKeyword */:
return parseFunctionDeclaration(fullStart, decorators, modifiers);
case 69 /* ClassKeyword */:
return parseClassDeclaration(fullStart, decorators, modifiers);
- case 104 /* InterfaceKeyword */:
+ case 103 /* InterfaceKeyword */:
return parseInterfaceDeclaration(fullStart, decorators, modifiers);
case 123 /* TypeKeyword */:
return parseTypeAliasDeclaration(fullStart, decorators, modifiers);
@@ -13201,15 +13232,16 @@ var ts;
return result;
}
function getPropertiesOfType(type) {
- if (type.flags & 16384 /* Union */) {
- return getPropertiesOfUnionType(type);
- }
- return getPropertiesOfObjectType(getApparentType(type));
+ type = getApparentType(type);
+ return type.flags & 16384 /* Union */ ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type);
}
// For a type parameter, return the base constraint of the type parameter. For the string, number,
// boolean, and symbol primitive types, return the corresponding object types. Otherwise return the
// type itself. Note that the apparent type of a union type is the union type itself.
function getApparentType(type) {
+ if (type.flags & 16384 /* Union */) {
+ type = getReducedTypeOfUnionType(type);
+ }
if (type.flags & 512 /* TypeParameter */) {
do {
type = getConstraintOfTypeParameter(type);
@@ -13281,28 +13313,27 @@ var ts;
// necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from
// Object and Function as appropriate.
function getPropertyOfType(type, name) {
+ type = getApparentType(type);
+ if (type.flags & 48128 /* ObjectType */) {
+ var resolved = resolveObjectOrUnionTypeMembers(type);
+ if (ts.hasProperty(resolved.members, name)) {
+ var symbol = resolved.members[name];
+ if (symbolIsValue(symbol)) {
+ return symbol;
+ }
+ }
+ if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
+ var symbol = getPropertyOfObjectType(globalFunctionType, name);
+ if (symbol) {
+ return symbol;
+ }
+ }
+ return getPropertyOfObjectType(globalObjectType, name);
+ }
if (type.flags & 16384 /* Union */) {
return getPropertyOfUnionType(type, name);
}
- if (!(type.flags & 48128 /* ObjectType */)) {
- type = getApparentType(type);
- if (!(type.flags & 48128 /* ObjectType */)) {
- return undefined;
- }
- }
- var resolved = resolveObjectOrUnionTypeMembers(type);
- if (ts.hasProperty(resolved.members, name)) {
- var symbol = resolved.members[name];
- if (symbolIsValue(symbol)) {
- return symbol;
- }
- }
- if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
- var symbol = getPropertyOfObjectType(globalFunctionType, name);
- if (symbol)
- return symbol;
- }
- return getPropertyOfObjectType(globalObjectType, name);
+ return undefined;
}
function getSignaturesOfObjectOrUnionType(type, kind) {
if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) {
@@ -13825,6 +13856,10 @@ var ts;
}
}
}
+ // The noSubtypeReduction flag is there because it isn't possible to always do subtype reduction. The flag
+ // is true when creating a union type from a type node and when instantiating a union type. In both of those
+ // cases subtype reduction has to be deferred to properly support recursive union types. For example, a
+ // type alias of the form "type Item = string | (() => Item)" cannot be reduced during its declaration.
function getUnionType(types, noSubtypeReduction) {
if (types.length === 0) {
return emptyObjectType;
@@ -13849,9 +13884,17 @@ var ts;
if (!type) {
type = unionTypes[id] = createObjectType(16384 /* Union */ | getWideningFlagsOfTypes(sortedTypes));
type.types = sortedTypes;
+ type.reducedType = noSubtypeReduction ? undefined : type;
}
return type;
}
+ function getReducedTypeOfUnionType(type) {
+ // If union type was created without subtype reduction, perform the deferred reduction now
+ if (!type.reducedType) {
+ type.reducedType = getUnionType(type.types, false);
+ }
+ return type.reducedType;
+ }
function getTypeFromUnionTypeNode(node) {
var links = getNodeLinks(node);
if (!links.resolvedType) {
@@ -17230,7 +17273,7 @@ var ts;
function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) {
ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
// Grammar checking
- var hasGrammarError = checkGrammarFunctionLikeDeclaration(node);
+ var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node);
if (!hasGrammarError && node.kind === 162 /* FunctionExpression */) {
checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node);
}
@@ -17272,7 +17315,7 @@ var ts;
}
function checkFunctionExpressionOrObjectLiteralMethodBody(node) {
ts.Debug.assert(node.kind !== 134 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
- if (node.type) {
+ if (node.type && !node.asteriskToken) {
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type));
}
if (node.body) {
@@ -17834,6 +17877,7 @@ var ts;
return type;
}
function checkExpression(node, contextualMapper) {
+ checkGrammarIdentifierInStrictMode(node);
return checkExpressionOrQualifiedName(node, contextualMapper);
}
// Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When
@@ -17941,6 +17985,7 @@ var ts;
}
// DECLARATION AND STATEMENT TYPE CHECKING
function checkTypeParameter(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
// Grammar Checking
if (node.expression) {
grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected);
@@ -18172,9 +18217,11 @@ var ts;
checkDecorators(node);
}
function checkTypeReferenceNode(node) {
+ checkGrammarTypeReferenceInStrictMode(node.typeName);
return checkTypeReferenceOrHeritageClauseElement(node);
}
function checkHeritageClauseElement(node) {
+ checkGrammarHeritageClauseElementInStrictMode(node.expression);
return checkTypeReferenceOrHeritageClauseElement(node);
}
function checkTypeReferenceOrHeritageClauseElement(node) {
@@ -18648,6 +18695,7 @@ var ts;
}
}
function checkFunctionLikeDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
checkDecorators(node);
checkSignatureDeclaration(node);
// Do not use hasDynamicName here, because that returns false for well known symbols.
@@ -18678,7 +18726,7 @@ var ts;
}
}
checkSourceElement(node.body);
- if (node.type && !isAccessor(node.kind)) {
+ if (node.type && !isAccessor(node.kind) && !node.asteriskToken) {
checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNodeOrHeritageClauseElement(node.type));
}
// Report an implicit any error if there is no body, no explicit return type, and node is not a private method
@@ -18891,6 +18939,7 @@ var ts;
}
// Check variable, parameter, or property declaration
function checkVariableLikeDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
checkDecorators(node);
checkSourceElement(node.type);
// For a computed property, just check the initializer and exit
@@ -19120,7 +19169,10 @@ var ts;
return checkElementTypeOfArrayOrString(inputType, errorNode);
}
if (isArrayLikeType(inputType)) {
- return getIndexTypeOfType(inputType, 1 /* Number */);
+ var indexType = getIndexTypeOfType(inputType, 1 /* Number */);
+ if (indexType) {
+ return indexType;
+ }
}
error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType));
return unknownType;
@@ -19521,6 +19573,7 @@ var ts;
return unknownType;
}
function checkClassDeclaration(node) {
+ checkGrammarDeclarationNameInStrictMode(node);
// Grammar checking
if (node.parent.kind !== 206 /* ModuleBlock */ && node.parent.kind !== 227 /* SourceFile */) {
grammarErrorOnNode(node, ts.Diagnostics.class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration);
@@ -19721,7 +19774,7 @@ var ts;
}
function checkInterfaceDeclaration(node) {
// Grammar checking
- checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node);
checkTypeParameters(node.typeParameters);
if (produceDiagnostics) {
checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0);
@@ -19921,7 +19974,7 @@ var ts;
return;
}
// Grammar checking
- checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node);
checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0);
checkCollisionWithCapturedThisVariable(node, node.name);
checkCollisionWithRequireExportsInGeneratedCode(node, node.name);
@@ -19983,7 +20036,7 @@ var ts;
function checkModuleDeclaration(node) {
if (produceDiagnostics) {
// Grammar checking
- if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node)) {
+ if (!checkGrammarDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node)) {
if (!ts.isInAmbientContext(node) && node.name.kind === 8 /* StringLiteral */) {
grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names);
}
@@ -20078,7 +20131,7 @@ var ts;
checkAliasSymbol(node);
}
function checkImportDeclaration(node) {
- if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) {
+ if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) {
grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers);
}
if (checkExternalImportOrExportDeclaration(node)) {
@@ -20099,7 +20152,7 @@ var ts;
}
}
function checkImportEqualsDeclaration(node) {
- checkGrammarDecorators(node) || checkGrammarModifiers(node);
+ checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node);
if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
checkImportBinding(node);
if (node.flags & 1 /* Export */) {
@@ -20418,6 +20471,8 @@ var ts;
// Grammar checking
checkGrammarSourceFile(node);
emitExtends = false;
+ emitDecorate = false;
+ emitParam = false;
potentialThisCollisions.length = 0;
ts.forEach(node.statements, checkSourceElement);
checkFunctionExpressionBodies(node);
@@ -21346,6 +21401,137 @@ var ts;
anyArrayType = createArrayType(anyType);
}
// GRAMMAR CHECKING
+ function isReservedwordInStrictMode(node) {
+ // Check that originalKeywordKind is less than LastFurtureReservedWord to see if an Identifier is a strict-mode reserved word
+ return (node.parserContextFlags & 1 /* StrictMode */) &&
+ (node.originalKeywordKind >= 102 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 110 /* LastFutureReservedWord */);
+ }
+ function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) {
+ // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.)
+ // if so, we would like to give more explicit invalid usage error.
+ if (ts.getAncestor(identifier, 201 /* ClassDeclaration */) || ts.getAncestor(identifier, 174 /* ClassExpression */)) {
+ return grammarErrorOnNode(identifier, message, arg0);
+ }
+ return false;
+ }
+ function checkGrammarImportDeclarationNameInStrictMode(node) {
+ // Check if the import declaration used strict-mode reserved word in its names bindings
+ if (node.importClause) {
+ var impotClause = node.importClause;
+ if (impotClause.namedBindings) {
+ var nameBindings = impotClause.namedBindings;
+ if (nameBindings.kind === 211 /* NamespaceImport */) {
+ var name_11 = nameBindings.name;
+ if (name_11.originalKeywordKind) {
+ var nameText = ts.declarationNameToString(name_11);
+ return grammarErrorOnNode(name_11, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ else if (nameBindings.kind === 212 /* NamedImports */) {
+ var reportError = false;
+ for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) {
+ var element = _a[_i];
+ var name_12 = element.name;
+ if (name_12.originalKeywordKind) {
+ var nameText = ts.declarationNameToString(name_12);
+ reportError = reportError || grammarErrorOnNode(name_12, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ return reportError;
+ }
+ }
+ }
+ return false;
+ }
+ function checkGrammarDeclarationNameInStrictMode(node) {
+ var name = node.name;
+ if (name && name.kind === 65 /* Identifier */ && isReservedwordInStrictMode(name)) {
+ var nameText = ts.declarationNameToString(name);
+ switch (node.kind) {
+ case 129 /* Parameter */:
+ case 198 /* VariableDeclaration */:
+ case 200 /* FunctionDeclaration */:
+ case 128 /* TypeParameter */:
+ case 152 /* BindingElement */:
+ case 202 /* InterfaceDeclaration */:
+ case 203 /* TypeAliasDeclaration */:
+ case 204 /* EnumDeclaration */:
+ return checkGrammarIdentifierInStrictMode(name);
+ case 201 /* ClassDeclaration */:
+ // Report an error if the class declaration uses strict-mode reserved word.
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText);
+ case 205 /* ModuleDeclaration */:
+ // Report an error if the module declaration uses strict-mode reserved word.
+ // TODO(yuisu): fix this when having external module in strict mode
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ case 208 /* ImportEqualsDeclaration */:
+ // TODO(yuisu): fix this when having external module in strict mode
+ return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ }
+ }
+ return false;
+ }
+ function checkGrammarTypeReferenceInStrictMode(typeName) {
+ // Check if the type reference is using strict mode keyword
+ // Example:
+ // class C {
+ // foo(x: public){} // Error.
+ // }
+ if (typeName.kind === 65 /* Identifier */) {
+ checkGrammarTypeNameInStrictMode(typeName);
+ }
+ else if (typeName.kind === 126 /* QualifiedName */) {
+ // Walk from right to left and report a possible error at each Identifier in QualifiedName
+ // Example:
+ // x1: public.private.package // error at public and private
+ checkGrammarTypeNameInStrictMode(typeName.right);
+ checkGrammarTypeReferenceInStrictMode(typeName.left);
+ }
+ }
+ // This function will report an error for every identifier in property access expression
+ // whether it violates strict mode reserved words.
+ // Example:
+ // public // error at public
+ // public.private.package // error at public
+ // B.private.B // no error
+ function checkGrammarHeritageClauseElementInStrictMode(expression) {
+ // Example:
+ // class C extends public // error at public
+ if (expression && expression.kind === 65 /* Identifier */) {
+ return checkGrammarIdentifierInStrictMode(expression);
+ }
+ else if (expression && expression.kind === 155 /* PropertyAccessExpression */) {
+ // Walk from left to right in PropertyAccessExpression until we are at the left most expression
+ // in PropertyAccessExpression. According to grammar production of MemberExpression,
+ // the left component expression is a PrimaryExpression (i.e. Identifier) while the other
+ // component after dots can be IdentifierName.
+ checkGrammarHeritageClauseElementInStrictMode(expression.expression);
+ }
+ }
+ // The function takes an identifier itself or an expression which has SyntaxKind.Identifier.
+ function checkGrammarIdentifierInStrictMode(node, nameText) {
+ if (node && node.kind === 65 /* Identifier */ && isReservedwordInStrictMode(node)) {
+ if (!nameText) {
+ nameText = ts.declarationNameToString(node);
+ }
+ // TODO (yuisu): Fix when module is a strict mode
+ var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) ||
+ grammarErrorOnNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ return errorReport;
+ }
+ return false;
+ }
+ // The function takes an identifier when uses as a typeName in TypeReferenceNode
+ function checkGrammarTypeNameInStrictMode(node) {
+ if (node && node.kind === 65 /* Identifier */ && isReservedwordInStrictMode(node)) {
+ var nameText = ts.declarationNameToString(node);
+ // TODO (yuisu): Fix when module is a strict mode
+ var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) ||
+ grammarErrorOnNode(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode, nameText);
+ return errorReport;
+ }
+ return false;
+ }
function checkGrammarDecorators(node) {
if (!node.decorators) {
return false;
@@ -21398,14 +21584,14 @@ var ts;
for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) {
var modifier = _a[_i];
switch (modifier.kind) {
- case 109 /* PublicKeyword */:
- case 108 /* ProtectedKeyword */:
- case 107 /* PrivateKeyword */:
+ case 108 /* PublicKeyword */:
+ case 107 /* ProtectedKeyword */:
+ case 106 /* PrivateKeyword */:
var text = void 0;
- if (modifier.kind === 109 /* PublicKeyword */) {
+ if (modifier.kind === 108 /* PublicKeyword */) {
text = "public";
}
- else if (modifier.kind === 108 /* ProtectedKeyword */) {
+ else if (modifier.kind === 107 /* ProtectedKeyword */) {
text = "protected";
lastProtected = modifier;
}
@@ -21424,7 +21610,7 @@ var ts;
}
flags |= ts.modifierToFlag(modifier.kind);
break;
- case 110 /* StaticKeyword */:
+ case 109 /* StaticKeyword */:
if (flags & 128 /* Static */) {
return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static");
}
@@ -21656,7 +21842,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 103 /* ImplementsKeyword */);
+ ts.Debug.assert(heritageClause.token === 102 /* ImplementsKeyword */);
if (seenImplementsClause) {
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen);
}
@@ -21679,7 +21865,7 @@ var ts;
seenExtendsClause = true;
}
else {
- ts.Debug.assert(heritageClause.token === 103 /* ImplementsKeyword */);
+ ts.Debug.assert(heritageClause.token === 102 /* ImplementsKeyword */);
return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);
}
// Grammar checking heritageClause inside class declaration
@@ -21721,11 +21907,11 @@ var ts;
var inStrictMode = (node.parserContextFlags & 1 /* StrictMode */) !== 0;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
- var name_11 = prop.name;
+ var name_13 = prop.name;
if (prop.kind === 175 /* OmittedExpression */ ||
- name_11.kind === 127 /* ComputedPropertyName */) {
+ name_13.kind === 127 /* ComputedPropertyName */) {
// If the name is not a ComputedPropertyName, the grammar checking will skip it
- checkGrammarComputedPropertyName(name_11);
+ checkGrammarComputedPropertyName(name_13);
continue;
}
// ECMA-262 11.1.5 Object Initialiser
@@ -21740,8 +21926,8 @@ var ts;
if (prop.kind === 224 /* PropertyAssignment */ || prop.kind === 225 /* ShorthandPropertyAssignment */) {
// Grammar checking for computedPropertName and shorthandPropertyAssignment
checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional);
- if (name_11.kind === 7 /* NumericLiteral */) {
- checkGrammarNumbericLiteral(name_11);
+ if (name_13.kind === 7 /* NumericLiteral */) {
+ checkGrammarNumbericLiteral(name_13);
}
currentKind = Property;
}
@@ -21757,26 +21943,26 @@ var ts;
else {
ts.Debug.fail("Unexpected syntax kind:" + prop.kind);
}
- if (!ts.hasProperty(seen, name_11.text)) {
- seen[name_11.text] = currentKind;
+ if (!ts.hasProperty(seen, name_13.text)) {
+ seen[name_13.text] = currentKind;
}
else {
- var existingKind = seen[name_11.text];
+ var existingKind = seen[name_13.text];
if (currentKind === Property && existingKind === Property) {
if (inStrictMode) {
- grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode);
+ grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode);
}
}
else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) {
if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) {
- seen[name_11.text] = currentKind | existingKind;
+ seen[name_13.text] = currentKind | existingKind;
}
else {
- return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
+ return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);
}
}
else {
- return grammarErrorOnNode(name_11, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
+ return grammarErrorOnNode(name_13, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);
}
}
}
@@ -22124,15 +22310,14 @@ var ts;
var identifier = name;
if (contextNode && (contextNode.parserContextFlags & 1 /* StrictMode */) && ts.isEvalOrArgumentsIdentifier(identifier)) {
var nameText = ts.declarationNameToString(identifier);
- // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.)
- // if so, we would like to give more explicit invalid usage error.
- // This will be particularly helpful in the case of "arguments" as such case is very common mistake.
- if (ts.getAncestor(name, 201 /* ClassDeclaration */) || ts.getAncestor(name, 174 /* ClassExpression */)) {
- return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText);
- }
- else {
+ // We check first if the name is inside class declaration or class expression; if so give explicit message
+ // otherwise report generic error message.
+ // reportGrammarErrorInClassDeclaration only return true if grammar error is successfully reported and false otherwise
+ var reportErrorInClassDeclaration = reportStrictModeGrammarErrorInClassDeclaration(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText);
+ if (!reportErrorInClassDeclaration) {
return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText);
}
+ return reportErrorInClassDeclaration;
}
}
}
@@ -22631,9 +22816,9 @@ var ts;
}
var count = 0;
while (true) {
- var name_12 = baseName + "_" + (++count);
- if (!ts.hasProperty(currentSourceFile.identifiers, name_12)) {
- return name_12;
+ var name_14 = baseName + "_" + (++count);
+ if (!ts.hasProperty(currentSourceFile.identifiers, name_14)) {
+ return name_14;
}
}
}
@@ -23835,9 +24020,9 @@ var ts;
tempFlags++;
// Skip over 'i' and 'n'
if (count !== 8 && count !== 13) {
- var name_13 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26);
- if (isUniqueName(name_13)) {
- return name_13;
+ var name_15 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26);
+ if (isUniqueName(name_15)) {
+ return name_15;
}
}
}
@@ -23870,9 +24055,9 @@ var ts;
}
function generateNameForModuleOrEnum(node) {
if (node.name.kind === 65 /* Identifier */) {
- var name_14 = node.name.text;
+ var name_16 = node.name.text;
// Use module/enum name itself if it is unique, otherwise make a unique variation
- assignGeneratedName(node, isUniqueLocalName(name_14, node) ? name_14 : makeUniqueName(name_14));
+ assignGeneratedName(node, isUniqueLocalName(name_16, node) ? name_16 : makeUniqueName(name_16));
}
}
function generateNameForImportOrExportDeclaration(node) {
@@ -24085,8 +24270,8 @@ var ts;
// Child scopes are always shown with a dot (even if they have no name),
// unless it is a computed property. Then it is shown with brackets,
// but the brackets are included in the name.
- var name_15 = node.name;
- if (!name_15 || name_15.kind !== 127 /* ComputedPropertyName */) {
+ var name_17 = node.name;
+ if (!name_17 || name_17.kind !== 127 /* ComputedPropertyName */) {
scopeName = "." + scopeName;
}
scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName;
@@ -24115,10 +24300,10 @@ var ts;
node.kind === 204 /* EnumDeclaration */) {
// Declaration and has associated name use it
if (node.name) {
- var name_16 = node.name;
+ var name_18 = node.name;
// For computed property names, the text will include the brackets
- scopeName = name_16.kind === 127 /* ComputedPropertyName */
- ? ts.getTextOfNode(name_16)
+ scopeName = name_18.kind === 127 /* ComputedPropertyName */
+ ? ts.getTextOfNode(name_18)
: node.name.text;
}
recordScopeNameStart(scopeName);
@@ -24592,6 +24777,7 @@ var ts;
default:
return -1 /* LessThan */;
}
+ case 172 /* YieldExpression */:
case 170 /* ConditionalExpression */:
return -1 /* LessThan */;
default:
@@ -24779,6 +24965,16 @@ var ts;
write("...");
emit(node.expression);
}
+ function emitYieldExpression(node) {
+ write(ts.tokenToString(110 /* YieldKeyword */));
+ if (node.asteriskToken) {
+ write("*");
+ }
+ if (node.expression) {
+ write(" ");
+ emit(node.expression);
+ }
+ }
function needsParenthesisForPropertyAccessOrInvocation(node) {
switch (node.kind) {
case 65 /* Identifier */:
@@ -25037,6 +25233,9 @@ var ts;
write("]");
}
function emitMethod(node) {
+ if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) {
+ write("*");
+ }
emit(node.name, false);
if (languageVersion < 2 /* ES6 */) {
write(": function ");
@@ -25458,7 +25657,7 @@ var ts;
var tokenKind = 98 /* VarKeyword */;
if (decl && languageVersion >= 2 /* ES6 */) {
if (ts.isLet(decl)) {
- tokenKind = 105 /* LetKeyword */;
+ tokenKind = 104 /* LetKeyword */;
}
else if (ts.isConst(decl)) {
tokenKind = 70 /* ConstKeyword */;
@@ -25471,7 +25670,7 @@ var ts;
switch (tokenKind) {
case 98 /* VarKeyword */:
return write("var ");
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
return write("let ");
case 70 /* ConstKeyword */:
return write("const ");
@@ -26140,12 +26339,12 @@ var ts;
function emitParameter(node) {
if (languageVersion < 2 /* ES6 */) {
if (ts.isBindingPattern(node.name)) {
- var name_17 = createTempVariable(0 /* Auto */);
+ var name_19 = createTempVariable(0 /* Auto */);
if (!tempParameters) {
tempParameters = [];
}
- tempParameters.push(name_17);
- emit(name_17);
+ tempParameters.push(name_19);
+ emit(name_19);
}
else {
emit(node.name);
@@ -26269,7 +26468,11 @@ var ts;
write("default ");
}
}
- write("function ");
+ write("function");
+ if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) {
+ write("*");
+ }
+ write(" ");
}
if (shouldEmitFunctionName(node)) {
emitDeclarationName(node);
@@ -26616,6 +26819,9 @@ var ts;
else if (member.kind === 137 /* SetAccessor */) {
write("set ");
}
+ if (member.asteriskToken) {
+ write("*");
+ }
emit(member.name);
emitSignatureAndBody(member);
emitEnd(member);
@@ -27761,8 +27967,8 @@ var ts;
// export { x, y }
for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) {
var specifier = _d[_c];
- var name_18 = (specifier.propertyName || specifier.name).text;
- (exportSpecifiers[name_18] || (exportSpecifiers[name_18] = [])).push(specifier);
+ var name_20 = (specifier.propertyName || specifier.name).text;
+ (exportSpecifiers[name_20] || (exportSpecifiers[name_20] = [])).push(specifier);
}
}
break;
@@ -28094,6 +28300,8 @@ var ts;
return emitConditionalExpression(node);
case 173 /* SpreadElementExpression */:
return emitSpreadElementExpression(node);
+ case 172 /* YieldExpression */:
+ return emitYieldExpression(node);
case 175 /* OmittedExpression */:
return;
case 179 /* Block */:
@@ -29334,32 +29542,34 @@ var ts;
// Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[]
ts.forEach(program.getSourceFiles(), function (sourceFile) {
cancellationToken.throwIfCancellationRequested();
- var declarations = sourceFile.getNamedDeclarations();
- for (var _i = 0; _i < declarations.length; _i++) {
- var declaration = declarations[_i];
- var name = getDeclarationName(declaration);
- if (name !== undefined) {
+ var nameToDeclarations = sourceFile.getNamedDeclarations();
+ for (var name_21 in nameToDeclarations) {
+ var declarations = ts.getProperty(nameToDeclarations, name_21);
+ if (declarations) {
// First do a quick check to see if the name of the declaration matches the
// last portion of the (possibly) dotted name they're searching for.
- var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name);
+ var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_21);
if (!matches) {
continue;
}
- // It was a match! If the pattern has dots in it, then also see if the
- // declaration container matches as well.
- if (patternMatcher.patternContainsDots) {
- var containers = getContainers(declaration);
- if (!containers) {
- return undefined;
- }
- matches = patternMatcher.getMatches(containers, name);
- if (!matches) {
- continue;
+ for (var _i = 0; _i < declarations.length; _i++) {
+ var declaration = declarations[_i];
+ // It was a match! If the pattern has dots in it, then also see if the
+ // declaration container matches as well.
+ if (patternMatcher.patternContainsDots) {
+ var containers = getContainers(declaration);
+ if (!containers) {
+ return undefined;
+ }
+ matches = patternMatcher.getMatches(containers, name_21);
+ if (!matches) {
+ continue;
+ }
}
+ var fileName = sourceFile.fileName;
+ var matchKind = bestMatchKind(matches);
+ rawItems.push({ name: name_21, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration });
}
- var fileName = sourceFile.fileName;
- var matchKind = bestMatchKind(matches);
- rawItems.push({ name: name, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration });
}
}
});
@@ -29380,25 +29590,13 @@ var ts;
}
return true;
}
- function getDeclarationName(declaration) {
- var result = getTextOfIdentifierOrLiteral(declaration.name);
- if (result !== undefined) {
- return result;
- }
- if (declaration.name.kind === 127 /* ComputedPropertyName */) {
- var expr = declaration.name.expression;
- if (expr.kind === 155 /* PropertyAccessExpression */) {
- return expr.name.text;
- }
- return getTextOfIdentifierOrLiteral(expr);
- }
- return undefined;
- }
function getTextOfIdentifierOrLiteral(node) {
- if (node.kind === 65 /* Identifier */ ||
- node.kind === 8 /* StringLiteral */ ||
- node.kind === 7 /* NumericLiteral */) {
- return node.text;
+ if (node) {
+ if (node.kind === 65 /* Identifier */ ||
+ node.kind === 8 /* StringLiteral */ ||
+ node.kind === 7 /* NumericLiteral */) {
+ return node.text;
+ }
}
return undefined;
}
@@ -29753,9 +29951,9 @@ var ts;
case 198 /* VariableDeclaration */:
case 152 /* BindingElement */:
var variableDeclarationNode;
- var name_19;
+ var name_22;
if (node.kind === 152 /* BindingElement */) {
- name_19 = node.name;
+ name_22 = node.name;
variableDeclarationNode = node;
// binding elements are added only for variable declarations
// bubble up to the containing variable declaration
@@ -29767,16 +29965,16 @@ var ts;
else {
ts.Debug.assert(!ts.isBindingPattern(node.name));
variableDeclarationNode = node;
- name_19 = node.name;
+ name_22 = node.name;
}
if (ts.isConst(variableDeclarationNode)) {
- return createItem(node, getTextOfNode(name_19), ts.ScriptElementKind.constElement);
+ return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.constElement);
}
else if (ts.isLet(variableDeclarationNode)) {
- return createItem(node, getTextOfNode(name_19), ts.ScriptElementKind.letElement);
+ return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.letElement);
}
else {
- return createItem(node, getTextOfNode(name_19), ts.ScriptElementKind.variableElement);
+ return createItem(node, getTextOfNode(name_22), ts.ScriptElementKind.variableElement);
}
case 135 /* Constructor */:
return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement);
@@ -30675,7 +30873,8 @@ var ts;
ArgumentListKind[ArgumentListKind["CallArguments"] = 1] = "CallArguments";
ArgumentListKind[ArgumentListKind["TaggedTemplateArguments"] = 2] = "TaggedTemplateArguments";
})(ArgumentListKind || (ArgumentListKind = {}));
- function getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken) {
+ function getSignatureHelpItems(program, sourceFile, position, cancellationToken) {
+ var typeChecker = program.getTypeChecker();
// Decide whether to show signature help
var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position);
if (!startingToken) {
@@ -30690,12 +30889,54 @@ var ts;
}
var call = argumentInfo.invocation;
var candidates = [];
- var resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates);
+ var resolvedSignature = typeChecker.getResolvedSignature(call, candidates);
cancellationToken.throwIfCancellationRequested();
if (!candidates.length) {
+ // We didn't have any sig help items produced by the TS compiler. If this is a JS
+ // file, then see if we can figure out anything better.
+ if (ts.isJavaScript(sourceFile.fileName)) {
+ return createJavaScriptSignatureHelpItems(argumentInfo);
+ }
return undefined;
}
return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo);
+ function createJavaScriptSignatureHelpItems(argumentInfo) {
+ if (argumentInfo.invocation.kind !== 157 /* CallExpression */) {
+ return undefined;
+ }
+ // See if we can find some symbol with the call expression name that has call signatures.
+ var callExpression = argumentInfo.invocation;
+ var expression = callExpression.expression;
+ var name = expression.kind === 65 /* Identifier */
+ ? expression
+ : expression.kind === 155 /* PropertyAccessExpression */
+ ? expression.name
+ : undefined;
+ if (!name || !name.text) {
+ return undefined;
+ }
+ var typeChecker = program.getTypeChecker();
+ for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
+ var sourceFile_1 = _a[_i];
+ var nameToDeclarations = sourceFile_1.getNamedDeclarations();
+ var declarations = ts.getProperty(nameToDeclarations, name.text);
+ if (declarations) {
+ for (var _b = 0; _b < declarations.length; _b++) {
+ var declaration = declarations[_b];
+ var symbol = declaration.symbol;
+ if (symbol) {
+ var type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration);
+ if (type) {
+ var callSignatures = type.getCallSignatures();
+ if (callSignatures && callSignatures.length) {
+ return createSignatureHelpItems(callSignatures, callSignatures[0], argumentInfo);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
/**
* Returns relevant information for the argument list and the current argument if we are
* in the argument of an invocation; returns undefined otherwise.
@@ -30949,8 +31190,8 @@ var ts;
var isTypeParameterList = argumentListInfo.kind === 0 /* TypeArguments */;
var invocation = argumentListInfo.invocation;
var callTarget = ts.getInvokedExpression(invocation);
- var callTargetSymbol = typeInfoResolver.getSymbolAtLocation(callTarget);
- var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined);
+ var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget);
+ var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, undefined, undefined);
var items = ts.map(candidates, function (candidateSignature) {
var signatureHelpParameters;
var prefixDisplayParts = [];
@@ -30964,13 +31205,13 @@ var ts;
signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray;
suffixDisplayParts.push(ts.punctuationPart(25 /* GreaterThanToken */));
var parameterParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation);
});
suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts);
}
else {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation);
});
prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts);
prefixDisplayParts.push(ts.punctuationPart(16 /* OpenParenToken */));
@@ -30979,7 +31220,7 @@ var ts;
suffixDisplayParts.push(ts.punctuationPart(17 /* CloseParenToken */));
}
var returnTypeParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation);
});
suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts);
return {
@@ -31008,7 +31249,7 @@ var ts;
};
function createSignatureHelpParameterForParameter(parameter) {
var displayParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation);
});
var isOptional = ts.hasQuestionToken(parameter.valueDeclaration);
return {
@@ -31020,7 +31261,7 @@ var ts;
}
function createSignatureHelpParameterForTypeParameter(typeParameter) {
var displayParts = ts.mapToDisplayParts(function (writer) {
- return typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation);
+ return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation);
});
return {
name: typeParameter.symbol.name,
@@ -31468,9 +31709,9 @@ var ts;
ts.isInsideTemplateLiteral = isInsideTemplateLiteral;
function isAccessibilityModifier(kind) {
switch (kind) {
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
return true;
}
return false;
@@ -31662,6 +31903,10 @@ var ts;
});
}
ts.signatureToDisplayParts = signatureToDisplayParts;
+ function isJavaScript(fileName) {
+ return ts.fileExtensionIs(fileName, ".js");
+ }
+ ts.isJavaScript = isJavaScript;
})(ts || (ts = {}));
///
///
@@ -32183,7 +32428,7 @@ var ts;
this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34 /* MinusToken */, 39 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */));
this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23 /* CommaToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([98 /* VarKeyword */, 94 /* ThrowKeyword */, 88 /* NewKeyword */, 74 /* DeleteKeyword */, 90 /* ReturnKeyword */, 97 /* TypeOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
- this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([105 /* LetKeyword */, 70 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */));
+ this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104 /* LetKeyword */, 70 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */));
this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8 /* Delete */));
this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(83 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */));
this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */));
@@ -32206,8 +32451,8 @@ var ts;
// Use of module as a function call. e.g.: import m2 = module("m2");
this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([117 /* ModuleKeyword */, 118 /* RequireKeyword */]), 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
// Add a space around certain TypeScript keywords
- this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 103 /* ImplementsKeyword */, 85 /* ImportKeyword */, 104 /* InterfaceKeyword */, 117 /* ModuleKeyword */, 107 /* PrivateKeyword */, 109 /* PublicKeyword */, 120 /* SetKeyword */, 110 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
- this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79 /* ExtendsKeyword */, 103 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
+ this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 102 /* ImplementsKeyword */, 85 /* ImportKeyword */, 103 /* InterfaceKeyword */, 117 /* ModuleKeyword */, 106 /* PrivateKeyword */, 108 /* PublicKeyword */, 120 /* SetKeyword */, 109 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
+ this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79 /* ExtendsKeyword */, 102 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
// Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" {
this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8 /* StringLiteral */, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */));
// Lambda expressions
@@ -32226,7 +32471,7 @@ var ts;
// decorators
this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 52 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */));
this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(52 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */));
- this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 110 /* StaticKeyword */, 109 /* PublicKeyword */, 107 /* PrivateKeyword */, 108 /* ProtectedKeyword */, 116 /* GetKeyword */, 120 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */));
+ this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 109 /* StaticKeyword */, 108 /* PublicKeyword */, 106 /* PrivateKeyword */, 107 /* ProtectedKeyword */, 116 /* GetKeyword */, 120 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */));
// These rules are higher in priority than user-configurable rules.
this.HighPriorityCommonRules =
[
@@ -32316,9 +32561,9 @@ var ts;
}
Rules.prototype.getRuleName = function (rule) {
var o = this;
- for (var name_20 in o) {
- if (o[name_20] === rule) {
- return name_20;
+ for (var name_23 in o) {
+ if (o[name_23] === rule) {
+ return name_23;
}
}
throw new Error("Unknown rule");
@@ -33243,7 +33488,7 @@ var ts;
}
switch (node.kind) {
case 201 /* ClassDeclaration */: return 69 /* ClassKeyword */;
- case 202 /* InterfaceDeclaration */: return 104 /* InterfaceKeyword */;
+ case 202 /* InterfaceDeclaration */: return 103 /* InterfaceKeyword */;
case 200 /* FunctionDeclaration */: return 83 /* FunctionKeyword */;
case 204 /* EnumDeclaration */: return 204 /* EnumDeclaration */;
case 136 /* GetAccessor */: return 116 /* GetKeyword */;
@@ -34716,29 +34961,65 @@ var ts;
return this.namedDeclarations;
};
SourceFileObject.prototype.computeNamedDeclarations = function () {
- var namedDeclarations = [];
+ var result = {};
ts.forEachChild(this, visit);
- return namedDeclarations;
+ return result;
+ function addDeclaration(declaration) {
+ var name = getDeclarationName(declaration);
+ if (name) {
+ var declarations = getDeclarations(name);
+ declarations.push(declaration);
+ }
+ }
+ function getDeclarations(name) {
+ return ts.getProperty(result, name) || (result[name] = []);
+ }
+ function getDeclarationName(declaration) {
+ if (declaration.name) {
+ var result_2 = getTextOfIdentifierOrLiteral(declaration.name);
+ if (result_2 !== undefined) {
+ return result_2;
+ }
+ if (declaration.name.kind === 127 /* ComputedPropertyName */) {
+ var expr = declaration.name.expression;
+ if (expr.kind === 155 /* PropertyAccessExpression */) {
+ return expr.name.text;
+ }
+ return getTextOfIdentifierOrLiteral(expr);
+ }
+ }
+ return undefined;
+ }
+ function getTextOfIdentifierOrLiteral(node) {
+ if (node) {
+ if (node.kind === 65 /* Identifier */ ||
+ node.kind === 8 /* StringLiteral */ ||
+ node.kind === 7 /* NumericLiteral */) {
+ return node.text;
+ }
+ }
+ return undefined;
+ }
function visit(node) {
switch (node.kind) {
case 200 /* FunctionDeclaration */:
case 134 /* MethodDeclaration */:
case 133 /* MethodSignature */:
var functionDeclaration = node;
- if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) {
- var lastDeclaration = namedDeclarations.length > 0 ?
- namedDeclarations[namedDeclarations.length - 1] :
- undefined;
+ var declarationName = getDeclarationName(functionDeclaration);
+ if (declarationName) {
+ var declarations = getDeclarations(declarationName);
+ var lastDeclaration = ts.lastOrUndefined(declarations);
// Check whether this declaration belongs to an "overload group".
- if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) {
+ if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) {
// Overwrite the last declaration if it was an overload
// and this one is an implementation.
if (functionDeclaration.body && !lastDeclaration.body) {
- namedDeclarations[namedDeclarations.length - 1] = functionDeclaration;
+ declarations[declarations.length - 1] = functionDeclaration;
}
}
else {
- namedDeclarations.push(functionDeclaration);
+ declarations.push(functionDeclaration);
}
ts.forEachChild(node, visit);
}
@@ -34757,9 +35038,7 @@ var ts;
case 136 /* GetAccessor */:
case 137 /* SetAccessor */:
case 145 /* TypeLiteral */:
- if (node.name) {
- namedDeclarations.push(node);
- }
+ addDeclaration(node);
// fall through
case 135 /* Constructor */:
case 180 /* VariableStatement */:
@@ -34789,7 +35068,7 @@ var ts;
case 226 /* EnumMember */:
case 132 /* PropertyDeclaration */:
case 131 /* PropertySignature */:
- namedDeclarations.push(node);
+ addDeclaration(node);
break;
case 215 /* ExportDeclaration */:
// Handle named exports case e.g.:
@@ -34804,14 +35083,14 @@ var ts;
// Handle default import case e.g.:
// import d from "mod";
if (importClause.name) {
- namedDeclarations.push(importClause);
+ addDeclaration(importClause);
}
// Handle named bindings in imports e.g.:
// import * as NS from "mod";
// import {a, b as B} from "mod";
if (importClause.namedBindings) {
if (importClause.namedBindings.kind === 211 /* NamespaceImport */) {
- namedDeclarations.push(importClause.namedBindings);
+ addDeclaration(importClause.namedBindings);
}
else {
ts.forEach(importClause.namedBindings.elements, visit);
@@ -35400,7 +35679,7 @@ var ts;
}
else if (token === 35 /* AsteriskToken */) {
token = scanner.scan();
- if (token === 102 /* AsKeyword */) {
+ if (token === 111 /* AsKeyword */) {
token = scanner.scan();
if (token === 65 /* Identifier */) {
token = scanner.scan();
@@ -35671,8 +35950,6 @@ var ts;
var syntaxTreeCache = new SyntaxTreeCache(host);
var ruleProvider;
var program;
- // this checker is used to answer all LS questions except errors
- var typeInfoResolver;
var useCaseSensitivefileNames = false;
var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken());
// Check if the localized messages json is set, otherwise query the host for it
@@ -35742,7 +36019,9 @@ var ts;
}
}
program = newProgram;
- typeInfoResolver = program.getTypeChecker();
+ // Make sure all the nodes in the program are both bound, and have their parent
+ // pointers set property.
+ program.getTypeChecker();
return;
function getOrCreateSourceFile(fileName) {
// The program is asking for this file, check first if the host can locate it.
@@ -35814,15 +36093,8 @@ var ts;
synchronizeHostData();
return program;
}
- /**
- * Clean up any semantic caches that are not needed.
- * The host can call this method if it wants to jettison unused memory.
- * We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches.
- */
function cleanupSemanticCache() {
- if (program) {
- typeInfoResolver = program.getTypeChecker();
- }
+ // TODO: Should we jettison the program (or it's type checker) here?
}
function dispose() {
if (program) {
@@ -35836,9 +36108,6 @@ var ts;
synchronizeHostData();
return program.getSyntacticDiagnostics(getValidSourceFile(fileName));
}
- function isJavaScript(fileName) {
- return ts.fileExtensionIs(fileName, ".js");
- }
/**
* getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors
* If '-d' enabled, report both semantic and emitter errors
@@ -35849,7 +36118,7 @@ var ts;
// For JavaScript files, we don't want to report the normal typescript semantic errors.
// Instead, we just report errors for using TypeScript-only constructs from within a
// JavaScript file.
- if (isJavaScript(fileName)) {
+ if (ts.isJavaScript(fileName)) {
return getJavaScriptSemanticDiagnostics(targetSourceFile);
}
// Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file.
@@ -35886,7 +36155,7 @@ var ts;
break;
case 222 /* HeritageClause */:
var heritageClause = node;
- if (heritageClause.token === 103 /* ImplementsKeyword */) {
+ if (heritageClause.token === 102 /* ImplementsKeyword */) {
diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file));
return true;
}
@@ -35989,14 +36258,14 @@ var ts;
for (var _i = 0; _i < modifiers.length; _i++) {
var modifier = modifiers[_i];
switch (modifier.kind) {
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
case 115 /* DeclareKeyword */:
diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind)));
return true;
// These are all legal modifiers.
- case 110 /* StaticKeyword */:
+ case 109 /* StaticKeyword */:
case 78 /* ExportKeyword */:
case 70 /* ConstKeyword */:
case 73 /* DefaultKeyword */:
@@ -36058,29 +36327,8 @@ var ts;
}
return ts.unescapeIdentifier(displayName);
}
- function createCompletionEntry(symbol, typeChecker, location) {
- // Try to get a valid display name for this symbol, if we could not find one, then ignore it.
- // We would like to only show things that can be added after a dot, so for instance numeric properties can
- // not be accessed with a dot (a.1 <- invalid)
- var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, true);
- if (!displayName) {
- return undefined;
- }
- // TODO(drosen): Right now we just permit *all* semantic meanings when calling
- // 'getSymbolKind' which is permissible given that it is backwards compatible; but
- // really we should consider passing the meaning for the node so that we don't report
- // that a suggestion for a value is an interface. We COULD also just do what
- // 'getSymbolModifiers' does, which is to use the first declaration.
- // Use a 'sortText' of 0' so that all symbol completion entries come before any other
- // entries (like JavaScript identifier entries).
- return {
- name: displayName,
- kind: getSymbolKind(symbol, typeChecker, location),
- kindModifiers: getSymbolModifiers(symbol),
- sortText: "0"
- };
- }
function getCompletionData(fileName, position) {
+ var typeChecker = program.getTypeChecker();
var syntacticStart = new Date().getTime();
var sourceFile = getValidSourceFile(fileName);
var start = new Date().getTime();
@@ -36149,26 +36397,26 @@ var ts;
isMemberCompletion = true;
isNewIdentifierLocation = false;
if (node.kind === 65 /* Identifier */ || node.kind === 126 /* QualifiedName */ || node.kind === 155 /* PropertyAccessExpression */) {
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
// This is an alias, follow what it aliases
if (symbol && symbol.flags & 8388608 /* Alias */) {
- symbol = typeInfoResolver.getAliasedSymbol(symbol);
+ symbol = typeChecker.getAliasedSymbol(symbol);
}
if (symbol && symbol.flags & 1952 /* HasExports */) {
// Extract module or enum members
- var exportedSymbols = typeInfoResolver.getExportsOfModule(symbol);
+ var exportedSymbols = typeChecker.getExportsOfModule(symbol);
ts.forEach(exportedSymbols, function (symbol) {
- if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) {
+ if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) {
symbols.push(symbol);
}
});
}
}
- var type = typeInfoResolver.getTypeAtLocation(node);
+ var type = typeChecker.getTypeAtLocation(node);
if (type) {
// Filter private properties
ts.forEach(type.getApparentProperties(), function (symbol) {
- if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) {
+ if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) {
symbols.push(symbol);
}
});
@@ -36180,11 +36428,11 @@ var ts;
// Object literal expression, look up possible property names from contextual type
isMemberCompletion = true;
isNewIdentifierLocation = true;
- var contextualType = typeInfoResolver.getContextualType(containingObjectLiteral);
+ var contextualType = typeChecker.getContextualType(containingObjectLiteral);
if (!contextualType) {
return false;
}
- var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType);
+ var contextualTypeMembers = typeChecker.getPropertiesOfType(contextualType);
if (contextualTypeMembers && contextualTypeMembers.length > 0) {
// Add filtered items to the completion list
symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties);
@@ -36200,9 +36448,9 @@ var ts;
ts.Debug.assert(importDeclaration !== undefined);
var exports;
if (importDeclaration.moduleSpecifier) {
- var moduleSpecifierSymbol = typeInfoResolver.getSymbolAtLocation(importDeclaration.moduleSpecifier);
+ var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier);
if (moduleSpecifierSymbol) {
- exports = typeInfoResolver.getExportsOfModule(moduleSpecifierSymbol);
+ exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol);
}
}
//let exports = typeInfoResolver.getExportsOfImportDeclaration(importDeclaration);
@@ -36247,7 +36495,7 @@ var ts;
var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile;
/// TODO filter meaning based on the current context
var symbolMeanings = 793056 /* Type */ | 107455 /* Value */ | 1536 /* Namespace */ | 8388608 /* Alias */;
- symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings);
+ symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);
}
return true;
}
@@ -36310,9 +36558,9 @@ var ts;
return containingNodeKind === 171 /* TemplateExpression */; // `aa ${|
case 12 /* TemplateMiddle */:
return containingNodeKind === 176 /* TemplateSpan */; // `aa ${10} dd ${|
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
return containingNodeKind === 132 /* PropertyDeclaration */; // class A{ public |
}
// Previous token may have been a keyword that was converted to an identifier.
@@ -36402,6 +36650,7 @@ var ts;
containingNodeKind === 150 /* ObjectBindingPattern */; // function func({ x|
case 22 /* SemicolonToken */:
return containingNodeKind === 131 /* PropertySignature */ &&
+ previousToken.parent && previousToken.parent.parent &&
(previousToken.parent.parent.kind === 202 /* InterfaceDeclaration */ ||
previousToken.parent.parent.kind === 145 /* TypeLiteral */); // let x : { a; |
case 24 /* LessThanToken */:
@@ -36409,27 +36658,28 @@ var ts;
containingNodeKind === 200 /* FunctionDeclaration */ ||
containingNodeKind === 202 /* InterfaceDeclaration */ ||
isFunction(containingNodeKind);
- case 110 /* StaticKeyword */:
+ case 109 /* StaticKeyword */:
return containingNodeKind === 132 /* PropertyDeclaration */;
case 21 /* DotDotDotToken */:
return containingNodeKind === 129 /* Parameter */ ||
containingNodeKind === 135 /* Constructor */ ||
- (previousToken.parent.parent.kind === 151 /* ArrayBindingPattern */); // var [ ...z|
- case 109 /* PublicKeyword */:
- case 107 /* PrivateKeyword */:
- case 108 /* ProtectedKeyword */:
+ (previousToken.parent && previousToken.parent.parent &&
+ previousToken.parent.parent.kind === 151 /* ArrayBindingPattern */); // var [ ...z|
+ case 108 /* PublicKeyword */:
+ case 106 /* PrivateKeyword */:
+ case 107 /* ProtectedKeyword */:
return containingNodeKind === 129 /* Parameter */;
case 69 /* ClassKeyword */:
case 77 /* EnumKeyword */:
- case 104 /* InterfaceKeyword */:
+ case 103 /* InterfaceKeyword */:
case 83 /* FunctionKeyword */:
case 98 /* VarKeyword */:
case 116 /* GetKeyword */:
case 120 /* SetKeyword */:
case 85 /* ImportKeyword */:
- case 105 /* LetKeyword */:
+ case 104 /* LetKeyword */:
case 70 /* ConstKeyword */:
- case 111 /* YieldKeyword */:
+ case 110 /* YieldKeyword */:
return true;
}
// Previous token may have been a keyword that was converted to an identifier.
@@ -36506,7 +36756,7 @@ var ts;
}
var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot;
var entries;
- if (isRightOfDot && isJavaScript(fileName)) {
+ if (isRightOfDot && ts.isJavaScript(fileName)) {
entries = getCompletionEntriesFromSymbols(symbols);
ts.addRange(entries, getJavaScriptCompletionEntries());
}
@@ -36528,10 +36778,10 @@ var ts;
for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
var sourceFile = _a[_i];
var nameTable = getNameTable(sourceFile);
- for (var name_21 in nameTable) {
- if (!allNames[name_21]) {
- allNames[name_21] = name_21;
- var displayName = getCompletionEntryDisplayName(name_21, target, true);
+ for (var name_24 in nameTable) {
+ if (!allNames[name_24]) {
+ allNames[name_24] = name_24;
+ var displayName = getCompletionEntryDisplayName(name_24, target, true);
if (displayName) {
var entry = {
name: displayName,
@@ -36546,6 +36796,28 @@ var ts;
}
return entries;
}
+ function createCompletionEntry(symbol, location) {
+ // Try to get a valid display name for this symbol, if we could not find one, then ignore it.
+ // We would like to only show things that can be added after a dot, so for instance numeric properties can
+ // not be accessed with a dot (a.1 <- invalid)
+ var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, true);
+ if (!displayName) {
+ return undefined;
+ }
+ // TODO(drosen): Right now we just permit *all* semantic meanings when calling
+ // 'getSymbolKind' which is permissible given that it is backwards compatible; but
+ // really we should consider passing the meaning for the node so that we don't report
+ // that a suggestion for a value is an interface. We COULD also just do what
+ // 'getSymbolModifiers' does, which is to use the first declaration.
+ // Use a 'sortText' of 0' so that all symbol completion entries come before any other
+ // entries (like JavaScript identifier entries).
+ return {
+ name: displayName,
+ kind: getSymbolKind(symbol, location),
+ kindModifiers: getSymbolModifiers(symbol),
+ sortText: "0"
+ };
+ }
function getCompletionEntriesFromSymbols(symbols) {
var start = new Date().getTime();
var entries = [];
@@ -36553,7 +36825,7 @@ var ts;
var nameToSymbol = {};
for (var _i = 0; _i < symbols.length; _i++) {
var symbol = symbols[_i];
- var entry = createCompletionEntry(symbol, typeInfoResolver, location);
+ var entry = createCompletionEntry(symbol, location);
if (entry) {
var id = ts.escapeIdentifier(entry.name);
if (!ts.lookUp(nameToSymbol, id)) {
@@ -36580,7 +36852,7 @@ var ts;
// completion entry.
var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, false) === entryName ? s : undefined; });
if (symbol) {
- var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, typeInfoResolver, location_2, 7 /* All */);
+ var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, location_2, 7 /* All */);
return {
name: entryName,
kind: displayPartsDocumentationsAndSymbolKind.symbolKind,
@@ -36604,7 +36876,7 @@ var ts;
return undefined;
}
// TODO(drosen): use contextual SemanticMeaning.
- function getSymbolKind(symbol, typeResolver, location) {
+ function getSymbolKind(symbol, location) {
var flags = symbol.getFlags();
if (flags & 32 /* Class */)
return ScriptElementKind.classElement;
@@ -36616,7 +36888,7 @@ var ts;
return ScriptElementKind.interfaceElement;
if (flags & 262144 /* TypeParameter */)
return ScriptElementKind.typeParameterElement;
- var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location);
+ var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location);
if (result === ScriptElementKind.unknown) {
if (flags & 262144 /* TypeParameter */)
return ScriptElementKind.typeParameterElement;
@@ -36629,11 +36901,12 @@ var ts;
}
return result;
}
- function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location) {
- if (typeResolver.isUndefinedSymbol(symbol)) {
+ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location) {
+ var typeChecker = program.getTypeChecker();
+ if (typeChecker.isUndefinedSymbol(symbol)) {
return ScriptElementKind.variableElement;
}
- if (typeResolver.isArgumentsSymbol(symbol)) {
+ if (typeChecker.isArgumentsSymbol(symbol)) {
return ScriptElementKind.localVariableElement;
}
if (flags & 3 /* Variable */) {
@@ -36661,7 +36934,7 @@ var ts;
if (flags & 4 /* Property */) {
if (flags & 268435456 /* UnionProperty */) {
// If union property is result of union of non method (property/accessors/variables), it is labeled as property
- var unionPropertyKind = ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) {
+ var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) {
var rootSymbolFlags = rootSymbol.getFlags();
if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) {
return ScriptElementKind.memberVariableElement;
@@ -36671,7 +36944,7 @@ var ts;
if (!unionPropertyKind) {
// If this was union of all methods,
//make sure it has call signatures before we can label it as method
- var typeOfUnionProperty = typeInfoResolver.getTypeOfSymbolAtLocation(symbol, location);
+ var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (typeOfUnionProperty.getCallSignatures().length) {
return ScriptElementKind.memberFunctionElement;
}
@@ -36704,14 +36977,14 @@ var ts;
? ts.getNodeModifiers(symbol.declarations[0])
: ScriptElementKindModifier.none;
}
- function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location,
- // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
- semanticMeaning) {
+ // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
+ function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) {
if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); }
+ var typeChecker = program.getTypeChecker();
var displayParts = [];
var documentation;
var symbolFlags = symbol.flags;
- var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location);
+ var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location);
var hasAddedSymbolInfo;
var type;
// Class at constructor site need to be shown as constructor apart from property,method, vars
@@ -36721,7 +36994,7 @@ var ts;
symbolKind = ScriptElementKind.memberVariableElement;
}
var signature;
- type = typeResolver.getTypeOfSymbolAtLocation(symbol, location);
+ type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (type) {
if (location.parent && location.parent.kind === 155 /* PropertyAccessExpression */) {
var right = location.parent.name;
@@ -36740,7 +37013,7 @@ var ts;
}
if (callExpression) {
var candidateSignatures = [];
- signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures);
+ signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures);
if (!signature && candidateSignatures.length) {
// Use the first candidate:
signature = candidateSignatures[0];
@@ -36785,7 +37058,7 @@ var ts;
displayParts.push(ts.spacePart());
}
if (!(type.flags & 32768 /* Anonymous */)) {
- displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, undefined, 1 /* WriteTypeParametersOrArguments */));
+ displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1 /* WriteTypeParametersOrArguments */));
}
addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */);
break;
@@ -36801,8 +37074,8 @@ var ts;
// get the signature from the declaration and write it
var functionDeclaration = location.parent;
var allSignatures = functionDeclaration.kind === 135 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures();
- if (!typeResolver.isImplementationOfOverload(functionDeclaration)) {
- signature = typeResolver.getSignatureFromDeclaration(functionDeclaration);
+ if (!typeChecker.isImplementationOfOverload(functionDeclaration)) {
+ signature = typeChecker.getSignatureFromDeclaration(functionDeclaration);
}
else {
signature = allSignatures[0];
@@ -36830,7 +37103,7 @@ var ts;
}
if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) {
addNewLineIfDisplayPartsExist();
- displayParts.push(ts.keywordPart(104 /* InterfaceKeyword */));
+ displayParts.push(ts.keywordPart(103 /* InterfaceKeyword */));
displayParts.push(ts.spacePart());
addFullSymbolName(symbol);
writeTypeParametersOfSymbol(symbol, sourceFile);
@@ -36843,7 +37116,7 @@ var ts;
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(53 /* EqualsToken */));
displayParts.push(ts.spacePart());
- displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
+ displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
}
if (symbolFlags & 384 /* Enum */) {
addNewLineIfDisplayPartsExist();
@@ -36879,7 +37152,7 @@ var ts;
else {
// Method/function type parameter
var signatureDeclaration = ts.getDeclarationOfKind(symbol, 128 /* TypeParameter */).parent;
- var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration);
+ var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration);
if (signatureDeclaration.kind === 139 /* ConstructSignature */) {
displayParts.push(ts.keywordPart(88 /* NewKeyword */));
displayParts.push(ts.spacePart());
@@ -36887,14 +37160,14 @@ var ts;
else if (signatureDeclaration.kind !== 138 /* CallSignature */ && signatureDeclaration.name) {
addFullSymbolName(signatureDeclaration.symbol);
}
- displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */));
+ displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */));
}
}
if (symbolFlags & 8 /* EnumMember */) {
addPrefixForAnyFunctionOrVar(symbol, "enum member");
var declaration = symbol.declarations[0];
if (declaration.kind === 226 /* EnumMember */) {
- var constantValue = typeResolver.getConstantValue(declaration);
+ var constantValue = typeChecker.getConstantValue(declaration);
if (constantValue !== undefined) {
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(53 /* EqualsToken */));
@@ -36921,7 +37194,7 @@ var ts;
displayParts.push(ts.punctuationPart(17 /* CloseParenToken */));
}
else {
- var internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
+ var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
if (internalAliasSymbol) {
displayParts.push(ts.spacePart());
displayParts.push(ts.operatorPart(53 /* EqualsToken */));
@@ -36946,12 +37219,12 @@ var ts;
// If the type is type parameter, format it specially
if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
- typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration);
+ typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration);
});
displayParts.push.apply(displayParts, typeParameterParts);
}
else {
- displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeResolver, type, enclosingDeclaration));
+ displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, type, enclosingDeclaration));
}
}
else if (symbolFlags & 16 /* Function */ ||
@@ -36966,7 +37239,7 @@ var ts;
}
}
else {
- symbolKind = getSymbolKind(symbol, typeResolver, location);
+ symbolKind = getSymbolKind(symbol, location);
}
}
if (!documentation) {
@@ -36979,7 +37252,7 @@ var ts;
}
}
function addFullSymbolName(symbol, enclosingDeclaration) {
- var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */);
+ var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */);
displayParts.push.apply(displayParts, fullSymbolDisplayParts);
}
function addPrefixForAnyFunctionOrVar(symbol, symbolKind) {
@@ -37007,7 +37280,7 @@ var ts;
}
}
function addSignatureDisplayParts(signature, allSignatures, flags) {
- displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */));
+ displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */));
if (allSignatures.length > 1) {
displayParts.push(ts.spacePart());
displayParts.push(ts.punctuationPart(16 /* OpenParenToken */));
@@ -37021,7 +37294,7 @@ var ts;
}
function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) {
var typeParameterParts = ts.mapToDisplayParts(function (writer) {
- typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
+ typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
});
displayParts.push.apply(displayParts, typeParameterParts);
}
@@ -37033,7 +37306,11 @@ var ts;
if (!node) {
return undefined;
}
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ if (isLabelName(node)) {
+ return undefined;
+ }
+ var typeChecker = program.getTypeChecker();
+ var symbol = typeChecker.getSymbolAtLocation(node);
if (!symbol) {
// Try getting just type at this position and show
switch (node.kind) {
@@ -37043,20 +37320,20 @@ var ts;
case 93 /* ThisKeyword */:
case 91 /* SuperKeyword */:
// For the identifiers/this/super etc get the type at position
- var type = typeInfoResolver.getTypeAtLocation(node);
+ var type = typeChecker.getTypeAtLocation(node);
if (type) {
return {
kind: ScriptElementKind.unknown,
kindModifiers: ScriptElementKindModifier.none,
textSpan: ts.createTextSpan(node.getStart(), node.getWidth()),
- displayParts: ts.typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)),
+ displayParts: ts.typeToDisplayParts(typeChecker, type, getContainerNode(node)),
documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined
};
}
}
return undefined;
}
- var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node);
+ var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node);
return {
kind: displayPartsDocumentationsAndKind.symbolKind,
kindModifiers: getSymbolModifiers(symbol),
@@ -37105,7 +37382,8 @@ var ts;
}
return undefined;
}
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var typeChecker = program.getTypeChecker();
+ var symbol = typeChecker.getSymbolAtLocation(node);
// Could not find a symbol e.g. node is string or number keyword,
// or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol
if (!symbol) {
@@ -37118,7 +37396,7 @@ var ts;
if (symbol.flags & 8388608 /* Alias */) {
var declaration = symbol.declarations[0];
if (node.kind === 65 /* Identifier */ && node.parent === declaration) {
- symbol = typeInfoResolver.getAliasedSymbol(symbol);
+ symbol = typeChecker.getAliasedSymbol(symbol);
}
}
// Because name in short-hand property assignment has two different meanings: property name and property value,
@@ -37127,22 +37405,22 @@ var ts;
// is performed at the location of property access, we would like to go to definition of the property in the short-hand
// assignment. This case and others are handled by the following code.
if (node.parent.kind === 225 /* ShorthandPropertyAssignment */) {
- var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
+ var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
if (!shorthandSymbol) {
return [];
}
var shorthandDeclarations = shorthandSymbol.getDeclarations();
- var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node);
- var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol);
- var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node);
+ var shorthandSymbolKind = getSymbolKind(shorthandSymbol, node);
+ var shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol);
+ var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node);
return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); });
}
var result = [];
var declarations = symbol.getDeclarations();
- var symbolName = typeInfoResolver.symbolToString(symbol); // Do not get scoped name, just the name of the symbol
- var symbolKind = getSymbolKind(symbol, typeInfoResolver, node);
+ var symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol
+ var symbolKind = getSymbolKind(symbol, node);
var containerSymbol = symbol.parent;
- var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : "";
+ var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : "";
if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) &&
!tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) {
// Just add all the declarations.
@@ -37197,7 +37475,7 @@ var ts;
var sourceFile = getCanonicalFileName(ts.normalizeSlashes(fileName));
// Get occurrences only supports reporting occurrences for the file queried. So
// filter down to that list.
- results = ts.filter(results, function (r) { return r.fileName === fileName; });
+ results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile; });
}
return results;
}
@@ -37460,7 +37738,7 @@ var ts;
return undefined;
}
}
- else if (modifier === 110 /* StaticKeyword */) {
+ else if (modifier === 109 /* StaticKeyword */) {
if (container.kind !== 201 /* ClassDeclaration */) {
return undefined;
}
@@ -37509,13 +37787,13 @@ var ts;
return ts.map(keywords, getHighlightSpanForNode);
function getFlagFromModifier(modifier) {
switch (modifier) {
- case 109 /* PublicKeyword */:
+ case 108 /* PublicKeyword */:
return 16 /* Public */;
- case 107 /* PrivateKeyword */:
+ case 106 /* PrivateKeyword */:
return 32 /* Private */;
- case 108 /* ProtectedKeyword */:
+ case 107 /* ProtectedKeyword */:
return 64 /* Protected */;
- case 110 /* StaticKeyword */:
+ case 109 /* StaticKeyword */:
return 128 /* Static */;
case 78 /* ExportKeyword */:
return 1 /* Export */;
@@ -37776,6 +38054,7 @@ var ts;
return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments);
}
function getReferencedSymbolsForNodes(node, sourceFiles, findInStrings, findInComments) {
+ var typeChecker = program.getTypeChecker();
// Labels
if (isLabelName(node)) {
if (isJumpStatementTarget(node)) {
@@ -37795,7 +38074,7 @@ var ts;
if (node.kind === 91 /* SuperKeyword */) {
return getReferencesForSuperKeyword(node);
}
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
// Could not find a symbol e.g. unknown identifier
if (!symbol) {
// Can't have references to something that we have no symbol for.
@@ -37834,7 +38113,7 @@ var ts;
}
return result;
function getDefinition(symbol) {
- var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), typeInfoResolver, node);
+ var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node);
var name = ts.map(info.displayParts, function (p) { return p.text; }).join("");
var declarations = symbol.declarations;
if (!declarations || declarations.length === 0) {
@@ -37877,7 +38156,7 @@ var ts;
if (isImportOrExportSpecifierName(location)) {
return location.getText();
}
- name = typeInfoResolver.symbolToString(symbol);
+ name = typeChecker.symbolToString(symbol);
return stripQuotes(name);
}
function getInternedName(symbol, location, declarations) {
@@ -38065,10 +38344,10 @@ var ts;
if (!(getMeaningFromLocation(referenceLocation) & searchMeaning)) {
return;
}
- var referenceSymbol = typeInfoResolver.getSymbolAtLocation(referenceLocation);
+ var referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation);
if (referenceSymbol) {
var referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
- var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
+ var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
var relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation);
if (relatedSymbol) {
var referencedSymbol = getReferencedSymbol(relatedSymbol);
@@ -38257,14 +38536,14 @@ var ts;
var result = [symbol];
// If the symbol is an alias, add what it alaises to the list
if (isImportOrExportSpecifierImportSymbol(symbol)) {
- result.push(typeInfoResolver.getAliasedSymbol(symbol));
+ result.push(typeChecker.getAliasedSymbol(symbol));
}
// If the location is in a context sensitive location (i.e. in an object literal) try
// to get a contextual type for it, and add the property symbol from the contextual
// type to the search set
if (isNameOfPropertyAssignment(location)) {
ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) {
- result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol));
+ result.push.apply(result, typeChecker.getRootSymbols(contextualSymbol));
});
/* Because in short-hand property assignment, location has two meaning : property name and as value of the property
* When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of
@@ -38277,14 +38556,14 @@ var ts;
* so that when matching with potential reference symbol, both symbols from property declaration and variable declaration
* will be included correctly.
*/
- var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent);
+ var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent);
if (shorthandValueSymbol) {
result.push(shorthandValueSymbol);
}
}
// If this is a union property, add all the symbols from all its source symbols in all unioned types.
// If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list
- ts.forEach(typeInfoResolver.getRootSymbols(symbol), function (rootSymbol) {
+ ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) {
if (rootSymbol !== symbol) {
result.push(rootSymbol);
}
@@ -38310,9 +38589,9 @@ var ts;
return;
function getPropertySymbolFromTypeReference(typeReference) {
if (typeReference) {
- var type = typeInfoResolver.getTypeAtLocation(typeReference);
+ var type = typeChecker.getTypeAtLocation(typeReference);
if (type) {
- var propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName);
+ var propertySymbol = typeChecker.getPropertyOfType(type, propertyName);
if (propertySymbol) {
result.push(propertySymbol);
}
@@ -38329,7 +38608,7 @@ var ts;
// If the reference symbol is an alias, check if what it is aliasing is one of the search
// symbols.
if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) {
- var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol);
+ var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol);
if (searchSymbols.indexOf(aliasedSymbol) >= 0) {
return aliasedSymbol;
}
@@ -38339,12 +38618,12 @@ var ts;
// compare to our searchSymbol
if (isNameOfPropertyAssignment(referenceLocation)) {
return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) {
- return ts.forEach(typeInfoResolver.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
+ return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
});
}
// Unwrap symbols to get to the root (e.g. transient symbols as a result of widening)
// Or a union property, use its underlying unioned symbols
- return ts.forEach(typeInfoResolver.getRootSymbols(referenceSymbol), function (rootSymbol) {
+ return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) {
// if it is in the list, then we are done
if (searchSymbols.indexOf(rootSymbol) >= 0) {
return rootSymbol;
@@ -38352,9 +38631,9 @@ var ts;
// Finally, try all properties with the same name in any type the containing type extended or implemented, and
// see if any is in the list
if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) {
- var result_2 = [];
- getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_2);
- return ts.forEach(result_2, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
+ var result_3 = [];
+ getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3);
+ return ts.forEach(result_3, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; });
}
return undefined;
});
@@ -38362,29 +38641,29 @@ var ts;
function getPropertySymbolsFromContextualType(node) {
if (isNameOfPropertyAssignment(node)) {
var objectLiteral = node.parent.parent;
- var contextualType = typeInfoResolver.getContextualType(objectLiteral);
- var name_22 = node.text;
+ var contextualType = typeChecker.getContextualType(objectLiteral);
+ var name_25 = node.text;
if (contextualType) {
if (contextualType.flags & 16384 /* Union */) {
// This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types)
// if not, search the constituent types for the property
- var unionProperty = contextualType.getProperty(name_22);
+ var unionProperty = contextualType.getProperty(name_25);
if (unionProperty) {
return [unionProperty];
}
else {
- var result_3 = [];
+ var result_4 = [];
ts.forEach(contextualType.types, function (t) {
- var symbol = t.getProperty(name_22);
+ var symbol = t.getProperty(name_25);
if (symbol) {
- result_3.push(symbol);
+ result_4.push(symbol);
}
});
- return result_3;
+ return result_4;
}
}
else {
- var symbol_1 = contextualType.getProperty(name_22);
+ var symbol_1 = contextualType.getProperty(name_25);
if (symbol_1) {
return [symbol_1];
}
@@ -38549,7 +38828,7 @@ var ts;
}
if (!isLastClause && root.parent.kind === 177 /* HeritageClauseElement */ && root.parent.parent.kind === 222 /* HeritageClause */) {
var decl = root.parent.parent.parent;
- return (decl.kind === 201 /* ClassDeclaration */ && root.parent.parent.token === 103 /* ImplementsKeyword */) ||
+ return (decl.kind === 201 /* ClassDeclaration */ && root.parent.parent.token === 102 /* ImplementsKeyword */) ||
(decl.kind === 202 /* InterfaceDeclaration */ && root.parent.parent.token === 79 /* ExtendsKeyword */);
}
return false;
@@ -38610,7 +38889,7 @@ var ts;
function getSignatureHelpItems(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
- return ts.SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken);
+ return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken);
}
/// Syntactic features
function getSourceFile(fileName) {
@@ -38677,6 +38956,7 @@ var ts;
function getSemanticClassifications(fileName, span) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
+ var typeChecker = program.getTypeChecker();
var result = [];
processNode(sourceFile);
return result;
@@ -38722,7 +39002,7 @@ var ts;
// Only walk into nodes that intersect the requested span.
if (node && ts.textSpanIntersectsWith(span, node.getStart(), node.getWidth())) {
if (node.kind === 65 /* Identifier */ && node.getWidth() > 0) {
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
if (symbol) {
var type = classifySymbol(symbol, getMeaningFromLocation(node));
if (type) {
@@ -39134,10 +39414,11 @@ var ts;
function getRenameInfo(fileName, position) {
synchronizeHostData();
var sourceFile = getValidSourceFile(fileName);
+ var typeChecker = program.getTypeChecker();
var node = ts.getTouchingWord(sourceFile, position);
// Can only rename an identifier.
if (node && node.kind === 65 /* Identifier */) {
- var symbol = typeInfoResolver.getSymbolAtLocation(node);
+ var symbol = typeChecker.getSymbolAtLocation(node);
// Only allow a symbol to be renamed if it actually has at least one declaration.
if (symbol) {
var declarations = symbol.getDeclarations();
@@ -39147,19 +39428,19 @@ var ts;
if (defaultLibFileName) {
for (var _i = 0; _i < declarations.length; _i++) {
var current = declarations[_i];
- var sourceFile_1 = current.getSourceFile();
- if (sourceFile_1 && getCanonicalFileName(ts.normalizePath(sourceFile_1.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) {
+ var sourceFile_2 = current.getSourceFile();
+ if (sourceFile_2 && getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) {
return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key));
}
}
}
- var kind = getSymbolKind(symbol, typeInfoResolver, node);
+ var kind = getSymbolKind(symbol, node);
if (kind) {
return {
canRename: true,
localizedErrorMessage: undefined,
displayName: symbol.name,
- fullDisplayName: typeInfoResolver.getFullyQualifiedName(symbol),
+ fullDisplayName: typeChecker.getFullyQualifiedName(symbol),
kind: kind,
kindModifiers: getSymbolModifiers(symbol),
triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth())
@@ -39304,7 +39585,7 @@ var ts;
if (keyword2 === 116 /* GetKeyword */ ||
keyword2 === 120 /* SetKeyword */ ||
keyword2 === 114 /* ConstructorKeyword */ ||
- keyword2 === 110 /* StaticKeyword */) {
+ keyword2 === 109 /* StaticKeyword */) {
// Allow things like "public get", "public constructor" and "public static".
// These are all legal.
return true;
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index bff0c137e24..d0c51eb05c9 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -2197,25 +2197,7 @@ module ts {
}
else if (hasSpreadElement) {
let unionOfElements = getUnionType(elementTypes);
- if (languageVersion >= ScriptTarget.ES6) {
- // If the user has something like:
- //
- // function fun(...[a, ...b]) { }
- //
- // Normally, in ES6, the implied type of an array binding pattern with a rest element is
- // an iterable. However, there is a requirement in our type system that all rest
- // parameters be array types. To satisfy this, we have an exception to the rule that
- // says the type of an array binding pattern with a rest element is an array type
- // if it is *itself* in a rest parameter. It will still be compatible with a spreaded
- // iterable argument, but within the function it will be an array.
- let parent = pattern.parent;
- let isRestParameter = parent.kind === SyntaxKind.Parameter &&
- pattern === (parent).name &&
- (parent).dotDotDotToken !== undefined;
- return isRestParameter ? createArrayType(unionOfElements) : createIterableType(unionOfElements);
- }
-
- return createArrayType(unionOfElements);
+ return languageVersion >= ScriptTarget.ES6 ? createIterableType(unionOfElements) : createArrayType(unionOfElements);
}
// If the pattern has at least one element, and no rest element, then it should imply a tuple type.
@@ -2904,16 +2886,17 @@ module ts {
}
function getPropertiesOfType(type: Type): Symbol[] {
- if (type.flags & TypeFlags.Union) {
- return getPropertiesOfUnionType(type);
- }
- return getPropertiesOfObjectType(getApparentType(type));
+ type = getApparentType(type);
+ return type.flags & TypeFlags.Union ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type);
}
// For a type parameter, return the base constraint of the type parameter. For the string, number,
// boolean, and symbol primitive types, return the corresponding object types. Otherwise return the
// type itself. Note that the apparent type of a union type is the union type itself.
function getApparentType(type: Type): Type {
+ if (type.flags & TypeFlags.Union) {
+ type = getReducedTypeOfUnionType(type);
+ }
if (type.flags & TypeFlags.TypeParameter) {
do {
type = getConstraintOfTypeParameter(type);
@@ -2986,27 +2969,27 @@ module ts {
// necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from
// Object and Function as appropriate.
function getPropertyOfType(type: Type, name: string): Symbol {
+ type = getApparentType(type);
+ if (type.flags & TypeFlags.ObjectType) {
+ let resolved = resolveObjectOrUnionTypeMembers(type);
+ if (hasProperty(resolved.members, name)) {
+ let symbol = resolved.members[name];
+ if (symbolIsValue(symbol)) {
+ return symbol;
+ }
+ }
+ if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
+ let symbol = getPropertyOfObjectType(globalFunctionType, name);
+ if (symbol) {
+ return symbol;
+ }
+ }
+ return getPropertyOfObjectType(globalObjectType, name);
+ }
if (type.flags & TypeFlags.Union) {
return getPropertyOfUnionType(type, name);
}
- if (!(type.flags & TypeFlags.ObjectType)) {
- type = getApparentType(type);
- if (!(type.flags & TypeFlags.ObjectType)) {
- return undefined;
- }
- }
- let resolved = resolveObjectOrUnionTypeMembers(type);
- if (hasProperty(resolved.members, name)) {
- let symbol = resolved.members[name];
- if (symbolIsValue(symbol)) {
- return symbol;
- }
- }
- if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {
- let symbol = getPropertyOfObjectType(globalFunctionType, name);
- if (symbol) return symbol;
- }
- return getPropertyOfObjectType(globalObjectType, name);
+ return undefined;
}
function getSignaturesOfObjectOrUnionType(type: Type, kind: SignatureKind): Signature[] {
@@ -3581,6 +3564,10 @@ module ts {
}
}
+ // The noSubtypeReduction flag is there because it isn't possible to always do subtype reduction. The flag
+ // is true when creating a union type from a type node and when instantiating a union type. In both of those
+ // cases subtype reduction has to be deferred to properly support recursive union types. For example, a
+ // type alias of the form "type Item = string | (() => Item)" cannot be reduced during its declaration.
function getUnionType(types: Type[], noSubtypeReduction?: boolean): Type {
if (types.length === 0) {
return emptyObjectType;
@@ -3605,10 +3592,19 @@ module ts {
if (!type) {
type = unionTypes[id] = createObjectType(TypeFlags.Union | getWideningFlagsOfTypes(sortedTypes));
type.types = sortedTypes;
+ type.reducedType = noSubtypeReduction ? undefined : type;
}
return type;
}
+ function getReducedTypeOfUnionType(type: UnionType): Type {
+ // If union type was created without subtype reduction, perform the deferred reduction now
+ if (!type.reducedType) {
+ type.reducedType = getUnionType(type.types, /*noSubtypeReduction*/ false);
+ }
+ return type.reducedType;
+ }
+
function getTypeFromUnionTypeNode(node: UnionTypeNode): Type {
let links = getNodeLinks(node);
if (!links.resolvedType) {
@@ -4002,6 +3998,7 @@ module ts {
if (source === numberType && target.flags & TypeFlags.Enum) return Ternary.True;
}
}
+ let saveErrorInfo = errorInfo;
if (source.flags & TypeFlags.Union || target.flags & TypeFlags.Union) {
if (relation === identityRelation) {
if (source.flags & TypeFlags.Union && target.flags & TypeFlags.Union) {
@@ -4040,25 +4037,34 @@ module ts {
return result;
}
}
- else {
- let saveErrorInfo = errorInfo;
- if (source.flags & TypeFlags.Reference && target.flags & TypeFlags.Reference && (source).target === (target).target) {
- // We have type references to same target type, see if relationship holds for all type arguments
- if (result = typesRelatedTo((source).typeArguments, (target).typeArguments, reportErrors)) {
- return result;
- }
+ else if (source.flags & TypeFlags.Reference && target.flags & TypeFlags.Reference && (source).target === (target).target) {
+ // We have type references to same target type, see if relationship holds for all type arguments
+ if (result = typesRelatedTo((source).typeArguments, (target).typeArguments, reportErrors)) {
+ return result;
}
- // Even if relationship doesn't hold for type arguments, it may hold in a structural comparison
- // Report structural errors only if we haven't reported any errors yet
- let reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo;
- // identity relation does not use apparent type
- let sourceOrApparentType = relation === identityRelation ? source : getApparentType(source);
- if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType &&
- (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) {
+ }
+
+ // Even if relationship doesn't hold for unions, type parameters, or generic type references,
+ // it may hold in a structural comparison.
+ // Report structural errors only if we haven't reported any errors yet
+ let reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo;
+ // identity relation does not use apparent type
+ let sourceOrApparentType = relation === identityRelation ? source : getApparentType(source);
+ if (sourceOrApparentType.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType) {
+ if (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) {
errorInfo = saveErrorInfo;
return result;
}
}
+ else if (source.flags & TypeFlags.TypeParameter && sourceOrApparentType.flags & TypeFlags.Union) {
+ // We clear the errors first because the following check often gives a better error than
+ // the union comparison above if it is applicable.
+ errorInfo = saveErrorInfo;
+ if (result = isRelatedTo(sourceOrApparentType, target, reportErrors)) {
+ return result;
+ }
+ }
+
if (reportErrors) {
headMessage = headMessage || Diagnostics.Type_0_is_not_assignable_to_type_1;
let sourceType = typeToString(source);
@@ -5398,8 +5404,8 @@ module ts {
// will be bound to non-arrow function that contain this arrow function. This results in inconsistent behavior.
// To avoid that we will give an error to users if they use arguments objects in arrow function so that they
// can explicitly bound arguments objects
- if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction) {
- error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression);
+ if (symbol === argumentsSymbol && getContainingFunction(node).kind === SyntaxKind.ArrowFunction && languageVersion < ScriptTarget.ES6) {
+ error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
}
if (symbol.flags & SymbolFlags.Alias && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) {
@@ -6011,14 +6017,38 @@ module ts {
}
let hasSpreadElement = false;
let elementTypes: Type[] = [];
+ let inDestructuringPattern = isAssignmentTarget(node);
for (let e of elements) {
- let type = checkExpression(e, contextualMapper);
- elementTypes.push(type);
+ if (inDestructuringPattern && e.kind === SyntaxKind.SpreadElementExpression) {
+ // Given the following situation:
+ // var c: {};
+ // [...c] = ["", 0];
+ //
+ // c is represented in the tree as a spread element in an array literal.
+ // But c really functions as a rest element, and its purpose is to provide
+ // a contextual type for the right hand side of the assignment. Therefore,
+ // instead of calling checkExpression on "...c", which will give an error
+ // if c is not iterable/array-like, we need to act as if we are trying to
+ // get the contextual element type from it. So we do something similar to
+ // getContextualTypeForElementExpression, which will crucially not error
+ // if there is no index type / iterated type.
+ let restArrayType = checkExpression((e).expression, contextualMapper);
+ let restElementType = getIndexTypeOfType(restArrayType, IndexKind.Number) ||
+ (languageVersion >= ScriptTarget.ES6 ? checkIteratedType(restArrayType, /*expressionForError*/ undefined) : undefined);
+
+ if (restElementType) {
+ elementTypes.push(restElementType);
+ }
+ }
+ else {
+ let type = checkExpression(e, contextualMapper);
+ elementTypes.push(type);
+ }
hasSpreadElement = hasSpreadElement || e.kind === SyntaxKind.SpreadElementExpression;
}
if (!hasSpreadElement) {
let contextualType = getContextualType(node);
- if (contextualType && contextualTypeIsTupleLikeType(contextualType) || isAssignmentTarget(node)) {
+ if (contextualType && contextualTypeIsTupleLikeType(contextualType) || inDestructuringPattern) {
return createTupleType(elementTypes);
}
}
@@ -7609,7 +7639,7 @@ module ts {
// This elementType will be used if the specific property corresponding to this index is not
// present (aka the tuple element property). This call also checks that the parentType is in
// fact an iterable or array (depending on target language).
- let elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false);
+ let elementType = checkIteratedTypeOrElementType(sourceType, node, /*allowStringInput*/ false) || unknownType;
let elements = node.elements;
for (let i = 0; i < elements.length; i++) {
let e = elements[i];
@@ -7633,11 +7663,17 @@ module ts {
}
}
else {
- if (i === elements.length - 1) {
- checkReferenceAssignment((e).expression, createArrayType(elementType), contextualMapper);
+ if (i < elements.length - 1) {
+ error(e, Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern);
}
else {
- error(e, Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern);
+ let restExpression = (e).expression;
+ if (restExpression.kind === SyntaxKind.BinaryExpression && (restExpression).operatorToken.kind === SyntaxKind.EqualsToken) {
+ error((restExpression).operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer);
+ }
+ else {
+ checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper);
+ }
}
}
}
@@ -8097,10 +8133,11 @@ module ts {
if (node.questionToken && isBindingPattern(node.name) && func.body) {
error(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature);
}
- if (node.dotDotDotToken) {
- if (!isArrayType(getTypeOfSymbol(node.symbol))) {
- error(node, Diagnostics.A_rest_parameter_must_be_of_an_array_type);
- }
+
+ // Only check rest parameter type if it's not a binding pattern. Since binding patterns are
+ // not allowed in a rest parameter, we already have an error from checkGrammarParameterList.
+ if (node.dotDotDotToken && !isBindingPattern(node.name) && !isArrayType(getTypeOfSymbol(node.symbol))) {
+ error(node, Diagnostics.A_rest_parameter_must_be_of_an_array_type);
}
}
@@ -9403,6 +9440,10 @@ module ts {
}
function checkIteratedTypeOrElementType(inputType: Type, errorNode: Node, allowStringInput: boolean): Type {
+ if (inputType.flags & TypeFlags.Any) {
+ return inputType;
+ }
+
if (languageVersion >= ScriptTarget.ES6) {
return checkIteratedType(inputType, errorNode) || anyType;
}
@@ -10393,13 +10434,29 @@ module ts {
function getFirstNonAmbientClassOrFunctionDeclaration(symbol: Symbol): Declaration {
let declarations = symbol.declarations;
for (let declaration of declarations) {
- if ((declaration.kind === SyntaxKind.ClassDeclaration || (declaration.kind === SyntaxKind.FunctionDeclaration && nodeIsPresent((declaration).body))) && !isInAmbientContext(declaration)) {
+ if ((declaration.kind === SyntaxKind.ClassDeclaration ||
+ (declaration.kind === SyntaxKind.FunctionDeclaration && nodeIsPresent((declaration).body))) &&
+ !isInAmbientContext(declaration)) {
return declaration;
}
}
return undefined;
}
+ function inSameLexicalScope(node1: Node, node2: Node) {
+ let container1 = getEnclosingBlockScopeContainer(node1);
+ let container2 = getEnclosingBlockScopeContainer(node2);
+ if (isGlobalSourceFile(container1)) {
+ return isGlobalSourceFile(container2);
+ }
+ else if (isGlobalSourceFile(container2)) {
+ return false;
+ }
+ else {
+ return container1 === container2;
+ }
+ }
+
function checkModuleDeclaration(node: ModuleDeclaration) {
if (produceDiagnostics) {
// Grammar checking
@@ -10419,15 +10476,23 @@ module ts {
&& symbol.declarations.length > 1
&& !isInAmbientContext(node)
&& isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) {
- let classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
- if (classOrFunc) {
- if (getSourceFileOfNode(node) !== getSourceFileOfNode(classOrFunc)) {
+ let firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
+ if (firstNonAmbientClassOrFunc) {
+ if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
error(node.name, Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged);
}
- else if (node.pos < classOrFunc.pos) {
+ else if (node.pos < firstNonAmbientClassOrFunc.pos) {
error(node.name, Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);
}
}
+
+ // if the module merges with a class declaration in the same lexical scope,
+ // we need to track this to ensure the correct emit.
+ let mergedClass = getDeclarationOfKind(symbol, SyntaxKind.ClassDeclaration);
+ if (mergedClass &&
+ inSameLexicalScope(node, mergedClass)) {
+ getNodeLinks(node).flags |= NodeCheckFlags.LexicalModuleMergesWithClass;
+ }
}
// Checks for ambient external modules.
@@ -12246,6 +12311,10 @@ module ts {
return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);
}
+ if (isBindingPattern(parameter.name)) {
+ return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_element_cannot_contain_a_binding_pattern);
+ }
+
if (parameter.questionToken) {
return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_rest_parameter_cannot_be_optional);
}
@@ -12732,6 +12801,11 @@ module ts {
if (node !== elements[elements.length - 1]) {
return grammarErrorOnNode(node, Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern);
}
+
+ if (node.name.kind === SyntaxKind.ArrayBindingPattern || node.name.kind === SyntaxKind.ObjectBindingPattern) {
+ return grammarErrorOnNode(node.name, Diagnostics.A_rest_element_cannot_contain_a_binding_pattern);
+ }
+
if (node.initializer) {
// Error on equals token which immediate precedes the initializer
return grammarErrorAtPos(getSourceFileOfNode(node), node.initializer.pos - 1, 1, Diagnostics.A_rest_element_cannot_have_an_initializer);
@@ -12929,6 +13003,11 @@ module ts {
}
}
+ function isEvalOrArgumentsIdentifier(node: Node): boolean {
+ return node.kind === SyntaxKind.Identifier &&
+ ((node).text === "eval" || (node).text === "arguments");
+ }
+
function checkGrammarConstructorTypeParameters(node: ConstructorDeclaration) {
if (node.typeParameters) {
return grammarErrorAtPos(getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration);
diff --git a/src/compiler/core.ts b/src/compiler/core.ts
index 61fe2c7209a..80840068332 100644
--- a/src/compiler/core.ts
+++ b/src/compiler/core.ts
@@ -659,10 +659,6 @@ module ts {
"\u0085": "\\u0085" // nextLine
};
- export function getDefaultLibFileName(options: CompilerOptions): string {
- return options.target === ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts";
- }
-
export interface ObjectAllocator {
getNodeConstructor(kind: SyntaxKind): new () => Node;
getSymbolConstructor(): new (flags: SymbolFlags, name: string) => Symbol;
diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts
index 0271ac73105..f3e9c325da6 100644
--- a/src/compiler/diagnosticInformationMap.generated.ts
+++ b/src/compiler/diagnosticInformationMap.generated.ts
@@ -358,11 +358,12 @@ module ts {
Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: DiagnosticCategory.Error, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." },
Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: DiagnosticCategory.Error, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." },
Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." },
- The_arguments_object_cannot_be_referenced_in_an_arrow_function_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression." },
+ The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." },
External_module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: DiagnosticCategory.Error, key: "External module '{0}' resolves to a non-module entity and cannot be imported using this construct." },
External_module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: DiagnosticCategory.Error, key: "External module '{0}' uses 'export =' and cannot be used with 'export *'." },
An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." },
A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." },
+ A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." },
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },
diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json
index 063a0d50ef5..61ce23c316b 100644
--- a/src/compiler/diagnosticMessages.json
+++ b/src/compiler/diagnosticMessages.json
@@ -1419,7 +1419,7 @@
"category": "Error",
"code": 2495
},
- "The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": {
+ "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.": {
"category": "Error",
"code": 2496
},
@@ -1439,6 +1439,10 @@
"category": "Error",
"code": 2500
},
+ "A rest element cannot contain a binding pattern.": {
+ "category": "Error",
+ "code": 2501
+ },
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts
index 82916c3c9ae..ac8c2f828f2 100644
--- a/src/compiler/emitter.ts
+++ b/src/compiler/emitter.ts
@@ -1589,23 +1589,40 @@ var __param = this.__param || function(index, decorator) { return function (targ
return result;
}
- function createPropertyAccessExpression(expression: LeftHandSideExpression, name: Identifier): PropertyAccessExpression {
+ function createPropertyAccessExpression(expression: Expression, name: Identifier): PropertyAccessExpression {
let result = createSynthesizedNode(SyntaxKind.PropertyAccessExpression);
- result.expression = expression;
+ result.expression = parenthesizeForAccess(expression);
result.dotToken = createSynthesizedNode(SyntaxKind.DotToken);
result.name = name;
return result;
- }
+ }
- function createElementAccessExpression(expression: LeftHandSideExpression, argumentExpression: Expression): ElementAccessExpression {
+ function createElementAccessExpression(expression: Expression, argumentExpression: Expression): ElementAccessExpression {
let result = createSynthesizedNode(SyntaxKind.ElementAccessExpression);
- result.expression = expression;
+ result.expression = parenthesizeForAccess(expression);
result.argumentExpression = argumentExpression;
return result;
}
+ function parenthesizeForAccess(expr: Expression): LeftHandSideExpression {
+ // isLeftHandSideExpression is almost the correct criterion for when it is not necessary
+ // to parenthesize the expression before a dot. The known exceptions are:
+ //
+ // NewExpression:
+ // new C.x -> not the same as (new C).x
+ // NumberLiteral
+ // 1.x -> not the same as (1).x
+ //
+ if (isLeftHandSideExpression(expr) && expr.kind !== SyntaxKind.NewExpression && expr.kind !== SyntaxKind.NumericLiteral) {
+ return expr;
+ }
+ let node = createSynthesizedNode(SyntaxKind.ParenthesizedExpression);
+ node.expression = expr;
+ return node;
+ }
+
function emitComputedPropertyName(node: ComputedPropertyName) {
write("[");
emitExpressionForPropertyName(node);
@@ -2276,7 +2293,7 @@ var __param = this.__param || function(index, decorator) { return function (targ
if (node.initializer.kind === SyntaxKind.ArrayLiteralExpression || node.initializer.kind === SyntaxKind.ObjectLiteralExpression) {
// This is a destructuring pattern, so call emitDestructuring instead of emit. Calling emit will not work, because it will cause
// the BinaryExpression to be passed in instead of the expression statement, which will cause emitDestructuring to crash.
- emitDestructuring(assignmentExpression, /*isAssignmentExpressionStatement*/ true, /*value*/ undefined, /*locationForCheckingExistingName*/ node);
+ emitDestructuring(assignmentExpression, /*isAssignmentExpressionStatement*/ true, /*value*/ undefined);
}
else {
emitNodeWithoutSourceMap(assignmentExpression);
@@ -2480,16 +2497,7 @@ var __param = this.__param || function(index, decorator) { return function (targ
}
}
- /**
- * If the root has a chance of being a synthesized node, callers should also pass a value for
- * lowestNonSynthesizedAncestor. This should be an ancestor of root, it should not be synthesized,
- * and there should not be a lower ancestor that introduces a scope. This node will be used as the
- * location for ensuring that temporary names are unique.
- */
- function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration,
- isAssignmentExpressionStatement: boolean,
- value?: Expression,
- lowestNonSynthesizedAncestor?: Node) {
+ function emitDestructuring(root: BinaryExpression | VariableDeclaration | ParameterDeclaration, isAssignmentExpressionStatement: boolean, value?: Expression) {
let emitCount = 0;
// An exported declaration is actually emitted as an assignment (to a property on the module object), so
// temporary variables in an exported declaration need to have real declarations elsewhere
@@ -2520,9 +2528,6 @@ var __param = this.__param || function(index, decorator) { return function (targ
function ensureIdentifier(expr: Expression): Expression {
if (expr.kind !== SyntaxKind.Identifier) {
- // In case the root is a synthesized node, we need to pass lowestNonSynthesizedAncestor
- // as the location for determining uniqueness of the variable we are about to
- // generate.
let identifier = createTempVariable(TempFlags.Auto);
if (!isDeclaration) {
recordTempDeclaration(identifier);
@@ -2561,27 +2566,22 @@ var __param = this.__param || function(index, decorator) { return function (targ
return node;
}
- function parenthesizeForAccess(expr: Expression): LeftHandSideExpression {
- if (expr.kind === SyntaxKind.Identifier || expr.kind === SyntaxKind.PropertyAccessExpression || expr.kind === SyntaxKind.ElementAccessExpression) {
- return expr;
- }
- let node = createSynthesizedNode(SyntaxKind.ParenthesizedExpression);
- node.expression = expr;
- return node;
- }
-
- function createPropertyAccess(object: Expression, propName: Identifier): Expression {
+ function createPropertyAccessForDestructuringProperty(object: Expression, propName: Identifier | LiteralExpression): Expression {
if (propName.kind !== SyntaxKind.Identifier) {
- return createElementAccess(object, propName);
+ return createElementAccessExpression(object, propName);
}
- return createPropertyAccessExpression(parenthesizeForAccess(object), propName);
+
+ return createPropertyAccessExpression(object, propName);
}
- function createElementAccess(object: Expression, index: Expression): Expression {
- let node = createSynthesizedNode(SyntaxKind.ElementAccessExpression);
- node.expression = parenthesizeForAccess(object);
- node.argumentExpression = index;
- return node;
+ function createSliceCall(value: Expression, sliceIndex: number): CallExpression {
+ let call = createSynthesizedNode(SyntaxKind.CallExpression);
+ let sliceIdentifier = createSynthesizedNode(SyntaxKind.Identifier);
+ sliceIdentifier.text = "slice";
+ call.expression = createPropertyAccessExpression(value, sliceIdentifier);
+ call.arguments = >createSynthesizedNodeArray();
+ call.arguments[0] = createNumericLiteral(sliceIndex);
+ return call;
}
function emitObjectLiteralAssignment(target: ObjectLiteralExpression, value: Expression) {
@@ -2594,8 +2594,8 @@ var __param = this.__param || function(index, decorator) { return function (targ
for (let p of properties) {
if (p.kind === SyntaxKind.PropertyAssignment || p.kind === SyntaxKind.ShorthandPropertyAssignment) {
// TODO(andersh): Computed property support
- let propName = ((p).name);
- emitDestructuringAssignment((p).initializer || propName, createPropertyAccess(value, propName));
+ let propName = ((p).name);
+ emitDestructuringAssignment((p).initializer || propName, createPropertyAccessForDestructuringProperty(value, propName));
}
}
}
@@ -2611,14 +2611,10 @@ var __param = this.__param || function(index, decorator) { return function (targ
let e = elements[i];
if (e.kind !== SyntaxKind.OmittedExpression) {
if (e.kind !== SyntaxKind.SpreadElementExpression) {
- emitDestructuringAssignment(e, createElementAccess(value, createNumericLiteral(i)));
+ emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i)));
}
- else {
- if (i === elements.length - 1) {
- value = ensureIdentifier(value);
- emitAssignment((e).expression, value);
- write(".slice(" + i + ")");
- }
+ else if (i === elements.length - 1) {
+ emitDestructuringAssignment((e).expression, createSliceCall(value, i));
}
}
}
@@ -2682,19 +2678,15 @@ var __param = this.__param || function(index, decorator) { return function (targ
if (pattern.kind === SyntaxKind.ObjectBindingPattern) {
// Rewrite element to a declaration with an initializer that fetches property
let propName = element.propertyName || element.name;
- emitBindingElement(element, createPropertyAccess(value, propName));
+ emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName));
}
else if (element.kind !== SyntaxKind.OmittedExpression) {
if (!element.dotDotDotToken) {
// Rewrite element to a declaration that accesses array element at index i
- emitBindingElement(element, createElementAccess(value, createNumericLiteral(i)));
+ emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i)));
}
- else {
- if (i === elements.length - 1) {
- value = ensureIdentifier(value);
- emitAssignment(element.name, value);
- write(".slice(" + i + ")");
- }
+ else if (i === elements.length - 1) {
+ emitBindingElement(element, createSliceCall(value, i));
}
}
}
@@ -2862,6 +2854,12 @@ var __param = this.__param || function(index, decorator) { return function (targ
if (languageVersion < ScriptTarget.ES6) {
let tempIndex = 0;
forEach(node.parameters, p => {
+ // A rest parameter cannot have a binding pattern or an initializer,
+ // so let's just ignore it.
+ if (p.dotDotDotToken) {
+ return;
+ }
+
if (isBindingPattern(p.name)) {
writeLine();
write("var ");
@@ -2892,6 +2890,12 @@ var __param = this.__param || function(index, decorator) { return function (targ
if (languageVersion < ScriptTarget.ES6 && hasRestParameters(node)) {
let restIndex = node.parameters.length - 1;
let restParam = node.parameters[restIndex];
+
+ // A rest parameter cannot have a binding pattern, so let's just ignore it if it does.
+ if (isBindingPattern(restParam.name)) {
+ return;
+ }
+
let tempName = createTempVariable(TempFlags._i).text;
writeLine();
emitLeadingComments(restParam);
@@ -4207,6 +4211,10 @@ var __param = this.__param || function(index, decorator) { return function (targ
return isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation);
}
+ function isModuleMergedWithES6Class(node: ModuleDeclaration) {
+ return languageVersion === ScriptTarget.ES6 && !!(resolver.getNodeCheckFlags(node) & NodeCheckFlags.LexicalModuleMergesWithClass);
+ }
+
function emitModuleDeclaration(node: ModuleDeclaration) {
// Emit only if this module is non-ambient.
let shouldEmit = shouldEmitModuleDeclaration(node);
@@ -4215,15 +4223,19 @@ var __param = this.__param || function(index, decorator) { return function (targ
return emitOnlyPinnedOrTripleSlashComments(node);
}
- emitStart(node);
- if (isES6ExportedDeclaration(node)) {
- write("export ");
+ if (!isModuleMergedWithES6Class(node)) {
+ emitStart(node);
+ if (isES6ExportedDeclaration(node)) {
+ write("export ");
+ }
+
+ write("var ");
+ emit(node.name);
+ write(";");
+ emitEnd(node);
+ writeLine();
}
- write("var ");
- emit(node.name);
- write(";");
- emitEnd(node);
- writeLine();
+
emitStart(node);
write("(function (");
emitStart(node.name);
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 93f8404d881..5fce6df3bd5 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -318,452 +318,12 @@ module ts {
}
}
- const enum ParsingContext {
- SourceElements, // Elements in source file
- ModuleElements, // Elements in module declaration
- BlockStatements, // Statements in block
- SwitchClauses, // Clauses in switch statement
- SwitchClauseStatements, // Statements in switch clause
- TypeMembers, // Members in interface or type literal
- ClassMembers, // Members in class declaration
- EnumMembers, // Members in enum declaration
- HeritageClauseElement, // Elements in a heritage clause
- VariableDeclarations, // Variable declarations in variable statement
- ObjectBindingElements, // Binding elements in object binding list
- ArrayBindingElements, // Binding elements in array binding list
- ArgumentExpressions, // Expressions in argument list
- ObjectLiteralMembers, // Members in object literal
- ArrayLiteralMembers, // Members in array literal
- Parameters, // Parameters in parameter list
- TypeParameters, // Type parameters in type parameter list
- TypeArguments, // Type arguments in type argument list
- TupleElementTypes, // Element types in tuple element type list
- HeritageClauses, // Heritage clauses for a class or interface declaration.
- ImportOrExportSpecifiers, // Named import clause's import specifier list
- Count // Number of parsing contexts
- }
+ export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes = false): SourceFile {
+ let start = new Date().getTime();
+ let result = Parser.parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes);
- const enum Tristate {
- False,
- True,
- Unknown
- }
-
- function parsingContextErrors(context: ParsingContext): DiagnosticMessage {
- switch (context) {
- case ParsingContext.SourceElements: return Diagnostics.Declaration_or_statement_expected;
- case ParsingContext.ModuleElements: return Diagnostics.Declaration_or_statement_expected;
- case ParsingContext.BlockStatements: return Diagnostics.Statement_expected;
- case ParsingContext.SwitchClauses: return Diagnostics.case_or_default_expected;
- case ParsingContext.SwitchClauseStatements: return Diagnostics.Statement_expected;
- case ParsingContext.TypeMembers: return Diagnostics.Property_or_signature_expected;
- case ParsingContext.ClassMembers: return Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected;
- case ParsingContext.EnumMembers: return Diagnostics.Enum_member_expected;
- case ParsingContext.HeritageClauseElement: return Diagnostics.Expression_expected;
- case ParsingContext.VariableDeclarations: return Diagnostics.Variable_declaration_expected;
- case ParsingContext.ObjectBindingElements: return Diagnostics.Property_destructuring_pattern_expected;
- case ParsingContext.ArrayBindingElements: return Diagnostics.Array_element_destructuring_pattern_expected;
- case ParsingContext.ArgumentExpressions: return Diagnostics.Argument_expression_expected;
- case ParsingContext.ObjectLiteralMembers: return Diagnostics.Property_assignment_expected;
- case ParsingContext.ArrayLiteralMembers: return Diagnostics.Expression_or_comma_expected;
- case ParsingContext.Parameters: return Diagnostics.Parameter_declaration_expected;
- case ParsingContext.TypeParameters: return Diagnostics.Type_parameter_declaration_expected;
- case ParsingContext.TypeArguments: return Diagnostics.Type_argument_expected;
- case ParsingContext.TupleElementTypes: return Diagnostics.Type_expected;
- case ParsingContext.HeritageClauses: return Diagnostics.Unexpected_token_expected;
- case ParsingContext.ImportOrExportSpecifiers: return Diagnostics.Identifier_expected;
- }
- };
-
- export function modifierToFlag(token: SyntaxKind): NodeFlags {
- switch (token) {
- case SyntaxKind.StaticKeyword: return NodeFlags.Static;
- case SyntaxKind.PublicKeyword: return NodeFlags.Public;
- case SyntaxKind.ProtectedKeyword: return NodeFlags.Protected;
- case SyntaxKind.PrivateKeyword: return NodeFlags.Private;
- case SyntaxKind.ExportKeyword: return NodeFlags.Export;
- case SyntaxKind.DeclareKeyword: return NodeFlags.Ambient;
- case SyntaxKind.ConstKeyword: return NodeFlags.Const;
- case SyntaxKind.DefaultKeyword: return NodeFlags.Default;
- }
- return 0;
- }
-
- function fixupParentReferences(sourceFile: SourceFile) {
- // normally parent references are set during binding. However, for clients that only need
- // a syntax tree, and no semantic features, then the binding process is an unnecessary
- // overhead. This functions allows us to set all the parents, without all the expense of
- // binding.
-
- let parent: Node = sourceFile;
- forEachChild(sourceFile, visitNode);
- return;
-
- function visitNode(n: Node): void {
- // walk down setting parents that differ from the parent we think it should be. This
- // allows us to quickly bail out of setting parents for subtrees during incremental
- // parsing
- if (n.parent !== parent) {
- n.parent = parent;
-
- let saveParent = parent;
- parent = n;
- forEachChild(n, visitNode);
- parent = saveParent;
- }
- }
- }
-
- function shouldCheckNode(node: Node) {
- switch (node.kind) {
- case SyntaxKind.StringLiteral:
- case SyntaxKind.NumericLiteral:
- case SyntaxKind.Identifier:
- return true;
- }
-
- return false;
- }
-
- function moveElementEntirelyPastChangeRange(element: IncrementalElement, isArray: boolean, delta: number, oldText: string, newText: string, aggressiveChecks: boolean) {
- if (isArray) {
- visitArray(element);
- }
- else {
- visitNode(element);
- }
- return;
-
- function visitNode(node: IncrementalNode) {
- if (aggressiveChecks && shouldCheckNode(node)) {
- var text = oldText.substring(node.pos, node.end);
- }
-
- // Ditch any existing LS children we may have created. This way we can avoid
- // moving them forward.
- node._children = undefined;
- node.pos += delta;
- node.end += delta;
-
- if (aggressiveChecks && shouldCheckNode(node)) {
- Debug.assert(text === newText.substring(node.pos, node.end));
- }
-
- forEachChild(node, visitNode, visitArray);
- checkNodePositions(node, aggressiveChecks);
- }
-
- function visitArray(array: IncrementalNodeArray) {
- array._children = undefined;
- array.pos += delta;
- array.end += delta;
-
- for (let node of array) {
- visitNode(node);
- }
- }
- }
-
- function adjustIntersectingElement(element: IncrementalElement, changeStart: number, changeRangeOldEnd: number, changeRangeNewEnd: number, delta: number) {
- Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range");
- Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range");
- Debug.assert(element.pos <= element.end);
-
- // We have an element that intersects the change range in some way. It may have its
- // start, or its end (or both) in the changed range. We want to adjust any part
- // that intersects such that the final tree is in a consistent state. i.e. all
- // chlidren have spans within the span of their parent, and all siblings are ordered
- // properly.
-
- // We may need to update both the 'pos' and the 'end' of the element.
-
- // If the 'pos' is before the start of the change, then we don't need to touch it.
- // If it isn't, then the 'pos' must be inside the change. How we update it will
- // depend if delta is positive or negative. If delta is positive then we have
- // something like:
- //
- // -------------------AAA-----------------
- // -------------------BBBCCCCCCC-----------------
- //
- // In this case, we consider any node that started in the change range to still be
- // starting at the same position.
- //
- // however, if the delta is negative, then we instead have something like this:
- //
- // -------------------XXXYYYYYYY-----------------
- // -------------------ZZZ-----------------
- //
- // In this case, any element that started in the 'X' range will keep its position.
- // However any element htat started after that will have their pos adjusted to be
- // at the end of the new range. i.e. any node that started in the 'Y' range will
- // be adjusted to have their start at the end of the 'Z' range.
- //
- // The element will keep its position if possible. Or Move backward to the new-end
- // if it's in the 'Y' range.
- element.pos = Math.min(element.pos, changeRangeNewEnd);
-
- // If the 'end' is after the change range, then we always adjust it by the delta
- // amount. However, if the end is in the change range, then how we adjust it
- // will depend on if delta is positive or negative. If delta is positive then we
- // have something like:
- //
- // -------------------AAA-----------------
- // -------------------BBBCCCCCCC-----------------
- //
- // In this case, we consider any node that ended inside the change range to keep its
- // end position.
- //
- // however, if the delta is negative, then we instead have something like this:
- //
- // -------------------XXXYYYYYYY-----------------
- // -------------------ZZZ-----------------
- //
- // In this case, any element that ended in the 'X' range will keep its position.
- // However any element htat ended after that will have their pos adjusted to be
- // at the end of the new range. i.e. any node that ended in the 'Y' range will
- // be adjusted to have their end at the end of the 'Z' range.
- if (element.end >= changeRangeOldEnd) {
- // Element ends after the change range. Always adjust the end pos.
- element.end += delta;
- }
- else {
- // Element ends in the change range. The element will keep its position if
- // possible. Or Move backward to the new-end if it's in the 'Y' range.
- element.end = Math.min(element.end, changeRangeNewEnd);
- }
-
- Debug.assert(element.pos <= element.end);
- if (element.parent) {
- Debug.assert(element.pos >= element.parent.pos);
- Debug.assert(element.end <= element.parent.end);
- }
- }
-
- function checkNodePositions(node: Node, aggressiveChecks: boolean) {
- if (aggressiveChecks) {
- let pos = node.pos;
- forEachChild(node, child => {
- Debug.assert(child.pos >= pos);
- pos = child.end;
- });
- Debug.assert(pos <= node.end);
- }
- }
-
- function updateTokenPositionsAndMarkElements(
- sourceFile: IncrementalNode,
- changeStart: number,
- changeRangeOldEnd: number,
- changeRangeNewEnd: number,
- delta: number,
- oldText: string,
- newText: string,
- aggressiveChecks: boolean): void {
-
- visitNode(sourceFile);
- return;
-
- function visitNode(child: IncrementalNode) {
- Debug.assert(child.pos <= child.end);
- if (child.pos > changeRangeOldEnd) {
- // Node is entirely past the change range. We need to move both its pos and
- // end, forward or backward appropriately.
- moveElementEntirelyPastChangeRange(child, /*isArray:*/ false, delta, oldText, newText, aggressiveChecks);
- return;
- }
-
- // Check if the element intersects the change range. If it does, then it is not
- // reusable. Also, we'll need to recurse to see what constituent portions we may
- // be able to use.
- let fullEnd = child.end;
- if (fullEnd >= changeStart) {
- child.intersectsChange = true;
- child._children = undefined;
-
- // Adjust the pos or end (or both) of the intersecting element accordingly.
- adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
- forEachChild(child, visitNode, visitArray);
-
- checkNodePositions(child, aggressiveChecks);
- return;
- }
-
- // Otherwise, the node is entirely before the change range. No need to do anything with it.
- Debug.assert(fullEnd < changeStart);
- }
-
- function visitArray(array: IncrementalNodeArray) {
- Debug.assert(array.pos <= array.end);
- if (array.pos > changeRangeOldEnd) {
- // Array is entirely after the change range. We need to move it, and move any of
- // its children.
- moveElementEntirelyPastChangeRange(array, /*isArray:*/ true, delta, oldText, newText, aggressiveChecks);
- return;
- }
-
- // Check if the element intersects the change range. If it does, then it is not
- // reusable. Also, we'll need to recurse to see what constituent portions we may
- // be able to use.
- let fullEnd = array.end;
- if (fullEnd >= changeStart) {
- array.intersectsChange = true;
- array._children = undefined;
-
- // Adjust the pos or end (or both) of the intersecting array accordingly.
- adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
- for (let node of array) {
- visitNode(node);
- }
- return;
- }
-
- // Otherwise, the array is entirely before the change range. No need to do anything with it.
- Debug.assert(fullEnd < changeStart);
- }
- }
-
- function extendToAffectedRange(sourceFile: SourceFile, changeRange: TextChangeRange): TextChangeRange {
- // Consider the following code:
- // void foo() { /; }
- //
- // If the text changes with an insertion of / just before the semicolon then we end up with:
- // void foo() { //; }
- //
- // If we were to just use the changeRange a is, then we would not rescan the { token
- // (as it does not intersect the actual original change range). Because an edit may
- // change the token touching it, we actually need to look back *at least* one token so
- // that the prior token sees that change.
- let maxLookahead = 1;
-
- let start = changeRange.span.start;
-
- // the first iteration aligns us with the change start. subsequent iteration move us to
- // the left by maxLookahead tokens. We only need to do this as long as we're not at the
- // start of the tree.
- for (let i = 0; start > 0 && i <= maxLookahead; i++) {
- let nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start);
- Debug.assert(nearestNode.pos <= start);
- let position = nearestNode.pos;
-
- start = Math.max(0, position - 1);
- }
-
- let finalSpan = createTextSpanFromBounds(start, textSpanEnd(changeRange.span));
- let finalLength = changeRange.newLength + (changeRange.span.start - start);
-
- return createTextChangeRange(finalSpan, finalLength);
- }
-
- function findNearestNodeStartingBeforeOrAtPosition(sourceFile: SourceFile, position: number): Node {
- let bestResult: Node = sourceFile;
- let lastNodeEntirelyBeforePosition: Node;
-
- forEachChild(sourceFile, visit);
-
- if (lastNodeEntirelyBeforePosition) {
- let lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition);
- if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) {
- bestResult = lastChildOfLastEntireNodeBeforePosition;
- }
- }
-
- return bestResult;
-
- function getLastChild(node: Node): Node {
- while (true) {
- let lastChild = getLastChildWorker(node);
- if (lastChild) {
- node = lastChild;
- }
- else {
- return node;
- }
- }
- }
-
- function getLastChildWorker(node: Node): Node {
- let last: Node = undefined;
- forEachChild(node, child => {
- if (nodeIsPresent(child)) {
- last = child;
- }
- });
- return last;
- }
-
- function visit(child: Node) {
- if (nodeIsMissing(child)) {
- // Missing nodes are effectively invisible to us. We never even consider them
- // When trying to find the nearest node before us.
- return;
- }
-
- // If the child intersects this position, then this node is currently the nearest
- // node that starts before the position.
- if (child.pos <= position) {
- if (child.pos >= bestResult.pos) {
- // This node starts before the position, and is closer to the position than
- // the previous best node we found. It is now the new best node.
- bestResult = child;
- }
-
- // Now, the node may overlap the position, or it may end entirely before the
- // position. If it overlaps with the position, then either it, or one of its
- // children must be the nearest node before the position. So we can just
- // recurse into this child to see if we can find something better.
- if (position < child.end) {
- // The nearest node is either this child, or one of the children inside
- // of it. We've already marked this child as the best so far. Recurse
- // in case one of the children is better.
- forEachChild(child, visit);
-
- // Once we look at the children of this node, then there's no need to
- // continue any further.
- return true;
- }
- else {
- Debug.assert(child.end <= position);
- // The child ends entirely before this position. Say you have the following
- // (where $ is the position)
- //
- // ? $ : <...> <...>
- //
- // We would want to find the nearest preceding node in "complex expr 2".
- // To support that, we keep track of this node, and once we're done searching
- // for a best node, we recurse down this node to see if we can find a good
- // result in it.
- //
- // This approach allows us to quickly skip over nodes that are entirely
- // before the position, while still allowing us to find any nodes in the
- // last one that might be what we want.
- lastNodeEntirelyBeforePosition = child;
- }
- }
- else {
- Debug.assert(child.pos > position);
- // We're now at a node that is entirely past the position we're searching for.
- // This node (and all following nodes) could never contribute to the result,
- // so just skip them by returning 'true' here.
- return true;
- }
- }
- }
-
- function checkChangeRange(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks: boolean) {
- let oldText = sourceFile.text;
- if (textChangeRange) {
- Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length);
-
- if (aggressiveChecks || Debug.shouldAssert(AssertionLevel.VeryAggressive)) {
- let oldTextPrefix = oldText.substr(0, textChangeRange.span.start);
- let newTextPrefix = newText.substr(0, textChangeRange.span.start);
- Debug.assert(oldTextPrefix === newTextPrefix);
-
- let oldTextSuffix = oldText.substring(textSpanEnd(textChangeRange.span), oldText.length);
- let newTextSuffix = newText.substring(textSpanEnd(textChangeRangeNewSpan(textChangeRange)), newText.length);
- Debug.assert(oldTextSuffix === newTextSuffix);
- }
- }
+ parseTime += new Date().getTime() - start;
+ return result;
}
// Produces a new SourceFile for the 'newText' provided. The 'textChangeRange' parameter
@@ -776,256 +336,28 @@ module ts {
// becoming detached from any SourceFile). It is recommended that this SourceFile not
// be used once 'update' is called on it.
export function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile {
- aggressiveChecks = aggressiveChecks || Debug.shouldAssert(AssertionLevel.Aggressive);
-
- checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks);
- if (textChangeRangeIsUnchanged(textChangeRange)) {
- // if the text didn't change, then we can just return our current source file as-is.
- return sourceFile;
- }
-
- if (sourceFile.statements.length === 0) {
- // If we don't have any statements in the current source file, then there's no real
- // way to incrementally parse. So just do a full parse instead.
- return parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setNodeParents*/ true)
- }
-
- // Make sure we're not trying to incrementally update a source file more than once. Once
- // we do an update the original source file is considered unusbale from that point onwards.
- //
- // This is because we do incremental parsing in-place. i.e. we take nodes from the old
- // tree and give them new positions and parents. From that point on, trusting the old
- // tree at all is not possible as far too much of it may violate invariants.
- let incrementalSourceFile = sourceFile;
- Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed);
- incrementalSourceFile.hasBeenIncrementallyParsed = true;
-
- let oldText = sourceFile.text;
- let syntaxCursor = createSyntaxCursor(sourceFile);
-
- // Make the actual change larger so that we know to reparse anything whose lookahead
- // might have intersected the change.
- let changeRange = extendToAffectedRange(sourceFile, textChangeRange);
- checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks);
-
- // Ensure that extending the affected range only moved the start of the change range
- // earlier in the file.
- Debug.assert(changeRange.span.start <= textChangeRange.span.start);
- Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span));
- Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange)));
-
- // The is the amount the nodes after the edit range need to be adjusted. It can be
- // positive (if the edit added characters), negative (if the edit deleted characters)
- // or zero (if this was a pure overwrite with nothing added/removed).
- let delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length;
-
- // If we added or removed characters during the edit, then we need to go and adjust all
- // the nodes after the edit. Those nodes may move forward (if we inserted chars) or they
- // may move backward (if we deleted chars).
- //
- // Doing this helps us out in two ways. First, it means that any nodes/tokens we want
- // to reuse are already at the appropriate position in the new text. That way when we
- // reuse them, we don't have to figure out if they need to be adjusted. Second, it makes
- // it very easy to determine if we can reuse a node. If the node's position is at where
- // we are in the text, then we can reuse it. Otherwise we can't. If the node's position
- // is ahead of us, then we'll need to rescan tokens. If the node's position is behind
- // us, then we'll need to skip it or crumble it as appropriate
- //
- // We will also adjust the positions of nodes that intersect the change range as well.
- // By doing this, we ensure that all the positions in the old tree are consistent, not
- // just the positions of nodes entirely before/after the change range. By being
- // consistent, we can then easily map from positions to nodes in the old tree easily.
- //
- // Also, mark any syntax elements that intersect the changed span. We know, up front,
- // that we cannot reuse these elements.
- updateTokenPositionsAndMarkElements(incrementalSourceFile,
- changeRange.span.start, textSpanEnd(changeRange.span), textSpanEnd(textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks);
-
- // Now that we've set up our internal incremental state just proceed and parse the
- // source file in the normal fashion. When possible the parser will retrieve and
- // reuse nodes from the old tree.
- //
- // Note: passing in 'true' for setNodeParents is very important. When incrementally
- // parsing, we will be reusing nodes from the old tree, and placing it into new
- // parents. If we don't set the parents now, we'll end up with an observably
- // inconsistent tree. Setting the parents on the new tree should be very fast. We
- // will immediately bail out of walking any subtrees when we can see that their parents
- // are already correct.
- let result = parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /* setParentNode */ true)
-
- return result;
+ return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
}
- export function isEvalOrArgumentsIdentifier(node: Node): boolean {
- return node.kind === SyntaxKind.Identifier &&
- ((node).text === "eval" || (node).text === "arguments");
- }
-
- /// Should be called only on prologue directives (isPrologueDirective(node) should be true)
- function isUseStrictPrologueDirective(sourceFile: SourceFile, node: Node): boolean {
- Debug.assert(isPrologueDirective(node));
- let nodeText = getSourceTextOfNodeFromSourceFile(sourceFile,(node).expression);
-
- // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the
- // string to contain unicode escapes (as per ES5).
- return nodeText === '"use strict"' || nodeText === "'use strict'";
- }
-
- interface IncrementalElement extends TextRange {
- parent?: Node;
- intersectsChange: boolean
- length?: number;
- _children: Node[];
- }
-
- interface IncrementalNode extends Node, IncrementalElement {
- hasBeenIncrementallyParsed: boolean
- }
-
- interface IncrementalNodeArray extends NodeArray, IncrementalElement {
- length: number
- }
-
- // Allows finding nodes in the source file at a certain position in an efficient manner.
- // The implementation takes advantage of the calling pattern it knows the parser will
- // make in order to optimize finding nodes as quickly as possible.
- interface SyntaxCursor {
- currentNode(position: number): IncrementalNode;
- }
-
- const enum InvalidPosition {
- Value = -1
- }
-
- function createSyntaxCursor(sourceFile: SourceFile): SyntaxCursor {
- let currentArray: NodeArray = sourceFile.statements;
- let currentArrayIndex = 0;
-
- Debug.assert(currentArrayIndex < currentArray.length);
- let current = currentArray[currentArrayIndex];
- let lastQueriedPosition = InvalidPosition.Value;
-
- return {
- currentNode(position: number) {
- // Only compute the current node if the position is different than the last time
- // we were asked. The parser commonly asks for the node at the same position
- // twice. Once to know if can read an appropriate list element at a certain point,
- // and then to actually read and consume the node.
- if (position !== lastQueriedPosition) {
- // Much of the time the parser will need the very next node in the array that
- // we just returned a node from.So just simply check for that case and move
- // forward in the array instead of searching for the node again.
- if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) {
- currentArrayIndex++;
- current = currentArray[currentArrayIndex];
- }
-
- // If we don't have a node, or the node we have isn't in the right position,
- // then try to find a viable node at the position requested.
- if (!current || current.pos !== position) {
- findHighestListElementThatStartsAtPosition(position);
- }
- }
-
- // Cache this query so that we don't do any extra work if the parser calls back
- // into us. Note: this is very common as the parser will make pairs of calls like
- // 'isListElement -> parseListElement'. If we were unable to find a node when
- // called with 'isListElement', we don't want to redo the work when parseListElement
- // is called immediately after.
- lastQueriedPosition = position;
-
- // Either we don'd have a node, or we have a node at the position being asked for.
- Debug.assert(!current || current.pos === position);
- return current;
- }
- };
-
- // Finds the highest element in the tree we can find that starts at the provided position.
- // The element must be a direct child of some node list in the tree. This way after we
- // return it, we can easily return its next sibling in the list.
- function findHighestListElementThatStartsAtPosition(position: number) {
- // Clear out any cached state about the last node we found.
- currentArray = undefined;
- currentArrayIndex = InvalidPosition.Value;
- current = undefined;
-
- // Recurse into the source file to find the highest node at this position.
- forEachChild(sourceFile, visitNode, visitArray);
- return;
-
- function visitNode(node: Node) {
- if (position >= node.pos && position < node.end) {
- // Position was within this node. Keep searching deeper to find the node.
- forEachChild(node, visitNode, visitArray);
-
- // don't procede any futher in the search.
- return true;
- }
-
- // position wasn't in this node, have to keep searching.
- return false;
- }
-
- function visitArray(array: NodeArray) {
- if (position >= array.pos && position < array.end) {
- // position was in this array. Search through this array to see if we find a
- // viable element.
- for (let i = 0, n = array.length; i < n; i++) {
- let child = array[i];
- if (child) {
- if (child.pos === position) {
- // Found the right node. We're done.
- currentArray = array;
- currentArrayIndex = i;
- current = child;
- return true;
- }
- else {
- if (child.pos < position && position < child.end) {
- // Position in somewhere within this child. Search in it and
- // stop searching in this array.
- forEachChild(child, visitNode, visitArray);
- return true;
- }
- }
- }
- }
- }
-
- // position wasn't in this array, have to keep searching.
- return false;
- }
- }
- }
-
- export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes = false): SourceFile {
- let start = new Date().getTime();
- let result = parseSourceFile(fileName, sourceText, languageVersion, /*syntaxCursor*/ undefined, setParentNodes);
-
- parseTime += new Date().getTime() - start;
- return result;
- }
-
- function parseSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, syntaxCursor: SyntaxCursor, setParentNodes = false): SourceFile {
+ // Implement the parser as a singleton module. We do this for perf reasons because creating
+ // parser instances can actually be expensive enough to impact us on projects with many source
+ // files.
+ module Parser {
+ // Share a single scanner across all calls to parse a source file. This helps speed things
+ // up by avoiding the cost of creating/compiling scanners over and over again.
+ const scanner = createScanner(ScriptTarget.Latest, /*skipTrivia:*/ true);
const disallowInAndDecoratorContext = ParserContextFlags.DisallowIn | ParserContextFlags.Decorator;
- let parsingContext: ParsingContext = 0;
- let identifiers: Map = {};
- let identifierCount = 0;
- let nodeCount = 0;
+ let sourceFile: SourceFile;
+ let syntaxCursor: IncrementalParser.SyntaxCursor;
+
let token: SyntaxKind;
+ let sourceText: string;
+ let nodeCount: number;
+ let identifiers: Map;
+ let identifierCount: number;
- let sourceFile = createNode(SyntaxKind.SourceFile, /*pos*/ 0);
-
- sourceFile.pos = 0;
- sourceFile.end = sourceText.length;
- sourceFile.text = sourceText;
-
- sourceFile.parseDiagnostics = [];
- sourceFile.bindDiagnostics = [];
- sourceFile.languageVersion = languageVersion;
- sourceFile.fileName = normalizePath(fileName);
- sourceFile.flags = fileExtensionIs(sourceFile.fileName, ".d.ts") ? NodeFlags.DeclarationFile : 0;
+ let parsingContext: ParsingContext;
// Flags that dictate what parsing context we're in. For example:
// Whether or not we are in strict parsing mode. All that changes in strict parsing mode is
@@ -1104,28 +436,97 @@ module ts {
// attached to the EOF token.
let parseErrorBeforeNextFinishedNode: boolean = false;
- // Create and prime the scanner before parsing the source elements.
- let scanner = createScanner(languageVersion, /*skipTrivia*/ true, sourceText, scanError);
- token = nextToken();
+ export function parseSourceFile(fileName: string, _sourceText: string, languageVersion: ScriptTarget, _syntaxCursor: IncrementalParser.SyntaxCursor, setParentNodes?: boolean): SourceFile {
+ sourceText = _sourceText;
+ syntaxCursor = _syntaxCursor;
- processReferenceComments(sourceFile);
+ parsingContext = 0;
+ identifiers = {};
+ identifierCount = 0;
+ nodeCount = 0;
- sourceFile.statements = parseList(ParsingContext.SourceElements, /*checkForStrictMode*/ true, parseSourceElement);
- Debug.assert(token === SyntaxKind.EndOfFileToken);
- sourceFile.endOfFileToken = parseTokenNode();
+ contextFlags = 0;
+ parseErrorBeforeNextFinishedNode = false;
- setExternalModuleIndicator(sourceFile);
+ createSourceFile(fileName, languageVersion);
- sourceFile.nodeCount = nodeCount;
- sourceFile.identifierCount = identifierCount;
- sourceFile.identifiers = identifiers;
+ // Initialize and prime the scanner before parsing the source elements.
+ scanner.setText(sourceText);
+ scanner.setOnError(scanError);
+ scanner.setScriptTarget(languageVersion);
+ token = nextToken();
- if (setParentNodes) {
- fixupParentReferences(sourceFile);
+ processReferenceComments(sourceFile);
+
+ sourceFile.statements = parseList(ParsingContext.SourceElements, /*checkForStrictMode*/ true, parseSourceElement);
+ Debug.assert(token === SyntaxKind.EndOfFileToken);
+ sourceFile.endOfFileToken = parseTokenNode();
+
+ setExternalModuleIndicator(sourceFile);
+
+ sourceFile.nodeCount = nodeCount;
+ sourceFile.identifierCount = identifierCount;
+ sourceFile.identifiers = identifiers;
+
+ if (setParentNodes) {
+ fixupParentReferences(sourceFile);
+ }
+
+ syntaxCursor = undefined;
+
+ // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily.
+ scanner.setText("");
+ scanner.setOnError(undefined);
+
+ let result = sourceFile;
+
+ // Clear any data. We don't want to accidently hold onto it for too long.
+ sourceFile = undefined;
+ identifiers = undefined;
+ syntaxCursor = undefined;
+ sourceText = undefined;
+
+ return result;
}
- syntaxCursor = undefined;
- return sourceFile;
+ function fixupParentReferences(sourceFile: SourceFile) {
+ // normally parent references are set during binding. However, for clients that only need
+ // a syntax tree, and no semantic features, then the binding process is an unnecessary
+ // overhead. This functions allows us to set all the parents, without all the expense of
+ // binding.
+
+ let parent: Node = sourceFile;
+ forEachChild(sourceFile, visitNode);
+ return;
+
+ function visitNode(n: Node): void {
+ // walk down setting parents that differ from the parent we think it should be. This
+ // allows us to quickly bail out of setting parents for subtrees during incremental
+ // parsing
+ if (n.parent !== parent) {
+ n.parent = parent;
+
+ let saveParent = parent;
+ parent = n;
+ forEachChild(n, visitNode);
+ parent = saveParent;
+ }
+ }
+ }
+
+ function createSourceFile(fileName: string, languageVersion: ScriptTarget) {
+ sourceFile = createNode(SyntaxKind.SourceFile, /*pos*/ 0);
+
+ sourceFile.pos = 0;
+ sourceFile.end = sourceText.length;
+ sourceFile.text = sourceText;
+
+ sourceFile.parseDiagnostics = [];
+ sourceFile.bindDiagnostics = [];
+ sourceFile.languageVersion = languageVersion;
+ sourceFile.fileName = normalizePath(fileName);
+ sourceFile.flags = fileExtensionIs(sourceFile.fileName, ".d.ts") ? NodeFlags.DeclarationFile : 0;
+ }
function setContextFlag(val: Boolean, flag: ParserContextFlags) {
if (val) {
@@ -1459,7 +860,7 @@ module ts {
return node;
}
-
+
function createMissingNode(kind: SyntaxKind, reportAtCurrentPosition: boolean, diagnosticMessage: DiagnosticMessage, arg0?: any): Node {
if (reportAtCurrentPosition) {
parseErrorAtPosition(scanner.getStartPos(), 0, diagnosticMessage, arg0);
@@ -1488,7 +889,7 @@ module ts {
// Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker
if (token !== SyntaxKind.Identifier) {
- node.originalKeywordKind = token;
+ node.originalKeywordKind = token;
}
node.text = internIdentifier(scanner.getTokenValue());
nextToken();
@@ -1827,6 +1228,16 @@ module ts {
return result;
}
+ /// Should be called only on prologue directives (isPrologueDirective(node) should be true)
+ function isUseStrictPrologueDirective(sourceFile: SourceFile, node: Node): boolean {
+ Debug.assert(isPrologueDirective(node));
+ let nodeText = getSourceTextOfNodeFromSourceFile(sourceFile, (node).expression);
+
+ // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the
+ // string to contain unicode escapes (as per ES5).
+ return nodeText === '"use strict"' || nodeText === "'use strict'";
+ }
+
function parseListElement(parsingContext: ParsingContext, parseElement: () => T): T {
let node = currentNode(parsingContext);
if (node) {
@@ -2118,6 +1529,32 @@ module ts {
return false;
}
+ function parsingContextErrors(context: ParsingContext): DiagnosticMessage {
+ switch (context) {
+ case ParsingContext.SourceElements: return Diagnostics.Declaration_or_statement_expected;
+ case ParsingContext.ModuleElements: return Diagnostics.Declaration_or_statement_expected;
+ case ParsingContext.BlockStatements: return Diagnostics.Statement_expected;
+ case ParsingContext.SwitchClauses: return Diagnostics.case_or_default_expected;
+ case ParsingContext.SwitchClauseStatements: return Diagnostics.Statement_expected;
+ case ParsingContext.TypeMembers: return Diagnostics.Property_or_signature_expected;
+ case ParsingContext.ClassMembers: return Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected;
+ case ParsingContext.EnumMembers: return Diagnostics.Enum_member_expected;
+ case ParsingContext.HeritageClauseElement: return Diagnostics.Expression_expected;
+ case ParsingContext.VariableDeclarations: return Diagnostics.Variable_declaration_expected;
+ case ParsingContext.ObjectBindingElements: return Diagnostics.Property_destructuring_pattern_expected;
+ case ParsingContext.ArrayBindingElements: return Diagnostics.Array_element_destructuring_pattern_expected;
+ case ParsingContext.ArgumentExpressions: return Diagnostics.Argument_expression_expected;
+ case ParsingContext.ObjectLiteralMembers: return Diagnostics.Property_assignment_expected;
+ case ParsingContext.ArrayLiteralMembers: return Diagnostics.Expression_or_comma_expected;
+ case ParsingContext.Parameters: return Diagnostics.Parameter_declaration_expected;
+ case ParsingContext.TypeParameters: return Diagnostics.Type_parameter_declaration_expected;
+ case ParsingContext.TypeArguments: return Diagnostics.Type_argument_expected;
+ case ParsingContext.TupleElementTypes: return Diagnostics.Type_expected;
+ case ParsingContext.HeritageClauses: return Diagnostics.Unexpected_token_expected;
+ case ParsingContext.ImportOrExportSpecifiers: return Diagnostics.Identifier_expected;
+ }
+ };
+
// Parses a comma-delimited list of elements
function parseDelimitedList(kind: ParsingContext, parseElement: () => T, considerSemicolonAsDelimeter?: boolean): NodeArray {
let saveParsingContext = parsingContext;
@@ -2428,10 +1865,10 @@ module ts {
}
function fillSignature(
- returnToken: SyntaxKind,
- yieldAndGeneratorParameterContext: boolean,
- requireCompleteParameterList: boolean,
- signature: SignatureDeclaration): void {
+ returnToken: SyntaxKind,
+ yieldAndGeneratorParameterContext: boolean,
+ requireCompleteParameterList: boolean,
+ signature: SignatureDeclaration): void {
let returnTokenRequired = returnToken === SyntaxKind.EqualsGreaterThanToken;
signature.typeParameters = parseTypeParameters();
signature.parameters = parseParameterList(yieldAndGeneratorParameterContext, requireCompleteParameterList);
@@ -3765,9 +3202,9 @@ module ts {
case SyntaxKind.CommaToken: // foo,
case SyntaxKind.OpenBraceToken: // foo {
- // We don't want to treat these as type arguments. Otherwise we'll parse this
- // as an invocation expression. Instead, we want to parse out the expression
- // in isolation from the type arguments.
+ // We don't want to treat these as type arguments. Otherwise we'll parse this
+ // as an invocation expression. Instead, we want to parse out the expression
+ // in isolation from the type arguments.
default:
// Anything else treat as an expression.
@@ -3830,7 +3267,7 @@ module ts {
function parseArgumentOrArrayLiteralElement(): Expression {
return token === SyntaxKind.DotDotDotToken ? parseSpreadElement() :
token === SyntaxKind.CommaToken ? createNode(SyntaxKind.OmittedExpression) :
- parseAssignmentExpressionOrHigher();
+ parseAssignmentExpressionOrHigher();
}
function parseArgumentExpression(): Expression {
@@ -5315,7 +4752,7 @@ module ts {
function processReferenceComments(sourceFile: SourceFile): void {
let triviaScanner = createScanner(sourceFile.languageVersion, /*skipTrivia*/false, sourceText);
let referencedFiles: FileReference[] = [];
- let amdDependencies: {path: string; name: string}[] = [];
+ let amdDependencies: { path: string; name: string }[] = [];
let amdModuleName: string;
// Keep scanning all the leading trivia in the file until we get to something that
@@ -5363,7 +4800,7 @@ module ts {
let pathMatchResult = pathRegex.exec(comment);
let nameMatchResult = nameRegex.exec(comment);
if (pathMatchResult) {
- let amdDependency = {path: pathMatchResult[2], name: nameMatchResult ? nameMatchResult[2] : undefined };
+ let amdDependency = { path: pathMatchResult[2], name: nameMatchResult ? nameMatchResult[2] : undefined };
amdDependencies.push(amdDependency);
}
}
@@ -5378,47 +4815,605 @@ module ts {
function setExternalModuleIndicator(sourceFile: SourceFile) {
sourceFile.externalModuleIndicator = forEach(sourceFile.statements, node =>
node.flags & NodeFlags.Export
- || node.kind === SyntaxKind.ImportEqualsDeclaration && (node).moduleReference.kind === SyntaxKind.ExternalModuleReference
- || node.kind === SyntaxKind.ImportDeclaration
- || node.kind === SyntaxKind.ExportAssignment
- || node.kind === SyntaxKind.ExportDeclaration
+ || node.kind === SyntaxKind.ImportEqualsDeclaration && (node).moduleReference.kind === SyntaxKind.ExternalModuleReference
+ || node.kind === SyntaxKind.ImportDeclaration
+ || node.kind === SyntaxKind.ExportAssignment
+ || node.kind === SyntaxKind.ExportDeclaration
? node
: undefined);
}
+
+ const enum ParsingContext {
+ SourceElements, // Elements in source file
+ ModuleElements, // Elements in module declaration
+ BlockStatements, // Statements in block
+ SwitchClauses, // Clauses in switch statement
+ SwitchClauseStatements, // Statements in switch clause
+ TypeMembers, // Members in interface or type literal
+ ClassMembers, // Members in class declaration
+ EnumMembers, // Members in enum declaration
+ HeritageClauseElement, // Elements in a heritage clause
+ VariableDeclarations, // Variable declarations in variable statement
+ ObjectBindingElements, // Binding elements in object binding list
+ ArrayBindingElements, // Binding elements in array binding list
+ ArgumentExpressions, // Expressions in argument list
+ ObjectLiteralMembers, // Members in object literal
+ ArrayLiteralMembers, // Members in array literal
+ Parameters, // Parameters in parameter list
+ TypeParameters, // Type parameters in type parameter list
+ TypeArguments, // Type arguments in type argument list
+ TupleElementTypes, // Element types in tuple element type list
+ HeritageClauses, // Heritage clauses for a class or interface declaration.
+ ImportOrExportSpecifiers, // Named import clause's import specifier list
+ Count // Number of parsing contexts
+ }
+
+ const enum Tristate {
+ False,
+ True,
+ Unknown
+ }
}
- export function isLeftHandSideExpression(expr: Expression): boolean {
- if (expr) {
- switch (expr.kind) {
- case SyntaxKind.PropertyAccessExpression:
- case SyntaxKind.ElementAccessExpression:
- case SyntaxKind.NewExpression:
- case SyntaxKind.CallExpression:
- case SyntaxKind.TaggedTemplateExpression:
- case SyntaxKind.ArrayLiteralExpression:
- case SyntaxKind.ParenthesizedExpression:
- case SyntaxKind.ObjectLiteralExpression:
- case SyntaxKind.ClassExpression:
- case SyntaxKind.FunctionExpression:
- case SyntaxKind.Identifier:
- case SyntaxKind.RegularExpressionLiteral:
- case SyntaxKind.NumericLiteral:
- case SyntaxKind.StringLiteral:
- case SyntaxKind.NoSubstitutionTemplateLiteral:
- case SyntaxKind.TemplateExpression:
- case SyntaxKind.FalseKeyword:
- case SyntaxKind.NullKeyword:
- case SyntaxKind.ThisKeyword:
- case SyntaxKind.TrueKeyword:
- case SyntaxKind.SuperKeyword:
- return true;
+ module IncrementalParser {
+ export function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks: boolean): SourceFile {
+ aggressiveChecks = aggressiveChecks || Debug.shouldAssert(AssertionLevel.Aggressive);
+
+ checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks);
+ if (textChangeRangeIsUnchanged(textChangeRange)) {
+ // if the text didn't change, then we can just return our current source file as-is.
+ return sourceFile;
+ }
+
+ if (sourceFile.statements.length === 0) {
+ // If we don't have any statements in the current source file, then there's no real
+ // way to incrementally parse. So just do a full parse instead.
+ return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, /*syntaxCursor*/ undefined, /*setNodeParents*/ true)
+ }
+
+ // Make sure we're not trying to incrementally update a source file more than once. Once
+ // we do an update the original source file is considered unusbale from that point onwards.
+ //
+ // This is because we do incremental parsing in-place. i.e. we take nodes from the old
+ // tree and give them new positions and parents. From that point on, trusting the old
+ // tree at all is not possible as far too much of it may violate invariants.
+ let incrementalSourceFile = sourceFile;
+ Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed);
+ incrementalSourceFile.hasBeenIncrementallyParsed = true;
+
+ let oldText = sourceFile.text;
+ let syntaxCursor = createSyntaxCursor(sourceFile);
+
+ // Make the actual change larger so that we know to reparse anything whose lookahead
+ // might have intersected the change.
+ let changeRange = extendToAffectedRange(sourceFile, textChangeRange);
+ checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks);
+
+ // Ensure that extending the affected range only moved the start of the change range
+ // earlier in the file.
+ Debug.assert(changeRange.span.start <= textChangeRange.span.start);
+ Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span));
+ Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange)));
+
+ // The is the amount the nodes after the edit range need to be adjusted. It can be
+ // positive (if the edit added characters), negative (if the edit deleted characters)
+ // or zero (if this was a pure overwrite with nothing added/removed).
+ let delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length;
+
+ // If we added or removed characters during the edit, then we need to go and adjust all
+ // the nodes after the edit. Those nodes may move forward (if we inserted chars) or they
+ // may move backward (if we deleted chars).
+ //
+ // Doing this helps us out in two ways. First, it means that any nodes/tokens we want
+ // to reuse are already at the appropriate position in the new text. That way when we
+ // reuse them, we don't have to figure out if they need to be adjusted. Second, it makes
+ // it very easy to determine if we can reuse a node. If the node's position is at where
+ // we are in the text, then we can reuse it. Otherwise we can't. If the node's position
+ // is ahead of us, then we'll need to rescan tokens. If the node's position is behind
+ // us, then we'll need to skip it or crumble it as appropriate
+ //
+ // We will also adjust the positions of nodes that intersect the change range as well.
+ // By doing this, we ensure that all the positions in the old tree are consistent, not
+ // just the positions of nodes entirely before/after the change range. By being
+ // consistent, we can then easily map from positions to nodes in the old tree easily.
+ //
+ // Also, mark any syntax elements that intersect the changed span. We know, up front,
+ // that we cannot reuse these elements.
+ updateTokenPositionsAndMarkElements(incrementalSourceFile,
+ changeRange.span.start, textSpanEnd(changeRange.span), textSpanEnd(textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks);
+
+ // Now that we've set up our internal incremental state just proceed and parse the
+ // source file in the normal fashion. When possible the parser will retrieve and
+ // reuse nodes from the old tree.
+ //
+ // Note: passing in 'true' for setNodeParents is very important. When incrementally
+ // parsing, we will be reusing nodes from the old tree, and placing it into new
+ // parents. If we don't set the parents now, we'll end up with an observably
+ // inconsistent tree. Setting the parents on the new tree should be very fast. We
+ // will immediately bail out of walking any subtrees when we can see that their parents
+ // are already correct.
+ let result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, /* setParentNode */ true)
+
+ return result;
+ }
+
+ function moveElementEntirelyPastChangeRange(element: IncrementalElement, isArray: boolean, delta: number, oldText: string, newText: string, aggressiveChecks: boolean) {
+ if (isArray) {
+ visitArray(element);
+ }
+ else {
+ visitNode(element);
+ }
+ return;
+
+ function visitNode(node: IncrementalNode) {
+ if (aggressiveChecks && shouldCheckNode(node)) {
+ var text = oldText.substring(node.pos, node.end);
+ }
+
+ // Ditch any existing LS children we may have created. This way we can avoid
+ // moving them forward.
+ node._children = undefined;
+ node.pos += delta;
+ node.end += delta;
+
+ if (aggressiveChecks && shouldCheckNode(node)) {
+ Debug.assert(text === newText.substring(node.pos, node.end));
+ }
+
+ forEachChild(node, visitNode, visitArray);
+ checkNodePositions(node, aggressiveChecks);
+ }
+
+ function visitArray(array: IncrementalNodeArray) {
+ array._children = undefined;
+ array.pos += delta;
+ array.end += delta;
+
+ for (let node of array) {
+ visitNode(node);
+ }
}
}
- return false;
- }
+ function shouldCheckNode(node: Node) {
+ switch (node.kind) {
+ case SyntaxKind.StringLiteral:
+ case SyntaxKind.NumericLiteral:
+ case SyntaxKind.Identifier:
+ return true;
+ }
- export function isAssignmentOperator(token: SyntaxKind): boolean {
- return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment;
+ return false;
+ }
+
+ function adjustIntersectingElement(element: IncrementalElement, changeStart: number, changeRangeOldEnd: number, changeRangeNewEnd: number, delta: number) {
+ Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range");
+ Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range");
+ Debug.assert(element.pos <= element.end);
+
+ // We have an element that intersects the change range in some way. It may have its
+ // start, or its end (or both) in the changed range. We want to adjust any part
+ // that intersects such that the final tree is in a consistent state. i.e. all
+ // chlidren have spans within the span of their parent, and all siblings are ordered
+ // properly.
+
+ // We may need to update both the 'pos' and the 'end' of the element.
+
+ // If the 'pos' is before the start of the change, then we don't need to touch it.
+ // If it isn't, then the 'pos' must be inside the change. How we update it will
+ // depend if delta is positive or negative. If delta is positive then we have
+ // something like:
+ //
+ // -------------------AAA-----------------
+ // -------------------BBBCCCCCCC-----------------
+ //
+ // In this case, we consider any node that started in the change range to still be
+ // starting at the same position.
+ //
+ // however, if the delta is negative, then we instead have something like this:
+ //
+ // -------------------XXXYYYYYYY-----------------
+ // -------------------ZZZ-----------------
+ //
+ // In this case, any element that started in the 'X' range will keep its position.
+ // However any element htat started after that will have their pos adjusted to be
+ // at the end of the new range. i.e. any node that started in the 'Y' range will
+ // be adjusted to have their start at the end of the 'Z' range.
+ //
+ // The element will keep its position if possible. Or Move backward to the new-end
+ // if it's in the 'Y' range.
+ element.pos = Math.min(element.pos, changeRangeNewEnd);
+
+ // If the 'end' is after the change range, then we always adjust it by the delta
+ // amount. However, if the end is in the change range, then how we adjust it
+ // will depend on if delta is positive or negative. If delta is positive then we
+ // have something like:
+ //
+ // -------------------AAA-----------------
+ // -------------------BBBCCCCCCC-----------------
+ //
+ // In this case, we consider any node that ended inside the change range to keep its
+ // end position.
+ //
+ // however, if the delta is negative, then we instead have something like this:
+ //
+ // -------------------XXXYYYYYYY-----------------
+ // -------------------ZZZ-----------------
+ //
+ // In this case, any element that ended in the 'X' range will keep its position.
+ // However any element htat ended after that will have their pos adjusted to be
+ // at the end of the new range. i.e. any node that ended in the 'Y' range will
+ // be adjusted to have their end at the end of the 'Z' range.
+ if (element.end >= changeRangeOldEnd) {
+ // Element ends after the change range. Always adjust the end pos.
+ element.end += delta;
+ }
+ else {
+ // Element ends in the change range. The element will keep its position if
+ // possible. Or Move backward to the new-end if it's in the 'Y' range.
+ element.end = Math.min(element.end, changeRangeNewEnd);
+ }
+
+ Debug.assert(element.pos <= element.end);
+ if (element.parent) {
+ Debug.assert(element.pos >= element.parent.pos);
+ Debug.assert(element.end <= element.parent.end);
+ }
+ }
+
+ function checkNodePositions(node: Node, aggressiveChecks: boolean) {
+ if (aggressiveChecks) {
+ let pos = node.pos;
+ forEachChild(node, child => {
+ Debug.assert(child.pos >= pos);
+ pos = child.end;
+ });
+ Debug.assert(pos <= node.end);
+ }
+ }
+
+ function updateTokenPositionsAndMarkElements(
+ sourceFile: IncrementalNode,
+ changeStart: number,
+ changeRangeOldEnd: number,
+ changeRangeNewEnd: number,
+ delta: number,
+ oldText: string,
+ newText: string,
+ aggressiveChecks: boolean): void {
+
+ visitNode(sourceFile);
+ return;
+
+ function visitNode(child: IncrementalNode) {
+ Debug.assert(child.pos <= child.end);
+ if (child.pos > changeRangeOldEnd) {
+ // Node is entirely past the change range. We need to move both its pos and
+ // end, forward or backward appropriately.
+ moveElementEntirelyPastChangeRange(child, /*isArray:*/ false, delta, oldText, newText, aggressiveChecks);
+ return;
+ }
+
+ // Check if the element intersects the change range. If it does, then it is not
+ // reusable. Also, we'll need to recurse to see what constituent portions we may
+ // be able to use.
+ let fullEnd = child.end;
+ if (fullEnd >= changeStart) {
+ child.intersectsChange = true;
+ child._children = undefined;
+
+ // Adjust the pos or end (or both) of the intersecting element accordingly.
+ adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
+ forEachChild(child, visitNode, visitArray);
+
+ checkNodePositions(child, aggressiveChecks);
+ return;
+ }
+
+ // Otherwise, the node is entirely before the change range. No need to do anything with it.
+ Debug.assert(fullEnd < changeStart);
+ }
+
+ function visitArray(array: IncrementalNodeArray) {
+ Debug.assert(array.pos <= array.end);
+ if (array.pos > changeRangeOldEnd) {
+ // Array is entirely after the change range. We need to move it, and move any of
+ // its children.
+ moveElementEntirelyPastChangeRange(array, /*isArray:*/ true, delta, oldText, newText, aggressiveChecks);
+ return;
+ }
+
+ // Check if the element intersects the change range. If it does, then it is not
+ // reusable. Also, we'll need to recurse to see what constituent portions we may
+ // be able to use.
+ let fullEnd = array.end;
+ if (fullEnd >= changeStart) {
+ array.intersectsChange = true;
+ array._children = undefined;
+
+ // Adjust the pos or end (or both) of the intersecting array accordingly.
+ adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
+ for (let node of array) {
+ visitNode(node);
+ }
+ return;
+ }
+
+ // Otherwise, the array is entirely before the change range. No need to do anything with it.
+ Debug.assert(fullEnd < changeStart);
+ }
+ }
+
+ function extendToAffectedRange(sourceFile: SourceFile, changeRange: TextChangeRange): TextChangeRange {
+ // Consider the following code:
+ // void foo() { /; }
+ //
+ // If the text changes with an insertion of / just before the semicolon then we end up with:
+ // void foo() { //; }
+ //
+ // If we were to just use the changeRange a is, then we would not rescan the { token
+ // (as it does not intersect the actual original change range). Because an edit may
+ // change the token touching it, we actually need to look back *at least* one token so
+ // that the prior token sees that change.
+ let maxLookahead = 1;
+
+ let start = changeRange.span.start;
+
+ // the first iteration aligns us with the change start. subsequent iteration move us to
+ // the left by maxLookahead tokens. We only need to do this as long as we're not at the
+ // start of the tree.
+ for (let i = 0; start > 0 && i <= maxLookahead; i++) {
+ let nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start);
+ Debug.assert(nearestNode.pos <= start);
+ let position = nearestNode.pos;
+
+ start = Math.max(0, position - 1);
+ }
+
+ let finalSpan = createTextSpanFromBounds(start, textSpanEnd(changeRange.span));
+ let finalLength = changeRange.newLength + (changeRange.span.start - start);
+
+ return createTextChangeRange(finalSpan, finalLength);
+ }
+
+ function findNearestNodeStartingBeforeOrAtPosition(sourceFile: SourceFile, position: number): Node {
+ let bestResult: Node = sourceFile;
+ let lastNodeEntirelyBeforePosition: Node;
+
+ forEachChild(sourceFile, visit);
+
+ if (lastNodeEntirelyBeforePosition) {
+ let lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition);
+ if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) {
+ bestResult = lastChildOfLastEntireNodeBeforePosition;
+ }
+ }
+
+ return bestResult;
+
+ function getLastChild(node: Node): Node {
+ while (true) {
+ let lastChild = getLastChildWorker(node);
+ if (lastChild) {
+ node = lastChild;
+ }
+ else {
+ return node;
+ }
+ }
+ }
+
+ function getLastChildWorker(node: Node): Node {
+ let last: Node = undefined;
+ forEachChild(node, child => {
+ if (nodeIsPresent(child)) {
+ last = child;
+ }
+ });
+ return last;
+ }
+
+ function visit(child: Node) {
+ if (nodeIsMissing(child)) {
+ // Missing nodes are effectively invisible to us. We never even consider them
+ // When trying to find the nearest node before us.
+ return;
+ }
+
+ // If the child intersects this position, then this node is currently the nearest
+ // node that starts before the position.
+ if (child.pos <= position) {
+ if (child.pos >= bestResult.pos) {
+ // This node starts before the position, and is closer to the position than
+ // the previous best node we found. It is now the new best node.
+ bestResult = child;
+ }
+
+ // Now, the node may overlap the position, or it may end entirely before the
+ // position. If it overlaps with the position, then either it, or one of its
+ // children must be the nearest node before the position. So we can just
+ // recurse into this child to see if we can find something better.
+ if (position < child.end) {
+ // The nearest node is either this child, or one of the children inside
+ // of it. We've already marked this child as the best so far. Recurse
+ // in case one of the children is better.
+ forEachChild(child, visit);
+
+ // Once we look at the children of this node, then there's no need to
+ // continue any further.
+ return true;
+ }
+ else {
+ Debug.assert(child.end <= position);
+ // The child ends entirely before this position. Say you have the following
+ // (where $ is the position)
+ //
+ // ? $ : <...> <...>
+ //
+ // We would want to find the nearest preceding node in "complex expr 2".
+ // To support that, we keep track of this node, and once we're done searching
+ // for a best node, we recurse down this node to see if we can find a good
+ // result in it.
+ //
+ // This approach allows us to quickly skip over nodes that are entirely
+ // before the position, while still allowing us to find any nodes in the
+ // last one that might be what we want.
+ lastNodeEntirelyBeforePosition = child;
+ }
+ }
+ else {
+ Debug.assert(child.pos > position);
+ // We're now at a node that is entirely past the position we're searching for.
+ // This node (and all following nodes) could never contribute to the result,
+ // so just skip them by returning 'true' here.
+ return true;
+ }
+ }
+ }
+
+ function checkChangeRange(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks: boolean) {
+ let oldText = sourceFile.text;
+ if (textChangeRange) {
+ Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length);
+
+ if (aggressiveChecks || Debug.shouldAssert(AssertionLevel.VeryAggressive)) {
+ let oldTextPrefix = oldText.substr(0, textChangeRange.span.start);
+ let newTextPrefix = newText.substr(0, textChangeRange.span.start);
+ Debug.assert(oldTextPrefix === newTextPrefix);
+
+ let oldTextSuffix = oldText.substring(textSpanEnd(textChangeRange.span), oldText.length);
+ let newTextSuffix = newText.substring(textSpanEnd(textChangeRangeNewSpan(textChangeRange)), newText.length);
+ Debug.assert(oldTextSuffix === newTextSuffix);
+ }
+ }
+ }
+
+ interface IncrementalElement extends TextRange {
+ parent?: Node;
+ intersectsChange: boolean
+ length?: number;
+ _children: Node[];
+ }
+
+ export interface IncrementalNode extends Node, IncrementalElement {
+ hasBeenIncrementallyParsed: boolean
+ }
+
+ interface IncrementalNodeArray extends NodeArray, IncrementalElement {
+ length: number
+ }
+
+ // Allows finding nodes in the source file at a certain position in an efficient manner.
+ // The implementation takes advantage of the calling pattern it knows the parser will
+ // make in order to optimize finding nodes as quickly as possible.
+ export interface SyntaxCursor {
+ currentNode(position: number): IncrementalNode;
+ }
+
+ function createSyntaxCursor(sourceFile: SourceFile): SyntaxCursor {
+ let currentArray: NodeArray = sourceFile.statements;
+ let currentArrayIndex = 0;
+
+ Debug.assert(currentArrayIndex < currentArray.length);
+ let current = currentArray[currentArrayIndex];
+ let lastQueriedPosition = InvalidPosition.Value;
+
+ return {
+ currentNode(position: number) {
+ // Only compute the current node if the position is different than the last time
+ // we were asked. The parser commonly asks for the node at the same position
+ // twice. Once to know if can read an appropriate list element at a certain point,
+ // and then to actually read and consume the node.
+ if (position !== lastQueriedPosition) {
+ // Much of the time the parser will need the very next node in the array that
+ // we just returned a node from.So just simply check for that case and move
+ // forward in the array instead of searching for the node again.
+ if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) {
+ currentArrayIndex++;
+ current = currentArray[currentArrayIndex];
+ }
+
+ // If we don't have a node, or the node we have isn't in the right position,
+ // then try to find a viable node at the position requested.
+ if (!current || current.pos !== position) {
+ findHighestListElementThatStartsAtPosition(position);
+ }
+ }
+
+ // Cache this query so that we don't do any extra work if the parser calls back
+ // into us. Note: this is very common as the parser will make pairs of calls like
+ // 'isListElement -> parseListElement'. If we were unable to find a node when
+ // called with 'isListElement', we don't want to redo the work when parseListElement
+ // is called immediately after.
+ lastQueriedPosition = position;
+
+ // Either we don'd have a node, or we have a node at the position being asked for.
+ Debug.assert(!current || current.pos === position);
+ return current;
+ }
+ };
+
+ // Finds the highest element in the tree we can find that starts at the provided position.
+ // The element must be a direct child of some node list in the tree. This way after we
+ // return it, we can easily return its next sibling in the list.
+ function findHighestListElementThatStartsAtPosition(position: number) {
+ // Clear out any cached state about the last node we found.
+ currentArray = undefined;
+ currentArrayIndex = InvalidPosition.Value;
+ current = undefined;
+
+ // Recurse into the source file to find the highest node at this position.
+ forEachChild(sourceFile, visitNode, visitArray);
+ return;
+
+ function visitNode(node: Node) {
+ if (position >= node.pos && position < node.end) {
+ // Position was within this node. Keep searching deeper to find the node.
+ forEachChild(node, visitNode, visitArray);
+
+ // don't procede any futher in the search.
+ return true;
+ }
+
+ // position wasn't in this node, have to keep searching.
+ return false;
+ }
+
+ function visitArray(array: NodeArray) {
+ if (position >= array.pos && position < array.end) {
+ // position was in this array. Search through this array to see if we find a
+ // viable element.
+ for (let i = 0, n = array.length; i < n; i++) {
+ let child = array[i];
+ if (child) {
+ if (child.pos === position) {
+ // Found the right node. We're done.
+ currentArray = array;
+ currentArrayIndex = i;
+ current = child;
+ return true;
+ }
+ else {
+ if (child.pos < position && position < child.end) {
+ // Position in somewhere within this child. Search in it and
+ // stop searching in this array.
+ forEachChild(child, visitNode, visitArray);
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ // position wasn't in this array, have to keep searching.
+ return false;
+ }
+ }
+ }
+
+ const enum InvalidPosition {
+ Value = -1
+ }
}
-}
+}
\ No newline at end of file
diff --git a/src/compiler/program.ts b/src/compiler/program.ts
index 46466478029..3cf0f34e54f 100644
--- a/src/compiler/program.ts
+++ b/src/compiler/program.ts
@@ -54,6 +54,7 @@ module ts {
}
text = "";
}
+
return text !== undefined ? createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined;
}
diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts
index 327fb5261a0..53d213f5bd5 100644
--- a/src/compiler/scanner.ts
+++ b/src/compiler/scanner.ts
@@ -25,6 +25,8 @@ module ts {
reScanTemplateToken(): SyntaxKind;
scan(): SyntaxKind;
setText(text: string): void;
+ setOnError(onError: ErrorCallback): void;
+ setScriptTarget(scriptTarget: ScriptTarget): void;
setTextPos(textPos: number): void;
// Invokes the provided callback then unconditionally restores the scanner to the state it
// was in immediately prior to invoking the callback. The result of invoking the callback
@@ -599,6 +601,7 @@ module ts {
export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback): Scanner {
let pos: number; // Current position (end position of text of current token)
let len: number; // Length of text
+
let startPos: number; // Start position of whitespace before current token
let tokenPos: number; // Start position of text of current token
let token: SyntaxKind;
@@ -607,6 +610,32 @@ module ts {
let hasExtendedUnicodeEscape: boolean;
let tokenIsUnterminated: boolean;
+ setText(text);
+
+ return {
+ getStartPos: () => startPos,
+ getTextPos: () => pos,
+ getToken: () => token,
+ getTokenPos: () => tokenPos,
+ getTokenText: () => text.substring(tokenPos, pos),
+ getTokenValue: () => tokenValue,
+ hasExtendedUnicodeEscape: () => hasExtendedUnicodeEscape,
+ hasPrecedingLineBreak: () => precedingLineBreak,
+ isIdentifier: () => token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord,
+ isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord,
+ isUnterminated: () => tokenIsUnterminated,
+ reScanGreaterToken,
+ reScanSlashToken,
+ reScanTemplateToken,
+ scan,
+ setText,
+ setScriptTarget,
+ setOnError,
+ setTextPos,
+ tryScan,
+ lookAhead,
+ };
+
function error(message: DiagnosticMessage, length?: number): void {
if (onError) {
onError(message, length || 0);
@@ -1450,37 +1479,24 @@ module ts {
setTextPos(0);
}
+ function setOnError(errorCallback: ErrorCallback) {
+ onError = errorCallback;
+ }
+
+ function setScriptTarget(scriptTarget: ScriptTarget) {
+ languageVersion = scriptTarget;
+ }
+
function setTextPos(textPos: number) {
pos = textPos;
startPos = textPos;
tokenPos = textPos;
token = SyntaxKind.Unknown;
precedingLineBreak = false;
+
+ tokenValue = undefined;
+ hasExtendedUnicodeEscape = false;
+ tokenIsUnterminated = false;
}
-
- setText(text);
-
-
- return {
- getStartPos: () => startPos,
- getTextPos: () => pos,
- getToken: () => token,
- getTokenPos: () => tokenPos,
- getTokenText: () => text.substring(tokenPos, pos),
- getTokenValue: () => tokenValue,
- hasExtendedUnicodeEscape: () => hasExtendedUnicodeEscape,
- hasPrecedingLineBreak: () => precedingLineBreak,
- isIdentifier: () => token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord,
- isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord,
- isUnterminated: () => tokenIsUnterminated,
- reScanGreaterToken,
- reScanSlashToken,
- reScanTemplateToken,
- scan,
- setText,
- setTextPos,
- tryScan,
- lookAhead,
- };
}
}
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index 43c210331a5..b3d2f7858ea 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -121,7 +121,6 @@ module ts {
WhileKeyword,
WithKeyword,
// Strict mode reserved words
- AsKeyword,
ImplementsKeyword,
InterfaceKeyword,
LetKeyword,
@@ -132,6 +131,7 @@ module ts {
StaticKeyword,
YieldKeyword,
// Contextual keywords
+ AsKeyword,
AnyKeyword,
BooleanKeyword,
ConstructorKeyword,
@@ -1405,6 +1405,7 @@ module ts {
BlockScopedBindingInLoop = 0x00000100,
EmitDecorate = 0x00000200, // Emit __decorate
EmitParam = 0x00000400, // Emit __param helper for decorators
+ LexicalModuleMergesWithClass = 0x00000800, // Instantiated lexical module declaration is merged with a previous class declaration.
}
/* @internal */
@@ -1512,6 +1513,8 @@ module ts {
export interface UnionType extends Type {
types: Type[]; // Constituent types
/* @internal */
+ reducedType: Type; // Reduced union type (all subtypes removed)
+ /* @internal */
resolvedProperties: SymbolTable; // Cache of resolved properties
}
diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts
index b0c50fc7f66..02fae4be6de 100644
--- a/src/compiler/utilities.ts
+++ b/src/compiler/utilities.ts
@@ -211,8 +211,10 @@ module ts {
isCatchClauseVariableDeclaration(declaration);
}
+ // Gets the nearest enclosing block scope container that has the provided node
+ // as a descendant, that is not the provided node.
export function getEnclosingBlockScopeContainer(node: Node): Node {
- let current = node;
+ let current = node.parent;
while (current) {
if (isFunctionLike(current)) {
return current;
@@ -271,7 +273,6 @@ module ts {
};
}
- /* @internal */
export function getSpanOfTokenAtPosition(sourceFile: SourceFile, pos: number): TextSpan {
let scanner = createScanner(sourceFile.languageVersion, /*skipTrivia*/ true, sourceFile.text);
scanner.setTextPos(pos);
@@ -408,7 +409,6 @@ module ts {
export let fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/
-
// Warning: This has the same semantics as the forEach family of functions,
// in that traversal terminates in the event that 'visitor' supplies a truthy value.
export function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T {
@@ -439,7 +439,6 @@ module ts {
}
}
- /* @internal */
export function isVariableLike(node: Node): boolean {
if (node) {
switch (node.kind) {
@@ -1151,218 +1150,7 @@ module ts {
}
return false;
}
-
- export function textSpanEnd(span: TextSpan) {
- return span.start + span.length
- }
-
- export function textSpanIsEmpty(span: TextSpan) {
- return span.length === 0
- }
-
- export function textSpanContainsPosition(span: TextSpan, position: number) {
- return position >= span.start && position < textSpanEnd(span);
- }
-
- // Returns true if 'span' contains 'other'.
- export function textSpanContainsTextSpan(span: TextSpan, other: TextSpan) {
- return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
- }
-
- export function textSpanOverlapsWith(span: TextSpan, other: TextSpan) {
- let overlapStart = Math.max(span.start, other.start);
- let overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
- return overlapStart < overlapEnd;
- }
-
- export function textSpanOverlap(span1: TextSpan, span2: TextSpan) {
- let overlapStart = Math.max(span1.start, span2.start);
- let overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
- if (overlapStart < overlapEnd) {
- return createTextSpanFromBounds(overlapStart, overlapEnd);
- }
- return undefined;
- }
-
- export function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan) {
- return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start
- }
-
- export function textSpanIntersectsWith(span: TextSpan, start: number, length: number) {
- let end = start + length;
- return start <= textSpanEnd(span) && end >= span.start;
- }
-
- export function textSpanIntersectsWithPosition(span: TextSpan, position: number) {
- return position <= textSpanEnd(span) && position >= span.start;
- }
-
- export function textSpanIntersection(span1: TextSpan, span2: TextSpan) {
- let intersectStart = Math.max(span1.start, span2.start);
- let intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
- if (intersectStart <= intersectEnd) {
- return createTextSpanFromBounds(intersectStart, intersectEnd);
- }
- return undefined;
- }
-
- export function createTextSpan(start: number, length: number): TextSpan {
- if (start < 0) {
- throw new Error("start < 0");
- }
- if (length < 0) {
- throw new Error("length < 0");
- }
-
- return { start, length };
- }
-
- export function createTextSpanFromBounds(start: number, end: number) {
- return createTextSpan(start, end - start);
- }
-
- export function textChangeRangeNewSpan(range: TextChangeRange) {
- return createTextSpan(range.span.start, range.newLength);
- }
-
- export function textChangeRangeIsUnchanged(range: TextChangeRange) {
- return textSpanIsEmpty(range.span) && range.newLength === 0;
- }
-
- export function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange {
- if (newLength < 0) {
- throw new Error("newLength < 0");
- }
-
- return { span, newLength };
- }
-
- export let unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
-
- /**
- * Called to merge all the changes that occurred across several versions of a script snapshot
- * into a single change. i.e. if a user keeps making successive edits to a script we will
- * have a text change from V1 to V2, V2 to V3, ..., Vn.
- *
- * This function will then merge those changes into a single change range valid between V1 and
- * Vn.
- */
- export function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange {
- if (changes.length === 0) {
- return unchangedTextChangeRange;
- }
-
- if (changes.length === 1) {
- return changes[0];
- }
-
- // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd }
- // as it makes things much easier to reason about.
- let change0 = changes[0];
-
- let oldStartN = change0.span.start;
- let oldEndN = textSpanEnd(change0.span);
- let newEndN = oldStartN + change0.newLength;
-
- for (let i = 1; i < changes.length; i++) {
- let nextChange = changes[i];
-
- // Consider the following case:
- // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting
- // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }.
- // i.e. the span starting at 30 with length 30 is increased to length 40.
- //
- // 0 10 20 30 40 50 60 70 80 90 100
- // -------------------------------------------------------------------------------------------------------
- // | /
- // | /----
- // T1 | /----
- // | /----
- // | /----
- // -------------------------------------------------------------------------------------------------------
- // | \
- // | \
- // T2 | \
- // | \
- // | \
- // -------------------------------------------------------------------------------------------------------
- //
- // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial
- // it's just the min of the old and new starts. i.e.:
- //
- // 0 10 20 30 40 50 60 70 80 90 100
- // ------------------------------------------------------------*------------------------------------------
- // | /
- // | /----
- // T1 | /----
- // | /----
- // | /----
- // ----------------------------------------$-------------------$------------------------------------------
- // . | \
- // . | \
- // T2 . | \
- // . | \
- // . | \
- // ----------------------------------------------------------------------*--------------------------------
- //
- // (Note the dots represent the newly inferrred start.
- // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the
- // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see
- // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that
- // means:
- //
- // 0 10 20 30 40 50 60 70 80 90 100
- // --------------------------------------------------------------------------------*----------------------
- // | /
- // | /----
- // T1 | /----
- // | /----
- // | /----
- // ------------------------------------------------------------$------------------------------------------
- // . | \
- // . | \
- // T2 . | \
- // . | \
- // . | \
- // ----------------------------------------------------------------------*--------------------------------
- //
- // In other words (in this case), we're recognizing that the second edit happened after where the first edit
- // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started
- // that's the same as if we started at char 80 instead of 60.
- //
- // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter
- // than pusing the first edit forward to match the second, we'll push the second edit forward to match the
- // first.
- //
- // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange
- // semantics: { { start: 10, length: 70 }, newLength: 60 }
- //
- // The math then works out as follows.
- // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the
- // final result like so:
- //
- // {
- // oldStart3: Min(oldStart1, oldStart2),
- // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)),
- // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2))
- // }
-
- let oldStart1 = oldStartN;
- let oldEnd1 = oldEndN;
- let newEnd1 = newEndN;
-
- let oldStart2 = nextChange.span.start;
- let oldEnd2 = textSpanEnd(nextChange.span);
- let newEnd2 = oldStart2 + nextChange.newLength;
-
- oldStartN = Math.min(oldStart1, oldStart2);
- oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
- newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
- }
-
- return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN);
- }
-
+
export function nodeStartsNewLexicalEnvironment(n: Node): boolean {
return isFunctionLike(n) || n.kind === SyntaxKind.ModuleDeclaration || n.kind === SyntaxKind.SourceFile;
}
@@ -1379,7 +1167,13 @@ module ts {
return node;
}
- /* @internal */
+ export function createSynthesizedNodeArray(): NodeArray {
+ var array = >[];
+ array.pos = -1;
+ array.end = -1;
+ return array;
+ }
+
export function createDiagnosticCollection(): DiagnosticCollection {
let nonFileDiagnostics: Diagnostic[] = [];
let fileDiagnostics: Map = {};
@@ -1827,6 +1621,55 @@ module ts {
}
}
+ export function modifierToFlag(token: SyntaxKind): NodeFlags {
+ switch (token) {
+ case SyntaxKind.StaticKeyword: return NodeFlags.Static;
+ case SyntaxKind.PublicKeyword: return NodeFlags.Public;
+ case SyntaxKind.ProtectedKeyword: return NodeFlags.Protected;
+ case SyntaxKind.PrivateKeyword: return NodeFlags.Private;
+ case SyntaxKind.ExportKeyword: return NodeFlags.Export;
+ case SyntaxKind.DeclareKeyword: return NodeFlags.Ambient;
+ case SyntaxKind.ConstKeyword: return NodeFlags.Const;
+ case SyntaxKind.DefaultKeyword: return NodeFlags.Default;
+ }
+ return 0;
+ }
+
+ export function isLeftHandSideExpression(expr: Expression): boolean {
+ if (expr) {
+ switch (expr.kind) {
+ case SyntaxKind.PropertyAccessExpression:
+ case SyntaxKind.ElementAccessExpression:
+ case SyntaxKind.NewExpression:
+ case SyntaxKind.CallExpression:
+ case SyntaxKind.TaggedTemplateExpression:
+ case SyntaxKind.ArrayLiteralExpression:
+ case SyntaxKind.ParenthesizedExpression:
+ case SyntaxKind.ObjectLiteralExpression:
+ case SyntaxKind.ClassExpression:
+ case SyntaxKind.FunctionExpression:
+ case SyntaxKind.Identifier:
+ case SyntaxKind.RegularExpressionLiteral:
+ case SyntaxKind.NumericLiteral:
+ case SyntaxKind.StringLiteral:
+ case SyntaxKind.NoSubstitutionTemplateLiteral:
+ case SyntaxKind.TemplateExpression:
+ case SyntaxKind.FalseKeyword:
+ case SyntaxKind.NullKeyword:
+ case SyntaxKind.ThisKeyword:
+ case SyntaxKind.TrueKeyword:
+ case SyntaxKind.SuperKeyword:
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ export function isAssignmentOperator(token: SyntaxKind): boolean {
+ return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment;
+ }
+
// Returns false if this heritage clause element's expression contains something unsupported
// (i.e. not a name or dotted name).
export function isSupportedHeritageClauseElement(node: HeritageClauseElement): boolean {
@@ -1854,3 +1697,220 @@ module ts {
return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined;
}
}
+
+module ts {
+ export function getDefaultLibFileName(options: CompilerOptions): string {
+ return options.target === ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts";
+ }
+
+ export function textSpanEnd(span: TextSpan) {
+ return span.start + span.length
+ }
+
+ export function textSpanIsEmpty(span: TextSpan) {
+ return span.length === 0
+ }
+
+ export function textSpanContainsPosition(span: TextSpan, position: number) {
+ return position >= span.start && position < textSpanEnd(span);
+ }
+
+ // Returns true if 'span' contains 'other'.
+ export function textSpanContainsTextSpan(span: TextSpan, other: TextSpan) {
+ return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
+ }
+
+ export function textSpanOverlapsWith(span: TextSpan, other: TextSpan) {
+ let overlapStart = Math.max(span.start, other.start);
+ let overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other));
+ return overlapStart < overlapEnd;
+ }
+
+ export function textSpanOverlap(span1: TextSpan, span2: TextSpan) {
+ let overlapStart = Math.max(span1.start, span2.start);
+ let overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
+ if (overlapStart < overlapEnd) {
+ return createTextSpanFromBounds(overlapStart, overlapEnd);
+ }
+ return undefined;
+ }
+
+ export function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan) {
+ return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start
+ }
+
+ export function textSpanIntersectsWith(span: TextSpan, start: number, length: number) {
+ let end = start + length;
+ return start <= textSpanEnd(span) && end >= span.start;
+ }
+
+ export function textSpanIntersectsWithPosition(span: TextSpan, position: number) {
+ return position <= textSpanEnd(span) && position >= span.start;
+ }
+
+ export function textSpanIntersection(span1: TextSpan, span2: TextSpan) {
+ let intersectStart = Math.max(span1.start, span2.start);
+ let intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2));
+ if (intersectStart <= intersectEnd) {
+ return createTextSpanFromBounds(intersectStart, intersectEnd);
+ }
+ return undefined;
+ }
+
+ export function createTextSpan(start: number, length: number): TextSpan {
+ if (start < 0) {
+ throw new Error("start < 0");
+ }
+ if (length < 0) {
+ throw new Error("length < 0");
+ }
+
+ return { start, length };
+ }
+
+ export function createTextSpanFromBounds(start: number, end: number) {
+ return createTextSpan(start, end - start);
+ }
+
+ export function textChangeRangeNewSpan(range: TextChangeRange) {
+ return createTextSpan(range.span.start, range.newLength);
+ }
+
+ export function textChangeRangeIsUnchanged(range: TextChangeRange) {
+ return textSpanIsEmpty(range.span) && range.newLength === 0;
+ }
+
+ export function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange {
+ if (newLength < 0) {
+ throw new Error("newLength < 0");
+ }
+
+ return { span, newLength };
+ }
+
+ export let unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
+
+ /**
+ * Called to merge all the changes that occurred across several versions of a script snapshot
+ * into a single change. i.e. if a user keeps making successive edits to a script we will
+ * have a text change from V1 to V2, V2 to V3, ..., Vn.
+ *
+ * This function will then merge those changes into a single change range valid between V1 and
+ * Vn.
+ */
+ export function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange {
+ if (changes.length === 0) {
+ return unchangedTextChangeRange;
+ }
+
+ if (changes.length === 1) {
+ return changes[0];
+ }
+
+ // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd }
+ // as it makes things much easier to reason about.
+ let change0 = changes[0];
+
+ let oldStartN = change0.span.start;
+ let oldEndN = textSpanEnd(change0.span);
+ let newEndN = oldStartN + change0.newLength;
+
+ for (let i = 1; i < changes.length; i++) {
+ let nextChange = changes[i];
+
+ // Consider the following case:
+ // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting
+ // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }.
+ // i.e. the span starting at 30 with length 30 is increased to length 40.
+ //
+ // 0 10 20 30 40 50 60 70 80 90 100
+ // -------------------------------------------------------------------------------------------------------
+ // | /
+ // | /----
+ // T1 | /----
+ // | /----
+ // | /----
+ // -------------------------------------------------------------------------------------------------------
+ // | \
+ // | \
+ // T2 | \
+ // | \
+ // | \
+ // -------------------------------------------------------------------------------------------------------
+ //
+ // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial
+ // it's just the min of the old and new starts. i.e.:
+ //
+ // 0 10 20 30 40 50 60 70 80 90 100
+ // ------------------------------------------------------------*------------------------------------------
+ // | /
+ // | /----
+ // T1 | /----
+ // | /----
+ // | /----
+ // ----------------------------------------$-------------------$------------------------------------------
+ // . | \
+ // . | \
+ // T2 . | \
+ // . | \
+ // . | \
+ // ----------------------------------------------------------------------*--------------------------------
+ //
+ // (Note the dots represent the newly inferrred start.
+ // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the
+ // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see
+ // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that
+ // means:
+ //
+ // 0 10 20 30 40 50 60 70 80 90 100
+ // --------------------------------------------------------------------------------*----------------------
+ // | /
+ // | /----
+ // T1 | /----
+ // | /----
+ // | /----
+ // ------------------------------------------------------------$------------------------------------------
+ // . | \
+ // . | \
+ // T2 . | \
+ // . | \
+ // . | \
+ // ----------------------------------------------------------------------*--------------------------------
+ //
+ // In other words (in this case), we're recognizing that the second edit happened after where the first edit
+ // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started
+ // that's the same as if we started at char 80 instead of 60.
+ //
+ // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter
+ // than pusing the first edit forward to match the second, we'll push the second edit forward to match the
+ // first.
+ //
+ // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange
+ // semantics: { { start: 10, length: 70 }, newLength: 60 }
+ //
+ // The math then works out as follows.
+ // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the
+ // final result like so:
+ //
+ // {
+ // oldStart3: Min(oldStart1, oldStart2),
+ // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)),
+ // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2))
+ // }
+
+ let oldStart1 = oldStartN;
+ let oldEnd1 = oldEndN;
+ let newEnd1 = newEndN;
+
+ let oldStart2 = nextChange.span.start;
+ let oldEnd2 = textSpanEnd(nextChange.span);
+ let newEnd2 = oldStart2 + nextChange.newLength;
+
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+
+ return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN);
+ }
+}
diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts
index d4dd8e31258..42a0cabe48c 100644
--- a/src/harness/compilerRunner.ts
+++ b/src/harness/compilerRunner.ts
@@ -253,6 +253,10 @@ class CompilerBaselineRunner extends RunnerBase {
});
it('Correct type baselines for ' + fileName, () => {
+ if (fileName.indexOf("APISample") >= 0) {
+ return;
+ }
+
// NEWTODO: Type baselines
if (result.errors.length === 0) {
// The full walker simulates the types that you would get from doing a full
@@ -270,29 +274,53 @@ class CompilerBaselineRunner extends RunnerBase {
// These types are equivalent, but depend on what order the compiler observed
// certain parts of the program.
- var fullWalker = new TypeWriterWalker(program, /*fullTypeCheck:*/ true);
- var pullWalker = new TypeWriterWalker(program, /*fullTypeCheck:*/ false);
+ let allFiles = toBeCompiled.concat(otherFiles).filter(file => !!program.getSourceFile(file.unitName));
- var fullTypes = generateTypes(fullWalker);
- var pullTypes = generateTypes(pullWalker);
+ let fullWalker = new TypeWriterWalker(program, /*fullTypeCheck:*/ true);
+ let pullWalker = new TypeWriterWalker(program, /*fullTypeCheck:*/ false);
- if (fullTypes !== pullTypes) {
- Harness.Baseline.runBaseline('Correct full expression types for ' + fileName, justName.replace(/\.ts/, '.types'), () => fullTypes);
- Harness.Baseline.runBaseline('Correct pull expression types for ' + fileName, justName.replace(/\.ts/, '.types.pull'), () => pullTypes);
- }
- else {
- Harness.Baseline.runBaseline('Correct expression types for ' + fileName, justName.replace(/\.ts/, '.types'), () => fullTypes);
+ let fullResults: ts.Map = {};
+ let pullResults: ts.Map = {};
+
+ for (let sourceFile of allFiles) {
+ fullResults[sourceFile.unitName] = fullWalker.getTypeAndSymbols(sourceFile.unitName);
+ pullResults[sourceFile.unitName] = fullWalker.getTypeAndSymbols(sourceFile.unitName);
}
- function generateTypes(walker: TypeWriterWalker): string {
- var allFiles = toBeCompiled.concat(otherFiles).filter(file => !!program.getSourceFile(file.unitName));
- var typeLines: string[] = [];
- var typeMap: { [fileName: string]: { [lineNum: number]: string[]; } } = {};
+ // Produce baselines. The first gives the types for all expressions.
+ // The second gives symbols for all identifiers.
+ checkBaseLines(/*isSymbolBaseLine:*/ false);
+ checkBaseLines(/*isSymbolBaseLine:*/ true);
+
+ function checkBaseLines(isSymbolBaseLine: boolean) {
+ let fullBaseLine = generateBaseLine(fullResults, isSymbolBaseLine);
+ let pullBaseLine = generateBaseLine(pullResults, isSymbolBaseLine);
+
+ let fullExtension = isSymbolBaseLine ? '.symbols' : '.types';
+ let pullExtension = isSymbolBaseLine ? '.symbols.pull' : '.types.pull';
+
+ if (fullBaseLine !== pullBaseLine) {
+ Harness.Baseline.runBaseline('Correct full information for ' + fileName, justName.replace(/\.ts/, fullExtension), () => fullBaseLine);
+ Harness.Baseline.runBaseline('Correct pull information for ' + fileName, justName.replace(/\.ts/, pullExtension), () => pullBaseLine);
+ }
+ else {
+ Harness.Baseline.runBaseline('Correct information for ' + fileName, justName.replace(/\.ts/, fullExtension), () => fullBaseLine);
+ }
+ }
+
+ function generateBaseLine(typeWriterResults: ts.Map, isSymbolBaseline: boolean): string {
+ let typeLines: string[] = [];
+ let typeMap: { [fileName: string]: { [lineNum: number]: string[]; } } = {};
allFiles.forEach(file => {
var codeLines = file.content.split('\n');
- walker.getTypes(file.unitName).forEach(result => {
- var formattedLine = result.sourceText.replace(/\r?\n/g, "") + " : " + result.type;
+ typeWriterResults[file.unitName].forEach(result => {
+ if (isSymbolBaseline && !result.symbol) {
+ return;
+ }
+
+ var typeOrSymbolString = isSymbolBaseline ? result.symbol : result.type;
+ var formattedLine = result.sourceText.replace(/\r?\n/g, "") + " : " + typeOrSymbolString;
if (!typeMap[file.unitName]) {
typeMap[file.unitName] = {};
}
@@ -316,11 +344,13 @@ class CompilerBaselineRunner extends RunnerBase {
typeLines.push('>' + ty + '\r\n');
});
if (i + 1 < codeLines.length && (codeLines[i + 1].match(/^\s*[{|}]\s*$/) || codeLines[i + 1].trim() === '')) {
- } else {
+ }
+ else {
typeLines.push('\r\n');
}
}
- } else {
+ }
+ else {
typeLines.push('No type information for this code.');
}
}
diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts
index 736974c49a1..533f90a2d83 100644
--- a/src/harness/typeWriter.ts
+++ b/src/harness/typeWriter.ts
@@ -3,6 +3,7 @@ interface TypeWriterResult {
syntaxKind: number;
sourceText: string;
type: string;
+ symbol: string;
}
class TypeWriterWalker {
@@ -19,7 +20,7 @@ class TypeWriterWalker {
: program.getTypeChecker();
}
- public getTypes(fileName: string): TypeWriterResult[] {
+ public getTypeAndSymbols(fileName: string): TypeWriterResult[] {
var sourceFile = this.program.getSourceFile(fileName);
this.currentSourceFile = sourceFile;
this.results = [];
@@ -45,8 +46,9 @@ class TypeWriterWalker {
var symbol = this.checker.getSymbolAtLocation(node);
var typeString = this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation);
+ var symbolString: string;
if (symbol) {
- var symbolString = "Symbol(" + this.checker.symbolToString(symbol, node.parent);
+ symbolString = "Symbol(" + this.checker.symbolToString(symbol, node.parent);
if (symbol.declarations) {
for (let declaration of symbol.declarations) {
symbolString += ", ";
@@ -56,15 +58,14 @@ class TypeWriterWalker {
}
}
symbolString += ")";
-
- typeString += ", " + symbolString;
}
this.results.push({
line: lineAndCharacter.line,
syntaxKind: node.kind,
sourceText: sourceText,
- type: typeString
+ type: typeString,
+ symbol: symbolString
});
}
}
diff --git a/src/lib/scriptHost.d.ts b/src/lib/scriptHost.d.ts
index decf813bc2d..7faae06714c 100644
--- a/src/lib/scriptHost.d.ts
+++ b/src/lib/scriptHost.d.ts
@@ -21,13 +21,16 @@ interface TextStreamBase {
* The column number of the current character position in an input stream.
*/
Column: number;
+
/**
* The current line number in an input stream.
*/
Line: number;
+
/**
* Closes a text stream.
- * It is not necessary to close standard streams; they close automatically when the process ends. If you close a standard stream, be aware that any other pointers to that standard stream become invalid.
+ * It is not necessary to close standard streams; they close automatically when the process ends. If
+ * you close a standard stream, be aware that any other pointers to that standard stream become invalid.
*/
Close(): void;
}
@@ -37,10 +40,12 @@ interface TextStreamWriter extends TextStreamBase {
* Sends a string to an output stream.
*/
Write(s: string): void;
+
/**
* Sends a specified number of blank lines (newline characters) to an output stream.
*/
WriteBlankLines(intLines: number): void;
+
/**
* Sends a string followed by a newline character to an output stream.
*/
@@ -49,37 +54,43 @@ interface TextStreamWriter extends TextStreamBase {
interface TextStreamReader extends TextStreamBase {
/**
- * Returns a specified number of characters from an input stream, beginning at the current pointer position.
+ * Returns a specified number of characters from an input stream, starting at the current pointer position.
* Does not return until the ENTER key is pressed.
* Can only be used on a stream in reading mode; causes an error in writing or appending mode.
*/
Read(characters: number): string;
+
/**
* Returns all characters from an input stream.
* Can only be used on a stream in reading mode; causes an error in writing or appending mode.
*/
ReadAll(): string;
+
/**
* Returns an entire line from an input stream.
* Although this method extracts the newline character, it does not add it to the returned string.
* Can only be used on a stream in reading mode; causes an error in writing or appending mode.
*/
ReadLine(): string;
+
/**
* Skips a specified number of characters when reading from an input text stream.
* Can only be used on a stream in reading mode; causes an error in writing or appending mode.
* @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)
*/
Skip(characters: number): void;
+
/**
* Skips the next line when reading from an input text stream.
* Can only be used on a stream in reading mode, not writing or appending mode.
*/
SkipLine(): void;
+
/**
* Indicates whether the stream pointer position is at the end of a line.
*/
AtEndOfLine: boolean;
+
/**
* Indicates whether the stream pointer position is at the end of a stream.
*/
@@ -88,85 +99,180 @@ interface TextStreamReader extends TextStreamBase {
declare var WScript: {
/**
- * Outputs text to either a message box (under WScript.exe) or the command console window followed by a newline (under CScript.ext).
+ * Outputs text to either a message box (under WScript.exe) or the command console window followed by
+ * a newline (under CScript.exe).
*/
Echo(s: any): void;
+
/**
* Exposes the write-only error output stream for the current script.
* Can be accessed only while using CScript.exe.
*/
StdErr: TextStreamWriter;
+
/**
* Exposes the write-only output stream for the current script.
* Can be accessed only while using CScript.exe.
*/
StdOut: TextStreamWriter;
Arguments: { length: number; Item(n: number): string; };
+
/**
* The full path of the currently running script.
*/
ScriptFullName: string;
+
/**
* Forces the script to stop immediately, with an optional exit code.
*/
Quit(exitCode?: number): number;
+
/**
* The Windows Script Host build version number.
*/
BuildVersion: number;
+
/**
* Fully qualified path of the host executable.
*/
FullName: string;
+
/**
* Gets/sets the script mode - interactive(true) or batch(false).
*/
Interactive: boolean;
+
/**
* The name of the host executable (WScript.exe or CScript.exe).
*/
Name: string;
+
/**
* Path of the directory containing the host executable.
*/
Path: string;
+
/**
* The filename of the currently running script.
*/
ScriptName: string;
+
/**
* Exposes the read-only input stream for the current script.
* Can be accessed only while using CScript.exe.
*/
StdIn: TextStreamReader;
+
/**
* Windows Script Host version
*/
Version: string;
+
/**
* Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.
*/
ConnectObject(objEventSource: any, strPrefix: string): void;
+
/**
* Creates a COM object.
* @param strProgiID
* @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.
*/
CreateObject(strProgID: string, strPrefix?: string): any;
+
/**
* Disconnects a COM object from its event sources.
*/
DisconnectObject(obj: any): void;
+
/**
* Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.
- * @param strPathname Fully qualified path to the file containing the object persisted to disk. For objects in memory, pass a zero-length string.
+ * @param strPathname Fully qualified path to the file containing the object persisted to disk.
+ * For objects in memory, pass a zero-length string.
* @param strProgID
* @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.
*/
GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any;
+
/**
* Suspends script execution for a specified length of time, then continues execution.
* @param intTime Interval (in milliseconds) to suspend script execution.
*/
Sleep(intTime: number): void;
};
+
+/**
+ * Allows enumerating over a COM collection, which may not have indexed item access.
+ */
+interface Enumerator {
+ /**
+ * Returns true if the current item is the last one in the collection, or the collection is empty,
+ * or the current item is undefined.
+ */
+ atEnd(): boolean;
+
+ /**
+ * Returns the current item in the collection
+ */
+ item(): T;
+
+ /**
+ * Resets the current item in the collection to the first item. If there are no items in the collection,
+ * the current item is set to undefined.
+ */
+ moveFirst(): void;
+
+ /**
+ * Moves the current item to the next item in the collection. If the enumerator is at the end of
+ * the collection or the collection is empty, the current item is set to undefined.
+ */
+ moveNext(): void;
+}
+
+interface EnumeratorConstructor {
+ new (collection: any): Enumerator;
+ new (collection: any): Enumerator;
+}
+
+declare var Enumerator: EnumeratorConstructor;
+
+/**
+ * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions.
+ */
+interface VBArray {
+ /**
+ * Returns the number of dimensions (1-based).
+ */
+ dimensions(): number;
+
+ /**
+ * Takes an index for each dimension in the array, and returns the item at the corresponding location.
+ */
+ getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T;
+
+ /**
+ * Returns the smallest available index for a given dimension.
+ * @param dimension 1-based dimension (defaults to 1)
+ */
+ lbound(dimension?: number): number;
+
+ /**
+ * Returns the largest available index for a given dimension.
+ * @param dimension 1-based dimension (defaults to 1)
+ */
+ ubound(dimension?: number): number;
+
+ /**
+ * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions,
+ * each successive dimension is appended to the end of the array.
+ * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6]
+ */
+ toArray(): T[];
+}
+
+interface VBArrayConstructor {
+ new (safeArray: any): VBArray;
+ new (safeArray: any): VBArray;
+}
+
+declare var VBArray: VBArrayConstructor;
diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts
index 6e9c234c656..aec3bdf765f 100644
--- a/src/services/navigateTo.ts
+++ b/src/services/navigateTo.ts
@@ -10,11 +10,10 @@ module ts.NavigateTo {
forEach(program.getSourceFiles(), sourceFile => {
cancellationToken.throwIfCancellationRequested();
- let declarations = sourceFile.getNamedDeclarations();
- for (let declaration of declarations) {
- var name = getDeclarationName(declaration);
- if (name !== undefined) {
-
+ let nameToDeclarations = sourceFile.getNamedDeclarations();
+ for (let name in nameToDeclarations) {
+ let declarations = getProperty(nameToDeclarations, name);
+ if (declarations) {
// First do a quick check to see if the name of the declaration matches the
// last portion of the (possibly) dotted name they're searching for.
let matches = patternMatcher.getMatchesForLastSegmentOfPattern(name);
@@ -23,24 +22,26 @@ module ts.NavigateTo {
continue;
}
- // It was a match! If the pattern has dots in it, then also see if the
- // declaration container matches as well.
- if (patternMatcher.patternContainsDots) {
- let containers = getContainers(declaration);
- if (!containers) {
- return undefined;
+ for (let declaration of declarations) {
+ // It was a match! If the pattern has dots in it, then also see if the
+ // declaration container matches as well.
+ if (patternMatcher.patternContainsDots) {
+ let containers = getContainers(declaration);
+ if (!containers) {
+ return undefined;
+ }
+
+ matches = patternMatcher.getMatches(containers, name);
+
+ if (!matches) {
+ continue;
+ }
}
- matches = patternMatcher.getMatches(containers, name);
-
- if (!matches) {
- continue;
- }
+ let fileName = sourceFile.fileName;
+ let matchKind = bestMatchKind(matches);
+ rawItems.push({ name, fileName, matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration });
}
-
- let fileName = sourceFile.fileName;
- let matchKind = bestMatchKind(matches);
- rawItems.push({ name, fileName, matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration });
}
}
});
@@ -67,30 +68,14 @@ module ts.NavigateTo {
return true;
}
- function getDeclarationName(declaration: Declaration): string {
- let result = getTextOfIdentifierOrLiteral(declaration.name);
- if (result !== undefined) {
- return result;
- }
-
- if (declaration.name.kind === SyntaxKind.ComputedPropertyName) {
- let expr = (declaration.name).expression;
- if (expr.kind === SyntaxKind.PropertyAccessExpression) {
- return (expr).name.text;
- }
-
- return getTextOfIdentifierOrLiteral(expr);
- }
-
- return undefined;
- }
-
function getTextOfIdentifierOrLiteral(node: Node) {
- if (node.kind === SyntaxKind.Identifier ||
- node.kind === SyntaxKind.StringLiteral ||
- node.kind === SyntaxKind.NumericLiteral) {
+ if (node) {
+ if (node.kind === SyntaxKind.Identifier ||
+ node.kind === SyntaxKind.StringLiteral ||
+ node.kind === SyntaxKind.NumericLiteral) {
- return (node).text;
+ return (node).text;
+ }
}
return undefined;
diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts
index 7c5ea3aa97f..d413f611209 100644
--- a/src/services/outliningElementsCollector.ts
+++ b/src/services/outliningElementsCollector.ts
@@ -1,180 +1,180 @@
-/* @internal */
-module ts {
- export module OutliningElementsCollector {
- export function collectElements(sourceFile: SourceFile): OutliningSpan[] {
- let elements: OutliningSpan[] = [];
- let collapseText = "...";
-
- function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean) {
- if (hintSpanNode && startElement && endElement) {
- let span: OutliningSpan = {
- textSpan: createTextSpanFromBounds(startElement.pos, endElement.end),
- hintSpan: createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end),
- bannerText: collapseText,
- autoCollapse: autoCollapse
- };
- elements.push(span);
- }
- }
-
- function addOutliningSpanComments(commentSpan: CommentRange, autoCollapse: boolean) {
- if (commentSpan) {
- let span: OutliningSpan = {
- textSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end),
- hintSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end),
- bannerText: collapseText,
- autoCollapse: autoCollapse
- };
- elements.push(span);
- }
- }
-
- function addOutliningForLeadingCommentsForNode(n: Node) {
- let comments = ts.getLeadingCommentRangesOfNode(n, sourceFile);
-
- if (comments) {
- let firstSingleLineCommentStart = -1;
- let lastSingleLineCommentEnd = -1;
- let isFirstSingleLineComment = true;
- let singleLineCommentCount = 0;
-
- for (let currentComment of comments) {
-
- // For single line comments, combine consecutive ones (2 or more) into
- // a single span from the start of the first till the end of the last
- if (currentComment.kind === SyntaxKind.SingleLineCommentTrivia) {
- if (isFirstSingleLineComment) {
- firstSingleLineCommentStart = currentComment.pos;
- }
- isFirstSingleLineComment = false;
- lastSingleLineCommentEnd = currentComment.end;
- singleLineCommentCount++;
- }
- else if (currentComment.kind === SyntaxKind.MultiLineCommentTrivia) {
- combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd);
- addOutliningSpanComments(currentComment, /*autoCollapse*/ false);
-
- singleLineCommentCount = 0;
- lastSingleLineCommentEnd = -1;
- isFirstSingleLineComment = true;
- }
- }
-
- combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd);
- }
- }
-
- function combineAndAddMultipleSingleLineComments(count: number, start: number, end: number) {
- // Only outline spans of two or more consecutive single line comments
- if (count > 1) {
- let multipleSingleLineComments = {
- pos: start,
- end: end,
- kind: SyntaxKind.SingleLineCommentTrivia
- }
-
- addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false);
- }
- }
-
- function autoCollapse(node: Node) {
- return isFunctionBlock(node) && node.parent.kind !== SyntaxKind.ArrowFunction;
- }
-
- let depth = 0;
- let maxDepth = 20;
- function walk(n: Node): void {
- if (depth > maxDepth) {
- return;
- }
-
- if (isDeclaration(n)) {
- addOutliningForLeadingCommentsForNode(n);
- }
-
- switch (n.kind) {
- case SyntaxKind.Block:
- if (!isFunctionBlock(n)) {
- let parent = n.parent;
- let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
- let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
-
- // Check if the block is standalone, or 'attached' to some parent statement.
- // If the latter, we want to collaps the block, but consider its hint span
- // to be the entire span of the parent.
- if (parent.kind === SyntaxKind.DoStatement ||
- parent.kind === SyntaxKind.ForInStatement ||
- parent.kind === SyntaxKind.ForOfStatement ||
- parent.kind === SyntaxKind.ForStatement ||
- parent.kind === SyntaxKind.IfStatement ||
- parent.kind === SyntaxKind.WhileStatement ||
- parent.kind === SyntaxKind.WithStatement ||
- parent.kind === SyntaxKind.CatchClause) {
-
- addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n));
- break;
- }
-
- if (parent.kind === SyntaxKind.TryStatement) {
- // Could be the try-block, or the finally-block.
- let tryStatement = parent;
- if (tryStatement.tryBlock === n) {
- addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n));
- break;
- }
- else if (tryStatement.finallyBlock === n) {
- let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile);
- if (finallyKeyword) {
- addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n));
- break;
- }
- }
-
- // fall through.
- }
-
- // Block was a standalone block. In this case we want to only collapse
- // the span of the block, independent of any parent span.
- let span = createTextSpanFromBounds(n.getStart(), n.end);
- elements.push({
- textSpan: span,
- hintSpan: span,
- bannerText: collapseText,
- autoCollapse: autoCollapse(n)
- });
- break;
- }
- // Fallthrough.
-
- case SyntaxKind.ModuleBlock: {
- let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
- let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
- addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n));
- break;
- }
- case SyntaxKind.ClassDeclaration:
- case SyntaxKind.InterfaceDeclaration:
- case SyntaxKind.EnumDeclaration:
- case SyntaxKind.ObjectLiteralExpression:
- case SyntaxKind.CaseBlock: {
- let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
- let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
- addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n));
- break;
- }
- case SyntaxKind.ArrayLiteralExpression:
- let openBracket = findChildOfKind(n, SyntaxKind.OpenBracketToken, sourceFile);
- let closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile);
- addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n));
- break;
- }
- depth++;
- forEachChild(n, walk);
- depth--;
- }
-
- walk(sourceFile);
- return elements;
- }
- }
+/* @internal */
+module ts {
+ export module OutliningElementsCollector {
+ export function collectElements(sourceFile: SourceFile): OutliningSpan[] {
+ let elements: OutliningSpan[] = [];
+ let collapseText = "...";
+
+ function addOutliningSpan(hintSpanNode: Node, startElement: Node, endElement: Node, autoCollapse: boolean) {
+ if (hintSpanNode && startElement && endElement) {
+ let span: OutliningSpan = {
+ textSpan: createTextSpanFromBounds(startElement.pos, endElement.end),
+ hintSpan: createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end),
+ bannerText: collapseText,
+ autoCollapse: autoCollapse
+ };
+ elements.push(span);
+ }
+ }
+
+ function addOutliningSpanComments(commentSpan: CommentRange, autoCollapse: boolean) {
+ if (commentSpan) {
+ let span: OutliningSpan = {
+ textSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end),
+ hintSpan: createTextSpanFromBounds(commentSpan.pos, commentSpan.end),
+ bannerText: collapseText,
+ autoCollapse: autoCollapse
+ };
+ elements.push(span);
+ }
+ }
+
+ function addOutliningForLeadingCommentsForNode(n: Node) {
+ let comments = ts.getLeadingCommentRangesOfNode(n, sourceFile);
+
+ if (comments) {
+ let firstSingleLineCommentStart = -1;
+ let lastSingleLineCommentEnd = -1;
+ let isFirstSingleLineComment = true;
+ let singleLineCommentCount = 0;
+
+ for (let currentComment of comments) {
+
+ // For single line comments, combine consecutive ones (2 or more) into
+ // a single span from the start of the first till the end of the last
+ if (currentComment.kind === SyntaxKind.SingleLineCommentTrivia) {
+ if (isFirstSingleLineComment) {
+ firstSingleLineCommentStart = currentComment.pos;
+ }
+ isFirstSingleLineComment = false;
+ lastSingleLineCommentEnd = currentComment.end;
+ singleLineCommentCount++;
+ }
+ else if (currentComment.kind === SyntaxKind.MultiLineCommentTrivia) {
+ combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd);
+ addOutliningSpanComments(currentComment, /*autoCollapse*/ false);
+
+ singleLineCommentCount = 0;
+ lastSingleLineCommentEnd = -1;
+ isFirstSingleLineComment = true;
+ }
+ }
+
+ combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd);
+ }
+ }
+
+ function combineAndAddMultipleSingleLineComments(count: number, start: number, end: number) {
+ // Only outline spans of two or more consecutive single line comments
+ if (count > 1) {
+ let multipleSingleLineComments = {
+ pos: start,
+ end: end,
+ kind: SyntaxKind.SingleLineCommentTrivia
+ }
+
+ addOutliningSpanComments(multipleSingleLineComments, /*autoCollapse*/ false);
+ }
+ }
+
+ function autoCollapse(node: Node) {
+ return isFunctionBlock(node) && node.parent.kind !== SyntaxKind.ArrowFunction;
+ }
+
+ let depth = 0;
+ let maxDepth = 20;
+ function walk(n: Node): void {
+ if (depth > maxDepth) {
+ return;
+ }
+
+ if (isDeclaration(n)) {
+ addOutliningForLeadingCommentsForNode(n);
+ }
+
+ switch (n.kind) {
+ case SyntaxKind.Block:
+ if (!isFunctionBlock(n)) {
+ let parent = n.parent;
+ let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
+ let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
+
+ // Check if the block is standalone, or 'attached' to some parent statement.
+ // If the latter, we want to collaps the block, but consider its hint span
+ // to be the entire span of the parent.
+ if (parent.kind === SyntaxKind.DoStatement ||
+ parent.kind === SyntaxKind.ForInStatement ||
+ parent.kind === SyntaxKind.ForOfStatement ||
+ parent.kind === SyntaxKind.ForStatement ||
+ parent.kind === SyntaxKind.IfStatement ||
+ parent.kind === SyntaxKind.WhileStatement ||
+ parent.kind === SyntaxKind.WithStatement ||
+ parent.kind === SyntaxKind.CatchClause) {
+
+ addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n));
+ break;
+ }
+
+ if (parent.kind === SyntaxKind.TryStatement) {
+ // Could be the try-block, or the finally-block.
+ let tryStatement = parent;
+ if (tryStatement.tryBlock === n) {
+ addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n));
+ break;
+ }
+ else if (tryStatement.finallyBlock === n) {
+ let finallyKeyword = findChildOfKind(tryStatement, SyntaxKind.FinallyKeyword, sourceFile);
+ if (finallyKeyword) {
+ addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n));
+ break;
+ }
+ }
+
+ // fall through.
+ }
+
+ // Block was a standalone block. In this case we want to only collapse
+ // the span of the block, independent of any parent span.
+ let span = createTextSpanFromBounds(n.getStart(), n.end);
+ elements.push({
+ textSpan: span,
+ hintSpan: span,
+ bannerText: collapseText,
+ autoCollapse: autoCollapse(n)
+ });
+ break;
+ }
+ // Fallthrough.
+
+ case SyntaxKind.ModuleBlock: {
+ let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
+ let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
+ addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n));
+ break;
+ }
+ case SyntaxKind.ClassDeclaration:
+ case SyntaxKind.InterfaceDeclaration:
+ case SyntaxKind.EnumDeclaration:
+ case SyntaxKind.ObjectLiteralExpression:
+ case SyntaxKind.CaseBlock: {
+ let openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
+ let closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
+ addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n));
+ break;
+ }
+ case SyntaxKind.ArrayLiteralExpression:
+ let openBracket = findChildOfKind(n, SyntaxKind.OpenBracketToken, sourceFile);
+ let closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile);
+ addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n));
+ break;
+ }
+ depth++;
+ forEachChild(n, walk);
+ depth--;
+ }
+
+ walk(sourceFile);
+ return elements;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/services/services.ts b/src/services/services.ts
index c57dea2e1c3..98a7fe0499f 100644
--- a/src/services/services.ts
+++ b/src/services/services.ts
@@ -63,7 +63,8 @@ module ts {
/* @internal */ scriptSnapshot: IScriptSnapshot;
/* @internal */ nameTable: Map;
- getNamedDeclarations(): Declaration[];
+ /* @internal */ getNamedDeclarations(): Map;
+
getLineAndCharacterOfPosition(pos: number): LineAndCharacter;
getLineStarts(): number[];
getPositionOfLineAndCharacter(line: number, character: number): number;
@@ -749,7 +750,7 @@ module ts {
public identifiers: Map;
public nameTable: Map;
- private namedDeclarations: Declaration[];
+ private namedDeclarations: Map;
public update(newText: string, textChangeRange: TextChangeRange): SourceFile {
return updateSourceFile(this, newText, textChangeRange);
@@ -767,7 +768,7 @@ module ts {
return ts.getPositionOfLineAndCharacter(this, line, character);
}
- public getNamedDeclarations() {
+ public getNamedDeclarations(): Map {
if (!this.namedDeclarations) {
this.namedDeclarations = this.computeNamedDeclarations();
}
@@ -775,12 +776,57 @@ module ts {
return this.namedDeclarations;
}
- private computeNamedDeclarations() {
- let namedDeclarations: Declaration[] = [];
+ private computeNamedDeclarations(): Map {
+ let result: Map = {};
forEachChild(this, visit);
- return namedDeclarations;
+ return result;
+
+ function addDeclaration(declaration: Declaration) {
+ let name = getDeclarationName(declaration);
+ if (name) {
+ let declarations = getDeclarations(name);
+ declarations.push(declaration);
+ }
+ }
+
+ function getDeclarations(name: string) {
+ return getProperty(result, name) || (result[name] = []);
+ }
+
+ function getDeclarationName(declaration: Declaration) {
+ if (declaration.name) {
+ let result = getTextOfIdentifierOrLiteral(declaration.name);
+ if (result !== undefined) {
+ return result;
+ }
+
+ if (declaration.name.kind === SyntaxKind.ComputedPropertyName) {
+ let expr = (declaration.name).expression;
+ if (expr.kind === SyntaxKind.PropertyAccessExpression) {
+ return (expr).name.text;
+ }
+
+ return getTextOfIdentifierOrLiteral(expr);
+ }
+ }
+
+ return undefined;
+ }
+
+ function getTextOfIdentifierOrLiteral(node: Node) {
+ if (node) {
+ if (node.kind === SyntaxKind.Identifier ||
+ node.kind === SyntaxKind.StringLiteral ||
+ node.kind === SyntaxKind.NumericLiteral) {
+
+ return (node).text;
+ }
+ }
+
+ return undefined;
+ }
function visit(node: Node): void {
switch (node.kind) {
@@ -788,22 +834,22 @@ module ts {
case SyntaxKind.MethodDeclaration:
case SyntaxKind.MethodSignature:
let functionDeclaration = node;
+ let declarationName = getDeclarationName(functionDeclaration);
- if (functionDeclaration.name && functionDeclaration.name.getFullWidth() > 0) {
- let lastDeclaration = namedDeclarations.length > 0 ?
- namedDeclarations[namedDeclarations.length - 1] :
- undefined;
+ if (declarationName) {
+ let declarations = getDeclarations(declarationName);
+ let lastDeclaration = lastOrUndefined(declarations);
// Check whether this declaration belongs to an "overload group".
- if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) {
+ if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) {
// Overwrite the last declaration if it was an overload
// and this one is an implementation.
if (functionDeclaration.body && !(lastDeclaration).body) {
- namedDeclarations[namedDeclarations.length - 1] = functionDeclaration;
+ declarations[declarations.length - 1] = functionDeclaration;
}
}
else {
- namedDeclarations.push(functionDeclaration);
+ declarations.push(functionDeclaration);
}
forEachChild(node, visit);
@@ -824,10 +870,8 @@ module ts {
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
case SyntaxKind.TypeLiteral:
- if ((node).name) {
- namedDeclarations.push(node);
- }
- // fall through
+ addDeclaration(node);
+ // fall through
case SyntaxKind.Constructor:
case SyntaxKind.VariableStatement:
case SyntaxKind.VariableDeclarationList:
@@ -858,7 +902,7 @@ module ts {
case SyntaxKind.EnumMember:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.PropertySignature:
- namedDeclarations.push(node);
+ addDeclaration(node);
break;
case SyntaxKind.ExportDeclaration:
@@ -875,7 +919,7 @@ module ts {
// Handle default import case e.g.:
// import d from "mod";
if (importClause.name) {
- namedDeclarations.push(importClause);
+ addDeclaration(importClause);
}
// Handle named bindings in imports e.g.:
@@ -883,7 +927,7 @@ module ts {
// import {a, b as B} from "mod";
if (importClause.namedBindings) {
if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {
- namedDeclarations.push(importClause.namedBindings);
+ addDeclaration(importClause.namedBindings);
}
else {
forEach((importClause.namedBindings).elements, visit);
@@ -2260,8 +2304,6 @@ module ts {
let ruleProvider: formatting.RulesProvider;
let program: Program;
- // this checker is used to answer all LS questions except errors
- let typeInfoResolver: TypeChecker;
let useCaseSensitivefileNames = false;
let cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken());
@@ -2343,8 +2385,10 @@ module ts {
}
program = newProgram;
- typeInfoResolver = program.getTypeChecker();
+ // Make sure all the nodes in the program are both bound, and have their parent
+ // pointers set property.
+ program.getTypeChecker();
return;
function getOrCreateSourceFile(fileName: string): SourceFile {
@@ -2428,15 +2472,8 @@ module ts {
return program;
}
- /**
- * Clean up any semantic caches that are not needed.
- * The host can call this method if it wants to jettison unused memory.
- * We will just dump the typeChecker and recreate a new one. this should have the effect of destroying all the semantic caches.
- */
function cleanupSemanticCache(): void {
- if (program) {
- typeInfoResolver = program.getTypeChecker();
- }
+ // TODO: Should we jettison the program (or it's type checker) here?
}
function dispose(): void {
@@ -2453,10 +2490,6 @@ module ts {
return program.getSyntacticDiagnostics(getValidSourceFile(fileName));
}
- function isJavaScript(fileName: string) {
- return fileExtensionIs(fileName, ".js");
- }
-
/**
* getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors
* If '-d' enabled, report both semantic and emitter errors
@@ -2704,32 +2737,8 @@ module ts {
return unescapeIdentifier(displayName);
}
- function createCompletionEntry(symbol: Symbol, typeChecker: TypeChecker, location: Node): CompletionEntry {
- // Try to get a valid display name for this symbol, if we could not find one, then ignore it.
- // We would like to only show things that can be added after a dot, so for instance numeric properties can
- // not be accessed with a dot (a.1 <- invalid)
- let displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks:*/ true);
- if (!displayName) {
- return undefined;
- }
-
- // TODO(drosen): Right now we just permit *all* semantic meanings when calling
- // 'getSymbolKind' which is permissible given that it is backwards compatible; but
- // really we should consider passing the meaning for the node so that we don't report
- // that a suggestion for a value is an interface. We COULD also just do what
- // 'getSymbolModifiers' does, which is to use the first declaration.
-
- // Use a 'sortText' of 0' so that all symbol completion entries come before any other
- // entries (like JavaScript identifier entries).
- return {
- name: displayName,
- kind: getSymbolKind(symbol, typeChecker, location),
- kindModifiers: getSymbolModifiers(symbol),
- sortText: "0",
- };
- }
-
function getCompletionData(fileName: string, position: number) {
+ let typeChecker = program.getTypeChecker();
let syntacticStart = new Date().getTime();
let sourceFile = getValidSourceFile(fileName);
@@ -2813,29 +2822,29 @@ module ts {
isNewIdentifierLocation = false;
if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression) {
- let symbol = typeInfoResolver.getSymbolAtLocation(node);
+ let symbol = typeChecker.getSymbolAtLocation(node);
// This is an alias, follow what it aliases
if (symbol && symbol.flags & SymbolFlags.Alias) {
- symbol = typeInfoResolver.getAliasedSymbol(symbol);
+ symbol = typeChecker.getAliasedSymbol(symbol);
}
if (symbol && symbol.flags & SymbolFlags.HasExports) {
// Extract module or enum members
- let exportedSymbols = typeInfoResolver.getExportsOfModule(symbol);
+ let exportedSymbols = typeChecker.getExportsOfModule(symbol);
forEach(exportedSymbols, symbol => {
- if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) {
+ if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) {
symbols.push(symbol);
}
});
}
}
- let type = typeInfoResolver.getTypeAtLocation(node);
+ let type = typeChecker.getTypeAtLocation(node);
if (type) {
// Filter private properties
forEach(type.getApparentProperties(), symbol => {
- if (typeInfoResolver.isValidPropertyAccess((node.parent), symbol.name)) {
+ if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) {
symbols.push(symbol);
}
});
@@ -2849,12 +2858,12 @@ module ts {
isMemberCompletion = true;
isNewIdentifierLocation = true;
- let contextualType = typeInfoResolver.getContextualType(containingObjectLiteral);
+ let contextualType = typeChecker.getContextualType(containingObjectLiteral);
if (!contextualType) {
return false;
}
- let contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType);
+ let contextualTypeMembers = typeChecker.getPropertiesOfType(contextualType);
if (contextualTypeMembers && contextualTypeMembers.length > 0) {
// Add filtered items to the completion list
symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties);
@@ -2871,9 +2880,9 @@ module ts {
let exports: Symbol[];
if (importDeclaration.moduleSpecifier) {
- let moduleSpecifierSymbol = typeInfoResolver.getSymbolAtLocation(importDeclaration.moduleSpecifier);
+ let moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier);
if (moduleSpecifierSymbol) {
- exports = typeInfoResolver.getExportsOfModule(moduleSpecifierSymbol);
+ exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol);
}
}
@@ -2922,7 +2931,7 @@ module ts {
/// TODO filter meaning based on the current context
let symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias;
- symbols = typeInfoResolver.getSymbolsInScope(scopeNode, symbolMeanings);
+ symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);
}
return true;
@@ -3285,6 +3294,31 @@ module ts {
return entries;
}
+ function createCompletionEntry(symbol: Symbol, location: Node): CompletionEntry {
+ // Try to get a valid display name for this symbol, if we could not find one, then ignore it.
+ // We would like to only show things that can be added after a dot, so for instance numeric properties can
+ // not be accessed with a dot (a.1 <- invalid)
+ let displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, /*performCharacterChecks:*/ true);
+ if (!displayName) {
+ return undefined;
+ }
+
+ // TODO(drosen): Right now we just permit *all* semantic meanings when calling
+ // 'getSymbolKind' which is permissible given that it is backwards compatible; but
+ // really we should consider passing the meaning for the node so that we don't report
+ // that a suggestion for a value is an interface. We COULD also just do what
+ // 'getSymbolModifiers' does, which is to use the first declaration.
+
+ // Use a 'sortText' of 0' so that all symbol completion entries come before any other
+ // entries (like JavaScript identifier entries).
+ return {
+ name: displayName,
+ kind: getSymbolKind(symbol, location),
+ kindModifiers: getSymbolModifiers(symbol),
+ sortText: "0",
+ };
+ }
+
function getCompletionEntriesFromSymbols(symbols: Symbol[]): CompletionEntry[] {
let start = new Date().getTime();
var entries: CompletionEntry[] = [];
@@ -3292,7 +3326,7 @@ module ts {
if (symbols) {
var nameToSymbol: Map = {};
for (let symbol of symbols) {
- let entry = createCompletionEntry(symbol, typeInfoResolver, location);
+ let entry = createCompletionEntry(symbol, location);
if (entry) {
let id = escapeIdentifier(entry.name);
if (!lookUp(nameToSymbol, id)) {
@@ -3324,7 +3358,7 @@ module ts {
let symbol = forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(s, target, /*performCharacterChecks:*/ false) === entryName ? s : undefined);
if (symbol) {
- let displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, typeInfoResolver, location, SemanticMeaning.All);
+ let displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location, location, SemanticMeaning.All);
return {
name: entryName,
kind: displayPartsDocumentationsAndSymbolKind.symbolKind,
@@ -3351,7 +3385,7 @@ module ts {
}
// TODO(drosen): use contextual SemanticMeaning.
- function getSymbolKind(symbol: Symbol, typeResolver: TypeChecker, location: Node): string {
+ function getSymbolKind(symbol: Symbol, location: Node): string {
let flags = symbol.getFlags();
if (flags & SymbolFlags.Class) return ScriptElementKind.classElement;
@@ -3360,7 +3394,7 @@ module ts {
if (flags & SymbolFlags.Interface) return ScriptElementKind.interfaceElement;
if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement;
- let result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver, location);
+ let result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location);
if (result === ScriptElementKind.unknown) {
if (flags & SymbolFlags.TypeParameter) return ScriptElementKind.typeParameterElement;
if (flags & SymbolFlags.EnumMember) return ScriptElementKind.variableElement;
@@ -3371,11 +3405,13 @@ module ts {
return result;
}
- function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol: Symbol, flags: SymbolFlags, typeResolver: TypeChecker, location: Node) {
- if (typeResolver.isUndefinedSymbol(symbol)) {
+ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol: Symbol, flags: SymbolFlags, location: Node) {
+ let typeChecker = program.getTypeChecker();
+
+ if (typeChecker.isUndefinedSymbol(symbol)) {
return ScriptElementKind.variableElement;
}
- if (typeResolver.isArgumentsSymbol(symbol)) {
+ if (typeChecker.isArgumentsSymbol(symbol)) {
return ScriptElementKind.localVariableElement;
}
if (flags & SymbolFlags.Variable) {
@@ -3399,7 +3435,7 @@ module ts {
if (flags & SymbolFlags.Property) {
if (flags & SymbolFlags.UnionProperty) {
// If union property is result of union of non method (property/accessors/variables), it is labeled as property
- let unionPropertyKind = forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => {
+ let unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), rootSymbol => {
let rootSymbolFlags = rootSymbol.getFlags();
if (rootSymbolFlags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Variable)) {
return ScriptElementKind.memberVariableElement;
@@ -3409,7 +3445,7 @@ module ts {
if (!unionPropertyKind) {
// If this was union of all methods,
//make sure it has call signatures before we can label it as method
- let typeOfUnionProperty = typeInfoResolver.getTypeOfSymbolAtLocation(symbol, location);
+ let typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (typeOfUnionProperty.getCallSignatures().length) {
return ScriptElementKind.memberFunctionElement;
}
@@ -3442,15 +3478,16 @@ module ts {
: ScriptElementKindModifier.none;
}
+ // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol: Symbol, sourceFile: SourceFile, enclosingDeclaration: Node,
- typeResolver: TypeChecker, location: Node,
- // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location
- semanticMeaning = getMeaningFromLocation(location)) {
+ location: Node, semanticMeaning = getMeaningFromLocation(location)) {
+
+ let typeChecker = program.getTypeChecker();
let displayParts: SymbolDisplayPart[] = [];
let documentation: SymbolDisplayPart[];
let symbolFlags = symbol.flags;
- let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver, location);
+ let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location);
let hasAddedSymbolInfo: boolean;
let type: Type;
@@ -3462,7 +3499,7 @@ module ts {
}
let signature: Signature;
- type = typeResolver.getTypeOfSymbolAtLocation(symbol, location);
+ type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
if (type) {
if (location.parent && location.parent.kind === SyntaxKind.PropertyAccessExpression) {
let right = (location.parent).name;
@@ -3483,7 +3520,7 @@ module ts {
if (callExpression) {
let candidateSignatures: Signature[] = [];
- signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures);
+ signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures);
if (!signature && candidateSignatures.length) {
// Use the first candidate:
signature = candidateSignatures[0];
@@ -3532,7 +3569,7 @@ module ts {
displayParts.push(spacePart());
}
if (!(type.flags & TypeFlags.Anonymous)) {
- displayParts.push.apply(displayParts, symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments));
+ displayParts.push.apply(displayParts, symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments));
}
addSignatureDisplayParts(signature, allSignatures, TypeFormatFlags.WriteArrowStyleSignature);
break;
@@ -3549,8 +3586,8 @@ module ts {
// get the signature from the declaration and write it
let functionDeclaration = location.parent;
let allSignatures = functionDeclaration.kind === SyntaxKind.Constructor ? type.getConstructSignatures() : type.getCallSignatures();
- if (!typeResolver.isImplementationOfOverload(functionDeclaration)) {
- signature = typeResolver.getSignatureFromDeclaration(functionDeclaration);
+ if (!typeChecker.isImplementationOfOverload(functionDeclaration)) {
+ signature = typeChecker.getSignatureFromDeclaration(functionDeclaration);
}
else {
signature = allSignatures[0];
@@ -3593,7 +3630,7 @@ module ts {
displayParts.push(spacePart());
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
displayParts.push(spacePart());
- displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, typeResolver.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
+ displayParts.push.apply(displayParts, typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
}
if (symbolFlags & SymbolFlags.Enum) {
addNewLineIfDisplayPartsExist();
@@ -3629,7 +3666,7 @@ module ts {
else {
// Method/function type parameter
let signatureDeclaration = getDeclarationOfKind(symbol, SyntaxKind.TypeParameter).parent;
- let signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration);
+ let signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration);
if (signatureDeclaration.kind === SyntaxKind.ConstructSignature) {
displayParts.push(keywordPart(SyntaxKind.NewKeyword));
displayParts.push(spacePart());
@@ -3637,14 +3674,14 @@ module ts {
else if (signatureDeclaration.kind !== SyntaxKind.CallSignature && signatureDeclaration.name) {
addFullSymbolName(signatureDeclaration.symbol);
}
- displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, sourceFile, TypeFormatFlags.WriteTypeArgumentsOfSignature));
+ displayParts.push.apply(displayParts, signatureToDisplayParts(typeChecker, signature, sourceFile, TypeFormatFlags.WriteTypeArgumentsOfSignature));
}
}
if (symbolFlags & SymbolFlags.EnumMember) {
addPrefixForAnyFunctionOrVar(symbol, "enum member");
let declaration = symbol.declarations[0];
if (declaration.kind === SyntaxKind.EnumMember) {
- let constantValue = typeResolver.getConstantValue(declaration);
+ let constantValue = typeChecker.getConstantValue(declaration);
if (constantValue !== undefined) {
displayParts.push(spacePart());
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
@@ -3671,7 +3708,7 @@ module ts {
displayParts.push(punctuationPart(SyntaxKind.CloseParenToken));
}
else {
- let internalAliasSymbol = typeResolver.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
+ let internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference);
if (internalAliasSymbol) {
displayParts.push(spacePart());
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
@@ -3696,12 +3733,12 @@ module ts {
// If the type is type parameter, format it specially
if (type.symbol && type.symbol.flags & SymbolFlags.TypeParameter) {
let typeParameterParts = mapToDisplayParts(writer => {
- typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration);
+ typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration);
});
displayParts.push.apply(displayParts, typeParameterParts);
}
else {
- displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, type, enclosingDeclaration));
+ displayParts.push.apply(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration));
}
}
else if (symbolFlags & SymbolFlags.Function ||
@@ -3716,7 +3753,7 @@ module ts {
}
}
else {
- symbolKind = getSymbolKind(symbol, typeResolver, location);
+ symbolKind = getSymbolKind(symbol, location);
}
}
@@ -3733,7 +3770,7 @@ module ts {
}
function addFullSymbolName(symbol: Symbol, enclosingDeclaration?: Node) {
- let fullSymbolDisplayParts = symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined,
+ let fullSymbolDisplayParts = symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined,
SymbolFormatFlags.WriteTypeParametersOrArguments | SymbolFormatFlags.UseOnlyExternalAliasing);
displayParts.push.apply(displayParts, fullSymbolDisplayParts);
}
@@ -3765,7 +3802,7 @@ module ts {
}
function addSignatureDisplayParts(signature: Signature, allSignatures: Signature[], flags?: TypeFormatFlags) {
- displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | TypeFormatFlags.WriteTypeArgumentsOfSignature));
+ displayParts.push.apply(displayParts, signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | TypeFormatFlags.WriteTypeArgumentsOfSignature));
if (allSignatures.length > 1) {
displayParts.push(spacePart());
displayParts.push(punctuationPart(SyntaxKind.OpenParenToken));
@@ -3780,7 +3817,7 @@ module ts {
function writeTypeParametersOfSymbol(symbol: Symbol, enclosingDeclaration: Node) {
let typeParameterParts = mapToDisplayParts(writer => {
- typeResolver.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
+ typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration);
});
displayParts.push.apply(displayParts, typeParameterParts);
}
@@ -3799,7 +3836,9 @@ module ts {
return undefined;
}
- let symbol = typeInfoResolver.getSymbolAtLocation(node);
+ let typeChecker = program.getTypeChecker();
+ let symbol = typeChecker.getSymbolAtLocation(node);
+
if (!symbol) {
// Try getting just type at this position and show
switch (node.kind) {
@@ -3809,13 +3848,13 @@ module ts {
case SyntaxKind.ThisKeyword:
case SyntaxKind.SuperKeyword:
// For the identifiers/this/super etc get the type at position
- let type = typeInfoResolver.getTypeAtLocation(node);
+ let type = typeChecker.getTypeAtLocation(node);
if (type) {
return {
kind: ScriptElementKind.unknown,
kindModifiers: ScriptElementKindModifier.none,
textSpan: createTextSpan(node.getStart(), node.getWidth()),
- displayParts: typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)),
+ displayParts: typeToDisplayParts(typeChecker, type, getContainerNode(node)),
documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined
};
}
@@ -3824,7 +3863,7 @@ module ts {
return undefined;
}
- let displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node);
+ let displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node);
return {
kind: displayPartsDocumentationsAndKind.symbolKind,
kindModifiers: getSymbolModifiers(symbol),
@@ -3880,7 +3919,8 @@ module ts {
return undefined;
}
- let symbol = typeInfoResolver.getSymbolAtLocation(node);
+ let typeChecker = program.getTypeChecker();
+ let symbol = typeChecker.getSymbolAtLocation(node);
// Could not find a symbol e.g. node is string or number keyword,
// or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol
@@ -3895,7 +3935,7 @@ module ts {
if (symbol.flags & SymbolFlags.Alias) {
let declaration = symbol.declarations[0];
if (node.kind === SyntaxKind.Identifier && node.parent === declaration) {
- symbol = typeInfoResolver.getAliasedSymbol(symbol);
+ symbol = typeChecker.getAliasedSymbol(symbol);
}
}
@@ -3905,25 +3945,25 @@ module ts {
// is performed at the location of property access, we would like to go to definition of the property in the short-hand
// assignment. This case and others are handled by the following code.
if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) {
- let shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
+ let shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
if (!shorthandSymbol) {
return [];
}
let shorthandDeclarations = shorthandSymbol.getDeclarations();
- let shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver, node);
- let shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol);
- let shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node);
+ let shorthandSymbolKind = getSymbolKind(shorthandSymbol, node);
+ let shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol);
+ let shorthandContainerName = typeChecker.symbolToString(symbol.parent, node);
return map(shorthandDeclarations,
declaration => createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName));
}
let result: DefinitionInfo[] = [];
let declarations = symbol.getDeclarations();
- let symbolName = typeInfoResolver.symbolToString(symbol); // Do not get scoped name, just the name of the symbol
- let symbolKind = getSymbolKind(symbol, typeInfoResolver, node);
+ let symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol
+ let symbolKind = getSymbolKind(symbol, node);
let containerSymbol = symbol.parent;
- let containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : "";
+ let containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : "";
if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) &&
!tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) {
@@ -4682,7 +4722,9 @@ module ts {
return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments);
}
- function getReferencedSymbolsForNodes(node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean): ReferencedSymbol[]{
+ function getReferencedSymbolsForNodes(node: Node, sourceFiles: SourceFile[], findInStrings: boolean, findInComments: boolean): ReferencedSymbol[] {
+ let typeChecker = program.getTypeChecker();
+
// Labels
if (isLabelName(node)) {
if (isJumpStatementTarget(node)) {
@@ -4705,7 +4747,7 @@ module ts {
return getReferencesForSuperKeyword(node);
}
- let symbol = typeInfoResolver.getSymbolAtLocation(node);
+ let symbol = typeChecker.getSymbolAtLocation(node);
// Could not find a symbol e.g. unknown identifier
if (!symbol) {
@@ -4756,7 +4798,7 @@ module ts {
return result;
function getDefinition(symbol: Symbol): DefinitionInfo {
- let info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), typeInfoResolver, node);
+ let info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node);
let name = map(info.displayParts, p => p.text).join("");
let declarations = symbol.declarations;
if (!declarations || declarations.length === 0) {
@@ -4806,7 +4848,7 @@ module ts {
return location.getText();
}
- name = typeInfoResolver.symbolToString(symbol);
+ name = typeChecker.symbolToString(symbol);
return stripQuotes(name);
}
@@ -5042,10 +5084,10 @@ module ts {
return;
}
- let referenceSymbol = typeInfoResolver.getSymbolAtLocation(referenceLocation);
+ let referenceSymbol = typeChecker.getSymbolAtLocation(referenceLocation);
if (referenceSymbol) {
let referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
- let shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
+ let shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
var relatedSymbol = getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation);
if (relatedSymbol) {
@@ -5270,7 +5312,7 @@ module ts {
// If the symbol is an alias, add what it alaises to the list
if (isImportOrExportSpecifierImportSymbol(symbol)) {
- result.push(typeInfoResolver.getAliasedSymbol(symbol));
+ result.push(typeChecker.getAliasedSymbol(symbol));
}
// If the location is in a context sensitive location (i.e. in an object literal) try
@@ -5278,7 +5320,7 @@ module ts {
// type to the search set
if (isNameOfPropertyAssignment(location)) {
forEach(getPropertySymbolsFromContextualType(location), contextualSymbol => {
- result.push.apply(result, typeInfoResolver.getRootSymbols(contextualSymbol));
+ result.push.apply(result, typeChecker.getRootSymbols(contextualSymbol));
});
/* Because in short-hand property assignment, location has two meaning : property name and as value of the property
@@ -5292,7 +5334,7 @@ module ts {
* so that when matching with potential reference symbol, both symbols from property declaration and variable declaration
* will be included correctly.
*/
- let shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(location.parent);
+ let shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent);
if (shorthandValueSymbol) {
result.push(shorthandValueSymbol);
}
@@ -5300,7 +5342,7 @@ module ts {
// If this is a union property, add all the symbols from all its source symbols in all unioned types.
// If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list
- forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => {
+ forEach(typeChecker.getRootSymbols(symbol), rootSymbol => {
if (rootSymbol !== symbol) {
result.push(rootSymbol);
}
@@ -5330,9 +5372,9 @@ module ts {
function getPropertySymbolFromTypeReference(typeReference: HeritageClauseElement) {
if (typeReference) {
- let type = typeInfoResolver.getTypeAtLocation(typeReference);
+ let type = typeChecker.getTypeAtLocation(typeReference);
if (type) {
- let propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName);
+ let propertySymbol = typeChecker.getPropertyOfType(type, propertyName);
if (propertySymbol) {
result.push(propertySymbol);
}
@@ -5352,7 +5394,7 @@ module ts {
// If the reference symbol is an alias, check if what it is aliasing is one of the search
// symbols.
if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) {
- var aliasedSymbol = typeInfoResolver.getAliasedSymbol(referenceSymbol);
+ var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol);
if (searchSymbols.indexOf(aliasedSymbol) >= 0) {
return aliasedSymbol;
}
@@ -5363,13 +5405,13 @@ module ts {
// compare to our searchSymbol
if (isNameOfPropertyAssignment(referenceLocation)) {
return forEach(getPropertySymbolsFromContextualType(referenceLocation), contextualSymbol => {
- return forEach(typeInfoResolver.getRootSymbols(contextualSymbol), s => searchSymbols.indexOf(s) >= 0 ? s : undefined);
+ return forEach(typeChecker.getRootSymbols(contextualSymbol), s => searchSymbols.indexOf(s) >= 0 ? s : undefined);
});
}
// Unwrap symbols to get to the root (e.g. transient symbols as a result of widening)
// Or a union property, use its underlying unioned symbols
- return forEach(typeInfoResolver.getRootSymbols(referenceSymbol), rootSymbol => {
+ return forEach(typeChecker.getRootSymbols(referenceSymbol), rootSymbol => {
// if it is in the list, then we are done
if (searchSymbols.indexOf(rootSymbol) >= 0) {
return rootSymbol;
@@ -5390,7 +5432,7 @@ module ts {
function getPropertySymbolsFromContextualType(node: Node): Symbol[] {
if (isNameOfPropertyAssignment(node)) {
let objectLiteral = node.parent.parent;
- let contextualType = typeInfoResolver.getContextualType(objectLiteral);
+ let contextualType = typeChecker.getContextualType(objectLiteral);
let name = (node).text;
if (contextualType) {
if (contextualType.flags & TypeFlags.Union) {
@@ -5682,7 +5724,7 @@ module ts {
let sourceFile = getValidSourceFile(fileName);
- return SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken);
+ return SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken);
}
/// Syntactic features
@@ -5763,6 +5805,7 @@ module ts {
synchronizeHostData();
let sourceFile = getValidSourceFile(fileName);
+ let typeChecker = program.getTypeChecker();
let result: ClassifiedSpan[] = [];
processNode(sourceFile);
@@ -5815,7 +5858,7 @@ module ts {
// Only walk into nodes that intersect the requested span.
if (node && textSpanIntersectsWith(span, node.getStart(), node.getWidth())) {
if (node.kind === SyntaxKind.Identifier && node.getWidth() > 0) {
- let symbol = typeInfoResolver.getSymbolAtLocation(node);
+ let symbol = typeChecker.getSymbolAtLocation(node);
if (symbol) {
let type = classifySymbol(symbol, getMeaningFromLocation(node));
if (type) {
@@ -6297,12 +6340,13 @@ module ts {
synchronizeHostData();
let sourceFile = getValidSourceFile(fileName);
+ let typeChecker = program.getTypeChecker();
let node = getTouchingWord(sourceFile, position);
// Can only rename an identifier.
if (node && node.kind === SyntaxKind.Identifier) {
- let symbol = typeInfoResolver.getSymbolAtLocation(node);
+ let symbol = typeChecker.getSymbolAtLocation(node);
// Only allow a symbol to be renamed if it actually has at least one declaration.
if (symbol) {
@@ -6319,13 +6363,13 @@ module ts {
}
}
- let kind = getSymbolKind(symbol, typeInfoResolver, node);
+ let kind = getSymbolKind(symbol, node);
if (kind) {
return {
canRename: true,
localizedErrorMessage: undefined,
displayName: symbol.name,
- fullDisplayName: typeInfoResolver.getFullyQualifiedName(symbol),
+ fullDisplayName: typeChecker.getFullyQualifiedName(symbol),
kind: kind,
kindModifiers: getSymbolModifiers(symbol),
triggerSpan: createTextSpan(node.getStart(), node.getWidth())
diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts
index e311048191f..77aba4c85c1 100644
--- a/src/services/signatureHelp.ts
+++ b/src/services/signatureHelp.ts
@@ -178,7 +178,9 @@ module ts.SignatureHelp {
argumentCount: number;
}
- export function getSignatureHelpItems(sourceFile: SourceFile, position: number, typeInfoResolver: TypeChecker, cancellationToken: CancellationTokenObject): SignatureHelpItems {
+ export function getSignatureHelpItems(program: Program, sourceFile: SourceFile, position: number, cancellationToken: CancellationTokenObject): SignatureHelpItems {
+ let typeChecker = program.getTypeChecker();
+
// Decide whether to show signature help
let startingToken = findTokenOnLeftOfPosition(sourceFile, position);
if (!startingToken) {
@@ -196,15 +198,61 @@ module ts.SignatureHelp {
let call = argumentInfo.invocation;
let candidates = [];
- let resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates);
+ let resolvedSignature = typeChecker.getResolvedSignature(call, candidates);
cancellationToken.throwIfCancellationRequested();
if (!candidates.length) {
+ // We didn't have any sig help items produced by the TS compiler. If this is a JS
+ // file, then see if we can figure out anything better.
+ if (isJavaScript(sourceFile.fileName)) {
+ return createJavaScriptSignatureHelpItems(argumentInfo);
+ }
+
return undefined;
}
return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo);
+ function createJavaScriptSignatureHelpItems(argumentInfo: ArgumentListInfo): SignatureHelpItems {
+ if (argumentInfo.invocation.kind !== SyntaxKind.CallExpression) {
+ return undefined;
+ }
+
+ // See if we can find some symbol with the call expression name that has call signatures.
+ let callExpression = argumentInfo.invocation;
+ let expression = callExpression.expression;
+ let name = expression.kind === SyntaxKind.Identifier
+ ? expression
+ : expression.kind === SyntaxKind.PropertyAccessExpression
+ ? (expression).name
+ : undefined;
+
+ if (!name || !name.text) {
+ return undefined;
+ }
+
+ let typeChecker = program.getTypeChecker();
+ for (let sourceFile of program.getSourceFiles()) {
+ let nameToDeclarations = sourceFile.getNamedDeclarations();
+ let declarations = getProperty(nameToDeclarations, name.text);
+
+ if (declarations) {
+ for (let declaration of declarations) {
+ let symbol = declaration.symbol;
+ if (symbol) {
+ let type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration);
+ if (type) {
+ let callSignatures = type.getCallSignatures();
+ if (callSignatures && callSignatures.length) {
+ return createSignatureHelpItems(callSignatures, callSignatures[0], argumentInfo);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
/**
* Returns relevant information for the argument list and the current argument if we are
* in the argument of an invocation; returns undefined otherwise.
@@ -494,8 +542,8 @@ module ts.SignatureHelp {
let invocation = argumentListInfo.invocation;
let callTarget = getInvokedExpression(invocation)
- let callTargetSymbol = typeInfoResolver.getSymbolAtLocation(callTarget);
- let callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeInfoResolver, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined);
+ let callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget);
+ let callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeChecker, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined);
let items: SignatureHelpItem[] = map(candidates, candidateSignature => {
let signatureHelpParameters: SignatureHelpParameter[];
let prefixDisplayParts: SymbolDisplayPart[] = [];
@@ -511,12 +559,12 @@ module ts.SignatureHelp {
signatureHelpParameters = typeParameters && typeParameters.length > 0 ? map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray;
suffixDisplayParts.push(punctuationPart(SyntaxKind.GreaterThanToken));
let parameterParts = mapToDisplayParts(writer =>
- typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation));
+ typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation));
suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts);
}
else {
let typeParameterParts = mapToDisplayParts(writer =>
- typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation));
+ typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation));
prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts);
prefixDisplayParts.push(punctuationPart(SyntaxKind.OpenParenToken));
@@ -526,7 +574,7 @@ module ts.SignatureHelp {
}
let returnTypeParts = mapToDisplayParts(writer =>
- typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation));
+ typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation));
suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts);
return {
@@ -561,7 +609,7 @@ module ts.SignatureHelp {
function createSignatureHelpParameterForParameter(parameter: Symbol): SignatureHelpParameter {
let displayParts = mapToDisplayParts(writer =>
- typeInfoResolver.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation));
+ typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation));
let isOptional = hasQuestionToken(parameter.valueDeclaration);
@@ -575,7 +623,7 @@ module ts.SignatureHelp {
function createSignatureHelpParameterForTypeParameter(typeParameter: TypeParameter): SignatureHelpParameter {
let displayParts = mapToDisplayParts(writer =>
- typeInfoResolver.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation));
+ typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation));
return {
name: typeParameter.symbol.name,
diff --git a/src/services/utilities.ts b/src/services/utilities.ts
index 26b581e27b6..5e1460bbdcd 100644
--- a/src/services/utilities.ts
+++ b/src/services/utilities.ts
@@ -652,4 +652,8 @@ module ts {
typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags);
});
}
+
+ export function isJavaScript(fileName: string) {
+ return fileExtensionIs(fileName, ".js");
+ }
}
\ No newline at end of file
diff --git a/tests/baselines/reference/2dArrays.symbols b/tests/baselines/reference/2dArrays.symbols
new file mode 100644
index 00000000000..c069f2dae8c
--- /dev/null
+++ b/tests/baselines/reference/2dArrays.symbols
@@ -0,0 +1,38 @@
+=== tests/cases/compiler/2dArrays.ts ===
+class Cell {
+>Cell : Symbol(Cell, Decl(2dArrays.ts, 0, 0))
+}
+
+class Ship {
+>Ship : Symbol(Ship, Decl(2dArrays.ts, 1, 1))
+
+ isSunk: boolean;
+>isSunk : Symbol(isSunk, Decl(2dArrays.ts, 3, 12))
+}
+
+class Board {
+>Board : Symbol(Board, Decl(2dArrays.ts, 5, 1))
+
+ ships: Ship[];
+>ships : Symbol(ships, Decl(2dArrays.ts, 7, 13))
+>Ship : Symbol(Ship, Decl(2dArrays.ts, 1, 1))
+
+ cells: Cell[];
+>cells : Symbol(cells, Decl(2dArrays.ts, 8, 18))
+>Cell : Symbol(Cell, Decl(2dArrays.ts, 0, 0))
+
+ private allShipsSunk() {
+>allShipsSunk : Symbol(allShipsSunk, Decl(2dArrays.ts, 9, 18))
+
+ return this.ships.every(function (val) { return val.isSunk; });
+>this.ships.every : Symbol(Array.every, Decl(lib.d.ts, 1094, 62))
+>this.ships : Symbol(ships, Decl(2dArrays.ts, 7, 13))
+>this : Symbol(Board, Decl(2dArrays.ts, 5, 1))
+>ships : Symbol(ships, Decl(2dArrays.ts, 7, 13))
+>every : Symbol(Array.every, Decl(lib.d.ts, 1094, 62))
+>val : Symbol(val, Decl(2dArrays.ts, 12, 42))
+>val.isSunk : Symbol(Ship.isSunk, Decl(2dArrays.ts, 3, 12))
+>val : Symbol(val, Decl(2dArrays.ts, 12, 42))
+>isSunk : Symbol(Ship.isSunk, Decl(2dArrays.ts, 3, 12))
+ }
+}
diff --git a/tests/baselines/reference/2dArrays.types b/tests/baselines/reference/2dArrays.types
index cb6c2a3a723..b113ccdce7b 100644
--- a/tests/baselines/reference/2dArrays.types
+++ b/tests/baselines/reference/2dArrays.types
@@ -1,40 +1,40 @@
=== tests/cases/compiler/2dArrays.ts ===
class Cell {
->Cell : Cell, Symbol(Cell, Decl(2dArrays.ts, 0, 0))
+>Cell : Cell
}
class Ship {
->Ship : Ship, Symbol(Ship, Decl(2dArrays.ts, 1, 1))
+>Ship : Ship
isSunk: boolean;
->isSunk : boolean, Symbol(isSunk, Decl(2dArrays.ts, 3, 12))
+>isSunk : boolean
}
class Board {
->Board : Board, Symbol(Board, Decl(2dArrays.ts, 5, 1))
+>Board : Board
ships: Ship[];
->ships : Ship[], Symbol(ships, Decl(2dArrays.ts, 7, 13))
->Ship : Ship, Symbol(Ship, Decl(2dArrays.ts, 1, 1))
+>ships : Ship[]
+>Ship : Ship
cells: Cell[];
->cells : Cell[], Symbol(cells, Decl(2dArrays.ts, 8, 18))
->Cell : Cell, Symbol(Cell, Decl(2dArrays.ts, 0, 0))
+>cells : Cell[]
+>Cell : Cell
private allShipsSunk() {
->allShipsSunk : () => boolean, Symbol(allShipsSunk, Decl(2dArrays.ts, 9, 18))
+>allShipsSunk : () => boolean
return this.ships.every(function (val) { return val.isSunk; });
>this.ships.every(function (val) { return val.isSunk; }) : boolean
->this.ships.every : (callbackfn: (value: Ship, index: number, array: Ship[]) => boolean, thisArg?: any) => boolean, Symbol(Array.every, Decl(lib.d.ts, 1094, 62))
->this.ships : Ship[], Symbol(ships, Decl(2dArrays.ts, 7, 13))
->this : Board, Symbol(Board, Decl(2dArrays.ts, 5, 1))
->ships : Ship[], Symbol(ships, Decl(2dArrays.ts, 7, 13))
->every : (callbackfn: (value: Ship, index: number, array: Ship[]) => boolean, thisArg?: any) => boolean, Symbol(Array.every, Decl(lib.d.ts, 1094, 62))
+>this.ships.every : (callbackfn: (value: Ship, index: number, array: Ship[]) => boolean, thisArg?: any) => boolean
+>this.ships : Ship[]
+>this : Board
+>ships : Ship[]
+>every : (callbackfn: (value: Ship, index: number, array: Ship[]) => boolean, thisArg?: any) => boolean
>function (val) { return val.isSunk; } : (val: Ship) => boolean
->val : Ship, Symbol(val, Decl(2dArrays.ts, 12, 42))
->val.isSunk : boolean, Symbol(Ship.isSunk, Decl(2dArrays.ts, 3, 12))
->val : Ship, Symbol(val, Decl(2dArrays.ts, 12, 42))
->isSunk : boolean, Symbol(Ship.isSunk, Decl(2dArrays.ts, 3, 12))
+>val : Ship
+>val.isSunk : boolean
+>val : Ship
+>isSunk : boolean
}
}
diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types
deleted file mode 100644
index d147ded3f0e..00000000000
--- a/tests/baselines/reference/APISample_compile.types
+++ /dev/null
@@ -1,168 +0,0 @@
-=== tests/cases/compiler/APISample_compile.ts ===
-
-/*
- * Note: This test is a public API sample. The sample sources can be found
- at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler
- * Please log a "breaking change" issue for any API breaking change affecting this issue
- */
-
-declare var process: any;
->process : any, Symbol(process, Decl(APISample_compile.ts, 7, 11))
-
-declare var console: any;
->console : any, Symbol(console, Decl(APISample_compile.ts, 8, 11))
-
-declare var os: any;
->os : any, Symbol(os, Decl(APISample_compile.ts, 9, 11))
-
-import ts = require("typescript");
->ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
-
-export function compile(fileNames: string[], options: ts.CompilerOptions): void {
->compile : (fileNames: string[], options: ts.CompilerOptions) => void, Symbol(compile, Decl(APISample_compile.ts, 11, 34))
->fileNames : string[], Symbol(fileNames, Decl(APISample_compile.ts, 13, 24))
->options : ts.CompilerOptions, Symbol(options, Decl(APISample_compile.ts, 13, 44))
->ts : any, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
->CompilerOptions : ts.CompilerOptions, Symbol(ts.CompilerOptions, Decl(typescript.d.ts, 1074, 5))
-
- var program = ts.createProgram(fileNames, options);
->program : ts.Program, Symbol(program, Decl(APISample_compile.ts, 14, 7))
->ts.createProgram(fileNames, options) : ts.Program
->ts.createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program, Symbol(ts.createProgram, Decl(typescript.d.ts, 1201, 113))
->ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
->createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program, Symbol(ts.createProgram, Decl(typescript.d.ts, 1201, 113))
->fileNames : string[], Symbol(fileNames, Decl(APISample_compile.ts, 13, 24))
->options : ts.CompilerOptions, Symbol(options, Decl(APISample_compile.ts, 13, 44))
-
- var emitResult = program.emit();
->emitResult : ts.EmitResult, Symbol(emitResult, Decl(APISample_compile.ts, 15, 7))
->program.emit() : ts.EmitResult
->program.emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult, Symbol(ts.Program.emit, Decl(typescript.d.ts, 767, 39))
->program : ts.Program, Symbol(program, Decl(APISample_compile.ts, 14, 7))
->emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult, Symbol(ts.Program.emit, Decl(typescript.d.ts, 767, 39))
-
- var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
->allDiagnostics : ts.Diagnostic[], Symbol(allDiagnostics, Decl(APISample_compile.ts, 17, 7))
->ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics) : ts.Diagnostic[]
->ts.getPreEmitDiagnostics(program).concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
->ts.getPreEmitDiagnostics(program) : ts.Diagnostic[]
->ts.getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[], Symbol(ts.getPreEmitDiagnostics, Decl(typescript.d.ts, 1199, 98))
->ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
->getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[], Symbol(ts.getPreEmitDiagnostics, Decl(typescript.d.ts, 1199, 98))
->program : ts.Program, Symbol(program, Decl(APISample_compile.ts, 14, 7))
->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
->emitResult.diagnostics : ts.Diagnostic[], Symbol(ts.EmitResult.diagnostics, Decl(typescript.d.ts, 820, 29))
->emitResult : ts.EmitResult, Symbol(emitResult, Decl(APISample_compile.ts, 15, 7))
->diagnostics : ts.Diagnostic[], Symbol(ts.EmitResult.diagnostics, Decl(typescript.d.ts, 820, 29))
-
- allDiagnostics.forEach(diagnostic => {
->allDiagnostics.forEach(diagnostic => { var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); }) : void
->allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
->allDiagnostics : ts.Diagnostic[], Symbol(allDiagnostics, Decl(APISample_compile.ts, 17, 7))
->forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
->diagnostic => { var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } : (diagnostic: ts.Diagnostic) => void
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27))
-
- var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
->line : number, Symbol(line, Decl(APISample_compile.ts, 20, 13))
->character : number, Symbol(character, Decl(APISample_compile.ts, 20, 19))
->diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter
->diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46))
->diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27))
->file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46))
->diagnostic.start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25))
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27))
->start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25))
-
- var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
->message : string, Symbol(message, Decl(APISample_compile.ts, 21, 11))
->ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n') : string
->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1200, 67))
->ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1200, 67))
->diagnostic.messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23))
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27))
->messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23))
->'\n' : string
-
- console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
->console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`) : any
->console.log : any
->console : any, Symbol(console, Decl(APISample_compile.ts, 8, 11))
->log : any
->`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}` : string
->diagnostic.file.fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
->diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27))
->file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
->fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
->line + 1 : number
->line : number, Symbol(line, Decl(APISample_compile.ts, 20, 13))
->1 : number
->character + 1 : number
->character : number, Symbol(character, Decl(APISample_compile.ts, 20, 19))
->1 : number
->message : string, Symbol(message, Decl(APISample_compile.ts, 21, 11))
-
- });
-
- var exitCode = emitResult.emitSkipped ? 1 : 0;
->exitCode : number, Symbol(exitCode, Decl(APISample_compile.ts, 25, 7))
->emitResult.emitSkipped ? 1 : 0 : number
->emitResult.emitSkipped : boolean, Symbol(ts.EmitResult.emitSkipped, Decl(typescript.d.ts, 819, 26))
->emitResult : ts.EmitResult, Symbol(emitResult, Decl(APISample_compile.ts, 15, 7))
->emitSkipped : boolean, Symbol(ts.EmitResult.emitSkipped, Decl(typescript.d.ts, 819, 26))
->1 : number
->0 : number
-
- console.log(`Process exiting with code '${exitCode}'.`);
->console.log(`Process exiting with code '${exitCode}'.`) : any
->console.log : any
->console : any, Symbol(console, Decl(APISample_compile.ts, 8, 11))
->log : any
->`Process exiting with code '${exitCode}'.` : string
->exitCode : number, Symbol(exitCode, Decl(APISample_compile.ts, 25, 7))
-
- process.exit(exitCode);
->process.exit(exitCode) : any
->process.exit : any
->process : any, Symbol(process, Decl(APISample_compile.ts, 7, 11))
->exit : any
->exitCode : number, Symbol(exitCode, Decl(APISample_compile.ts, 25, 7))
-}
-
-compile(process.argv.slice(2), {
->compile(process.argv.slice(2), { noEmitOnError: true, noImplicitAny: true, target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS}) : void
->compile : (fileNames: string[], options: ts.CompilerOptions) => void, Symbol(compile, Decl(APISample_compile.ts, 11, 34))
->process.argv.slice(2) : any
->process.argv.slice : any
->process.argv : any
->process : any, Symbol(process, Decl(APISample_compile.ts, 7, 11))
->argv : any
->slice : any
->2 : number
->{ noEmitOnError: true, noImplicitAny: true, target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS} : { [x: string]: boolean | ts.ScriptTarget | ts.ModuleKind; noEmitOnError: boolean; noImplicitAny: boolean; target: ts.ScriptTarget; module: ts.ModuleKind; }
-
- noEmitOnError: true, noImplicitAny: true,
->noEmitOnError : boolean, Symbol(noEmitOnError, Decl(APISample_compile.ts, 30, 32))
->true : boolean
->noImplicitAny : boolean, Symbol(noImplicitAny, Decl(APISample_compile.ts, 31, 24))
->true : boolean
-
- target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS
->target : ts.ScriptTarget, Symbol(target, Decl(APISample_compile.ts, 31, 45))
->ts.ScriptTarget.ES5 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES5, Decl(typescript.d.ts, 1117, 16))
->ts.ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
->ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5))
->ES5 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES5, Decl(typescript.d.ts, 1117, 16))
->module : ts.ModuleKind, Symbol(module, Decl(APISample_compile.ts, 32, 32))
->ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
->ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20))
->ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
->CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
-
-});
diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types
deleted file mode 100644
index c285bc15390..00000000000
--- a/tests/baselines/reference/APISample_linter.types
+++ /dev/null
@@ -1,312 +0,0 @@
-=== tests/cases/compiler/APISample_linter.ts ===
-
-/*
- * Note: This test is a public API sample. The sample sources can be found
- at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter
- * Please log a "breaking change" issue for any API breaking change affecting this issue
- */
-
-declare var process: any;
->process : any, Symbol(process, Decl(APISample_linter.ts, 7, 11))
-
-declare var console: any;
->console : any, Symbol(console, Decl(APISample_linter.ts, 8, 11))
-
-declare var readFileSync: any;
->readFileSync : any, Symbol(readFileSync, Decl(APISample_linter.ts, 9, 11))
-
-import * as ts from "typescript";
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
-
-export function delint(sourceFile: ts.SourceFile) {
->delint : (sourceFile: ts.SourceFile) => void, Symbol(delint, Decl(APISample_linter.ts, 11, 33))
->sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 13, 23))
->ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SourceFile : ts.SourceFile, Symbol(ts.SourceFile, Decl(typescript.d.ts, 740, 5), Decl(typescript.d.ts, 1261, 5))
-
- delintNode(sourceFile);
->delintNode(sourceFile) : void
->delintNode : (node: ts.Node) => void, Symbol(delintNode, Decl(APISample_linter.ts, 14, 27))
->sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 13, 23))
-
- function delintNode(node: ts.Node) {
->delintNode : (node: ts.Node) => void, Symbol(delintNode, Decl(APISample_linter.ts, 14, 27))
->node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
->ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->Node : ts.Node, Symbol(ts.Node, Decl(typescript.d.ts, 296, 5), Decl(typescript.d.ts, 1221, 32))
-
- switch (node.kind) {
->node.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
->node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
->kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
-
- case ts.SyntaxKind.ForStatement:
->ts.SyntaxKind.ForStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.ForStatement, Decl(typescript.d.ts, 209, 29))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ForStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.ForStatement, Decl(typescript.d.ts, 209, 29))
-
- case ts.SyntaxKind.ForInStatement:
->ts.SyntaxKind.ForInStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.ForInStatement, Decl(typescript.d.ts, 210, 27))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ForInStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.ForInStatement, Decl(typescript.d.ts, 210, 27))
-
- case ts.SyntaxKind.WhileStatement:
->ts.SyntaxKind.WhileStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.WhileStatement, Decl(typescript.d.ts, 208, 26))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->WhileStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.WhileStatement, Decl(typescript.d.ts, 208, 26))
-
- case ts.SyntaxKind.DoStatement:
->ts.SyntaxKind.DoStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.DoStatement, Decl(typescript.d.ts, 207, 26))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->DoStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.DoStatement, Decl(typescript.d.ts, 207, 26))
-
- if ((node).statement.kind !== ts.SyntaxKind.Block) {
->(node).statement.kind !== ts.SyntaxKind.Block : boolean
->(node).statement.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
->(node).statement : ts.Statement, Symbol(ts.IterationStatement.statement, Decl(typescript.d.ts, 589, 52))
->(node) : ts.IterationStatement
->node : ts.IterationStatement
->ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->IterationStatement : ts.IterationStatement, Symbol(ts.IterationStatement, Decl(typescript.d.ts, 588, 5))
->node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
->statement : ts.Statement, Symbol(ts.IterationStatement.statement, Decl(typescript.d.ts, 589, 52))
->kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
->ts.SyntaxKind.Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
-
- report(node, "A looping statement's contents should be wrapped in a block body.");
->report(node, "A looping statement's contents should be wrapped in a block body.") : void
->report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5))
->node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
->"A looping statement's contents should be wrapped in a block body." : string
- }
- break;
-
- case ts.SyntaxKind.IfStatement:
->ts.SyntaxKind.IfStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.IfStatement, Decl(typescript.d.ts, 206, 34))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->IfStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.IfStatement, Decl(typescript.d.ts, 206, 34))
-
- let ifStatement = (node);
->ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
->(node) : ts.IfStatement
->node : ts.IfStatement
->ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->IfStatement : ts.IfStatement, Symbol(ts.IfStatement, Decl(typescript.d.ts, 583, 5))
->node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
-
- if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) {
->ifStatement.thenStatement.kind !== ts.SyntaxKind.Block : boolean
->ifStatement.thenStatement.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
->ifStatement.thenStatement : ts.Statement, Symbol(ts.IfStatement.thenStatement, Decl(typescript.d.ts, 585, 31))
->ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
->thenStatement : ts.Statement, Symbol(ts.IfStatement.thenStatement, Decl(typescript.d.ts, 585, 31))
->kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
->ts.SyntaxKind.Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
-
- report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.");
->report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.") : void
->report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5))
->ifStatement.thenStatement : ts.Statement, Symbol(ts.IfStatement.thenStatement, Decl(typescript.d.ts, 585, 31))
->ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
->thenStatement : ts.Statement, Symbol(ts.IfStatement.thenStatement, Decl(typescript.d.ts, 585, 31))
->"An if statement's contents should be wrapped in a block body." : string
- }
- if (ifStatement.elseStatement &&
->ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean
->ifStatement.elseStatement && ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean
->ifStatement.elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
->ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
->elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
-
- ifStatement.elseStatement.kind !== ts.SyntaxKind.Block &&
->ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean
->ifStatement.elseStatement.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
->ifStatement.elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
->ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
->elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
->kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
->ts.SyntaxKind.Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->Block : ts.SyntaxKind, Symbol(ts.SyntaxKind.Block, Decl(typescript.d.ts, 202, 36))
-
- ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) {
->ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean
->ifStatement.elseStatement.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
->ifStatement.elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
->ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
->elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
->kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
->ts.SyntaxKind.IfStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.IfStatement, Decl(typescript.d.ts, 206, 34))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->IfStatement : ts.SyntaxKind, Symbol(ts.SyntaxKind.IfStatement, Decl(typescript.d.ts, 206, 34))
-
- report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.");
->report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.") : void
->report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5))
->ifStatement.elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
->ifStatement : ts.IfStatement, Symbol(ifStatement, Decl(APISample_linter.ts, 28, 19))
->elseStatement : ts.Statement, Symbol(ts.IfStatement.elseStatement, Decl(typescript.d.ts, 586, 33))
->"An else statement's contents should be wrapped in a block body." : string
- }
- break;
-
- case ts.SyntaxKind.BinaryExpression:
->ts.SyntaxKind.BinaryExpression : ts.SyntaxKind, Symbol(ts.SyntaxKind.BinaryExpression, Decl(typescript.d.ts, 192, 37))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->BinaryExpression : ts.SyntaxKind, Symbol(ts.SyntaxKind.BinaryExpression, Decl(typescript.d.ts, 192, 37))
-
- let op = (node).operatorToken.kind;
->op : ts.SyntaxKind, Symbol(op, Decl(APISample_linter.ts, 40, 19))
->(node).operatorToken.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
->(node).operatorToken : ts.Node, Symbol(ts.BinaryExpression.operatorToken, Decl(typescript.d.ts, 497, 25))
->(node) : ts.BinaryExpression
->node : ts.BinaryExpression
->ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->BinaryExpression : ts.BinaryExpression, Symbol(ts.BinaryExpression, Decl(typescript.d.ts, 495, 5))
->node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
->operatorToken : ts.Node, Symbol(ts.BinaryExpression.operatorToken, Decl(typescript.d.ts, 497, 25))
->kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38))
-
- if (op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken) {
->op === ts.SyntaxKind.EqualsEqualsToken || op == ts.SyntaxKind.ExclamationEqualsToken : boolean
->op === ts.SyntaxKind.EqualsEqualsToken : boolean
->op : ts.SyntaxKind, Symbol(op, Decl(APISample_linter.ts, 40, 19))
->ts.SyntaxKind.EqualsEqualsToken : ts.SyntaxKind, Symbol(ts.SyntaxKind.EqualsEqualsToken, Decl(typescript.d.ts, 51, 36))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->EqualsEqualsToken : ts.SyntaxKind, Symbol(ts.SyntaxKind.EqualsEqualsToken, Decl(typescript.d.ts, 51, 36))
->op == ts.SyntaxKind.ExclamationEqualsToken : boolean
->op : ts.SyntaxKind, Symbol(op, Decl(APISample_linter.ts, 40, 19))
->ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind, Symbol(ts.SyntaxKind.ExclamationEqualsToken, Decl(typescript.d.ts, 52, 31))
->ts.SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->SyntaxKind : typeof ts.SyntaxKind, Symbol(ts.SyntaxKind, Decl(typescript.d.ts, 22, 5))
->ExclamationEqualsToken : ts.SyntaxKind, Symbol(ts.SyntaxKind.ExclamationEqualsToken, Decl(typescript.d.ts, 52, 31))
-
- report(node, "Use '===' and '!=='.")
->report(node, "Use '===' and '!=='.") : void
->report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5))
->node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
->"Use '===' and '!=='." : string
- }
- break;
- }
-
- ts.forEachChild(node, delintNode);
->ts.forEachChild(node, delintNode) : void
->ts.forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T, Symbol(ts.forEachChild, Decl(typescript.d.ts, 1186, 48))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T, Symbol(ts.forEachChild, Decl(typescript.d.ts, 1186, 48))
->node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24))
->delintNode : (node: ts.Node) => void, Symbol(delintNode, Decl(APISample_linter.ts, 14, 27))
- }
-
- function report(node: ts.Node, message: string) {
->report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5))
->node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 50, 20))
->ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->Node : ts.Node, Symbol(ts.Node, Decl(typescript.d.ts, 296, 5), Decl(typescript.d.ts, 1221, 32))
->message : string, Symbol(message, Decl(APISample_linter.ts, 50, 34))
-
- let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
->line : number, Symbol(line, Decl(APISample_linter.ts, 51, 13))
->character : number, Symbol(character, Decl(APISample_linter.ts, 51, 19))
->sourceFile.getLineAndCharacterOfPosition(node.getStart()) : ts.LineAndCharacter
->sourceFile.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46))
->sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 13, 23))
->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46))
->node.getStart() : number
->node.getStart : (sourceFile?: ts.SourceFile) => number, Symbol(ts.Node.getStart, Decl(typescript.d.ts, 1226, 53))
->node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 50, 20))
->getStart : (sourceFile?: ts.SourceFile) => number, Symbol(ts.Node.getStart, Decl(typescript.d.ts, 1226, 53))
-
- console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`);
->console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`) : any
->console.log : any
->console : any, Symbol(console, Decl(APISample_linter.ts, 8, 11))
->log : any
->`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}` : string
->sourceFile.fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
->sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 13, 23))
->fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
->line + 1 : number
->line : number, Symbol(line, Decl(APISample_linter.ts, 51, 13))
->1 : number
->character + 1 : number
->character : number, Symbol(character, Decl(APISample_linter.ts, 51, 19))
->1 : number
->message : string, Symbol(message, Decl(APISample_linter.ts, 50, 34))
- }
-}
-
-const fileNames = process.argv.slice(2);
->fileNames : any, Symbol(fileNames, Decl(APISample_linter.ts, 56, 5))
->process.argv.slice(2) : any
->process.argv.slice : any
->process.argv : any
->process : any, Symbol(process, Decl(APISample_linter.ts, 7, 11))
->argv : any
->slice : any
->2 : number
-
-fileNames.forEach(fileName => {
->fileNames.forEach(fileName => { // Parse a file let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);}) : any
->fileNames.forEach : any
->fileNames : any, Symbol(fileNames, Decl(APISample_linter.ts, 56, 5))
->forEach : any
->fileName => { // Parse a file let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); // delint it delint(sourceFile);} : (fileName: any) => void
->fileName : any, Symbol(fileName, Decl(APISample_linter.ts, 57, 18))
-
- // Parse a file
- let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true);
->sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 59, 7))
->ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true) : ts.SourceFile
->ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile, Symbol(ts.createSourceFile, Decl(typescript.d.ts, 1190, 62))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile, Symbol(ts.createSourceFile, Decl(typescript.d.ts, 1190, 62))
->fileName : any, Symbol(fileName, Decl(APISample_linter.ts, 57, 18))
->readFileSync(fileName).toString() : any
->readFileSync(fileName).toString : any
->readFileSync(fileName) : any
->readFileSync : any, Symbol(readFileSync, Decl(APISample_linter.ts, 9, 11))
->fileName : any, Symbol(fileName, Decl(APISample_linter.ts, 57, 18))
->toString : any
->ts.ScriptTarget.ES6 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES6, Decl(typescript.d.ts, 1118, 16))
->ts.ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6))
->ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5))
->ES6 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES6, Decl(typescript.d.ts, 1118, 16))
->true : boolean
-
- // delint it
- delint(sourceFile);
->delint(sourceFile) : void
->delint : (sourceFile: ts.SourceFile) => void, Symbol(delint, Decl(APISample_linter.ts, 11, 33))
->sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 59, 7))
-
-});
diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types
deleted file mode 100644
index 6e27f70d877..00000000000
--- a/tests/baselines/reference/APISample_transform.types
+++ /dev/null
@@ -1,44 +0,0 @@
-=== tests/cases/compiler/APISample_transform.ts ===
-
-/*
- * Note: This test is a public API sample. The sample sources can be found
- at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function
- * Please log a "breaking change" issue for any API breaking change affecting this issue
- */
-
-declare var console: any;
->console : any, Symbol(console, Decl(APISample_transform.ts, 7, 11))
-
-import * as ts from "typescript";
->ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6))
-
-const source = "let x: string = 'string'";
->source : string, Symbol(source, Decl(APISample_transform.ts, 11, 5))
->"let x: string = 'string'" : string
-
-let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS });
->result : string, Symbol(result, Decl(APISample_transform.ts, 13, 3))
->ts.transpile(source, { module: ts.ModuleKind.CommonJS }) : string
->ts.transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string, Symbol(ts.transpile, Decl(typescript.d.ts, 1729, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6))
->transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string, Symbol(ts.transpile, Decl(typescript.d.ts, 1729, 5))
->source : string, Symbol(source, Decl(APISample_transform.ts, 11, 5))
->{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; }
->module : ts.ModuleKind, Symbol(module, Decl(APISample_transform.ts, 13, 35))
->ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
->ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6))
->ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
->CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
-
-console.log(JSON.stringify(result));
->console.log(JSON.stringify(result)) : any
->console.log : any
->console : any, Symbol(console, Decl(APISample_transform.ts, 7, 11))
->log : any
->JSON.stringify(result) : string
->JSON.stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; }, Symbol(JSON.stringify, Decl(lib.d.ts, 964, 70), Decl(lib.d.ts, 969, 34), Decl(lib.d.ts, 975, 78), Decl(lib.d.ts, 981, 51), Decl(lib.d.ts, 988, 90))
->JSON : JSON, Symbol(JSON, Decl(lib.d.ts, 955, 42), Decl(lib.d.ts, 1000, 11))
->stringify : { (value: any): string; (value: any, replacer: (key: string, value: any) => any): string; (value: any, replacer: any[]): string; (value: any, replacer: (key: string, value: any) => any, space: any): string; (value: any, replacer: any[], space: any): string; }, Symbol(JSON.stringify, Decl(lib.d.ts, 964, 70), Decl(lib.d.ts, 969, 34), Decl(lib.d.ts, 975, 78), Decl(lib.d.ts, 981, 51), Decl(lib.d.ts, 988, 90))
->result : string, Symbol(result, Decl(APISample_transform.ts, 13, 3))
-
diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types
deleted file mode 100644
index abc915e3776..00000000000
--- a/tests/baselines/reference/APISample_watcher.types
+++ /dev/null
@@ -1,443 +0,0 @@
-=== tests/cases/compiler/APISample_watcher.ts ===
-
-/*
- * Note: This test is a public API sample. The sample sources can be found
- at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#incremental-build-support-using-the-language-services
- * Please log a "breaking change" issue for any API breaking change affecting this issue
- */
-
-declare var process: any;
->process : any, Symbol(process, Decl(APISample_watcher.ts, 7, 11))
-
-declare var console: any;
->console : any, Symbol(console, Decl(APISample_watcher.ts, 8, 11))
-
-declare var fs: any;
->fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
-
-declare var path: any;
->path : any, Symbol(path, Decl(APISample_watcher.ts, 10, 11))
-
-import * as ts from "typescript";
->ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
-
-function watch(rootFileNames: string[], options: ts.CompilerOptions) {
->watch : (rootFileNames: string[], options: ts.CompilerOptions) => void, Symbol(watch, Decl(APISample_watcher.ts, 12, 33))
->rootFileNames : string[], Symbol(rootFileNames, Decl(APISample_watcher.ts, 14, 15))
->options : ts.CompilerOptions, Symbol(options, Decl(APISample_watcher.ts, 14, 39))
->ts : any, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
->CompilerOptions : ts.CompilerOptions, Symbol(ts.CompilerOptions, Decl(typescript.d.ts, 1074, 5))
-
- const files: ts.Map<{ version: number }> = {};
->files : ts.Map<{ version: number; }>, Symbol(files, Decl(APISample_watcher.ts, 15, 9))
->ts : any, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
->Map : ts.Map, Symbol(ts.Map, Decl(typescript.d.ts, 15, 29))
->version : number, Symbol(version, Decl(APISample_watcher.ts, 15, 25))
->{} : { [x: string]: undefined; }
-
- // initialize the list of files
- rootFileNames.forEach(fileName => {
->rootFileNames.forEach(fileName => { files[fileName] = { version: 0 }; }) : void
->rootFileNames.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
->rootFileNames : string[], Symbol(rootFileNames, Decl(APISample_watcher.ts, 14, 15))
->forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
->fileName => { files[fileName] = { version: 0 }; } : (fileName: string) => void
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 18, 26))
-
- files[fileName] = { version: 0 };
->files[fileName] = { version: 0 } : { version: number; }
->files[fileName] : { version: number; }
->files : ts.Map<{ version: number; }>, Symbol(files, Decl(APISample_watcher.ts, 15, 9))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 18, 26))
->{ version: 0 } : { version: number; }
->version : number, Symbol(version, Decl(APISample_watcher.ts, 19, 27))
->0 : number
-
- });
-
- // Create the language service host to allow the LS to communicate with the host
- const servicesHost: ts.LanguageServiceHost = {
->servicesHost : ts.LanguageServiceHost, Symbol(servicesHost, Decl(APISample_watcher.ts, 23, 9))
->ts : any, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
->LanguageServiceHost : ts.LanguageServiceHost, Symbol(ts.LanguageServiceHost, Decl(typescript.d.ts, 1295, 5))
->{ getScriptFileNames: () => rootFileNames, getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), getScriptSnapshot: (fileName) => { if (!fs.existsSync(fileName)) { return undefined; } return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); }, getCurrentDirectory: () => process.cwd(), getCompilationSettings: () => options, getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), } : { getScriptFileNames: () => string[]; getScriptVersion: (fileName: string) => string; getScriptSnapshot: (fileName: string) => ts.IScriptSnapshot; getCurrentDirectory: () => any; getCompilationSettings: () => ts.CompilerOptions; getDefaultLibFileName: (options: ts.CompilerOptions) => string; }
-
- getScriptFileNames: () => rootFileNames,
->getScriptFileNames : () => string[], Symbol(getScriptFileNames, Decl(APISample_watcher.ts, 23, 50))
->() => rootFileNames : () => string[]
->rootFileNames : string[], Symbol(rootFileNames, Decl(APISample_watcher.ts, 14, 15))
-
- getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(),
->getScriptVersion : (fileName: string) => string, Symbol(getScriptVersion, Decl(APISample_watcher.ts, 24, 48))
->(fileName) => files[fileName] && files[fileName].version.toString() : (fileName: string) => string
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 25, 27))
->files[fileName] && files[fileName].version.toString() : string
->files[fileName] : { version: number; }
->files : ts.Map<{ version: number; }>, Symbol(files, Decl(APISample_watcher.ts, 15, 9))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 25, 27))
->files[fileName].version.toString() : string
->files[fileName].version.toString : (radix?: number) => string, Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
->files[fileName].version : number, Symbol(version, Decl(APISample_watcher.ts, 15, 25))
->files[fileName] : { version: number; }
->files : ts.Map<{ version: number; }>, Symbol(files, Decl(APISample_watcher.ts, 15, 9))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 25, 27))
->version : number, Symbol(version, Decl(APISample_watcher.ts, 15, 25))
->toString : (radix?: number) => string, Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
-
- getScriptSnapshot: (fileName) => {
->getScriptSnapshot : (fileName: string) => ts.IScriptSnapshot, Symbol(getScriptSnapshot, Decl(APISample_watcher.ts, 25, 94))
->(fileName) => { if (!fs.existsSync(fileName)) { return undefined; } return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); } : (fileName: string) => ts.IScriptSnapshot
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 26, 28))
-
- if (!fs.existsSync(fileName)) {
->!fs.existsSync(fileName) : boolean
->fs.existsSync(fileName) : any
->fs.existsSync : any
->fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
->existsSync : any
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 26, 28))
-
- return undefined;
->undefined : undefined, Symbol(undefined)
- }
-
- return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString());
->ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()) : ts.IScriptSnapshot
->ts.ScriptSnapshot.fromString : (text: string) => ts.IScriptSnapshot, Symbol(ts.ScriptSnapshot.fromString, Decl(typescript.d.ts, 1288, 27))
->ts.ScriptSnapshot : typeof ts.ScriptSnapshot, Symbol(ts.ScriptSnapshot, Decl(typescript.d.ts, 1287, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
->ScriptSnapshot : typeof ts.ScriptSnapshot, Symbol(ts.ScriptSnapshot, Decl(typescript.d.ts, 1287, 5))
->fromString : (text: string) => ts.IScriptSnapshot, Symbol(ts.ScriptSnapshot.fromString, Decl(typescript.d.ts, 1288, 27))
->fs.readFileSync(fileName).toString() : any
->fs.readFileSync(fileName).toString : any
->fs.readFileSync(fileName) : any
->fs.readFileSync : any
->fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
->readFileSync : any
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 26, 28))
->toString : any
-
- },
- getCurrentDirectory: () => process.cwd(),
->getCurrentDirectory : () => any, Symbol(getCurrentDirectory, Decl(APISample_watcher.ts, 32, 10))
->() => process.cwd() : () => any
->process.cwd() : any
->process.cwd : any
->process : any, Symbol(process, Decl(APISample_watcher.ts, 7, 11))
->cwd : any
-
- getCompilationSettings: () => options,
->getCompilationSettings : () => ts.CompilerOptions, Symbol(getCompilationSettings, Decl(APISample_watcher.ts, 33, 49))
->() => options : () => ts.CompilerOptions
->options : ts.CompilerOptions, Symbol(options, Decl(APISample_watcher.ts, 14, 39))
-
- getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options),
->getDefaultLibFileName : (options: ts.CompilerOptions) => string, Symbol(getDefaultLibFileName, Decl(APISample_watcher.ts, 34, 46))
->(options) => ts.getDefaultLibFilePath(options) : (options: ts.CompilerOptions) => string
->options : ts.CompilerOptions, Symbol(options, Decl(APISample_watcher.ts, 35, 32))
->ts.getDefaultLibFilePath(options) : string
->ts.getDefaultLibFilePath : (options: ts.CompilerOptions) => string, Symbol(ts.getDefaultLibFilePath, Decl(typescript.d.ts, 1737, 44))
->ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
->getDefaultLibFilePath : (options: ts.CompilerOptions) => string, Symbol(ts.getDefaultLibFilePath, Decl(typescript.d.ts, 1737, 44))
->options : ts.CompilerOptions, Symbol(options, Decl(APISample_watcher.ts, 35, 32))
-
- };
-
- // Create the language service files
- const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry())
->services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9))
->ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) : ts.LanguageService
->ts.createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService, Symbol(ts.createLanguageService, Decl(typescript.d.ts, 1735, 97))
->ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
->createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService, Symbol(ts.createLanguageService, Decl(typescript.d.ts, 1735, 97))
->servicesHost : ts.LanguageServiceHost, Symbol(servicesHost, Decl(APISample_watcher.ts, 23, 9))
->ts.createDocumentRegistry() : ts.DocumentRegistry
->ts.createDocumentRegistry : () => ts.DocumentRegistry, Symbol(ts.createDocumentRegistry, Decl(typescript.d.ts, 1733, 193))
->ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
->createDocumentRegistry : () => ts.DocumentRegistry, Symbol(ts.createDocumentRegistry, Decl(typescript.d.ts, 1733, 193))
-
- // Now let's watch the files
- rootFileNames.forEach(fileName => {
->rootFileNames.forEach(fileName => { // First time around, emit all files emitFile(fileName); // Add a watch on the file to handle next change fs.watchFile(fileName, { persistent: true, interval: 250 }, (curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); }); }) : void
->rootFileNames.forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
->rootFileNames : string[], Symbol(rootFileNames, Decl(APISample_watcher.ts, 14, 15))
->forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
->fileName => { // First time around, emit all files emitFile(fileName); // Add a watch on the file to handle next change fs.watchFile(fileName, { persistent: true, interval: 250 }, (curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); }); } : (fileName: string) => void
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 42, 26))
-
- // First time around, emit all files
- emitFile(fileName);
->emitFile(fileName) : void
->emitFile : (fileName: string) => void, Symbol(emitFile, Decl(APISample_watcher.ts, 61, 7))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 42, 26))
-
- // Add a watch on the file to handle next change
- fs.watchFile(fileName,
->fs.watchFile(fileName, { persistent: true, interval: 250 }, (curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); }) : any
->fs.watchFile : any
->fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
->watchFile : any
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 42, 26))
-
- { persistent: true, interval: 250 },
->{ persistent: true, interval: 250 } : { persistent: boolean; interval: number; }
->persistent : boolean, Symbol(persistent, Decl(APISample_watcher.ts, 48, 13))
->true : boolean
->interval : number, Symbol(interval, Decl(APISample_watcher.ts, 48, 31))
->250 : number
-
- (curr, prev) => {
->(curr, prev) => { // Check timestamp if (+curr.mtime <= +prev.mtime) { return; } // Update the version to signal a change in the file files[fileName].version++; // write the changes to disk emitFile(fileName); } : (curr: any, prev: any) => void
->curr : any, Symbol(curr, Decl(APISample_watcher.ts, 49, 13))
->prev : any, Symbol(prev, Decl(APISample_watcher.ts, 49, 18))
-
- // Check timestamp
- if (+curr.mtime <= +prev.mtime) {
->+curr.mtime <= +prev.mtime : boolean
->+curr.mtime : number
->curr.mtime : any
->curr : any, Symbol(curr, Decl(APISample_watcher.ts, 49, 13))
->mtime : any
->+prev.mtime : number
->prev.mtime : any
->prev : any, Symbol(prev, Decl(APISample_watcher.ts, 49, 18))
->mtime : any
-
- return;
- }
-
- // Update the version to signal a change in the file
- files[fileName].version++;
->files[fileName].version++ : number
->files[fileName].version : number, Symbol(version, Decl(APISample_watcher.ts, 15, 25))
->files[fileName] : { version: number; }
->files : ts.Map<{ version: number; }>, Symbol(files, Decl(APISample_watcher.ts, 15, 9))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 42, 26))
->version : number, Symbol(version, Decl(APISample_watcher.ts, 15, 25))
-
- // write the changes to disk
- emitFile(fileName);
->emitFile(fileName) : void
->emitFile : (fileName: string) => void, Symbol(emitFile, Decl(APISample_watcher.ts, 61, 7))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 42, 26))
-
- });
- });
-
- function emitFile(fileName: string) {
->emitFile : (fileName: string) => void, Symbol(emitFile, Decl(APISample_watcher.ts, 61, 7))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22))
-
- let output = services.getEmitOutput(fileName);
->output : ts.EmitOutput, Symbol(output, Decl(APISample_watcher.ts, 64, 11))
->services.getEmitOutput(fileName) : ts.EmitOutput
->services.getEmitOutput : (fileName: string) => ts.EmitOutput, Symbol(ts.LanguageService.getEmitOutput, Decl(typescript.d.ts, 1339, 132))
->services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9))
->getEmitOutput : (fileName: string) => ts.EmitOutput, Symbol(ts.LanguageService.getEmitOutput, Decl(typescript.d.ts, 1339, 132))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22))
-
- if (!output.emitSkipped) {
->!output.emitSkipped : boolean
->output.emitSkipped : boolean, Symbol(ts.EmitOutput.emitSkipped, Decl(typescript.d.ts, 1542, 34))
->output : ts.EmitOutput, Symbol(output, Decl(APISample_watcher.ts, 64, 11))
->emitSkipped : boolean, Symbol(ts.EmitOutput.emitSkipped, Decl(typescript.d.ts, 1542, 34))
-
- console.log(`Emitting ${fileName}`);
->console.log(`Emitting ${fileName}`) : any
->console.log : any
->console : any, Symbol(console, Decl(APISample_watcher.ts, 8, 11))
->log : any
->`Emitting ${fileName}` : string
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22))
- }
- else {
- console.log(`Emitting ${fileName} failed`);
->console.log(`Emitting ${fileName} failed`) : any
->console.log : any
->console : any, Symbol(console, Decl(APISample_watcher.ts, 8, 11))
->log : any
->`Emitting ${fileName} failed` : string
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22))
-
- logErrors(fileName);
->logErrors(fileName) : void
->logErrors : (fileName: string) => void, Symbol(logErrors, Decl(APISample_watcher.ts, 77, 5))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22))
- }
-
- output.outputFiles.forEach(o => {
->output.outputFiles.forEach(o => { fs.writeFileSync(o.name, o.text, "utf8"); }) : void
->output.outputFiles.forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
->output.outputFiles : ts.OutputFile[], Symbol(ts.EmitOutput.outputFiles, Decl(typescript.d.ts, 1541, 26))
->output : ts.EmitOutput, Symbol(output, Decl(APISample_watcher.ts, 64, 11))
->outputFiles : ts.OutputFile[], Symbol(ts.EmitOutput.outputFiles, Decl(typescript.d.ts, 1541, 26))
->forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
->o => { fs.writeFileSync(o.name, o.text, "utf8"); } : (o: ts.OutputFile) => void
->o : ts.OutputFile, Symbol(o, Decl(APISample_watcher.ts, 74, 35))
-
- fs.writeFileSync(o.name, o.text, "utf8");
->fs.writeFileSync(o.name, o.text, "utf8") : any
->fs.writeFileSync : any
->fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
->writeFileSync : any
->o.name : string, Symbol(ts.OutputFile.name, Decl(typescript.d.ts, 1550, 26))
->o : ts.OutputFile, Symbol(o, Decl(APISample_watcher.ts, 74, 35))
->name : string, Symbol(ts.OutputFile.name, Decl(typescript.d.ts, 1550, 26))
->o.text : string, Symbol(ts.OutputFile.text, Decl(typescript.d.ts, 1552, 36))
->o : ts.OutputFile, Symbol(o, Decl(APISample_watcher.ts, 74, 35))
->text : string, Symbol(ts.OutputFile.text, Decl(typescript.d.ts, 1552, 36))
->"utf8" : string
-
- });
- }
-
- function logErrors(fileName: string) {
->logErrors : (fileName: string) => void, Symbol(logErrors, Decl(APISample_watcher.ts, 77, 5))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 79, 23))
-
- let allDiagnostics = services.getCompilerOptionsDiagnostics()
->allDiagnostics : ts.Diagnostic[], Symbol(allDiagnostics, Decl(APISample_watcher.ts, 80, 11))
->services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat(services.getSemanticDiagnostics(fileName)) : ts.Diagnostic[]
->services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) .concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
->services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) : ts.Diagnostic[]
->services.getCompilerOptionsDiagnostics() .concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
->services.getCompilerOptionsDiagnostics() : ts.Diagnostic[]
->services.getCompilerOptionsDiagnostics : () => ts.Diagnostic[], Symbol(ts.LanguageService.getCompilerOptionsDiagnostics, Decl(typescript.d.ts, 1313, 63))
->services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9))
->getCompilerOptionsDiagnostics : () => ts.Diagnostic[], Symbol(ts.LanguageService.getCompilerOptionsDiagnostics, Decl(typescript.d.ts, 1313, 63))
-
- .concat(services.getSyntacticDiagnostics(fileName))
->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
->services.getSyntacticDiagnostics(fileName) : ts.Diagnostic[]
->services.getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSyntacticDiagnostics, Decl(typescript.d.ts, 1311, 37))
->services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9))
->getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSyntacticDiagnostics, Decl(typescript.d.ts, 1311, 37))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 79, 23))
-
- .concat(services.getSemanticDiagnostics(fileName));
->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46))
->services.getSemanticDiagnostics(fileName) : ts.Diagnostic[]
->services.getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSemanticDiagnostics, Decl(typescript.d.ts, 1312, 64))
->services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9))
->getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSemanticDiagnostics, Decl(typescript.d.ts, 1312, 64))
->fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 79, 23))
-
- allDiagnostics.forEach(diagnostic => {
->allDiagnostics.forEach(diagnostic => { let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { console.log(` Error: ${message}`); } }) : void
->allDiagnostics.forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
->allDiagnostics : ts.Diagnostic[], Symbol(allDiagnostics, Decl(APISample_watcher.ts, 80, 11))
->forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95))
->diagnostic => { let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`); } else { console.log(` Error: ${message}`); } } : (diagnostic: ts.Diagnostic) => void
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
-
- let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
->message : string, Symbol(message, Decl(APISample_watcher.ts, 85, 15))
->ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n") : string
->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1200, 67))
->ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1200, 67))
->diagnostic.messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23))
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
->messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23))
->"\n" : string
-
- if (diagnostic.file) {
->diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
->file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
-
- let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
->line : number, Symbol(line, Decl(APISample_watcher.ts, 87, 21))
->character : number, Symbol(character, Decl(APISample_watcher.ts, 87, 27))
->diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter
->diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46))
->diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
->file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46))
->diagnostic.start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25))
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
->start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25))
-
- console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
->console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`) : any
->console.log : any
->console : any, Symbol(console, Decl(APISample_watcher.ts, 8, 11))
->log : any
->` Error ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}` : string
->diagnostic.file.fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
->diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
->diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31))
->file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26))
->fileName : string, Symbol(ts.SourceFile.fileName, Decl(typescript.d.ts, 743, 29))
->line + 1 : number
->line : number, Symbol(line, Decl(APISample_watcher.ts, 87, 21))
->1 : number
->character + 1 : number
->character : number, Symbol(character, Decl(APISample_watcher.ts, 87, 27))
->1 : number
->message : string, Symbol(message, Decl(APISample_watcher.ts, 85, 15))
- }
- else {
- console.log(` Error: ${message}`);
->console.log(` Error: ${message}`) : any
->console.log : any
->console : any, Symbol(console, Decl(APISample_watcher.ts, 8, 11))
->log : any
->` Error: ${message}` : string
->message : string, Symbol(message, Decl(APISample_watcher.ts, 85, 15))
- }
- });
- }
-}
-
-// Initialize files constituting the program as all .ts files in the current directory
-const currentDirectoryFiles = fs.readdirSync(process.cwd()).
->currentDirectoryFiles : any, Symbol(currentDirectoryFiles, Decl(APISample_watcher.ts, 98, 5))
->fs.readdirSync(process.cwd()). filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts") : any
->fs.readdirSync(process.cwd()). filter : any
->fs.readdirSync(process.cwd()) : any
->fs.readdirSync : any
->fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11))
->readdirSync : any
->process.cwd() : any
->process.cwd : any
->process : any, Symbol(process, Decl(APISample_watcher.ts, 7, 11))
->cwd : any
-
- filter(fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts");
->filter : any
->fileName=> fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts" : (fileName: any) => boolean
->fileName : any, Symbol(fileName, Decl(APISample_watcher.ts, 99, 11))
->fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts" : boolean
->fileName.length >= 3 : boolean
->fileName.length : any
->fileName : any, Symbol(fileName, Decl(APISample_watcher.ts, 99, 11))
->length : any
->3 : number
->fileName.substr(fileName.length - 3, 3) === ".ts" : boolean
->fileName.substr(fileName.length - 3, 3) : any
->fileName.substr : any
->fileName : any, Symbol(fileName, Decl(APISample_watcher.ts, 99, 11))
->substr : any
->fileName.length - 3 : number
->fileName.length : any
->fileName : any, Symbol(fileName, Decl(APISample_watcher.ts, 99, 11))
->length : any
->3 : number
->3 : number
->".ts" : string
-
-// Start the watcher
-watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS });
->watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }) : void
->watch : (rootFileNames: string[], options: ts.CompilerOptions) => void, Symbol(watch, Decl(APISample_watcher.ts, 12, 33))
->currentDirectoryFiles : any, Symbol(currentDirectoryFiles, Decl(APISample_watcher.ts, 98, 5))
->{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; }
->module : ts.ModuleKind, Symbol(module, Decl(APISample_watcher.ts, 102, 30))
->ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
->ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
->ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6))
->ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5))
->CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17))
-
diff --git a/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.symbols b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.symbols
new file mode 100644
index 00000000000..cc0e8c5e746
--- /dev/null
+++ b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.symbols
@@ -0,0 +1,32 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
+declare module Point {
+>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
+
+ export var Origin: { x: number; y: number; }
+>Origin : Symbol(Origin, Decl(module.d.ts, 1, 14))
+>x : Symbol(x, Decl(module.d.ts, 1, 24))
+>y : Symbol(y, Decl(module.d.ts, 1, 35))
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/function.d.ts ===
+declare function Point(): { x: number; y: number; }
+>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
+>x : Symbol(x, Decl(function.d.ts, 0, 27))
+>y : Symbol(y, Decl(function.d.ts, 0, 38))
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
+var cl: { x: number; y: number; }
+>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>x : Symbol(x, Decl(test.ts, 0, 9))
+>y : Symbol(y, Decl(test.ts, 0, 20))
+
+var cl = Point();
+>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
+
+var cl = Point.Origin;
+>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>Point.Origin : Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
+>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
+>Origin : Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
+
diff --git a/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.types
index 974e500d341..da82a2ff662 100644
--- a/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.types
+++ b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.types
@@ -1,33 +1,33 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
declare module Point {
->Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
+>Point : typeof Point
export var Origin: { x: number; y: number; }
->Origin : { x: number; y: number; }, Symbol(Origin, Decl(module.d.ts, 1, 14))
->x : number, Symbol(x, Decl(module.d.ts, 1, 24))
->y : number, Symbol(y, Decl(module.d.ts, 1, 35))
+>Origin : { x: number; y: number; }
+>x : number
+>y : number
}
=== tests/cases/conformance/internalModules/DeclarationMerging/function.d.ts ===
declare function Point(): { x: number; y: number; }
->Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
->x : number, Symbol(x, Decl(function.d.ts, 0, 27))
->y : number, Symbol(y, Decl(function.d.ts, 0, 38))
+>Point : typeof Point
+>x : number
+>y : number
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
var cl: { x: number; y: number; }
->cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
->x : number, Symbol(x, Decl(test.ts, 0, 9))
->y : number, Symbol(y, Decl(test.ts, 0, 20))
+>cl : { x: number; y: number; }
+>x : number
+>y : number
var cl = Point();
->cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>cl : { x: number; y: number; }
>Point() : { x: number; y: number; }
->Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
+>Point : typeof Point
var cl = Point.Origin;
->cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
->Point.Origin : { x: number; y: number; }, Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
->Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.d.ts, 0, 0))
->Origin : { x: number; y: number; }, Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
+>cl : { x: number; y: number; }
+>Point.Origin : { x: number; y: number; }
+>Point : typeof Point
+>Origin : { x: number; y: number; }
diff --git a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.symbols b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.symbols
new file mode 100644
index 00000000000..2a24e5df919
--- /dev/null
+++ b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.symbols
@@ -0,0 +1,58 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
+declare module A {
+>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
+
+ export module Point {
+>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
+
+ export var Origin: {
+>Origin : Symbol(Origin, Decl(module.d.ts, 2, 18))
+
+ x: number;
+>x : Symbol(x, Decl(module.d.ts, 2, 28))
+
+ y: number;
+>y : Symbol(y, Decl(module.d.ts, 3, 22))
+ }
+ }
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/class.d.ts ===
+declare module A {
+>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
+
+ export class Point {
+>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
+
+ constructor(x: number, y: number);
+>x : Symbol(x, Decl(class.d.ts, 2, 20))
+>y : Symbol(y, Decl(class.d.ts, 2, 30))
+
+ x: number;
+>x : Symbol(x, Decl(class.d.ts, 2, 42))
+
+ y: number;
+>y : Symbol(y, Decl(class.d.ts, 3, 18))
+ }
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
+var p: { x: number; y: number; }
+>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>x : Symbol(x, Decl(test.ts, 0, 8))
+>y : Symbol(y, Decl(test.ts, 0, 19))
+
+var p = A.Point.Origin;
+>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>A.Point.Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
+>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
+>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
+>Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
+
+var p = new A.Point(0, 0); // unexpected error here, bug 840000
+>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
+>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
+
diff --git a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types
index 1bdabc46ee8..fec7593a993 100644
--- a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types
+++ b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types
@@ -1,61 +1,61 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
declare module A {
->A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
+>A : typeof A
export module Point {
->Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
+>Point : typeof Point
export var Origin: {
->Origin : { x: number; y: number; }, Symbol(Origin, Decl(module.d.ts, 2, 18))
+>Origin : { x: number; y: number; }
x: number;
->x : number, Symbol(x, Decl(module.d.ts, 2, 28))
+>x : number
y: number;
->y : number, Symbol(y, Decl(module.d.ts, 3, 22))
+>y : number
}
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/class.d.ts ===
declare module A {
->A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
+>A : typeof A
export class Point {
->Point : Point, Symbol(Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
+>Point : Point
constructor(x: number, y: number);
->x : number, Symbol(x, Decl(class.d.ts, 2, 20))
->y : number, Symbol(y, Decl(class.d.ts, 2, 30))
+>x : number
+>y : number
x: number;
->x : number, Symbol(x, Decl(class.d.ts, 2, 42))
+>x : number
y: number;
->y : number, Symbol(y, Decl(class.d.ts, 3, 18))
+>y : number
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
var p: { x: number; y: number; }
->p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
->x : number, Symbol(x, Decl(test.ts, 0, 8))
->y : number, Symbol(y, Decl(test.ts, 0, 19))
+>p : { x: number; y: number; }
+>x : number
+>y : number
var p = A.Point.Origin;
->p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
->A.Point.Origin : { x: number; y: number; }, Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
->A.Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
->A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
->Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
->Origin : { x: number; y: number; }, Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
+>p : { x: number; y: number; }
+>A.Point.Origin : { x: number; y: number; }
+>A.Point : typeof A.Point
+>A : typeof A
+>Point : typeof A.Point
+>Origin : { x: number; y: number; }
var p = new A.Point(0, 0); // unexpected error here, bug 840000
->p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>p : { x: number; y: number; }
>new A.Point(0, 0) : A.Point
->A.Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
->A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(class.d.ts, 0, 0))
->Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(class.d.ts, 0, 18))
+>A.Point : typeof A.Point
+>A : typeof A
+>Point : typeof A.Point
>0 : number
>0 : number
diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.symbols b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.symbols
new file mode 100644
index 00000000000..09762fd1406
--- /dev/null
+++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.symbols
@@ -0,0 +1,52 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
+declare module A {
+>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
+
+ export module Point {
+>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
+
+ export var Origin: {
+>Origin : Symbol(Origin, Decl(module.d.ts, 2, 18))
+
+ x: number;
+>x : Symbol(x, Decl(module.d.ts, 2, 28))
+
+ y: number;
+>y : Symbol(y, Decl(module.d.ts, 3, 22))
+ }
+ }
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/classPoint.ts ===
+module A {
+>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
+
+ export class Point {
+>Point : Symbol(Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(classPoint.ts, 2, 20))
+>y : Symbol(y, Decl(classPoint.ts, 2, 37))
+ }
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
+var p: { x: number; y: number; }
+>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>x : Symbol(x, Decl(test.ts, 0, 8))
+>y : Symbol(y, Decl(test.ts, 0, 19))
+
+var p = A.Point.Origin;
+>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>A.Point.Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
+>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
+>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
+>Origin : Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
+
+var p = new A.Point(0, 0); // unexpected error here, bug 840000
+>p : Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>A.Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
+>A : Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
+
diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types
index 9d90bf94449..cd57c0c503d 100644
--- a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types
+++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types
@@ -1,55 +1,55 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
declare module A {
->A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
+>A : typeof A
export module Point {
->Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
+>Point : typeof Point
export var Origin: {
->Origin : { x: number; y: number; }, Symbol(Origin, Decl(module.d.ts, 2, 18))
+>Origin : { x: number; y: number; }
x: number;
->x : number, Symbol(x, Decl(module.d.ts, 2, 28))
+>x : number
y: number;
->y : number, Symbol(y, Decl(module.d.ts, 3, 22))
+>y : number
}
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/classPoint.ts ===
module A {
->A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
+>A : typeof A
export class Point {
->Point : Point, Symbol(Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(classPoint.ts, 2, 20))
->y : number, Symbol(y, Decl(classPoint.ts, 2, 37))
+>x : number
+>y : number
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
var p: { x: number; y: number; }
->p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
->x : number, Symbol(x, Decl(test.ts, 0, 8))
->y : number, Symbol(y, Decl(test.ts, 0, 19))
+>p : { x: number; y: number; }
+>x : number
+>y : number
var p = A.Point.Origin;
->p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
->A.Point.Origin : { x: number; y: number; }, Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
->A.Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
->A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
->Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
->Origin : { x: number; y: number; }, Symbol(A.Point.Origin, Decl(module.d.ts, 2, 18))
+>p : { x: number; y: number; }
+>A.Point.Origin : { x: number; y: number; }
+>A.Point : typeof A.Point
+>A : typeof A
+>Point : typeof A.Point
+>Origin : { x: number; y: number; }
var p = new A.Point(0, 0); // unexpected error here, bug 840000
->p : { x: number; y: number; }, Symbol(p, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>p : { x: number; y: number; }
>new A.Point(0, 0) : A.Point
->A.Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
->A : typeof A, Symbol(A, Decl(module.d.ts, 0, 0), Decl(classPoint.ts, 0, 0))
->Point : typeof A.Point, Symbol(A.Point, Decl(module.d.ts, 0, 18), Decl(classPoint.ts, 0, 10))
+>A.Point : typeof A.Point
+>A : typeof A
+>Point : typeof A.Point
>0 : number
>0 : number
diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.symbols b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.symbols
new file mode 100644
index 00000000000..ccb8662712f
--- /dev/null
+++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.symbols
@@ -0,0 +1,35 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
+declare module Point {
+>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
+
+ export var Origin: { x: number; y: number; }
+>Origin : Symbol(Origin, Decl(module.d.ts, 1, 14))
+>x : Symbol(x, Decl(module.d.ts, 1, 24))
+>y : Symbol(y, Decl(module.d.ts, 1, 35))
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/function.ts ===
+function Point() {
+>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
+
+ return { x: 0, y: 0 };
+>x : Symbol(x, Decl(function.ts, 1, 12))
+>y : Symbol(y, Decl(function.ts, 1, 18))
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
+var cl: { x: number; y: number; }
+>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>x : Symbol(x, Decl(test.ts, 0, 9))
+>y : Symbol(y, Decl(test.ts, 0, 20))
+
+var cl = Point();
+>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
+
+var cl = Point.Origin;
+>cl : Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>Point.Origin : Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
+>Point : Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
+>Origin : Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
+
diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types
index 1384b65b029..035f2a50c37 100644
--- a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types
+++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types
@@ -1,39 +1,39 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/module.d.ts ===
declare module Point {
->Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
+>Point : typeof Point
export var Origin: { x: number; y: number; }
->Origin : { x: number; y: number; }, Symbol(Origin, Decl(module.d.ts, 1, 14))
->x : number, Symbol(x, Decl(module.d.ts, 1, 24))
->y : number, Symbol(y, Decl(module.d.ts, 1, 35))
+>Origin : { x: number; y: number; }
+>x : number
+>y : number
}
=== tests/cases/conformance/internalModules/DeclarationMerging/function.ts ===
function Point() {
->Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
+>Point : typeof Point
return { x: 0, y: 0 };
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(function.ts, 1, 12))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(function.ts, 1, 18))
+>y : number
>0 : number
}
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
var cl: { x: number; y: number; }
->cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
->x : number, Symbol(x, Decl(test.ts, 0, 9))
->y : number, Symbol(y, Decl(test.ts, 0, 20))
+>cl : { x: number; y: number; }
+>x : number
+>y : number
var cl = Point();
->cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
+>cl : { x: number; y: number; }
>Point() : { x: number; y: number; }
->Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
+>Point : typeof Point
var cl = Point.Origin;
->cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3), Decl(test.ts, 2, 3))
->Point.Origin : { x: number; y: number; }, Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
->Point : typeof Point, Symbol(Point, Decl(module.d.ts, 0, 0), Decl(function.ts, 0, 0))
->Origin : { x: number; y: number; }, Symbol(Point.Origin, Decl(module.d.ts, 1, 14))
+>cl : { x: number; y: number; }
+>Point.Origin : { x: number; y: number; }
+>Point : typeof Point
+>Origin : { x: number; y: number; }
diff --git a/tests/baselines/reference/ArrowFunction4.symbols b/tests/baselines/reference/ArrowFunction4.symbols
new file mode 100644
index 00000000000..cd19b8cdac9
--- /dev/null
+++ b/tests/baselines/reference/ArrowFunction4.symbols
@@ -0,0 +1,7 @@
+=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction4.ts ===
+var v = (a, b) => {
+>v : Symbol(v, Decl(ArrowFunction4.ts, 0, 3))
+>a : Symbol(a, Decl(ArrowFunction4.ts, 0, 9))
+>b : Symbol(b, Decl(ArrowFunction4.ts, 0, 11))
+
+};
diff --git a/tests/baselines/reference/ArrowFunction4.types b/tests/baselines/reference/ArrowFunction4.types
index 0472aba3d6c..1d049f193e6 100644
--- a/tests/baselines/reference/ArrowFunction4.types
+++ b/tests/baselines/reference/ArrowFunction4.types
@@ -1,8 +1,8 @@
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction4.ts ===
var v = (a, b) => {
->v : (a: any, b: any) => void, Symbol(v, Decl(ArrowFunction4.ts, 0, 3))
+>v : (a: any, b: any) => void
>(a, b) => { } : (a: any, b: any) => void
->a : any, Symbol(a, Decl(ArrowFunction4.ts, 0, 9))
->b : any, Symbol(b, Decl(ArrowFunction4.ts, 0, 11))
+>a : any
+>b : any
};
diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.symbols b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.symbols
new file mode 100644
index 00000000000..1c75c33a278
--- /dev/null
+++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.symbols
@@ -0,0 +1,47 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts ===
+class Point {
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 16))
+>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 33))
+
+ static Origin(): Point { return { x: 0, y: 0 }; }
+>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 55))
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1))
+>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 3, 37))
+>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 3, 43))
+}
+
+module Point {
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1))
+
+ function Origin() { return ""; }// not an error, since not exported
+>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 6, 14))
+}
+
+
+module A {
+>A : Symbol(A, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 8, 1))
+
+ export class Point {
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 20))
+>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 37))
+
+ static Origin(): Point { return { x: 0, y: 0 }; }
+>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 59))
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5))
+>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 15, 41))
+>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 15, 47))
+ }
+
+ export module Point {
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5))
+
+ function Origin() { return ""; }// not an error since not exported
+>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 18, 25))
+ }
+}
diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types
index e3b806d38d5..9d943ab354c 100644
--- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types
+++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types
@@ -1,55 +1,55 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts ===
class Point {
->Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 16))
->y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 33))
+>x : number
+>y : number
static Origin(): Point { return { x: 0, y: 0 }; }
->Origin : () => Point, Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 1, 55))
->Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1))
+>Origin : () => Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 3, 37))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 3, 43))
+>y : number
>0 : number
}
module Point {
->Point : typeof Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 4, 1))
+>Point : typeof Point
function Origin() { return ""; }// not an error, since not exported
->Origin : () => string, Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 6, 14))
+>Origin : () => string
>"" : string
}
module A {
->A : typeof A, Symbol(A, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 8, 1))
+>A : typeof A
export class Point {
->Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 20))
->y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 37))
+>x : number
+>y : number
static Origin(): Point { return { x: 0, y: 0 }; }
->Origin : () => Point, Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 13, 59))
->Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5))
+>Origin : () => Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 15, 41))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 15, 47))
+>y : number
>0 : number
}
export module Point {
->Point : typeof Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 16, 5))
+>Point : typeof Point
function Origin() { return ""; }// not an error since not exported
->Origin : () => string, Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts, 18, 25))
+>Origin : () => string
>"" : string
}
}
diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.symbols b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.symbols
new file mode 100644
index 00000000000..046b92fd6ee
--- /dev/null
+++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.symbols
@@ -0,0 +1,47 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts ===
+class Point {
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 16))
+>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 33))
+
+ static Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 55))
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1))
+>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 3, 28))
+>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 3, 34))
+}
+
+module Point {
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1))
+
+ var Origin = ""; // not an error, since not exported
+>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 7, 7))
+}
+
+
+module A {
+>A : Symbol(A, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 8, 1))
+
+ export class Point {
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 20))
+>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 37))
+
+ static Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 59))
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5))
+>x : Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 15, 32))
+>y : Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 15, 38))
+ }
+
+ export module Point {
+>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5))
+
+ var Origin = ""; // not an error since not exported
+>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 19, 11))
+ }
+}
diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types
index 961e8c1bfd2..8f8ffc8839f 100644
--- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types
+++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types
@@ -1,55 +1,55 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts ===
class Point {
->Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 16))
->y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 33))
+>x : number
+>y : number
static Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 1, 55))
->Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 3, 28))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 3, 34))
+>y : number
>0 : number
}
module Point {
->Point : typeof Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 4, 1))
+>Point : typeof Point
var Origin = ""; // not an error, since not exported
->Origin : string, Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 7, 7))
+>Origin : string
>"" : string
}
module A {
->A : typeof A, Symbol(A, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 8, 1))
+>A : typeof A
export class Point {
->Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 20))
->y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 37))
+>x : number
+>y : number
static Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 13, 59))
->Point : Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 15, 32))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 15, 38))
+>y : number
>0 : number
}
export module Point {
->Point : typeof Point, Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 16, 5))
+>Point : typeof Point
var Origin = ""; // not an error since not exported
->Origin : string, Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts, 19, 11))
+>Origin : string
>"" : string
}
}
diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.symbols b/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.symbols
new file mode 100644
index 00000000000..4375eaa3ffb
--- /dev/null
+++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.symbols
@@ -0,0 +1,3 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.ts ===
+
+No type information for this code.
\ No newline at end of file
diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt
new file mode 100644
index 00000000000..4c707dfd861
--- /dev/null
+++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt
@@ -0,0 +1,44 @@
+tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged
+
+
+==== tests/cases/conformance/internalModules/DeclarationMerging/class.ts (0 errors) ====
+ module X.Y {
+ export class Point {
+ constructor(x: number, y: number) {
+ this.x = x;
+ this.y = y;
+ }
+ x: number;
+ y: number;
+ }
+ }
+
+==== tests/cases/conformance/internalModules/DeclarationMerging/module.ts (1 errors) ====
+ module X.Y {
+ export module Point {
+ ~~~~~
+!!! error TS2433: A module declaration cannot be in a different file from a class or function with which it is merged
+ export var Origin = new Point(0, 0);
+ }
+ }
+
+==== tests/cases/conformance/internalModules/DeclarationMerging/test.ts (0 errors) ====
+ //var cl: { x: number; y: number; }
+ var cl = new X.Y.Point(1,1);
+ var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
+
+
+==== tests/cases/conformance/internalModules/DeclarationMerging/simple.ts (0 errors) ====
+ class A {
+ id: string;
+ }
+
+ module A {
+ export var Instance = new A();
+ }
+
+ // ensure merging works as expected
+ var a = A.Instance;
+ var a = new A();
+ var a: { id: string };
+
\ No newline at end of file
diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.js b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.js
new file mode 100644
index 00000000000..71f633a41e3
--- /dev/null
+++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.js
@@ -0,0 +1,81 @@
+//// [tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleWithSameNameAndCommonRootES6.ts] ////
+
+//// [class.ts]
+module X.Y {
+ export class Point {
+ constructor(x: number, y: number) {
+ this.x = x;
+ this.y = y;
+ }
+ x: number;
+ y: number;
+ }
+}
+
+//// [module.ts]
+module X.Y {
+ export module Point {
+ export var Origin = new Point(0, 0);
+ }
+}
+
+//// [test.ts]
+//var cl: { x: number; y: number; }
+var cl = new X.Y.Point(1,1);
+var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
+
+
+//// [simple.ts]
+class A {
+ id: string;
+}
+
+module A {
+ export var Instance = new A();
+}
+
+// ensure merging works as expected
+var a = A.Instance;
+var a = new A();
+var a: { id: string };
+
+
+//// [class.js]
+var X;
+(function (X) {
+ var Y;
+ (function (Y) {
+ class Point {
+ constructor(x, y) {
+ this.x = x;
+ this.y = y;
+ }
+ }
+ Y.Point = Point;
+ })(Y = X.Y || (X.Y = {}));
+})(X || (X = {}));
+//// [module.js]
+var X;
+(function (X) {
+ var Y;
+ (function (Y) {
+ var Point;
+ (function (Point) {
+ Point.Origin = new Point(0, 0);
+ })(Point = Y.Point || (Y.Point = {}));
+ })(Y = X.Y || (X.Y = {}));
+})(X || (X = {}));
+//// [test.js]
+//var cl: { x: number; y: number; }
+var cl = new X.Y.Point(1, 1);
+var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
+//// [simple.js]
+class A {
+}
+(function (A) {
+ A.Instance = new A();
+})(A || (A = {}));
+// ensure merging works as expected
+var a = A.Instance;
+var a = new A();
+var a;
diff --git a/tests/baselines/reference/ES3For-ofTypeCheck2.symbols b/tests/baselines/reference/ES3For-ofTypeCheck2.symbols
new file mode 100644
index 00000000000..607c404682b
--- /dev/null
+++ b/tests/baselines/reference/ES3For-ofTypeCheck2.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck2.ts ===
+for (var v of [true]) { }
+>v : Symbol(v, Decl(ES3For-ofTypeCheck2.ts, 0, 8))
+
diff --git a/tests/baselines/reference/ES3For-ofTypeCheck2.types b/tests/baselines/reference/ES3For-ofTypeCheck2.types
index 34e73689215..81230c9cea4 100644
--- a/tests/baselines/reference/ES3For-ofTypeCheck2.types
+++ b/tests/baselines/reference/ES3For-ofTypeCheck2.types
@@ -1,6 +1,6 @@
=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck2.ts ===
for (var v of [true]) { }
->v : boolean, Symbol(v, Decl(ES3For-ofTypeCheck2.ts, 0, 8))
+>v : boolean
>[true] : boolean[]
>true : boolean
diff --git a/tests/baselines/reference/ES3For-ofTypeCheck6.symbols b/tests/baselines/reference/ES3For-ofTypeCheck6.symbols
new file mode 100644
index 00000000000..f42b8e87f35
--- /dev/null
+++ b/tests/baselines/reference/ES3For-ofTypeCheck6.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck6.ts ===
+var union: string[] | number[];
+>union : Symbol(union, Decl(ES3For-ofTypeCheck6.ts, 0, 3))
+
+for (var v of union) { }
+>v : Symbol(v, Decl(ES3For-ofTypeCheck6.ts, 1, 8))
+>union : Symbol(union, Decl(ES3For-ofTypeCheck6.ts, 0, 3))
+
diff --git a/tests/baselines/reference/ES3For-ofTypeCheck6.types b/tests/baselines/reference/ES3For-ofTypeCheck6.types
index 0945c7b0795..d7e6045b029 100644
--- a/tests/baselines/reference/ES3For-ofTypeCheck6.types
+++ b/tests/baselines/reference/ES3For-ofTypeCheck6.types
@@ -1,8 +1,8 @@
=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck6.ts ===
var union: string[] | number[];
->union : string[] | number[], Symbol(union, Decl(ES3For-ofTypeCheck6.ts, 0, 3))
+>union : string[] | number[]
for (var v of union) { }
->v : string | number, Symbol(v, Decl(ES3For-ofTypeCheck6.ts, 1, 8))
->union : string[] | number[], Symbol(union, Decl(ES3For-ofTypeCheck6.ts, 0, 3))
+>v : string | number
+>union : string[] | number[]
diff --git a/tests/baselines/reference/ES5For-of10.symbols b/tests/baselines/reference/ES5For-of10.symbols
new file mode 100644
index 00000000000..302db0a5ec7
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of10.symbols
@@ -0,0 +1,23 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of10.ts ===
+function foo() {
+>foo : Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
+
+ return { x: 0 };
+>x : Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+}
+for (foo().x of []) {
+>foo().x : Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+>foo : Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
+>x : Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+
+ for (foo().x of [])
+>foo().x : Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+>foo : Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
+>x : Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+
+ var p = foo().x;
+>p : Symbol(p, Decl(ES5For-of10.ts, 5, 11))
+>foo().x : Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+>foo : Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
+>x : Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+}
diff --git a/tests/baselines/reference/ES5For-of10.types b/tests/baselines/reference/ES5For-of10.types
index 1f84648a76e..d31f8972038 100644
--- a/tests/baselines/reference/ES5For-of10.types
+++ b/tests/baselines/reference/ES5For-of10.types
@@ -1,30 +1,30 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of10.ts ===
function foo() {
->foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
+>foo : () => { x: number; }
return { x: 0 };
>{ x: 0 } : { x: number; }
->x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+>x : number
>0 : number
}
for (foo().x of []) {
->foo().x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+>foo().x : number
>foo() : { x: number; }
->foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
->x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+>foo : () => { x: number; }
+>x : number
>[] : undefined[]
for (foo().x of [])
->foo().x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+>foo().x : number
>foo() : { x: number; }
->foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
->x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+>foo : () => { x: number; }
+>x : number
>[] : undefined[]
var p = foo().x;
->p : number, Symbol(p, Decl(ES5For-of10.ts, 5, 11))
->foo().x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+>p : number
+>foo().x : number
>foo() : { x: number; }
->foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of10.ts, 0, 0))
->x : number, Symbol(x, Decl(ES5For-of10.ts, 1, 12))
+>foo : () => { x: number; }
+>x : number
}
diff --git a/tests/baselines/reference/ES5For-of11.symbols b/tests/baselines/reference/ES5For-of11.symbols
new file mode 100644
index 00000000000..7d80e3ab271
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of11.symbols
@@ -0,0 +1,7 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of11.ts ===
+var v;
+>v : Symbol(v, Decl(ES5For-of11.ts, 0, 3))
+
+for (v of []) { }
+>v : Symbol(v, Decl(ES5For-of11.ts, 0, 3))
+
diff --git a/tests/baselines/reference/ES5For-of11.types b/tests/baselines/reference/ES5For-of11.types
index b609424fb75..e51bc46f157 100644
--- a/tests/baselines/reference/ES5For-of11.types
+++ b/tests/baselines/reference/ES5For-of11.types
@@ -1,8 +1,8 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of11.ts ===
var v;
->v : any, Symbol(v, Decl(ES5For-of11.ts, 0, 3))
+>v : any
for (v of []) { }
->v : any, Symbol(v, Decl(ES5For-of11.ts, 0, 3))
+>v : any
>[] : undefined[]
diff --git a/tests/baselines/reference/ES5For-of13.symbols b/tests/baselines/reference/ES5For-of13.symbols
new file mode 100644
index 00000000000..2dcfe344cf4
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of13.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of13.ts ===
+for (let v of ['a', 'b', 'c']) {
+>v : Symbol(v, Decl(ES5For-of13.ts, 0, 8))
+
+ var x = v;
+>x : Symbol(x, Decl(ES5For-of13.ts, 1, 7))
+>v : Symbol(v, Decl(ES5For-of13.ts, 0, 8))
+}
diff --git a/tests/baselines/reference/ES5For-of13.types b/tests/baselines/reference/ES5For-of13.types
index 7f131241081..46125af551e 100644
--- a/tests/baselines/reference/ES5For-of13.types
+++ b/tests/baselines/reference/ES5For-of13.types
@@ -1,12 +1,12 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of13.ts ===
for (let v of ['a', 'b', 'c']) {
->v : string, Symbol(v, Decl(ES5For-of13.ts, 0, 8))
+>v : string
>['a', 'b', 'c'] : string[]
>'a' : string
>'b' : string
>'c' : string
var x = v;
->x : string, Symbol(x, Decl(ES5For-of13.ts, 1, 7))
->v : string, Symbol(v, Decl(ES5For-of13.ts, 0, 8))
+>x : string
+>v : string
}
diff --git a/tests/baselines/reference/ES5For-of14.symbols b/tests/baselines/reference/ES5For-of14.symbols
new file mode 100644
index 00000000000..771a088f8dc
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of14.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of14.ts ===
+for (const v of []) {
+>v : Symbol(v, Decl(ES5For-of14.ts, 0, 10))
+
+ var x = v;
+>x : Symbol(x, Decl(ES5For-of14.ts, 1, 7))
+>v : Symbol(v, Decl(ES5For-of14.ts, 0, 10))
+}
diff --git a/tests/baselines/reference/ES5For-of14.types b/tests/baselines/reference/ES5For-of14.types
index 3ca30c7f3dc..0a4f9a78453 100644
--- a/tests/baselines/reference/ES5For-of14.types
+++ b/tests/baselines/reference/ES5For-of14.types
@@ -1,9 +1,9 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of14.ts ===
for (const v of []) {
->v : any, Symbol(v, Decl(ES5For-of14.ts, 0, 10))
+>v : any
>[] : undefined[]
var x = v;
->x : any, Symbol(x, Decl(ES5For-of14.ts, 1, 7))
->v : any, Symbol(v, Decl(ES5For-of14.ts, 0, 10))
+>x : any
+>v : any
}
diff --git a/tests/baselines/reference/ES5For-of15.symbols b/tests/baselines/reference/ES5For-of15.symbols
new file mode 100644
index 00000000000..ea769ccfac9
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of15.symbols
@@ -0,0 +1,15 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of15.ts ===
+for (let v of []) {
+>v : Symbol(v, Decl(ES5For-of15.ts, 0, 8))
+
+ v;
+>v : Symbol(v, Decl(ES5For-of15.ts, 0, 8))
+
+ for (const v of []) {
+>v : Symbol(v, Decl(ES5For-of15.ts, 2, 14))
+
+ var x = v;
+>x : Symbol(x, Decl(ES5For-of15.ts, 3, 11))
+>v : Symbol(v, Decl(ES5For-of15.ts, 2, 14))
+ }
+}
diff --git a/tests/baselines/reference/ES5For-of15.types b/tests/baselines/reference/ES5For-of15.types
index a587ad7dcd1..90409b8b167 100644
--- a/tests/baselines/reference/ES5For-of15.types
+++ b/tests/baselines/reference/ES5For-of15.types
@@ -1,17 +1,17 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of15.ts ===
for (let v of []) {
->v : any, Symbol(v, Decl(ES5For-of15.ts, 0, 8))
+>v : any
>[] : undefined[]
v;
->v : any, Symbol(v, Decl(ES5For-of15.ts, 0, 8))
+>v : any
for (const v of []) {
->v : any, Symbol(v, Decl(ES5For-of15.ts, 2, 14))
+>v : any
>[] : undefined[]
var x = v;
->x : any, Symbol(x, Decl(ES5For-of15.ts, 3, 11))
->v : any, Symbol(v, Decl(ES5For-of15.ts, 2, 14))
+>x : any
+>v : any
}
}
diff --git a/tests/baselines/reference/ES5For-of16.symbols b/tests/baselines/reference/ES5For-of16.symbols
new file mode 100644
index 00000000000..f603cb05450
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of16.symbols
@@ -0,0 +1,18 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of16.ts ===
+for (let v of []) {
+>v : Symbol(v, Decl(ES5For-of16.ts, 0, 8))
+
+ v;
+>v : Symbol(v, Decl(ES5For-of16.ts, 0, 8))
+
+ for (let v of []) {
+>v : Symbol(v, Decl(ES5For-of16.ts, 2, 12))
+
+ var x = v;
+>x : Symbol(x, Decl(ES5For-of16.ts, 3, 11))
+>v : Symbol(v, Decl(ES5For-of16.ts, 2, 12))
+
+ v++;
+>v : Symbol(v, Decl(ES5For-of16.ts, 2, 12))
+ }
+}
diff --git a/tests/baselines/reference/ES5For-of16.types b/tests/baselines/reference/ES5For-of16.types
index 03b110edcf3..94f01509711 100644
--- a/tests/baselines/reference/ES5For-of16.types
+++ b/tests/baselines/reference/ES5For-of16.types
@@ -1,21 +1,21 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of16.ts ===
for (let v of []) {
->v : any, Symbol(v, Decl(ES5For-of16.ts, 0, 8))
+>v : any
>[] : undefined[]
v;
->v : any, Symbol(v, Decl(ES5For-of16.ts, 0, 8))
+>v : any
for (let v of []) {
->v : any, Symbol(v, Decl(ES5For-of16.ts, 2, 12))
+>v : any
>[] : undefined[]
var x = v;
->x : any, Symbol(x, Decl(ES5For-of16.ts, 3, 11))
->v : any, Symbol(v, Decl(ES5For-of16.ts, 2, 12))
+>x : any
+>v : any
v++;
>v++ : number
->v : any, Symbol(v, Decl(ES5For-of16.ts, 2, 12))
+>v : any
}
}
diff --git a/tests/baselines/reference/ES5For-of18.symbols b/tests/baselines/reference/ES5For-of18.symbols
new file mode 100644
index 00000000000..f564c4d5aaa
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of18.symbols
@@ -0,0 +1,14 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of18.ts ===
+for (let v of []) {
+>v : Symbol(v, Decl(ES5For-of18.ts, 0, 8))
+
+ v;
+>v : Symbol(v, Decl(ES5For-of18.ts, 0, 8))
+}
+for (let v of []) {
+>v : Symbol(v, Decl(ES5For-of18.ts, 3, 8))
+
+ v;
+>v : Symbol(v, Decl(ES5For-of18.ts, 3, 8))
+}
+
diff --git a/tests/baselines/reference/ES5For-of18.types b/tests/baselines/reference/ES5For-of18.types
index 8c659e20286..e78bc846df6 100644
--- a/tests/baselines/reference/ES5For-of18.types
+++ b/tests/baselines/reference/ES5For-of18.types
@@ -1,16 +1,16 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of18.ts ===
for (let v of []) {
->v : any, Symbol(v, Decl(ES5For-of18.ts, 0, 8))
+>v : any
>[] : undefined[]
v;
->v : any, Symbol(v, Decl(ES5For-of18.ts, 0, 8))
+>v : any
}
for (let v of []) {
->v : any, Symbol(v, Decl(ES5For-of18.ts, 3, 8))
+>v : any
>[] : undefined[]
v;
->v : any, Symbol(v, Decl(ES5For-of18.ts, 3, 8))
+>v : any
}
diff --git a/tests/baselines/reference/ES5For-of19.symbols b/tests/baselines/reference/ES5For-of19.symbols
new file mode 100644
index 00000000000..93133c2ec49
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of19.symbols
@@ -0,0 +1,19 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of19.ts ===
+for (let v of []) {
+>v : Symbol(v, Decl(ES5For-of19.ts, 0, 8))
+
+ v;
+>v : Symbol(v, Decl(ES5For-of19.ts, 0, 8))
+
+ function foo() {
+>foo : Symbol(foo, Decl(ES5For-of19.ts, 1, 6))
+
+ for (const v of []) {
+>v : Symbol(v, Decl(ES5For-of19.ts, 3, 18))
+
+ v;
+>v : Symbol(v, Decl(ES5For-of19.ts, 3, 18))
+ }
+ }
+}
+
diff --git a/tests/baselines/reference/ES5For-of19.types b/tests/baselines/reference/ES5For-of19.types
index ba55400c858..d95dc63d262 100644
--- a/tests/baselines/reference/ES5For-of19.types
+++ b/tests/baselines/reference/ES5For-of19.types
@@ -1,20 +1,20 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of19.ts ===
for (let v of []) {
->v : any, Symbol(v, Decl(ES5For-of19.ts, 0, 8))
+>v : any
>[] : undefined[]
v;
->v : any, Symbol(v, Decl(ES5For-of19.ts, 0, 8))
+>v : any
function foo() {
->foo : () => void, Symbol(foo, Decl(ES5For-of19.ts, 1, 6))
+>foo : () => void
for (const v of []) {
->v : any, Symbol(v, Decl(ES5For-of19.ts, 3, 18))
+>v : any
>[] : undefined[]
v;
->v : any, Symbol(v, Decl(ES5For-of19.ts, 3, 18))
+>v : any
}
}
}
diff --git a/tests/baselines/reference/ES5For-of2.symbols b/tests/baselines/reference/ES5For-of2.symbols
new file mode 100644
index 00000000000..250429031c5
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of2.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of2.ts ===
+for (var v of []) {
+>v : Symbol(v, Decl(ES5For-of2.ts, 0, 8))
+
+ var x = v;
+>x : Symbol(x, Decl(ES5For-of2.ts, 1, 7))
+>v : Symbol(v, Decl(ES5For-of2.ts, 0, 8))
+}
diff --git a/tests/baselines/reference/ES5For-of2.types b/tests/baselines/reference/ES5For-of2.types
index 7e3f096d9f6..3e680c44bc8 100644
--- a/tests/baselines/reference/ES5For-of2.types
+++ b/tests/baselines/reference/ES5For-of2.types
@@ -1,9 +1,9 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of2.ts ===
for (var v of []) {
->v : any, Symbol(v, Decl(ES5For-of2.ts, 0, 8))
+>v : any
>[] : undefined[]
var x = v;
->x : any, Symbol(x, Decl(ES5For-of2.ts, 1, 7))
->v : any, Symbol(v, Decl(ES5For-of2.ts, 0, 8))
+>x : any
+>v : any
}
diff --git a/tests/baselines/reference/ES5For-of21.symbols b/tests/baselines/reference/ES5For-of21.symbols
new file mode 100644
index 00000000000..9cbecdb20ba
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of21.symbols
@@ -0,0 +1,7 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of21.ts ===
+for (let v of []) {
+>v : Symbol(v, Decl(ES5For-of21.ts, 0, 8))
+
+ for (let _i of []) { }
+>_i : Symbol(_i, Decl(ES5For-of21.ts, 1, 12))
+}
diff --git a/tests/baselines/reference/ES5For-of21.types b/tests/baselines/reference/ES5For-of21.types
index 67280f1ae33..a15942fd013 100644
--- a/tests/baselines/reference/ES5For-of21.types
+++ b/tests/baselines/reference/ES5For-of21.types
@@ -1,9 +1,9 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of21.ts ===
for (let v of []) {
->v : any, Symbol(v, Decl(ES5For-of21.ts, 0, 8))
+>v : any
>[] : undefined[]
for (let _i of []) { }
->_i : any, Symbol(_i, Decl(ES5For-of21.ts, 1, 12))
+>_i : any
>[] : undefined[]
}
diff --git a/tests/baselines/reference/ES5For-of24.symbols b/tests/baselines/reference/ES5For-of24.symbols
new file mode 100644
index 00000000000..9a9a98660dc
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of24.symbols
@@ -0,0 +1,11 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of24.ts ===
+var a = [1, 2, 3];
+>a : Symbol(a, Decl(ES5For-of24.ts, 0, 3))
+
+for (var v of a) {
+>v : Symbol(v, Decl(ES5For-of24.ts, 1, 8))
+>a : Symbol(a, Decl(ES5For-of24.ts, 0, 3))
+
+ let a = 0;
+>a : Symbol(a, Decl(ES5For-of24.ts, 2, 7))
+}
diff --git a/tests/baselines/reference/ES5For-of24.types b/tests/baselines/reference/ES5For-of24.types
index 948a02d2111..c0c4666fbf5 100644
--- a/tests/baselines/reference/ES5For-of24.types
+++ b/tests/baselines/reference/ES5For-of24.types
@@ -1,16 +1,16 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of24.ts ===
var a = [1, 2, 3];
->a : number[], Symbol(a, Decl(ES5For-of24.ts, 0, 3))
+>a : number[]
>[1, 2, 3] : number[]
>1 : number
>2 : number
>3 : number
for (var v of a) {
->v : number, Symbol(v, Decl(ES5For-of24.ts, 1, 8))
->a : number[], Symbol(a, Decl(ES5For-of24.ts, 0, 3))
+>v : number
+>a : number[]
let a = 0;
->a : number, Symbol(a, Decl(ES5For-of24.ts, 2, 7))
+>a : number
>0 : number
}
diff --git a/tests/baselines/reference/ES5For-of25.symbols b/tests/baselines/reference/ES5For-of25.symbols
new file mode 100644
index 00000000000..22f04d9ae28
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of25.symbols
@@ -0,0 +1,14 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of25.ts ===
+var a = [1, 2, 3];
+>a : Symbol(a, Decl(ES5For-of25.ts, 0, 3))
+
+for (var v of a) {
+>v : Symbol(v, Decl(ES5For-of25.ts, 1, 8))
+>a : Symbol(a, Decl(ES5For-of25.ts, 0, 3))
+
+ v;
+>v : Symbol(v, Decl(ES5For-of25.ts, 1, 8))
+
+ a;
+>a : Symbol(a, Decl(ES5For-of25.ts, 0, 3))
+}
diff --git a/tests/baselines/reference/ES5For-of25.types b/tests/baselines/reference/ES5For-of25.types
index ffecb93363a..4650e3244d3 100644
--- a/tests/baselines/reference/ES5For-of25.types
+++ b/tests/baselines/reference/ES5For-of25.types
@@ -1,18 +1,18 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of25.ts ===
var a = [1, 2, 3];
->a : number[], Symbol(a, Decl(ES5For-of25.ts, 0, 3))
+>a : number[]
>[1, 2, 3] : number[]
>1 : number
>2 : number
>3 : number
for (var v of a) {
->v : number, Symbol(v, Decl(ES5For-of25.ts, 1, 8))
->a : number[], Symbol(a, Decl(ES5For-of25.ts, 0, 3))
+>v : number
+>a : number[]
v;
->v : number, Symbol(v, Decl(ES5For-of25.ts, 1, 8))
+>v : number
a;
->a : number[], Symbol(a, Decl(ES5For-of25.ts, 0, 3))
+>a : number[]
}
diff --git a/tests/baselines/reference/ES5For-of3.symbols b/tests/baselines/reference/ES5For-of3.symbols
new file mode 100644
index 00000000000..452b2224aea
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of3.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of3.ts ===
+for (var v of ['a', 'b', 'c'])
+>v : Symbol(v, Decl(ES5For-of3.ts, 0, 8))
+
+ var x = v;
+>x : Symbol(x, Decl(ES5For-of3.ts, 1, 7))
+>v : Symbol(v, Decl(ES5For-of3.ts, 0, 8))
+
diff --git a/tests/baselines/reference/ES5For-of3.types b/tests/baselines/reference/ES5For-of3.types
index fd01faa3e12..65267fe3f70 100644
--- a/tests/baselines/reference/ES5For-of3.types
+++ b/tests/baselines/reference/ES5For-of3.types
@@ -1,12 +1,12 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of3.ts ===
for (var v of ['a', 'b', 'c'])
->v : string, Symbol(v, Decl(ES5For-of3.ts, 0, 8))
+>v : string
>['a', 'b', 'c'] : string[]
>'a' : string
>'b' : string
>'c' : string
var x = v;
->x : string, Symbol(x, Decl(ES5For-of3.ts, 1, 7))
->v : string, Symbol(v, Decl(ES5For-of3.ts, 0, 8))
+>x : string
+>v : string
diff --git a/tests/baselines/reference/ES5For-of4.symbols b/tests/baselines/reference/ES5For-of4.symbols
new file mode 100644
index 00000000000..f79e09b366f
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of4.symbols
@@ -0,0 +1,12 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of4.ts ===
+for (var v of [])
+>v : Symbol(v, Decl(ES5For-of4.ts, 0, 8))
+
+ var x = v;
+>x : Symbol(x, Decl(ES5For-of4.ts, 1, 7))
+>v : Symbol(v, Decl(ES5For-of4.ts, 0, 8))
+
+var y = v;
+>y : Symbol(y, Decl(ES5For-of4.ts, 2, 3))
+>v : Symbol(v, Decl(ES5For-of4.ts, 0, 8))
+
diff --git a/tests/baselines/reference/ES5For-of4.types b/tests/baselines/reference/ES5For-of4.types
index ee756b0e60f..9396096746c 100644
--- a/tests/baselines/reference/ES5For-of4.types
+++ b/tests/baselines/reference/ES5For-of4.types
@@ -1,13 +1,13 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of4.ts ===
for (var v of [])
->v : any, Symbol(v, Decl(ES5For-of4.ts, 0, 8))
+>v : any
>[] : undefined[]
var x = v;
->x : any, Symbol(x, Decl(ES5For-of4.ts, 1, 7))
->v : any, Symbol(v, Decl(ES5For-of4.ts, 0, 8))
+>x : any
+>v : any
var y = v;
->y : any, Symbol(y, Decl(ES5For-of4.ts, 2, 3))
->v : any, Symbol(v, Decl(ES5For-of4.ts, 0, 8))
+>y : any
+>v : any
diff --git a/tests/baselines/reference/ES5For-of5.symbols b/tests/baselines/reference/ES5For-of5.symbols
new file mode 100644
index 00000000000..9cf59c68c2b
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of5.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of5.ts ===
+for (var _a of []) {
+>_a : Symbol(_a, Decl(ES5For-of5.ts, 0, 8))
+
+ var x = _a;
+>x : Symbol(x, Decl(ES5For-of5.ts, 1, 7))
+>_a : Symbol(_a, Decl(ES5For-of5.ts, 0, 8))
+}
diff --git a/tests/baselines/reference/ES5For-of5.types b/tests/baselines/reference/ES5For-of5.types
index 23bd15a88f4..dd9aa285edb 100644
--- a/tests/baselines/reference/ES5For-of5.types
+++ b/tests/baselines/reference/ES5For-of5.types
@@ -1,9 +1,9 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of5.ts ===
for (var _a of []) {
->_a : any, Symbol(_a, Decl(ES5For-of5.ts, 0, 8))
+>_a : any
>[] : undefined[]
var x = _a;
->x : any, Symbol(x, Decl(ES5For-of5.ts, 1, 7))
->_a : any, Symbol(_a, Decl(ES5For-of5.ts, 0, 8))
+>x : any
+>_a : any
}
diff --git a/tests/baselines/reference/ES5For-of6.symbols b/tests/baselines/reference/ES5For-of6.symbols
new file mode 100644
index 00000000000..3bdae947038
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of6.symbols
@@ -0,0 +1,13 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of6.ts ===
+for (var w of []) {
+>w : Symbol(w, Decl(ES5For-of6.ts, 0, 8))
+
+ for (var v of []) {
+>v : Symbol(v, Decl(ES5For-of6.ts, 1, 12))
+
+ var x = [w, v];
+>x : Symbol(x, Decl(ES5For-of6.ts, 2, 11))
+>w : Symbol(w, Decl(ES5For-of6.ts, 0, 8))
+>v : Symbol(v, Decl(ES5For-of6.ts, 1, 12))
+ }
+}
diff --git a/tests/baselines/reference/ES5For-of6.types b/tests/baselines/reference/ES5For-of6.types
index 2381b519bd7..e2d2f872809 100644
--- a/tests/baselines/reference/ES5For-of6.types
+++ b/tests/baselines/reference/ES5For-of6.types
@@ -1,16 +1,16 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of6.ts ===
for (var w of []) {
->w : any, Symbol(w, Decl(ES5For-of6.ts, 0, 8))
+>w : any
>[] : undefined[]
for (var v of []) {
->v : any, Symbol(v, Decl(ES5For-of6.ts, 1, 12))
+>v : any
>[] : undefined[]
var x = [w, v];
->x : any[], Symbol(x, Decl(ES5For-of6.ts, 2, 11))
+>x : any[]
>[w, v] : any[]
->w : any, Symbol(w, Decl(ES5For-of6.ts, 0, 8))
->v : any, Symbol(v, Decl(ES5For-of6.ts, 1, 12))
+>w : any
+>v : any
}
}
diff --git a/tests/baselines/reference/ES5For-of9.symbols b/tests/baselines/reference/ES5For-of9.symbols
new file mode 100644
index 00000000000..426a5442ecb
--- /dev/null
+++ b/tests/baselines/reference/ES5For-of9.symbols
@@ -0,0 +1,24 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-of9.ts ===
+function foo() {
+>foo : Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
+
+ return { x: 0 };
+>x : Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+}
+for (foo().x of []) {
+>foo().x : Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+>foo : Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
+>x : Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+
+ for (foo().x of []) {
+>foo().x : Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+>foo : Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
+>x : Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+
+ var p = foo().x;
+>p : Symbol(p, Decl(ES5For-of9.ts, 5, 11))
+>foo().x : Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+>foo : Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
+>x : Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+ }
+}
diff --git a/tests/baselines/reference/ES5For-of9.types b/tests/baselines/reference/ES5For-of9.types
index c8af0053413..ec41df704c6 100644
--- a/tests/baselines/reference/ES5For-of9.types
+++ b/tests/baselines/reference/ES5For-of9.types
@@ -1,31 +1,31 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of9.ts ===
function foo() {
->foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
+>foo : () => { x: number; }
return { x: 0 };
>{ x: 0 } : { x: number; }
->x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+>x : number
>0 : number
}
for (foo().x of []) {
->foo().x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+>foo().x : number
>foo() : { x: number; }
->foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
->x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+>foo : () => { x: number; }
+>x : number
>[] : undefined[]
for (foo().x of []) {
->foo().x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+>foo().x : number
>foo() : { x: number; }
->foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
->x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+>foo : () => { x: number; }
+>x : number
>[] : undefined[]
var p = foo().x;
->p : number, Symbol(p, Decl(ES5For-of9.ts, 5, 11))
->foo().x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+>p : number
+>foo().x : number
>foo() : { x: number; }
->foo : () => { x: number; }, Symbol(foo, Decl(ES5For-of9.ts, 0, 0))
->x : number, Symbol(x, Decl(ES5For-of9.ts, 1, 12))
+>foo : () => { x: number; }
+>x : number
}
}
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck1.symbols b/tests/baselines/reference/ES5For-ofTypeCheck1.symbols
new file mode 100644
index 00000000000..83b7fbd0d2c
--- /dev/null
+++ b/tests/baselines/reference/ES5For-ofTypeCheck1.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck1.ts ===
+for (var v of "") { }
+>v : Symbol(v, Decl(ES5For-ofTypeCheck1.ts, 0, 8))
+
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck1.types b/tests/baselines/reference/ES5For-ofTypeCheck1.types
index 001cd343edd..395900d683b 100644
--- a/tests/baselines/reference/ES5For-ofTypeCheck1.types
+++ b/tests/baselines/reference/ES5For-ofTypeCheck1.types
@@ -1,5 +1,5 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck1.ts ===
for (var v of "") { }
->v : string, Symbol(v, Decl(ES5For-ofTypeCheck1.ts, 0, 8))
+>v : string
>"" : string
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck2.symbols b/tests/baselines/reference/ES5For-ofTypeCheck2.symbols
new file mode 100644
index 00000000000..cd1d3f346e8
--- /dev/null
+++ b/tests/baselines/reference/ES5For-ofTypeCheck2.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck2.ts ===
+for (var v of [true]) { }
+>v : Symbol(v, Decl(ES5For-ofTypeCheck2.ts, 0, 8))
+
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck2.types b/tests/baselines/reference/ES5For-ofTypeCheck2.types
index 5dd5c58bf50..d28a2803216 100644
--- a/tests/baselines/reference/ES5For-ofTypeCheck2.types
+++ b/tests/baselines/reference/ES5For-ofTypeCheck2.types
@@ -1,6 +1,6 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck2.ts ===
for (var v of [true]) { }
->v : boolean, Symbol(v, Decl(ES5For-ofTypeCheck2.ts, 0, 8))
+>v : boolean
>[true] : boolean[]
>true : boolean
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck3.symbols b/tests/baselines/reference/ES5For-ofTypeCheck3.symbols
new file mode 100644
index 00000000000..82196315ca6
--- /dev/null
+++ b/tests/baselines/reference/ES5For-ofTypeCheck3.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck3.ts ===
+var tuple: [string, number] = ["", 0];
+>tuple : Symbol(tuple, Decl(ES5For-ofTypeCheck3.ts, 0, 3))
+
+for (var v of tuple) { }
+>v : Symbol(v, Decl(ES5For-ofTypeCheck3.ts, 1, 8))
+>tuple : Symbol(tuple, Decl(ES5For-ofTypeCheck3.ts, 0, 3))
+
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck3.types b/tests/baselines/reference/ES5For-ofTypeCheck3.types
index 9c5e81a4a3e..a62dcc94f98 100644
--- a/tests/baselines/reference/ES5For-ofTypeCheck3.types
+++ b/tests/baselines/reference/ES5For-ofTypeCheck3.types
@@ -1,11 +1,11 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck3.ts ===
var tuple: [string, number] = ["", 0];
->tuple : [string, number], Symbol(tuple, Decl(ES5For-ofTypeCheck3.ts, 0, 3))
+>tuple : [string, number]
>["", 0] : [string, number]
>"" : string
>0 : number
for (var v of tuple) { }
->v : string | number, Symbol(v, Decl(ES5For-ofTypeCheck3.ts, 1, 8))
->tuple : [string, number], Symbol(tuple, Decl(ES5For-ofTypeCheck3.ts, 0, 3))
+>v : string | number
+>tuple : [string, number]
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck4.symbols b/tests/baselines/reference/ES5For-ofTypeCheck4.symbols
new file mode 100644
index 00000000000..7d3dac4ef81
--- /dev/null
+++ b/tests/baselines/reference/ES5For-ofTypeCheck4.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck4.ts ===
+var union: string | string[];
+>union : Symbol(union, Decl(ES5For-ofTypeCheck4.ts, 0, 3))
+
+for (const v of union) { }
+>v : Symbol(v, Decl(ES5For-ofTypeCheck4.ts, 1, 10))
+>union : Symbol(union, Decl(ES5For-ofTypeCheck4.ts, 0, 3))
+
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck4.types b/tests/baselines/reference/ES5For-ofTypeCheck4.types
index 37d75b8865e..4f5721a0604 100644
--- a/tests/baselines/reference/ES5For-ofTypeCheck4.types
+++ b/tests/baselines/reference/ES5For-ofTypeCheck4.types
@@ -1,8 +1,8 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck4.ts ===
var union: string | string[];
->union : string | string[], Symbol(union, Decl(ES5For-ofTypeCheck4.ts, 0, 3))
+>union : string | string[]
for (const v of union) { }
->v : string, Symbol(v, Decl(ES5For-ofTypeCheck4.ts, 1, 10))
->union : string | string[], Symbol(union, Decl(ES5For-ofTypeCheck4.ts, 0, 3))
+>v : string
+>union : string | string[]
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck5.symbols b/tests/baselines/reference/ES5For-ofTypeCheck5.symbols
new file mode 100644
index 00000000000..41f80949e52
--- /dev/null
+++ b/tests/baselines/reference/ES5For-ofTypeCheck5.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck5.ts ===
+var union: string | number[];
+>union : Symbol(union, Decl(ES5For-ofTypeCheck5.ts, 0, 3))
+
+for (var v of union) { }
+>v : Symbol(v, Decl(ES5For-ofTypeCheck5.ts, 1, 8))
+>union : Symbol(union, Decl(ES5For-ofTypeCheck5.ts, 0, 3))
+
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck5.types b/tests/baselines/reference/ES5For-ofTypeCheck5.types
index 35487b4927d..ed3d13f3918 100644
--- a/tests/baselines/reference/ES5For-ofTypeCheck5.types
+++ b/tests/baselines/reference/ES5For-ofTypeCheck5.types
@@ -1,8 +1,8 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck5.ts ===
var union: string | number[];
->union : string | number[], Symbol(union, Decl(ES5For-ofTypeCheck5.ts, 0, 3))
+>union : string | number[]
for (var v of union) { }
->v : string | number, Symbol(v, Decl(ES5For-ofTypeCheck5.ts, 1, 8))
->union : string | number[], Symbol(union, Decl(ES5For-ofTypeCheck5.ts, 0, 3))
+>v : string | number
+>union : string | number[]
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck6.symbols b/tests/baselines/reference/ES5For-ofTypeCheck6.symbols
new file mode 100644
index 00000000000..4c362bf9bc7
--- /dev/null
+++ b/tests/baselines/reference/ES5For-ofTypeCheck6.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck6.ts ===
+var union: string[] | number[];
+>union : Symbol(union, Decl(ES5For-ofTypeCheck6.ts, 0, 3))
+
+for (var v of union) { }
+>v : Symbol(v, Decl(ES5For-ofTypeCheck6.ts, 1, 8))
+>union : Symbol(union, Decl(ES5For-ofTypeCheck6.ts, 0, 3))
+
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck6.types b/tests/baselines/reference/ES5For-ofTypeCheck6.types
index 74752ea7114..87999d9b0ca 100644
--- a/tests/baselines/reference/ES5For-ofTypeCheck6.types
+++ b/tests/baselines/reference/ES5For-ofTypeCheck6.types
@@ -1,8 +1,8 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck6.ts ===
var union: string[] | number[];
->union : string[] | number[], Symbol(union, Decl(ES5For-ofTypeCheck6.ts, 0, 3))
+>union : string[] | number[]
for (var v of union) { }
->v : string | number, Symbol(v, Decl(ES5For-ofTypeCheck6.ts, 1, 8))
->union : string[] | number[], Symbol(union, Decl(ES5For-ofTypeCheck6.ts, 0, 3))
+>v : string | number
+>union : string[] | number[]
diff --git a/tests/baselines/reference/ES5SymbolType1.symbols b/tests/baselines/reference/ES5SymbolType1.symbols
new file mode 100644
index 00000000000..ea6c9084046
--- /dev/null
+++ b/tests/baselines/reference/ES5SymbolType1.symbols
@@ -0,0 +1,9 @@
+=== tests/cases/conformance/Symbols/ES5SymbolType1.ts ===
+var s: symbol;
+>s : Symbol(s, Decl(ES5SymbolType1.ts, 0, 3))
+
+s.toString();
+>s.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
+>s : Symbol(s, Decl(ES5SymbolType1.ts, 0, 3))
+>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
+
diff --git a/tests/baselines/reference/ES5SymbolType1.types b/tests/baselines/reference/ES5SymbolType1.types
index 8b88bbf4da5..79d93902fd6 100644
--- a/tests/baselines/reference/ES5SymbolType1.types
+++ b/tests/baselines/reference/ES5SymbolType1.types
@@ -1,10 +1,10 @@
=== tests/cases/conformance/Symbols/ES5SymbolType1.ts ===
var s: symbol;
->s : symbol, Symbol(s, Decl(ES5SymbolType1.ts, 0, 3))
+>s : symbol
s.toString();
>s.toString() : string
->s.toString : () => string, Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
->s : symbol, Symbol(s, Decl(ES5SymbolType1.ts, 0, 3))
->toString : () => string, Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
+>s.toString : () => string
+>s : symbol
+>toString : () => string
diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.symbols b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.symbols
new file mode 100644
index 00000000000..dc97960f71e
--- /dev/null
+++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.symbols
@@ -0,0 +1,42 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/EnumAndModuleWithSameNameAndCommonRoot.ts ===
+enum enumdule {
+>enumdule : Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
+
+ Red, Blue
+>Red : Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15))
+>Blue : Symbol(enumdule.Blue, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 1, 8))
+}
+
+module enumdule {
+>enumdule : Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
+
+ export class Point {
+>Point : Symbol(Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 7, 20))
+>y : Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 7, 37))
+ }
+}
+
+var x: enumdule;
+>x : Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 11, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 12, 3))
+>enumdule : Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
+
+var x = enumdule.Red;
+>x : Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 11, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 12, 3))
+>enumdule.Red : Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15))
+>enumdule : Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
+>Red : Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15))
+
+var y: { x: number; y: number };
+>y : Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 15, 3))
+>x : Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 8))
+>y : Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 19))
+
+var y = new enumdule.Point(0, 0);
+>y : Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 15, 3))
+>enumdule.Point : Symbol(enumdule.Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17))
+>enumdule : Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
+>Point : Symbol(enumdule.Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17))
+
diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types
index b2e11aa63ae..205335c7eb6 100644
--- a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types
+++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types
@@ -1,45 +1,45 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/EnumAndModuleWithSameNameAndCommonRoot.ts ===
enum enumdule {
->enumdule : enumdule, Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
+>enumdule : enumdule
Red, Blue
->Red : enumdule, Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15))
->Blue : enumdule, Symbol(enumdule.Blue, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 1, 8))
+>Red : enumdule
+>Blue : enumdule
}
module enumdule {
->enumdule : typeof enumdule, Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
+>enumdule : typeof enumdule
export class Point {
->Point : Point, Symbol(Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 7, 20))
->y : number, Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 7, 37))
+>x : number
+>y : number
}
}
var x: enumdule;
->x : enumdule, Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 11, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 12, 3))
->enumdule : enumdule, Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
+>x : enumdule
+>enumdule : enumdule
var x = enumdule.Red;
->x : enumdule, Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 11, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 12, 3))
->enumdule.Red : enumdule, Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15))
->enumdule : typeof enumdule, Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
->Red : enumdule, Symbol(enumdule.Red, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 15))
+>x : enumdule
+>enumdule.Red : enumdule
+>enumdule : typeof enumdule
+>Red : enumdule
var y: { x: number; y: number };
->y : { x: number; y: number; }, Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 15, 3))
->x : number, Symbol(x, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 8))
->y : number, Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 19))
+>y : { x: number; y: number; }
+>x : number
+>y : number
var y = new enumdule.Point(0, 0);
->y : { x: number; y: number; }, Symbol(y, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 14, 3), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 15, 3))
+>y : { x: number; y: number; }
>new enumdule.Point(0, 0) : enumdule.Point
->enumdule.Point : typeof enumdule.Point, Symbol(enumdule.Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17))
->enumdule : typeof enumdule, Symbol(enumdule, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 0, 0), Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 2, 1))
->Point : typeof enumdule.Point, Symbol(enumdule.Point, Decl(EnumAndModuleWithSameNameAndCommonRoot.ts, 4, 17))
+>enumdule.Point : typeof enumdule.Point
+>enumdule : typeof enumdule
+>Point : typeof enumdule.Point
>0 : number
>0 : number
diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.symbols b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.symbols
new file mode 100644
index 00000000000..8346888d81f
--- /dev/null
+++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.symbols
@@ -0,0 +1,38 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWhichExtendsInterfaceWithInaccessibleType.ts ===
+module A {
+>A : Symbol(A, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 0))
+
+ interface Point {
+>Point : Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 2, 21))
+
+ y: number;
+>y : Symbol(y, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 3, 18))
+
+ fromOrigin(p: Point): number;
+>fromOrigin : Symbol(fromOrigin, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 4, 18))
+>p : Symbol(p, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 6, 19))
+>Point : Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
+ }
+
+ export class Point2d implements Point {
+>Point2d : Symbol(Point2d, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 7, 5))
+>Point : Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 20))
+>y : Symbol(y, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 37))
+
+ fromOrigin(p: Point) {
+>fromOrigin : Symbol(fromOrigin, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 59))
+>p : Symbol(p, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 12, 19))
+>Point : Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
+
+ return 1;
+ }
+ }
+}
+
+
diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types
index 90d8bf5fbe7..e47b38a0b61 100644
--- a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types
+++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types
@@ -1,34 +1,34 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWhichExtendsInterfaceWithInaccessibleType.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 0))
+>A : typeof A
interface Point {
->Point : Point, Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 2, 21))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 3, 18))
+>y : number
fromOrigin(p: Point): number;
->fromOrigin : (p: Point) => number, Symbol(fromOrigin, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 4, 18))
->p : Point, Symbol(p, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 6, 19))
->Point : Point, Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
+>fromOrigin : (p: Point) => number
+>p : Point
+>Point : Point
}
export class Point2d implements Point {
->Point2d : Point2d, Symbol(Point2d, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 7, 5))
->Point : Point, Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
+>Point2d : Point2d
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 20))
->y : number, Symbol(y, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 37))
+>x : number
+>y : number
fromOrigin(p: Point) {
->fromOrigin : (p: Point) => number, Symbol(fromOrigin, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 10, 59))
->p : Point, Symbol(p, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 12, 19))
->Point : Point, Symbol(Point, Decl(ExportClassWhichExtendsInterfaceWithInaccessibleType.ts, 0, 10))
+>fromOrigin : (p: Point) => number
+>p : Point
+>Point : Point
return 1;
>1 : number
diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols
new file mode 100644
index 00000000000..2802e6aa392
--- /dev/null
+++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols
@@ -0,0 +1,48 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts ===
+module A {
+>A : Symbol(A, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 0))
+
+ export class Point {
+>Point : Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 2, 24))
+
+ y: number;
+>y : Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 3, 18))
+ }
+
+ export var Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 14))
+>Point : Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+>x : Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 32))
+>y : Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 38))
+
+ export class Point3d extends Point {
+>Point3d : Symbol(Point3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
+>Point : Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+
+ z: number;
+>z : Symbol(z, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 9, 40))
+ }
+
+ export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
+>Origin3d : Symbol(Origin3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 14))
+>Point3d : Symbol(Point3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
+>x : Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 36))
+>y : Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 42))
+>z : Symbol(z, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 48))
+
+ export class Line{
+>Line : Symbol(Line, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 56))
+>TPoint : Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22))
+>Point : Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+
+ constructor(public start: TPoint, public end: TPoint) { }
+>start : Symbol(start, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 20))
+>TPoint : Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22))
+>end : Symbol(end, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 41))
+>TPoint : Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22))
+ }
+}
+
diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types
index 71ddde1965c..a5cefcc521e 100644
--- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types
+++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types
@@ -1,55 +1,55 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 0))
+>A : typeof A
export class Point {
->Point : Point, Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 2, 24))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 3, 18))
+>y : number
}
export var Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Origin, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 14))
->Point : Point, Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 32))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 38))
+>y : number
>0 : number
export class Point3d extends Point {
->Point3d : Point3d, Symbol(Point3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
->Point : Point, Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+>Point3d : Point3d
+>Point : Point
z: number;
->z : number, Symbol(z, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 9, 40))
+>z : number
}
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
->Origin3d : Point3d, Symbol(Origin3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 14))
->Point3d : Point3d, Symbol(Point3d, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
+>Origin3d : Point3d
+>Point3d : Point3d
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
->x : number, Symbol(x, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 36))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 42))
+>y : number
>0 : number
->z : number, Symbol(z, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 48))
+>z : number
>0 : number
export class Line{
->Line : Line, Symbol(Line, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 56))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22))
->Point : Point, Symbol(Point, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+>Line : Line
+>TPoint : TPoint
+>Point : Point
constructor(public start: TPoint, public end: TPoint) { }
->start : TPoint, Symbol(start, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 20))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22))
->end : TPoint, Symbol(end, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 41))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 22))
+>start : TPoint
+>TPoint : TPoint
+>end : TPoint
+>TPoint : TPoint
}
}
diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.symbols b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.symbols
new file mode 100644
index 00000000000..e1e433a8921
--- /dev/null
+++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.symbols
@@ -0,0 +1,28 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts ===
+module A {
+>A : Symbol(A, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 0))
+
+ class Point {
+>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 2, 17))
+
+ y: number;
+>y : Symbol(y, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 3, 18))
+ }
+
+ export class points {
+>points : Symbol(points, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 5, 5))
+
+ [idx: number]: Point;
+>idx : Symbol(idx, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 9, 9))
+>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+
+ [idx: string]: Point;
+>idx : Symbol(idx, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 10, 9))
+>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+ }
+}
+
+
diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.types b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.types
index cf6bcd1316c..451db7f92a8 100644
--- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.types
+++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.types
@@ -1,27 +1,27 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 0))
+>A : typeof A
class Point {
->Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 2, 17))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 3, 18))
+>y : number
}
export class points {
->points : points, Symbol(points, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 5, 5))
+>points : points
[idx: number]: Point;
->idx : number, Symbol(idx, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 9, 9))
->Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+>idx : number
+>Point : Point
[idx: string]: Point;
->idx : string, Symbol(idx, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 10, 9))
->Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+>idx : string
+>Point : Point
}
}
diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.symbols b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.symbols
new file mode 100644
index 00000000000..e1044bd2442
--- /dev/null
+++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.symbols
@@ -0,0 +1,58 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts ===
+module A {
+>A : Symbol(A, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 0))
+
+ class Point {
+>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 2, 17))
+
+ y: number;
+>y : Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 3, 18))
+ }
+
+ export var Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 14))
+>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>x : Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 32))
+>y : Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 38))
+
+ export class Point3d extends Point {
+>Point3d : Symbol(Point3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
+>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+
+ z: number;
+>z : Symbol(z, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 9, 40))
+ }
+
+ export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
+>Origin3d : Symbol(Origin3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 14))
+>Point3d : Symbol(Point3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
+>x : Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 36))
+>y : Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 42))
+>z : Symbol(z, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 48))
+
+ export class Line{
+>Line : Symbol(Line, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56))
+>TPoint : Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22))
+>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+
+ constructor(public start: TPoint, public end: TPoint) { }
+>start : Symbol(start, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 20))
+>TPoint : Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22))
+>end : Symbol(end, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 41))
+>TPoint : Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22))
+
+ static fromorigin2d(p: Point): Line{
+>fromorigin2d : Symbol(Line.fromorigin2d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 65))
+>p : Symbol(p, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 18, 28))
+>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>Line : Symbol(Line, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56))
+>Point : Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+
+ return null;
+ }
+ }
+}
+
diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types
index 1f3b2e17305..ba174d9bbba 100644
--- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types
+++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types
@@ -1,62 +1,62 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 0))
+>A : typeof A
class Point {
->Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 2, 17))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 3, 18))
+>y : number
}
export var Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Origin, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 14))
->Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 32))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 38))
+>y : number
>0 : number
export class Point3d extends Point {
->Point3d : Point3d, Symbol(Point3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
->Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>Point3d : Point3d
+>Point : Point
z: number;
->z : number, Symbol(z, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 9, 40))
+>z : number
}
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
->Origin3d : Point3d, Symbol(Origin3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 14))
->Point3d : Point3d, Symbol(Point3d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
+>Origin3d : Point3d
+>Point3d : Point3d
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
->x : number, Symbol(x, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 36))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 42))
+>y : number
>0 : number
->z : number, Symbol(z, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 48))
+>z : number
>0 : number
export class Line{
->Line : Line, Symbol(Line, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22))
->Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>Line : Line
+>TPoint : TPoint
+>Point : Point
constructor(public start: TPoint, public end: TPoint) { }
->start : TPoint, Symbol(start, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 20))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22))
->end : TPoint, Symbol(end, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 41))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 22))
+>start : TPoint
+>TPoint : TPoint
+>end : TPoint
+>TPoint : TPoint
static fromorigin2d(p: Point): Line{
->fromorigin2d : (p: Point) => Line, Symbol(Line.fromorigin2d, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 65))
->p : Point, Symbol(p, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 18, 28))
->Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
->Line : Line, Symbol(Line, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56))
->Point : Point, Symbol(Point, Decl(ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>fromorigin2d : (p: Point) => Line
+>p : Point
+>Point : Point
+>Line : Line
+>Point : Point
return null;
>null : null
diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.symbols b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.symbols
new file mode 100644
index 00000000000..37b6da18c37
--- /dev/null
+++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.symbols
@@ -0,0 +1,37 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts ===
+module A {
+>A : Symbol(A, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 0))
+
+ export class Point {
+>Point : Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 2, 24))
+
+ y: number;
+>y : Symbol(y, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 3, 18))
+ }
+
+ export class Line {
+>Line : Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5))
+
+ constructor(public start: Point, public end: Point) { }
+>start : Symbol(start, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 8, 20))
+>Point : Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
+>end : Symbol(end, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 8, 40))
+>Point : Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
+ }
+
+ export function fromOrigin(p: Point): Line {
+>fromOrigin : Symbol(fromOrigin, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 9, 5))
+>p : Symbol(p, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 11, 31))
+>Point : Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
+>Line : Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5))
+
+ return new Line({ x: 0, y: 0 }, p);
+>Line : Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5))
+>x : Symbol(x, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 12, 25))
+>y : Symbol(y, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 12, 31))
+>p : Symbol(p, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 11, 31))
+ }
+}
diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types
index e9817cb6e5c..60a6e122a78 100644
--- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types
+++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types
@@ -1,41 +1,41 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 0))
+>A : typeof A
export class Point {
->Point : Point, Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 2, 24))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 3, 18))
+>y : number
}
export class Line {
->Line : Line, Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5))
+>Line : Line
constructor(public start: Point, public end: Point) { }
->start : Point, Symbol(start, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 8, 20))
->Point : Point, Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
->end : Point, Symbol(end, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 8, 40))
->Point : Point, Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
+>start : Point
+>Point : Point
+>end : Point
+>Point : Point
}
export function fromOrigin(p: Point): Line {
->fromOrigin : (p: Point) => Line, Symbol(fromOrigin, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 9, 5))
->p : Point, Symbol(p, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 11, 31))
->Point : Point, Symbol(Point, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 0, 10))
->Line : Line, Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5))
+>fromOrigin : (p: Point) => Line
+>p : Point
+>Point : Point
+>Line : Line
return new Line({ x: 0, y: 0 }, p);
>new Line({ x: 0, y: 0 }, p) : Line
->Line : typeof Line, Symbol(Line, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 5, 5))
+>Line : typeof Line
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 12, 25))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 12, 31))
+>y : number
>0 : number
->p : Point, Symbol(p, Decl(ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts, 11, 31))
+>p : Point
}
}
diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.symbols b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.symbols
new file mode 100644
index 00000000000..41993ebf48f
--- /dev/null
+++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.symbols
@@ -0,0 +1,37 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts ===
+module A {
+>A : Symbol(A, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 0))
+
+ class Point {
+>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 2, 17))
+
+ y: number;
+>y : Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 3, 18))
+ }
+
+ export class Line {
+>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5))
+
+ constructor(public start: Point, public end: Point) { }
+>start : Symbol(start, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 8, 20))
+>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
+>end : Symbol(end, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 8, 40))
+>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
+ }
+
+ export function fromOrigin(p: Point): Line {
+>fromOrigin : Symbol(fromOrigin, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 9, 5))
+>p : Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 11, 31))
+>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
+>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5))
+
+ return new Line({ x: 0, y: 0 }, p);
+>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5))
+>x : Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 12, 25))
+>y : Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 12, 31))
+>p : Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 11, 31))
+ }
+}
diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types
index bec6d3816bf..ba862ad77cf 100644
--- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types
+++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types
@@ -1,41 +1,41 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 0))
+>A : typeof A
class Point {
->Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 2, 17))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 3, 18))
+>y : number
}
export class Line {
->Line : Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5))
+>Line : Line
constructor(public start: Point, public end: Point) { }
->start : Point, Symbol(start, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 8, 20))
->Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
->end : Point, Symbol(end, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 8, 40))
->Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
+>start : Point
+>Point : Point
+>end : Point
+>Point : Point
}
export function fromOrigin(p: Point): Line {
->fromOrigin : (p: Point) => Line, Symbol(fromOrigin, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 9, 5))
->p : Point, Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 11, 31))
->Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 0, 10))
->Line : Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5))
+>fromOrigin : (p: Point) => Line
+>p : Point
+>Point : Point
+>Line : Line
return new Line({ x: 0, y: 0 }, p);
>new Line({ x: 0, y: 0 }, p) : Line
->Line : typeof Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 5, 5))
+>Line : typeof Line
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 12, 25))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 12, 31))
+>y : number
>0 : number
->p : Point, Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts, 11, 31))
+>p : Point
}
}
diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.symbols b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.symbols
new file mode 100644
index 00000000000..77d57215795
--- /dev/null
+++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.symbols
@@ -0,0 +1,37 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts ===
+module A {
+>A : Symbol(A, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 0))
+
+ export class Point {
+>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 2, 24))
+
+ y: number;
+>y : Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 3, 18))
+ }
+
+ class Line {
+>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5))
+
+ constructor(public start: Point, public end: Point) { }
+>start : Symbol(start, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 8, 20))
+>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
+>end : Symbol(end, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 8, 40))
+>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
+ }
+
+ export function fromOrigin(p: Point): Line {
+>fromOrigin : Symbol(fromOrigin, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 9, 5))
+>p : Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 11, 31))
+>Point : Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
+>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5))
+
+ return new Line({ x: 0, y: 0 }, p);
+>Line : Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5))
+>x : Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 12, 25))
+>y : Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 12, 31))
+>p : Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 11, 31))
+ }
+}
diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types
index 09e28159ee6..ef72f80ffde 100644
--- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types
+++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types
@@ -1,41 +1,41 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 0))
+>A : typeof A
export class Point {
->Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 2, 24))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 3, 18))
+>y : number
}
class Line {
->Line : Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5))
+>Line : Line
constructor(public start: Point, public end: Point) { }
->start : Point, Symbol(start, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 8, 20))
->Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
->end : Point, Symbol(end, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 8, 40))
->Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
+>start : Point
+>Point : Point
+>end : Point
+>Point : Point
}
export function fromOrigin(p: Point): Line {
->fromOrigin : (p: Point) => Line, Symbol(fromOrigin, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 9, 5))
->p : Point, Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 11, 31))
->Point : Point, Symbol(Point, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 0, 10))
->Line : Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5))
+>fromOrigin : (p: Point) => Line
+>p : Point
+>Point : Point
+>Line : Line
return new Line({ x: 0, y: 0 }, p);
>new Line({ x: 0, y: 0 }, p) : Line
->Line : typeof Line, Symbol(Line, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 5, 5))
+>Line : typeof Line
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 12, 25))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 12, 31))
+>y : number
>0 : number
->p : Point, Symbol(p, Decl(ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts, 11, 31))
+>p : Point
}
}
diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols
new file mode 100644
index 00000000000..31b978c85f9
--- /dev/null
+++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.symbols
@@ -0,0 +1,56 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts ===
+module A {
+>A : Symbol(A, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 0))
+
+ export interface Point {
+>Point : Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 2, 28))
+
+ y: number;
+>y : Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 3, 18))
+ }
+
+ export var Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 14))
+>Point : Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+>x : Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 32))
+>y : Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 38))
+
+ export interface Point3d extends Point {
+>Point3d : Symbol(Point3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
+>Point : Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+
+ z: number;
+>z : Symbol(z, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 9, 44))
+ }
+
+ export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
+>Origin3d : Symbol(Origin3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 14))
+>Point3d : Symbol(Point3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
+>x : Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 36))
+>y : Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 42))
+>z : Symbol(z, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 48))
+
+ export interface Line{
+>Line : Symbol(Line, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 56))
+>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
+>Point : Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+
+ new (start: TPoint, end: TPoint);
+>start : Symbol(start, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 13))
+>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
+>end : Symbol(end, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 27))
+>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
+
+ start: TPoint;
+>start : Symbol(start, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 41))
+>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
+
+ end: TPoint;
+>end : Symbol(end, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 17, 22))
+>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
+ }
+}
+
diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types
index 4c4866609c4..b4a331b9140 100644
--- a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types
+++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types
@@ -1,63 +1,63 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 0))
+>A : typeof A
export interface Point {
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 2, 28))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 3, 18))
+>y : number
}
export var Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Origin, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 14))
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 32))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 38))
+>y : number
>0 : number
export interface Point3d extends Point {
->Point3d : Point3d, Symbol(Point3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+>Point3d : Point3d
+>Point : Point
z: number;
->z : number, Symbol(z, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 9, 44))
+>z : number
}
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
->Origin3d : Point3d, Symbol(Origin3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 14))
->Point3d : Point3d, Symbol(Point3d, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 7, 46))
+>Origin3d : Point3d
+>Point3d : Point3d
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
->x : number, Symbol(x, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 36))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 42))
+>y : number
>0 : number
->z : number, Symbol(z, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 48))
+>z : number
>0 : number
export interface Line{
->Line : Line, Symbol(Line, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 13, 56))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 0, 10))
+>Line : Line
+>TPoint : TPoint
+>Point : Point
new (start: TPoint, end: TPoint);
->start : TPoint, Symbol(start, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 13))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
->end : TPoint, Symbol(end, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 27))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
+>start : TPoint
+>TPoint : TPoint
+>end : TPoint
+>TPoint : TPoint
start: TPoint;
->start : TPoint, Symbol(start, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 16, 41))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
+>start : TPoint
+>TPoint : TPoint
end: TPoint;
->end : TPoint, Symbol(end, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 17, 22))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts, 15, 26))
+>end : TPoint
+>TPoint : TPoint
}
}
diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.symbols b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.symbols
new file mode 100644
index 00000000000..00f9025aa8c
--- /dev/null
+++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.symbols
@@ -0,0 +1,28 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts ===
+module A {
+>A : Symbol(A, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 0))
+
+ interface Point {
+>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 2, 21))
+
+ y: number;
+>y : Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 3, 18))
+ }
+
+ export interface points {
+>points : Symbol(points, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 5, 5))
+
+ [idx: number]: Point;
+>idx : Symbol(idx, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 9, 9))
+>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+
+ [idx: string]: Point;
+>idx : Symbol(idx, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 10, 9))
+>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+ }
+}
+
+
diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types
index 28d3b5f463c..8be90b5946e 100644
--- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types
+++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types
@@ -1,27 +1,27 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts ===
module A {
->A : any, Symbol(A, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 0))
+>A : any
interface Point {
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 2, 21))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 3, 18))
+>y : number
}
export interface points {
->points : points, Symbol(points, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 5, 5))
+>points : points
[idx: number]: Point;
->idx : number, Symbol(idx, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 9, 9))
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+>idx : number
+>Point : Point
[idx: string]: Point;
->idx : string, Symbol(idx, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 10, 9))
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts, 0, 10))
+>idx : string
+>Point : Point
}
}
diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.symbols b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.symbols
new file mode 100644
index 00000000000..7ee70a0c77b
--- /dev/null
+++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.symbols
@@ -0,0 +1,56 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts ===
+module A {
+>A : Symbol(A, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 0))
+
+ interface Point {
+>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 2, 21))
+
+ y: number;
+>y : Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 3, 18))
+ }
+
+ export var Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 14))
+>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>x : Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 32))
+>y : Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 38))
+
+ export interface Point3d extends Point {
+>Point3d : Symbol(Point3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
+>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+
+ z: number;
+>z : Symbol(z, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 9, 44))
+ }
+
+ export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
+>Origin3d : Symbol(Origin3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 14))
+>Point3d : Symbol(Point3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
+>x : Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 36))
+>y : Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 42))
+>z : Symbol(z, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 48))
+
+ export interface Line{
+>Line : Symbol(Line, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56))
+>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
+>Point : Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+
+ new (start: TPoint, end: TPoint);
+>start : Symbol(start, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 13))
+>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
+>end : Symbol(end, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 27))
+>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
+
+ start: TPoint;
+>start : Symbol(start, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 41))
+>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
+
+ end: TPoint;
+>end : Symbol(end, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 18, 22))
+>TPoint : Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
+ }
+}
+
diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types
index ca5a98c713d..366e21b6472 100644
--- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types
+++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types
@@ -1,63 +1,63 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 0))
+>A : typeof A
interface Point {
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 2, 21))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 3, 18))
+>y : number
}
export var Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Origin, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 14))
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 32))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 38))
+>y : number
>0 : number
export interface Point3d extends Point {
->Point3d : Point3d, Symbol(Point3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>Point3d : Point3d
+>Point : Point
z: number;
->z : number, Symbol(z, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 9, 44))
+>z : number
}
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
->Origin3d : Point3d, Symbol(Origin3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 14))
->Point3d : Point3d, Symbol(Point3d, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 7, 46))
+>Origin3d : Point3d
+>Point3d : Point3d
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
->x : number, Symbol(x, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 36))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 42))
+>y : number
>0 : number
->z : number, Symbol(z, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 48))
+>z : number
>0 : number
export interface Line{
->Line : Line, Symbol(Line, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 13, 56))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
->Point : Point, Symbol(Point, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 0, 10))
+>Line : Line
+>TPoint : TPoint
+>Point : Point
new (start: TPoint, end: TPoint);
->start : TPoint, Symbol(start, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 13))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
->end : TPoint, Symbol(end, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 27))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
+>start : TPoint
+>TPoint : TPoint
+>end : TPoint
+>TPoint : TPoint
start: TPoint;
->start : TPoint, Symbol(start, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 16, 41))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
+>start : TPoint
+>TPoint : TPoint
end: TPoint;
->end : TPoint, Symbol(end, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 18, 22))
->TPoint : TPoint, Symbol(TPoint, Decl(ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts, 15, 26))
+>end : TPoint
+>TPoint : TPoint
}
}
diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.symbols b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.symbols
new file mode 100644
index 00000000000..acf6a1caef4
--- /dev/null
+++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.symbols
@@ -0,0 +1,45 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportModuleWithAccessibleTypesOnItsExportedMembers.ts ===
+module A {
+>A : Symbol(A, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 0))
+
+ export class Point {
+>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 3, 20))
+>y : Symbol(y, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 3, 37))
+ }
+
+ export module B {
+>B : Symbol(B, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 4, 5))
+
+ export var Origin: Point = new Point(0, 0);
+>Origin : Symbol(Origin, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 18))
+>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+
+ export class Line {
+>Line : Symbol(Line, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 51))
+
+ constructor(start: Point, end: Point) {
+>start : Symbol(start, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 10, 24))
+>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+>end : Symbol(end, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 10, 37))
+>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+
+ }
+
+ static fromOrigin(p: Point) {
+>fromOrigin : Symbol(Line.fromOrigin, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 12, 13))
+>p : Symbol(p, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 14, 30))
+>Point : Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+
+ return new Line({ x: 0, y: 0 }, p);
+>Line : Symbol(Line, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 51))
+>x : Symbol(x, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 15, 33))
+>y : Symbol(y, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 15, 39))
+>p : Symbol(p, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 14, 30))
+ }
+ }
+ }
+}
diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types
index 14c97fb0920..cd8526242fa 100644
--- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types
+++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types
@@ -1,51 +1,51 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportModuleWithAccessibleTypesOnItsExportedMembers.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 0))
+>A : typeof A
export class Point {
->Point : Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 3, 20))
->y : number, Symbol(y, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 3, 37))
+>x : number
+>y : number
}
export module B {
->B : typeof B, Symbol(B, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 4, 5))
+>B : typeof B
export var Origin: Point = new Point(0, 0);
->Origin : Point, Symbol(Origin, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 18))
->Point : Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+>Origin : Point
+>Point : Point
>new Point(0, 0) : Point
->Point : typeof Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+>Point : typeof Point
>0 : number
>0 : number
export class Line {
->Line : Line, Symbol(Line, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 51))
+>Line : Line
constructor(start: Point, end: Point) {
->start : Point, Symbol(start, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 10, 24))
->Point : Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
->end : Point, Symbol(end, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 10, 37))
->Point : Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+>start : Point
+>Point : Point
+>end : Point
+>Point : Point
}
static fromOrigin(p: Point) {
->fromOrigin : (p: Point) => Line, Symbol(Line.fromOrigin, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 12, 13))
->p : Point, Symbol(p, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 14, 30))
->Point : Point, Symbol(Point, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 0, 10))
+>fromOrigin : (p: Point) => Line
+>p : Point
+>Point : Point
return new Line({ x: 0, y: 0 }, p);
>new Line({ x: 0, y: 0 }, p) : Line
->Line : typeof Line, Symbol(Line, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 7, 51))
+>Line : typeof Line
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 15, 33))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 15, 39))
+>y : number
>0 : number
->p : Point, Symbol(p, Decl(ExportModuleWithAccessibleTypesOnItsExportedMembers.ts, 14, 30))
+>p : Point
}
}
}
diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.symbols b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.symbols
new file mode 100644
index 00000000000..dccc613aca9
--- /dev/null
+++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.symbols
@@ -0,0 +1,26 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts ===
+module A {
+>A : Symbol(A, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 0))
+
+ class Point {
+>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 3, 20))
+>y : Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 3, 37))
+ }
+
+ export var Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 14))
+>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
+>x : Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 32))
+>y : Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 38))
+
+ export var Unity = { start: new Point(0, 0), end: new Point(1, 0) };
+>Unity : Symbol(Unity, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 14))
+>start : Symbol(start, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 24))
+>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
+>end : Symbol(end, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 48))
+>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
+}
+
diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types
index 7ae575da27b..e08a4345a95 100644
--- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types
+++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types
@@ -1,35 +1,35 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 0))
+>A : typeof A
class Point {
->Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 3, 20))
->y : number, Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 3, 37))
+>x : number
+>y : number
}
export var Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Origin, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 14))
->Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 32))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 6, 38))
+>y : number
>0 : number
export var Unity = { start: new Point(0, 0), end: new Point(1, 0) };
->Unity : { start: Point; end: Point; }, Symbol(Unity, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 14))
+>Unity : { start: Point; end: Point; }
>{ start: new Point(0, 0), end: new Point(1, 0) } : { start: Point; end: Point; }
->start : Point, Symbol(start, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 24))
+>start : Point
>new Point(0, 0) : Point
->Point : typeof Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
+>Point : typeof Point
>0 : number
>0 : number
->end : Point, Symbol(end, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 8, 48))
+>end : Point
>new Point(1, 0) : Point
->Point : typeof Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts, 0, 10))
+>Point : typeof Point
>1 : number
>0 : number
}
diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.symbols b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.symbols
new file mode 100644
index 00000000000..3c1ca13b616
--- /dev/null
+++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.symbols
@@ -0,0 +1,31 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts ===
+module A {
+>A : Symbol(A, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 0))
+
+ class Point {
+>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 3, 20))
+>y : Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 3, 37))
+ }
+
+ export var UnitSquare : {
+>UnitSquare : Symbol(UnitSquare, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 6, 14))
+
+ top: { left: Point, right: Point },
+>top : Symbol(top, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 6, 29))
+>left : Symbol(left, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 14))
+>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
+>right : Symbol(right, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 27))
+>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
+
+ bottom: { left: Point, right: Point }
+>bottom : Symbol(bottom, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 43))
+>left : Symbol(left, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 8, 17))
+>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
+>right : Symbol(right, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 8, 30))
+>Point : Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
+
+ } = null;
+}
diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types
index 9cc12dc057d..12a8cd974ad 100644
--- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types
+++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types
@@ -1,31 +1,31 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 0))
+>A : typeof A
class Point {
->Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 3, 20))
->y : number, Symbol(y, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 3, 37))
+>x : number
+>y : number
}
export var UnitSquare : {
->UnitSquare : { top: { left: Point; right: Point; }; bottom: { left: Point; right: Point; }; }, Symbol(UnitSquare, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 6, 14))
+>UnitSquare : { top: { left: Point; right: Point; }; bottom: { left: Point; right: Point; }; }
top: { left: Point, right: Point },
->top : { left: Point; right: Point; }, Symbol(top, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 6, 29))
->left : Point, Symbol(left, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 14))
->Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
->right : Point, Symbol(right, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 27))
->Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
+>top : { left: Point; right: Point; }
+>left : Point
+>Point : Point
+>right : Point
+>Point : Point
bottom: { left: Point, right: Point }
->bottom : { left: Point; right: Point; }, Symbol(bottom, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 7, 43))
->left : Point, Symbol(left, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 8, 17))
->Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
->right : Point, Symbol(right, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 8, 30))
->Point : Point, Symbol(Point, Decl(ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts, 0, 10))
+>bottom : { left: Point; right: Point; }
+>left : Point
+>Point : Point
+>right : Point
+>Point : Point
} = null;
>null : null
diff --git a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.symbols b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.symbols
new file mode 100644
index 00000000000..f56b2f526d4
--- /dev/null
+++ b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.symbols
@@ -0,0 +1,21 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts ===
+module A {
+>A : Symbol(A, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 0))
+
+ class B {
+>B : Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10))
+
+ id: number;
+>id : Symbol(id, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 1, 13))
+ }
+
+ export var beez: Array;
+>beez : Symbol(beez, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 5, 14))
+>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
+>B : Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10))
+
+ export var beez2 = new Array();
+>beez2 : Symbol(beez2, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 6, 14))
+>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
+>B : Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10))
+}
diff --git a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.types b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.types
index 961adc893d5..ba24bf93442 100644
--- a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.types
+++ b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.types
@@ -1,22 +1,22 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 0))
+>A : typeof A
class B {
->B : B, Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10))
+>B : B
id: number;
->id : number, Symbol(id, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 1, 13))
+>id : number
}
export var beez: Array;
->beez : B[], Symbol(beez, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 5, 14))
->Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
->B : B, Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10))
+>beez : B[]
+>Array : T[]
+>B : B
export var beez2 = new Array();
->beez2 : B[], Symbol(beez2, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 6, 14))
+>beez2 : B[]
>new Array() : B[]
->Array : ArrayConstructor, Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
->B : B, Symbol(B, Decl(ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts, 0, 10))
+>Array : ArrayConstructor
+>B : B
}
diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.symbols b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.symbols
new file mode 100644
index 00000000000..55ba5fd0cf3
--- /dev/null
+++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.symbols
@@ -0,0 +1,22 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableWithAccessibleTypeInTypeAnnotation.ts ===
+module A {
+>A : Symbol(A, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 0))
+
+ export interface Point {
+>Point : Symbol(Point, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 2, 28))
+
+ y: number;
+>y : Symbol(y, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 3, 18))
+ }
+
+ // valid since Point is exported
+ export var Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 14))
+>Point : Symbol(Point, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 10))
+>x : Symbol(x, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 32))
+>y : Symbol(y, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 38))
+}
+
diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types
index a0836493e33..faf86ea6982 100644
--- a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types
+++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types
@@ -1,25 +1,25 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableWithAccessibleTypeInTypeAnnotation.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 0))
+>A : typeof A
export interface Point {
->Point : Point, Symbol(Point, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 2, 28))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 3, 18))
+>y : number
}
// valid since Point is exported
export var Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Origin, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 14))
->Point : Point, Symbol(Point, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 0, 10))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 32))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportVariableWithAccessibleTypeInTypeAnnotation.ts, 8, 38))
+>y : number
>0 : number
}
diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.symbols b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.symbols
new file mode 100644
index 00000000000..ac43ccea789
--- /dev/null
+++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.symbols
@@ -0,0 +1,38 @@
+=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableWithInaccessibleTypeInTypeAnnotation.ts ===
+module A {
+>A : Symbol(A, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 0))
+
+ export interface Point {
+>Point : Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 2, 28))
+
+ y: number;
+>y : Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 3, 18))
+ }
+
+ // valid since Point is exported
+ export var Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 14))
+>Point : Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10))
+>x : Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 32))
+>y : Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 38))
+
+ interface Point3d extends Point {
+>Point3d : Symbol(Point3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 46))
+>Point : Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10))
+
+ z: number;
+>z : Symbol(z, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 10, 37))
+ }
+
+ // invalid Point3d is not exported
+ export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
+>Origin3d : Symbol(Origin3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 14))
+>Point3d : Symbol(Point3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 46))
+>x : Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 36))
+>y : Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 42))
+>z : Symbol(z, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 48))
+}
+
diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types
index aa245e4e578..4ce1912d441 100644
--- a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types
+++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types
@@ -1,45 +1,45 @@
=== tests/cases/conformance/internalModules/exportDeclarations/ExportVariableWithInaccessibleTypeInTypeAnnotation.ts ===
module A {
->A : typeof A, Symbol(A, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 0))
+>A : typeof A
export interface Point {
->Point : Point, Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 2, 28))
+>x : number
y: number;
->y : number, Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 3, 18))
+>y : number
}
// valid since Point is exported
export var Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Origin, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 14))
->Point : Point, Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 32))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 38))
+>y : number
>0 : number
interface Point3d extends Point {
->Point3d : Point3d, Symbol(Point3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 46))
->Point : Point, Symbol(Point, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 0, 10))
+>Point3d : Point3d
+>Point : Point
z: number;
->z : number, Symbol(z, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 10, 37))
+>z : number
}
// invalid Point3d is not exported
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
->Origin3d : Point3d, Symbol(Origin3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 14))
->Point3d : Point3d, Symbol(Point3d, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 8, 46))
+>Origin3d : Point3d
+>Point3d : Point3d
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
->x : number, Symbol(x, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 36))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 42))
+>y : number
>0 : number
->z : number, Symbol(z, Decl(ExportVariableWithInaccessibleTypeInTypeAnnotation.ts, 15, 48))
+>z : number
>0 : number
}
diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.symbols b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.symbols
new file mode 100644
index 00000000000..96963246d26
--- /dev/null
+++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.symbols
@@ -0,0 +1,52 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/function.ts ===
+module A {
+>A : Symbol(A, Decl(function.ts, 0, 0))
+
+ export function Point() {
+>Point : Symbol(Point, Decl(function.ts, 0, 10))
+
+ return { x: 0, y: 0 };
+>x : Symbol(x, Decl(function.ts, 2, 16))
+>y : Symbol(y, Decl(function.ts, 2, 22))
+ }
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/module.ts ===
+module B {
+>B : Symbol(B, Decl(module.ts, 0, 0))
+
+ export module Point {
+>Point : Symbol(Point, Decl(module.ts, 0, 10))
+
+ export var Origin = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(module.ts, 2, 18))
+>x : Symbol(x, Decl(module.ts, 2, 29))
+>y : Symbol(y, Decl(module.ts, 2, 35))
+ }
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
+var fn: () => { x: number; y: number };
+>fn : Symbol(fn, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3))
+>x : Symbol(x, Decl(test.ts, 0, 15))
+>y : Symbol(y, Decl(test.ts, 0, 26))
+
+var fn = A.Point;
+>fn : Symbol(fn, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3))
+>A.Point : Symbol(A.Point, Decl(function.ts, 0, 10))
+>A : Symbol(A, Decl(function.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(function.ts, 0, 10))
+
+var cl: { x: number; y: number; }
+>cl : Symbol(cl, Decl(test.ts, 3, 3), Decl(test.ts, 4, 3))
+>x : Symbol(x, Decl(test.ts, 3, 9))
+>y : Symbol(y, Decl(test.ts, 3, 20))
+
+var cl = B.Point.Origin;
+>cl : Symbol(cl, Decl(test.ts, 3, 3), Decl(test.ts, 4, 3))
+>B.Point.Origin : Symbol(B.Point.Origin, Decl(module.ts, 2, 18))
+>B.Point : Symbol(B.Point, Decl(module.ts, 0, 10))
+>B : Symbol(B, Decl(module.ts, 0, 0))
+>Point : Symbol(B.Point, Decl(module.ts, 0, 10))
+>Origin : Symbol(B.Point.Origin, Decl(module.ts, 2, 18))
+
diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types
index e63275fe58f..fe976cd0a3b 100644
--- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types
+++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types
@@ -1,58 +1,58 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/function.ts ===
module A {
->A : typeof A, Symbol(A, Decl(function.ts, 0, 0))
+>A : typeof A
export function Point() {
->Point : () => { x: number; y: number; }, Symbol(Point, Decl(function.ts, 0, 10))
+>Point : () => { x: number; y: number; }
return { x: 0, y: 0 };
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(function.ts, 2, 16))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(function.ts, 2, 22))
+>y : number
>0 : number
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/module.ts ===
module B {
->B : typeof B, Symbol(B, Decl(module.ts, 0, 0))
+>B : typeof B
export module Point {
->Point : typeof Point, Symbol(Point, Decl(module.ts, 0, 10))
+>Point : typeof Point
export var Origin = { x: 0, y: 0 };
->Origin : { x: number; y: number; }, Symbol(Origin, Decl(module.ts, 2, 18))
+>Origin : { x: number; y: number; }
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(module.ts, 2, 29))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(module.ts, 2, 35))
+>y : number
>0 : number
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
var fn: () => { x: number; y: number };
->fn : () => { x: number; y: number; }, Symbol(fn, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3))
->x : number, Symbol(x, Decl(test.ts, 0, 15))
->y : number, Symbol(y, Decl(test.ts, 0, 26))
+>fn : () => { x: number; y: number; }
+>x : number
+>y : number
var fn = A.Point;
->fn : () => { x: number; y: number; }, Symbol(fn, Decl(test.ts, 0, 3), Decl(test.ts, 1, 3))
->A.Point : () => { x: number; y: number; }, Symbol(A.Point, Decl(function.ts, 0, 10))
->A : typeof A, Symbol(A, Decl(function.ts, 0, 0))
->Point : () => { x: number; y: number; }, Symbol(A.Point, Decl(function.ts, 0, 10))
+>fn : () => { x: number; y: number; }
+>A.Point : () => { x: number; y: number; }
+>A : typeof A
+>Point : () => { x: number; y: number; }
var cl: { x: number; y: number; }
->cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 3, 3), Decl(test.ts, 4, 3))
->x : number, Symbol(x, Decl(test.ts, 3, 9))
->y : number, Symbol(y, Decl(test.ts, 3, 20))
+>cl : { x: number; y: number; }
+>x : number
+>y : number
var cl = B.Point.Origin;
->cl : { x: number; y: number; }, Symbol(cl, Decl(test.ts, 3, 3), Decl(test.ts, 4, 3))
->B.Point.Origin : { x: number; y: number; }, Symbol(B.Point.Origin, Decl(module.ts, 2, 18))
->B.Point : typeof B.Point, Symbol(B.Point, Decl(module.ts, 0, 10))
->B : typeof B, Symbol(B, Decl(module.ts, 0, 0))
->Point : typeof B.Point, Symbol(B.Point, Decl(module.ts, 0, 10))
->Origin : { x: number; y: number; }, Symbol(B.Point.Origin, Decl(module.ts, 2, 18))
+>cl : { x: number; y: number; }
+>B.Point.Origin : { x: number; y: number; }
+>B.Point : typeof B.Point
+>B : typeof B
+>Point : typeof B.Point
+>Origin : { x: number; y: number; }
diff --git a/tests/baselines/reference/FunctionDeclaration2_es6.symbols b/tests/baselines/reference/FunctionDeclaration2_es6.symbols
new file mode 100644
index 00000000000..ad9241abaf1
--- /dev/null
+++ b/tests/baselines/reference/FunctionDeclaration2_es6.symbols
@@ -0,0 +1,5 @@
+=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts ===
+function f(yield) {
+>f : Symbol(f, Decl(FunctionDeclaration2_es6.ts, 0, 0))
+>yield : Symbol(yield, Decl(FunctionDeclaration2_es6.ts, 0, 11))
+}
diff --git a/tests/baselines/reference/FunctionDeclaration2_es6.types b/tests/baselines/reference/FunctionDeclaration2_es6.types
index eefe4de1464..f23d9cf6840 100644
--- a/tests/baselines/reference/FunctionDeclaration2_es6.types
+++ b/tests/baselines/reference/FunctionDeclaration2_es6.types
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts ===
function f(yield) {
->f : (yield: any) => void, Symbol(f, Decl(FunctionDeclaration2_es6.ts, 0, 0))
->yield : any, Symbol(yield, Decl(FunctionDeclaration2_es6.ts, 0, 11))
+>f : (yield: any) => void
+>yield : any
}
diff --git a/tests/baselines/reference/FunctionDeclaration4_es6.symbols b/tests/baselines/reference/FunctionDeclaration4_es6.symbols
new file mode 100644
index 00000000000..badb1695cdc
--- /dev/null
+++ b/tests/baselines/reference/FunctionDeclaration4_es6.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts ===
+function yield() {
+>yield : Symbol(yield, Decl(FunctionDeclaration4_es6.ts, 0, 0))
+}
diff --git a/tests/baselines/reference/FunctionDeclaration4_es6.types b/tests/baselines/reference/FunctionDeclaration4_es6.types
index 9cf71703bc8..e4f102a8f70 100644
--- a/tests/baselines/reference/FunctionDeclaration4_es6.types
+++ b/tests/baselines/reference/FunctionDeclaration4_es6.types
@@ -1,4 +1,4 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts ===
function yield() {
->yield : () => void, Symbol(yield, Decl(FunctionDeclaration4_es6.ts, 0, 0))
+>yield : () => void
}
diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.symbols b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.symbols
new file mode 100644
index 00000000000..72eb0340eb2
--- /dev/null
+++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.symbols
@@ -0,0 +1,42 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/ModuleAndEnumWithSameNameAndCommonRoot.ts ===
+module enumdule {
+>enumdule : Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
+
+ export class Point {
+>Point : Symbol(Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 3, 20))
+>y : Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 3, 37))
+ }
+}
+
+enum enumdule {
+>enumdule : Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
+
+ Red, Blue
+>Red : Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15))
+>Blue : Symbol(enumdule.Blue, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 8, 8))
+}
+
+var x: enumdule;
+>x : Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 11, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 12, 3))
+>enumdule : Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
+
+var x = enumdule.Red;
+>x : Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 11, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 12, 3))
+>enumdule.Red : Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15))
+>enumdule : Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
+>Red : Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15))
+
+var y: { x: number; y: number };
+>y : Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 15, 3))
+>x : Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 8))
+>y : Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 19))
+
+var y = new enumdule.Point(0, 0);
+>y : Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 15, 3))
+>enumdule.Point : Symbol(enumdule.Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17))
+>enumdule : Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
+>Point : Symbol(enumdule.Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17))
+
diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types
index 4c5d815dfcf..343b69954b0 100644
--- a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types
+++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types
@@ -1,45 +1,45 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/ModuleAndEnumWithSameNameAndCommonRoot.ts ===
module enumdule {
->enumdule : typeof enumdule, Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
+>enumdule : typeof enumdule
export class Point {
->Point : Point, Symbol(Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 3, 20))
->y : number, Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 3, 37))
+>x : number
+>y : number
}
}
enum enumdule {
->enumdule : enumdule, Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
+>enumdule : enumdule
Red, Blue
->Red : enumdule, Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15))
->Blue : enumdule, Symbol(enumdule.Blue, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 8, 8))
+>Red : enumdule
+>Blue : enumdule
}
var x: enumdule;
->x : enumdule, Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 11, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 12, 3))
->enumdule : enumdule, Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
+>x : enumdule
+>enumdule : enumdule
var x = enumdule.Red;
->x : enumdule, Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 11, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 12, 3))
->enumdule.Red : enumdule, Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15))
->enumdule : typeof enumdule, Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
->Red : enumdule, Symbol(enumdule.Red, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 7, 15))
+>x : enumdule
+>enumdule.Red : enumdule
+>enumdule : typeof enumdule
+>Red : enumdule
var y: { x: number; y: number };
->y : { x: number; y: number; }, Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 15, 3))
->x : number, Symbol(x, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 8))
->y : number, Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 19))
+>y : { x: number; y: number; }
+>x : number
+>y : number
var y = new enumdule.Point(0, 0);
->y : { x: number; y: number; }, Symbol(y, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 14, 3), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 15, 3))
+>y : { x: number; y: number; }
>new enumdule.Point(0, 0) : enumdule.Point
->enumdule.Point : typeof enumdule.Point, Symbol(enumdule.Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17))
->enumdule : typeof enumdule, Symbol(enumdule, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 0), Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 5, 1))
->Point : typeof enumdule.Point, Symbol(enumdule.Point, Decl(ModuleAndEnumWithSameNameAndCommonRoot.ts, 0, 17))
+>enumdule.Point : typeof enumdule.Point
+>enumdule : typeof enumdule
+>Point : typeof enumdule.Point
>0 : number
>0 : number
diff --git a/tests/baselines/reference/Protected5.symbols b/tests/baselines/reference/Protected5.symbols
new file mode 100644
index 00000000000..a4c91729ed3
--- /dev/null
+++ b/tests/baselines/reference/Protected5.symbols
@@ -0,0 +1,7 @@
+=== tests/cases/conformance/parser/ecmascript5/Protected/Protected5.ts ===
+class C {
+>C : Symbol(C, Decl(Protected5.ts, 0, 0))
+
+ protected static m() { }
+>m : Symbol(C.m, Decl(Protected5.ts, 0, 9))
+}
diff --git a/tests/baselines/reference/Protected5.types b/tests/baselines/reference/Protected5.types
index f6586a5b81c..7ef0be949a7 100644
--- a/tests/baselines/reference/Protected5.types
+++ b/tests/baselines/reference/Protected5.types
@@ -1,7 +1,7 @@
=== tests/cases/conformance/parser/ecmascript5/Protected/Protected5.ts ===
class C {
->C : C, Symbol(C, Decl(Protected5.ts, 0, 0))
+>C : C
protected static m() { }
->m : () => void, Symbol(C.m, Decl(Protected5.ts, 0, 9))
+>m : () => void
}
diff --git a/tests/baselines/reference/Protected8.symbols b/tests/baselines/reference/Protected8.symbols
new file mode 100644
index 00000000000..502e68bb9c2
--- /dev/null
+++ b/tests/baselines/reference/Protected8.symbols
@@ -0,0 +1,10 @@
+=== tests/cases/conformance/parser/ecmascript5/Protected/Protected8.ts ===
+interface I {
+>I : Symbol(I, Decl(Protected8.ts, 0, 0))
+
+ protected
+>protected : Symbol(protected, Decl(Protected8.ts, 0, 13))
+
+ p
+>p : Symbol(p, Decl(Protected8.ts, 1, 12))
+}
diff --git a/tests/baselines/reference/Protected8.types b/tests/baselines/reference/Protected8.types
index 25b9ee44b8b..f29be486eec 100644
--- a/tests/baselines/reference/Protected8.types
+++ b/tests/baselines/reference/Protected8.types
@@ -1,10 +1,10 @@
=== tests/cases/conformance/parser/ecmascript5/Protected/Protected8.ts ===
interface I {
->I : I, Symbol(I, Decl(Protected8.ts, 0, 0))
+>I : I
protected
->protected : any, Symbol(protected, Decl(Protected8.ts, 0, 13))
+>protected : any
p
->p : any, Symbol(p, Decl(Protected8.ts, 1, 12))
+>p : any
}
diff --git a/tests/baselines/reference/Protected9.symbols b/tests/baselines/reference/Protected9.symbols
new file mode 100644
index 00000000000..27ce91344e4
--- /dev/null
+++ b/tests/baselines/reference/Protected9.symbols
@@ -0,0 +1,7 @@
+=== tests/cases/conformance/parser/ecmascript5/Protected/Protected9.ts ===
+class C {
+>C : Symbol(C, Decl(Protected9.ts, 0, 0))
+
+ constructor(protected p) { }
+>p : Symbol(p, Decl(Protected9.ts, 1, 15))
+}
diff --git a/tests/baselines/reference/Protected9.types b/tests/baselines/reference/Protected9.types
index d3dd2f46e65..d4b6e2fff82 100644
--- a/tests/baselines/reference/Protected9.types
+++ b/tests/baselines/reference/Protected9.types
@@ -1,7 +1,7 @@
=== tests/cases/conformance/parser/ecmascript5/Protected/Protected9.ts ===
class C {
->C : C, Symbol(C, Decl(Protected9.ts, 0, 0))
+>C : C
constructor(protected p) { }
->p : any, Symbol(p, Decl(Protected9.ts, 1, 15))
+>p : any
}
diff --git a/tests/baselines/reference/TupleType1.symbols b/tests/baselines/reference/TupleType1.symbols
new file mode 100644
index 00000000000..9f4b2c78a8e
--- /dev/null
+++ b/tests/baselines/reference/TupleType1.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType1.ts ===
+var v: [number]
+>v : Symbol(v, Decl(TupleType1.ts, 0, 3))
+
diff --git a/tests/baselines/reference/TupleType1.types b/tests/baselines/reference/TupleType1.types
index 83e6711e2e5..39fa32d5dca 100644
--- a/tests/baselines/reference/TupleType1.types
+++ b/tests/baselines/reference/TupleType1.types
@@ -1,4 +1,4 @@
=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType1.ts ===
var v: [number]
->v : [number], Symbol(v, Decl(TupleType1.ts, 0, 3))
+>v : [number]
diff --git a/tests/baselines/reference/TupleType2.symbols b/tests/baselines/reference/TupleType2.symbols
new file mode 100644
index 00000000000..5ef9209147a
--- /dev/null
+++ b/tests/baselines/reference/TupleType2.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType2.ts ===
+var v: [number, string]
+>v : Symbol(v, Decl(TupleType2.ts, 0, 3))
+
diff --git a/tests/baselines/reference/TupleType2.types b/tests/baselines/reference/TupleType2.types
index 5691baadd06..0f35f60786c 100644
--- a/tests/baselines/reference/TupleType2.types
+++ b/tests/baselines/reference/TupleType2.types
@@ -1,4 +1,4 @@
=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType2.ts ===
var v: [number, string]
->v : [number, string], Symbol(v, Decl(TupleType2.ts, 0, 3))
+>v : [number, string]
diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.symbols
new file mode 100644
index 00000000000..c9e2c124e9d
--- /dev/null
+++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.symbols
@@ -0,0 +1,96 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts ===
+module A {
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
+
+ export class Point {
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24))
+
+ y: number;
+>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18))
+ }
+}
+
+module A {
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
+
+ class Point {
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 7, 10))
+
+ fromCarthesian(p: A.Point) {
+>fromCarthesian : Symbol(fromCarthesian, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 8, 17))
+>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10))
+
+ return { x: p.x, y: p.y };
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 10, 20))
+>p.x : Symbol(Point.x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24))
+>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23))
+>x : Symbol(Point.x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24))
+>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 10, 28))
+>p.y : Symbol(Point.y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18))
+>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23))
+>y : Symbol(Point.y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18))
+ }
+ }
+}
+
+// ensure merges as expected
+var p: { x: number; y: number; };
+>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 3))
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 8))
+>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 19))
+
+var p: A.Point;
+>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 3))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10))
+
+module X.Y.Z {
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1))
+>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10))
+>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21))
+
+ export class Line {
+>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 14))
+
+ length: number;
+>length : Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 20, 23))
+ }
+}
+
+module X {
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1))
+
+ export module Y {
+>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10))
+
+ export module Z {
+>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21))
+
+ class Line {
+>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 27, 25))
+
+ name: string;
+>name : Symbol(name, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 28, 24))
+ }
+ }
+ }
+}
+
+// ensure merges as expected
+var l: { length: number; }
+>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 37, 3))
+>length : Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 8))
+
+var l: X.Y.Z.Line;
+>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 37, 3))
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1))
+>Y : Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10))
+>Z : Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21))
+>Line : Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 14))
+
+
diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types
index f253f897382..25c23b83273 100644
--- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types
+++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types
@@ -1,82 +1,82 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts ===
module A {
->A : typeof A, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
+>A : typeof A
export class Point {
->Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24))
+>x : number
y: number;
->y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18))
+>y : number
}
}
module A {
->A : typeof A, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
+>A : typeof A
class Point {
->Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 7, 10))
+>Point : Point
fromCarthesian(p: A.Point) {
->fromCarthesian : (p: A.Point) => { x: number; y: number; }, Symbol(fromCarthesian, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 8, 17))
->p : A.Point, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
->Point : A.Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10))
+>fromCarthesian : (p: A.Point) => { x: number; y: number; }
+>p : A.Point
+>A : any
+>Point : A.Point
return { x: p.x, y: p.y };
>{ x: p.x, y: p.y } : { x: number; y: number; }
->x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 10, 20))
->p.x : number, Symbol(Point.x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24))
->p : A.Point, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23))
->x : number, Symbol(Point.x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 1, 24))
->y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 10, 28))
->p.y : number, Symbol(Point.y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18))
->p : A.Point, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 9, 23))
->y : number, Symbol(Point.y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 2, 18))
+>x : number
+>p.x : number
+>p : A.Point
+>x : number
+>y : number
+>p.y : number
+>p : A.Point
+>y : number
}
}
}
// ensure merges as expected
var p: { x: number; y: number; };
->p : { x: number; y: number; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 3))
->x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 8))
->y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 19))
+>p : { x: number; y: number; }
+>x : number
+>y : number
var p: A.Point;
->p : { x: number; y: number; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 16, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 3))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 5, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 0, 10))
+>p : { x: number; y: number; }
+>A : any
+>Point : A.Point
module X.Y.Z {
->X : typeof X, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1))
->Y : typeof Y, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10))
->Z : typeof Z, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21))
+>X : typeof X
+>Y : typeof Y
+>Z : typeof Z
export class Line {
->Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 14))
+>Line : Line
length: number;
->length : number, Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 20, 23))
+>length : number
}
}
module X {
->X : typeof X, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1))
+>X : typeof X
export module Y {
->Y : typeof Y, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10))
+>Y : typeof Y
export module Z {
->Z : typeof Z, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21))
+>Z : typeof Z
class Line {
->Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 27, 25))
+>Line : Line
name: string;
->name : string, Symbol(name, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 28, 24))
+>name : string
}
}
}
@@ -84,14 +84,14 @@ module X {
// ensure merges as expected
var l: { length: number; }
->l : { length: number; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 37, 3))
->length : number, Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 8))
+>l : { length: number; }
+>length : number
var l: X.Y.Z.Line;
->l : { length: number; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 36, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 37, 3))
->X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 17, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 23, 1))
->Y : any, Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 25, 10))
->Z : any, Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 26, 21))
->Line : X.Y.Z.Line, Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts, 19, 14))
+>l : { length: number; }
+>X : any
+>Y : any
+>Z : any
+>Line : X.Y.Z.Line
diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.symbols
new file mode 100644
index 00000000000..2fcf3c4b09e
--- /dev/null
+++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.symbols
@@ -0,0 +1,103 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts ===
+module A {
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+
+ export interface Point {
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 1, 28))
+
+ y: number;
+>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 2, 18))
+
+ toCarth(): Point;
+>toCarth : Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 3, 18))
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+ }
+}
+
+module A {
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+
+ interface Point {
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 8, 10))
+
+ fromCarth(): Point;
+>fromCarth : Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 9, 21))
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 8, 10))
+ }
+}
+
+// ensure merges as expected
+var p: { x: number; y: number; toCarth(): A.Point; };
+>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 3))
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 8))
+>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 19))
+>toCarth : Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 30))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+
+var p: A.Point;
+>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 3))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+
+module X.Y.Z {
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1))
+>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10))
+>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20))
+
+ export interface Line {
+>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 14))
+
+ new (start: A.Point, end: A.Point);
+>start : Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 20, 13))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+>end : Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 20, 28))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+ }
+}
+
+module X {
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1))
+
+ export module Y.Z {
+>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10))
+>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20))
+
+ interface Line {
+>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 23))
+
+ start: A.Point;
+>start : Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 26, 24))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+
+ end: A.Point;
+>end : Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 27, 27))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+ }
+ }
+}
+
+// ensure merges as expected
+var l: { new (s: A.Point, e: A.Point); }
+>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 35, 3))
+>s : Symbol(s, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 14))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+>e : Symbol(e, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 25))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+
+var l: X.Y.Z.Line;
+>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 35, 3))
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1))
+>Y : Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10))
+>Z : Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20))
+>Line : Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 14))
+
diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types
index d16e446a082..309ad35d54f 100644
--- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types
+++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types
@@ -1,103 +1,103 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts ===
module A {
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+>A : any
export interface Point {
->Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 1, 28))
+>x : number
y: number;
->y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 2, 18))
+>y : number
toCarth(): Point;
->toCarth : () => Point, Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 3, 18))
->Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+>toCarth : () => Point
+>Point : Point
}
}
module A {
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
+>A : any
interface Point {
->Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 8, 10))
+>Point : Point
fromCarth(): Point;
->fromCarth : () => Point, Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 9, 21))
->Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 8, 10))
+>fromCarth : () => Point
+>Point : Point
}
}
// ensure merges as expected
var p: { x: number; y: number; toCarth(): A.Point; };
->p : { x: number; y: number; toCarth(): A.Point; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 3))
->x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 8))
->y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 19))
->toCarth : () => A.Point, Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 30))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+>p : { x: number; y: number; toCarth(): A.Point; }
+>x : number
+>y : number
+>toCarth : () => A.Point
+>A : any
+>Point : A.Point
var p: A.Point;
->p : { x: number; y: number; toCarth(): A.Point; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 3))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+>p : { x: number; y: number; toCarth(): A.Point; }
+>A : any
+>Point : A.Point
module X.Y.Z {
->X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1))
->Y : any, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10))
->Z : any, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20))
+>X : any
+>Y : any
+>Z : any
export interface Line {
->Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 14))
+>Line : Line
new (start: A.Point, end: A.Point);
->start : A.Point, Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 20, 13))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
->end : A.Point, Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 20, 28))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+>start : A.Point
+>A : any
+>Point : A.Point
+>end : A.Point
+>A : any
+>Point : A.Point
}
}
module X {
->X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1))
+>X : any
export module Y.Z {
->Y : any, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10))
->Z : any, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20))
+>Y : any
+>Z : any
interface Line {
->Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 23))
+>Line : Line
start: A.Point;
->start : A.Point, Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 26, 24))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+>start : A.Point
+>A : any
+>Point : A.Point
end: A.Point;
->end : A.Point, Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 27, 27))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+>end : A.Point
+>A : any
+>Point : A.Point
}
}
}
// ensure merges as expected
var l: { new (s: A.Point, e: A.Point); }
->l : new (s: A.Point, e: A.Point) => any, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 35, 3))
->s : A.Point, Symbol(s, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 14))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
->e : A.Point, Symbol(e, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 25))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 0, 10))
+>l : new (s: A.Point, e: A.Point) => any
+>s : A.Point
+>A : any
+>Point : A.Point
+>e : A.Point
+>A : any
+>Point : A.Point
var l: X.Y.Z.Line;
->l : new (s: A.Point, e: A.Point) => any, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 35, 3))
->X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 22, 1))
->Y : any, Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 24, 10))
->Z : any, Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 25, 20))
->Line : X.Y.Z.Line, Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts, 18, 14))
+>l : new (s: A.Point, e: A.Point) => any
+>X : any
+>Y : any
+>Z : any
+>Line : X.Y.Z.Line
diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.symbols
new file mode 100644
index 00000000000..b7402952dff
--- /dev/null
+++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.symbols
@@ -0,0 +1,120 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
+module A {
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+
+ export interface Point {
+>Point : Symbol(Point, Decl(part1.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(part1.ts, 1, 28))
+
+ y: number;
+>y : Symbol(y, Decl(part1.ts, 2, 18))
+ }
+
+ export module Utils {
+>Utils : Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
+
+ export function mirror(p: T) {
+>mirror : Symbol(mirror, Decl(part1.ts, 6, 25))
+>T : Symbol(T, Decl(part1.ts, 7, 31))
+>Point : Symbol(Point, Decl(part1.ts, 0, 10))
+>p : Symbol(p, Decl(part1.ts, 7, 48))
+>T : Symbol(T, Decl(part1.ts, 7, 31))
+
+ return { x: p.y, y: p.x };
+>x : Symbol(x, Decl(part1.ts, 8, 20))
+>p.y : Symbol(Point.y, Decl(part1.ts, 2, 18))
+>p : Symbol(p, Decl(part1.ts, 7, 48))
+>y : Symbol(Point.y, Decl(part1.ts, 2, 18))
+>y : Symbol(y, Decl(part1.ts, 8, 28))
+>p.x : Symbol(Point.x, Decl(part1.ts, 1, 28))
+>p : Symbol(p, Decl(part1.ts, 7, 48))
+>x : Symbol(Point.x, Decl(part1.ts, 1, 28))
+ }
+ }
+ export var Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(part1.ts, 11, 14))
+>Point : Symbol(Point, Decl(part1.ts, 0, 10))
+>x : Symbol(x, Decl(part1.ts, 11, 32))
+>y : Symbol(y, Decl(part1.ts, 11, 38))
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
+module A {
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+
+ // not a collision, since we don't export
+ var Origin: string = "0,0";
+>Origin : Symbol(Origin, Decl(part2.ts, 2, 7))
+
+ export module Utils {
+>Utils : Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
+
+ export class Plane {
+>Plane : Symbol(Plane, Decl(part2.ts, 4, 25))
+
+ constructor(public tl: Point, public br: Point) { }
+>tl : Symbol(tl, Decl(part2.ts, 6, 24))
+>Point : Symbol(Point, Decl(part1.ts, 0, 10))
+>br : Symbol(br, Decl(part2.ts, 6, 41))
+>Point : Symbol(Point, Decl(part1.ts, 0, 10))
+ }
+ }
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/part3.ts ===
+// test the merging actually worked
+
+var o: { x: number; y: number };
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>x : Symbol(x, Decl(part3.ts, 2, 8))
+>y : Symbol(y, Decl(part3.ts, 2, 19))
+
+var o: A.Point;
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(part1.ts, 0, 10))
+
+var o = A.Origin;
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>A.Origin : Symbol(A.Origin, Decl(part1.ts, 11, 14))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Origin : Symbol(A.Origin, Decl(part1.ts, 11, 14))
+
+var o = A.Utils.mirror(o);
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>A.Utils.mirror : Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
+>A.Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
+>mirror : Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+
+var p: { tl: A.Point; br: A.Point };
+>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
+>tl : Symbol(tl, Decl(part3.ts, 7, 8))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(part1.ts, 0, 10))
+>br : Symbol(br, Decl(part3.ts, 7, 21))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(part1.ts, 0, 10))
+
+var p: A.Utils.Plane;
+>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
+>Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25))
+
+var p = new A.Utils.Plane(o, { x: 1, y: 1 });
+>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
+>A.Utils.Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25))
+>A.Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
+>Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25))
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>x : Symbol(x, Decl(part3.ts, 9, 30))
+>y : Symbol(y, Decl(part3.ts, 9, 36))
+
+
diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types
index e09d6fd52b2..af3c0776b56 100644
--- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types
+++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types
@@ -1,69 +1,69 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
module A {
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>A : typeof A
export interface Point {
->Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(part1.ts, 1, 28))
+>x : number
y: number;
->y : number, Symbol(y, Decl(part1.ts, 2, 18))
+>y : number
}
export module Utils {
->Utils : typeof Utils, Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
+>Utils : typeof Utils
export function mirror(p: T) {
->mirror : (p: T) => { x: number; y: number; }, Symbol(mirror, Decl(part1.ts, 6, 25))
->T : T, Symbol(T, Decl(part1.ts, 7, 31))
->Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
->p : T, Symbol(p, Decl(part1.ts, 7, 48))
->T : T, Symbol(T, Decl(part1.ts, 7, 31))
+>mirror : (p: T) => { x: number; y: number; }
+>T : T
+>Point : Point
+>p : T
+>T : T
return { x: p.y, y: p.x };
>{ x: p.y, y: p.x } : { x: number; y: number; }
->x : number, Symbol(x, Decl(part1.ts, 8, 20))
->p.y : number, Symbol(Point.y, Decl(part1.ts, 2, 18))
->p : T, Symbol(p, Decl(part1.ts, 7, 48))
->y : number, Symbol(Point.y, Decl(part1.ts, 2, 18))
->y : number, Symbol(y, Decl(part1.ts, 8, 28))
->p.x : number, Symbol(Point.x, Decl(part1.ts, 1, 28))
->p : T, Symbol(p, Decl(part1.ts, 7, 48))
->x : number, Symbol(Point.x, Decl(part1.ts, 1, 28))
+>x : number
+>p.y : number
+>p : T
+>y : number
+>y : number
+>p.x : number
+>p : T
+>x : number
}
}
export var Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Origin, Decl(part1.ts, 11, 14))
->Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(part1.ts, 11, 32))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(part1.ts, 11, 38))
+>y : number
>0 : number
}
=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
module A {
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>A : typeof A
// not a collision, since we don't export
var Origin: string = "0,0";
->Origin : string, Symbol(Origin, Decl(part2.ts, 2, 7))
+>Origin : string
>"0,0" : string
export module Utils {
->Utils : typeof Utils, Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
+>Utils : typeof Utils
export class Plane {
->Plane : Plane, Symbol(Plane, Decl(part2.ts, 4, 25))
+>Plane : Plane
constructor(public tl: Point, public br: Point) { }
->tl : Point, Symbol(tl, Decl(part2.ts, 6, 24))
->Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
->br : Point, Symbol(br, Decl(part2.ts, 6, 41))
->Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
+>tl : Point
+>Point : Point
+>br : Point
+>Point : Point
}
}
}
@@ -72,59 +72,59 @@ module A {
// test the merging actually worked
var o: { x: number; y: number };
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
->x : number, Symbol(x, Decl(part3.ts, 2, 8))
->y : number, Symbol(y, Decl(part3.ts, 2, 19))
+>o : { x: number; y: number; }
+>x : number
+>y : number
var o: A.Point;
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
->A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
+>o : { x: number; y: number; }
+>A : any
+>Point : A.Point
var o = A.Origin;
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
->A.Origin : A.Point, Symbol(A.Origin, Decl(part1.ts, 11, 14))
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Origin : A.Point, Symbol(A.Origin, Decl(part1.ts, 11, 14))
+>o : { x: number; y: number; }
+>A.Origin : A.Point
+>A : typeof A
+>Origin : A.Point
var o = A.Utils.mirror(o);
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>o : { x: number; y: number; }
>A.Utils.mirror(o) : { x: number; y: number; }
->A.Utils.mirror : (p: T) => { x: number; y: number; }, Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
->A.Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
->mirror : (p: T) => { x: number; y: number; }, Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>A.Utils.mirror : (p: T) => { x: number; y: number; }
+>A.Utils : typeof A.Utils
+>A : typeof A
+>Utils : typeof A.Utils
+>mirror : (p: T) => { x: number; y: number; }
+>o : { x: number; y: number; }
var p: { tl: A.Point; br: A.Point };
->p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
->tl : A.Point, Symbol(tl, Decl(part3.ts, 7, 8))
->A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
->br : A.Point, Symbol(br, Decl(part3.ts, 7, 21))
->A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
+>p : { tl: A.Point; br: A.Point; }
+>tl : A.Point
+>A : any
+>Point : A.Point
+>br : A.Point
+>A : any
+>Point : A.Point
var p: A.Utils.Plane;
->p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
->A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Utils : any, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
->Plane : A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25))
+>p : { tl: A.Point; br: A.Point; }
+>A : any
+>Utils : any
+>Plane : A.Utils.Plane
var p = new A.Utils.Plane(o, { x: 1, y: 1 });
->p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
+>p : { tl: A.Point; br: A.Point; }
>new A.Utils.Plane(o, { x: 1, y: 1 }) : A.Utils.Plane
->A.Utils.Plane : typeof A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25))
->A.Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 2, 31))
->Plane : typeof A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 4, 25))
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>A.Utils.Plane : typeof A.Utils.Plane
+>A.Utils : typeof A.Utils
+>A : typeof A
+>Utils : typeof A.Utils
+>Plane : typeof A.Utils.Plane
+>o : { x: number; y: number; }
>{ x: 1, y: 1 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(part3.ts, 9, 30))
+>x : number
>1 : number
->y : number, Symbol(y, Decl(part3.ts, 9, 36))
+>y : number
>1 : number
diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.symbols
new file mode 100644
index 00000000000..3e8fa64501f
--- /dev/null
+++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.symbols
@@ -0,0 +1,112 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts ===
+module A {
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+
+ export interface Point {
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+
+ x: number;
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 1, 28))
+
+ y: number;
+>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 2, 18))
+
+ toCarth(): Point;
+>toCarth : Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 3, 18))
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+ }
+}
+
+module A {
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+
+ export interface Point {
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+
+ fromCarth(): Point;
+>fromCarth : Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 9, 28))
+>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+ }
+}
+
+// ensure merges as expected
+var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; };
+>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 3))
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 8))
+>y : Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 19))
+>toCarth : Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 30))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>fromCarth : Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 50))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+
+var p: A.Point;
+>p : Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 3))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+
+module X.Y.Z {
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1))
+>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10))
+>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20))
+
+ export interface Line {
+>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23))
+
+ new (start: A.Point, end: A.Point);
+>start : Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 20, 13))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>end : Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 20, 28))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+ }
+}
+
+module X {
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1))
+
+ export module Y.Z {
+>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10))
+>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20))
+
+ export interface Line {
+>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23))
+
+ start: A.Point;
+>start : Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 26, 31))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+
+ end: A.Point;
+>end : Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 27, 27))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+ }
+ }
+}
+
+// ensure merges as expected
+var l: { start: A.Point; end: A.Point; new (s: A.Point, e: A.Point); }
+>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 35, 3))
+>start : Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 8))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>end : Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 24))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>s : Symbol(s, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 44))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>e : Symbol(e, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 55))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+
+var l: X.Y.Z.Line;
+>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 35, 3))
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1))
+>Y : Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10))
+>Z : Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20))
+>Line : Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23))
+
diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types
index d75f723068f..5795beda4a9 100644
--- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types
+++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types
@@ -1,112 +1,112 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts ===
module A {
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>A : any
export interface Point {
->Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 1, 28))
+>x : number
y: number;
->y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 2, 18))
+>y : number
toCarth(): Point;
->toCarth : () => Point, Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 3, 18))
->Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>toCarth : () => Point
+>Point : Point
}
}
module A {
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
+>A : any
export interface Point {
->Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>Point : Point
fromCarth(): Point;
->fromCarth : () => Point, Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 9, 28))
->Point : Point, Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>fromCarth : () => Point
+>Point : Point
}
}
// ensure merges as expected
var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; };
->p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 3))
->x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 8))
->y : number, Symbol(y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 19))
->toCarth : () => A.Point, Symbol(toCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 30))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
->fromCarth : () => A.Point, Symbol(fromCarth, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 50))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }
+>x : number
+>y : number
+>toCarth : () => A.Point
+>A : any
+>Point : A.Point
+>fromCarth : () => A.Point
+>A : any
+>Point : A.Point
var p: A.Point;
->p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }, Symbol(p, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 15, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 3))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }
+>A : any
+>Point : A.Point
module X.Y.Z {
->X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1))
->Y : any, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10))
->Z : any, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20))
+>X : any
+>Y : any
+>Z : any
export interface Line {
->Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23))
+>Line : Line
new (start: A.Point, end: A.Point);
->start : A.Point, Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 20, 13))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
->end : A.Point, Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 20, 28))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>start : A.Point
+>A : any
+>Point : A.Point
+>end : A.Point
+>A : any
+>Point : A.Point
}
}
module X {
->X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1))
+>X : any
export module Y.Z {
->Y : any, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10))
->Z : any, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20))
+>Y : any
+>Z : any
export interface Line {
->Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23))
+>Line : Line
start: A.Point;
->start : A.Point, Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 26, 31))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>start : A.Point
+>A : any
+>Point : A.Point
end: A.Point;
->end : A.Point, Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 27, 27))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>end : A.Point
+>A : any
+>Point : A.Point
}
}
}
// ensure merges as expected
var l: { start: A.Point; end: A.Point; new (s: A.Point, e: A.Point); }
->l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 35, 3))
->start : A.Point, Symbol(start, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 8))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
->end : A.Point, Symbol(end, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 24))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
->s : A.Point, Symbol(s, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 44))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
->e : A.Point, Symbol(e, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 55))
->A : any, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 6, 1))
->Point : A.Point, Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 0, 10), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 8, 10))
+>l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; }
+>start : A.Point
+>A : any
+>Point : A.Point
+>end : A.Point
+>A : any
+>Point : A.Point
+>s : A.Point
+>A : any
+>Point : A.Point
+>e : A.Point
+>A : any
+>Point : A.Point
var l: X.Y.Z.Line;
->l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 34, 3), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 35, 3))
->X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 16, 15), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 22, 1))
->Y : any, Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 9), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 24, 10))
->Z : any, Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 11), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 20))
->Line : X.Y.Z.Line, Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 18, 14), Decl(TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts, 25, 23))
+>l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; }
+>X : any
+>Y : any
+>Z : any
+>Line : X.Y.Z.Line
diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.symbols b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.symbols
new file mode 100644
index 00000000000..e8187771695
--- /dev/null
+++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.symbols
@@ -0,0 +1,76 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts ===
+module A.B {
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1))
+>B : Symbol(B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9))
+
+ export var x: number;
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14))
+}
+
+module A{
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1))
+
+ module B {
+>B : Symbol(B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 4, 9))
+
+ export var x: string;
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 6, 18))
+ }
+}
+
+// ensure the right var decl is exported
+var x: number;
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 11, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 3))
+
+var x = A.B.x;
+>x : Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 11, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 3))
+>A.B.x : Symbol(A.B.x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14))
+>A.B : Symbol(A.B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9))
+>A : Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1))
+>B : Symbol(A.B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9))
+>x : Symbol(A.B.x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14))
+
+module X.Y.Z {
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1))
+>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10))
+>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 11))
+
+ export class Line {
+>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 14))
+
+ length: number;
+>length : Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 15, 23))
+ }
+}
+
+module X {
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1))
+
+ export module Y {
+>Y : Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10))
+
+ module Z {
+>Z : Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 21, 21))
+
+ export class Line {
+>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 22, 18))
+
+ name: string;
+>name : Symbol(name, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 23, 31))
+ }
+ }
+ }
+}
+
+// make sure merging works as expected
+var l: { length: number };
+>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 32, 3))
+>length : Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 8))
+
+var l: X.Y.Z.Line;
+>l : Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 32, 3))
+>X : Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1))
+>Y : Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10))
+>Z : Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 11))
+>Line : Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 14))
+
diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types
index 33b28ffbacd..a19e0839901 100644
--- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types
+++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types
@@ -1,62 +1,62 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts ===
module A.B {
->A : typeof A, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1))
->B : typeof B, Symbol(B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9))
+>A : typeof A
+>B : typeof B
export var x: number;
->x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14))
+>x : number
}
module A{
->A : typeof A, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1))
+>A : typeof A
module B {
->B : typeof B, Symbol(B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 4, 9))
+>B : typeof B
export var x: string;
->x : string, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 6, 18))
+>x : string
}
}
// ensure the right var decl is exported
var x: number;
->x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 11, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 3))
+>x : number
var x = A.B.x;
->x : number, Symbol(x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 11, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 3))
->A.B.x : number, Symbol(A.B.x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14))
->A.B : typeof A.B, Symbol(A.B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9))
->A : typeof A, Symbol(A, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 0), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 2, 1))
->B : typeof A.B, Symbol(A.B, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 0, 9))
->x : number, Symbol(A.B.x, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 1, 14))
+>x : number
+>A.B.x : number
+>A.B : typeof A.B
+>A : typeof A
+>B : typeof A.B
+>x : number
module X.Y.Z {
->X : typeof X, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1))
->Y : typeof Y, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10))
->Z : typeof Z, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 11))
+>X : typeof X
+>Y : typeof Y
+>Z : typeof Z
export class Line {
->Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 14))
+>Line : Line
length: number;
->length : number, Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 15, 23))
+>length : number
}
}
module X {
->X : typeof X, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1))
+>X : typeof X
export module Y {
->Y : typeof Y, Symbol(Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10))
+>Y : typeof Y
module Z {
->Z : typeof Z, Symbol(Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 21, 21))
+>Z : typeof Z
export class Line {
->Line : Line, Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 22, 18))
+>Line : Line
name: string;
->name : string, Symbol(name, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 23, 31))
+>name : string
}
}
}
@@ -64,13 +64,13 @@ module X {
// make sure merging works as expected
var l: { length: number };
->l : { length: number; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 32, 3))
->length : number, Symbol(length, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 8))
+>l : { length: number; }
+>length : number
var l: X.Y.Z.Line;
->l : { length: number; }, Symbol(l, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 31, 3), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 32, 3))
->X : any, Symbol(X, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 12, 14), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 18, 1))
->Y : any, Symbol(X.Y, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 9), Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 20, 10))
->Z : any, Symbol(X.Y.Z, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 11))
->Line : X.Y.Z.Line, Symbol(X.Y.Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts, 14, 14))
+>l : { length: number; }
+>X : any
+>Y : any
+>Z : any
+>Line : X.Y.Z.Line
diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.symbols b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.symbols
new file mode 100644
index 00000000000..5c533273fa6
--- /dev/null
+++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.symbols
@@ -0,0 +1,76 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
+module Root {
+>Root : Symbol(Root, Decl(part1.ts, 0, 0))
+
+ export module A {
+>A : Symbol(A, Decl(part1.ts, 0, 13))
+
+ export interface Point {
+>Point : Symbol(Point, Decl(part1.ts, 1, 21))
+
+ x: number;
+>x : Symbol(x, Decl(part1.ts, 2, 32))
+
+ y: number;
+>y : Symbol(y, Decl(part1.ts, 3, 22))
+ }
+
+ export module Utils {
+>Utils : Symbol(Utils, Decl(part1.ts, 5, 9))
+
+ export function mirror(p: T) {
+>mirror : Symbol(mirror, Decl(part1.ts, 7, 29))
+>T : Symbol(T, Decl(part1.ts, 8, 35))
+>Point : Symbol(Point, Decl(part1.ts, 1, 21))
+>p : Symbol(p, Decl(part1.ts, 8, 52))
+>T : Symbol(T, Decl(part1.ts, 8, 35))
+
+ return { x: p.y, y: p.x };
+>x : Symbol(x, Decl(part1.ts, 9, 24))
+>p.y : Symbol(Point.y, Decl(part1.ts, 3, 22))
+>p : Symbol(p, Decl(part1.ts, 8, 52))
+>y : Symbol(Point.y, Decl(part1.ts, 3, 22))
+>y : Symbol(y, Decl(part1.ts, 9, 32))
+>p.x : Symbol(Point.x, Decl(part1.ts, 2, 32))
+>p : Symbol(p, Decl(part1.ts, 8, 52))
+>x : Symbol(Point.x, Decl(part1.ts, 2, 32))
+ }
+ }
+ }
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
+module otherRoot {
+>otherRoot : Symbol(otherRoot, Decl(part2.ts, 0, 0))
+
+ export module A {
+>A : Symbol(A, Decl(part2.ts, 0, 18))
+
+ // have to be fully qualified since in different root
+ export var Origin: Root.A.Point = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(part2.ts, 3, 18))
+>Root : Symbol(Root, Decl(part1.ts, 0, 0))
+>A : Symbol(Root.A, Decl(part1.ts, 0, 13))
+>Point : Symbol(Root.A.Point, Decl(part1.ts, 1, 21))
+>x : Symbol(x, Decl(part2.ts, 3, 43))
+>y : Symbol(y, Decl(part2.ts, 3, 49))
+
+ export module Utils {
+>Utils : Symbol(Utils, Decl(part2.ts, 3, 57))
+
+ export class Plane {
+>Plane : Symbol(Plane, Decl(part2.ts, 5, 29))
+
+ constructor(public tl: Root.A.Point, public br: Root.A.Point) { }
+>tl : Symbol(tl, Decl(part2.ts, 7, 28))
+>Root : Symbol(Root, Decl(part1.ts, 0, 0))
+>A : Symbol(Root.A, Decl(part1.ts, 0, 13))
+>Point : Symbol(Root.A.Point, Decl(part1.ts, 1, 21))
+>br : Symbol(br, Decl(part2.ts, 7, 52))
+>Root : Symbol(Root, Decl(part1.ts, 0, 0))
+>A : Symbol(Root.A, Decl(part1.ts, 0, 13))
+>Point : Symbol(Root.A.Point, Decl(part1.ts, 1, 21))
+ }
+ }
+ }
+}
diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types
index 53f0982a91c..e005522ddfc 100644
--- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types
+++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types
@@ -1,40 +1,40 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
module Root {
->Root : typeof Root, Symbol(Root, Decl(part1.ts, 0, 0))
+>Root : typeof Root
export module A {
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 13))
+>A : typeof A
export interface Point {
->Point : Point, Symbol(Point, Decl(part1.ts, 1, 21))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(part1.ts, 2, 32))
+>x : number
y: number;
->y : number, Symbol(y, Decl(part1.ts, 3, 22))
+>y : number
}
export module Utils {
->Utils : typeof Utils, Symbol(Utils, Decl(part1.ts, 5, 9))
+>Utils : typeof Utils
export function mirror(p: T) {
->mirror : (p: T) => { x: number; y: number; }, Symbol(mirror, Decl(part1.ts, 7, 29))
->T : T, Symbol(T, Decl(part1.ts, 8, 35))
->Point : Point, Symbol(Point, Decl(part1.ts, 1, 21))
->p : T, Symbol(p, Decl(part1.ts, 8, 52))
->T : T, Symbol(T, Decl(part1.ts, 8, 35))
+>mirror : (p: T) => { x: number; y: number; }
+>T : T
+>Point : Point
+>p : T
+>T : T
return { x: p.y, y: p.x };
>{ x: p.y, y: p.x } : { x: number; y: number; }
->x : number, Symbol(x, Decl(part1.ts, 9, 24))
->p.y : number, Symbol(Point.y, Decl(part1.ts, 3, 22))
->p : T, Symbol(p, Decl(part1.ts, 8, 52))
->y : number, Symbol(Point.y, Decl(part1.ts, 3, 22))
->y : number, Symbol(y, Decl(part1.ts, 9, 32))
->p.x : number, Symbol(Point.x, Decl(part1.ts, 2, 32))
->p : T, Symbol(p, Decl(part1.ts, 8, 52))
->x : number, Symbol(Point.x, Decl(part1.ts, 2, 32))
+>x : number
+>p.y : number
+>p : T
+>y : number
+>y : number
+>p.x : number
+>p : T
+>x : number
}
}
}
@@ -42,38 +42,38 @@ module Root {
=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
module otherRoot {
->otherRoot : typeof otherRoot, Symbol(otherRoot, Decl(part2.ts, 0, 0))
+>otherRoot : typeof otherRoot
export module A {
->A : typeof A, Symbol(A, Decl(part2.ts, 0, 18))
+>A : typeof A
// have to be fully qualified since in different root
export var Origin: Root.A.Point = { x: 0, y: 0 };
->Origin : Root.A.Point, Symbol(Origin, Decl(part2.ts, 3, 18))
->Root : any, Symbol(Root, Decl(part1.ts, 0, 0))
->A : any, Symbol(Root.A, Decl(part1.ts, 0, 13))
->Point : Root.A.Point, Symbol(Root.A.Point, Decl(part1.ts, 1, 21))
+>Origin : Root.A.Point
+>Root : any
+>A : any
+>Point : Root.A.Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(part2.ts, 3, 43))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(part2.ts, 3, 49))
+>y : number
>0 : number
export module Utils {
->Utils : typeof Utils, Symbol(Utils, Decl(part2.ts, 3, 57))
+>Utils : typeof Utils
export class Plane {
->Plane : Plane, Symbol(Plane, Decl(part2.ts, 5, 29))
+>Plane : Plane
constructor(public tl: Root.A.Point, public br: Root.A.Point) { }
->tl : Root.A.Point, Symbol(tl, Decl(part2.ts, 7, 28))
->Root : any, Symbol(Root, Decl(part1.ts, 0, 0))
->A : any, Symbol(Root.A, Decl(part1.ts, 0, 13))
->Point : Root.A.Point, Symbol(Root.A.Point, Decl(part1.ts, 1, 21))
->br : Root.A.Point, Symbol(br, Decl(part2.ts, 7, 52))
->Root : any, Symbol(Root, Decl(part1.ts, 0, 0))
->A : any, Symbol(Root.A, Decl(part1.ts, 0, 13))
->Point : Root.A.Point, Symbol(Root.A.Point, Decl(part1.ts, 1, 21))
+>tl : Root.A.Point
+>Root : any
+>A : any
+>Point : Root.A.Point
+>br : Root.A.Point
+>Root : any
+>A : any
+>Point : Root.A.Point
}
}
}
diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.symbols b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.symbols
new file mode 100644
index 00000000000..34abd4ecd65
--- /dev/null
+++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.symbols
@@ -0,0 +1,117 @@
+=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
+module A {
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+
+ export interface Point {
+>Point : Symbol(Point, Decl(part1.ts, 0, 10))
+
+ x: number;
+>x : Symbol(x, Decl(part1.ts, 1, 28))
+
+ y: number;
+>y : Symbol(y, Decl(part1.ts, 2, 18))
+ }
+
+ export module Utils {
+>Utils : Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
+
+ export function mirror(p: T) {
+>mirror : Symbol(mirror, Decl(part1.ts, 6, 25))
+>T : Symbol(T, Decl(part1.ts, 7, 31))
+>Point : Symbol(Point, Decl(part1.ts, 0, 10))
+>p : Symbol(p, Decl(part1.ts, 7, 48))
+>T : Symbol(T, Decl(part1.ts, 7, 31))
+
+ return { x: p.y, y: p.x };
+>x : Symbol(x, Decl(part1.ts, 8, 20))
+>p.y : Symbol(Point.y, Decl(part1.ts, 2, 18))
+>p : Symbol(p, Decl(part1.ts, 7, 48))
+>y : Symbol(Point.y, Decl(part1.ts, 2, 18))
+>y : Symbol(y, Decl(part1.ts, 8, 28))
+>p.x : Symbol(Point.x, Decl(part1.ts, 1, 28))
+>p : Symbol(p, Decl(part1.ts, 7, 48))
+>x : Symbol(Point.x, Decl(part1.ts, 1, 28))
+ }
+ }
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
+module A {
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+
+ export var Origin: Point = { x: 0, y: 0 };
+>Origin : Symbol(Origin, Decl(part2.ts, 1, 14))
+>Point : Symbol(Point, Decl(part1.ts, 0, 10))
+>x : Symbol(x, Decl(part2.ts, 1, 32))
+>y : Symbol(y, Decl(part2.ts, 1, 38))
+
+ export module Utils {
+>Utils : Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
+
+ export class Plane {
+>Plane : Symbol(Plane, Decl(part2.ts, 3, 25))
+
+ constructor(public tl: Point, public br: Point) { }
+>tl : Symbol(tl, Decl(part2.ts, 5, 24))
+>Point : Symbol(Point, Decl(part1.ts, 0, 10))
+>br : Symbol(br, Decl(part2.ts, 5, 41))
+>Point : Symbol(Point, Decl(part1.ts, 0, 10))
+ }
+ }
+}
+
+=== tests/cases/conformance/internalModules/DeclarationMerging/part3.ts ===
+// test the merging actually worked
+
+var o: { x: number; y: number };
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>x : Symbol(x, Decl(part3.ts, 2, 8))
+>y : Symbol(y, Decl(part3.ts, 2, 19))
+
+var o: A.Point;
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(part1.ts, 0, 10))
+
+var o = A.Origin;
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>A.Origin : Symbol(A.Origin, Decl(part2.ts, 1, 14))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Origin : Symbol(A.Origin, Decl(part2.ts, 1, 14))
+
+var o = A.Utils.mirror(o);
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>A.Utils.mirror : Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
+>A.Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
+>mirror : Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+
+var p: { tl: A.Point; br: A.Point };
+>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
+>tl : Symbol(tl, Decl(part3.ts, 7, 8))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(part1.ts, 0, 10))
+>br : Symbol(br, Decl(part3.ts, 7, 21))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Point : Symbol(A.Point, Decl(part1.ts, 0, 10))
+
+var p: A.Utils.Plane;
+>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
+>Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25))
+
+var p = new A.Utils.Plane(o, { x: 1, y: 1 });
+>p : Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
+>A.Utils.Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25))
+>A.Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
+>A : Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>Utils : Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
+>Plane : Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25))
+>o : Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>x : Symbol(x, Decl(part3.ts, 9, 30))
+>y : Symbol(y, Decl(part3.ts, 9, 36))
+
+
diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types
index 09092db9829..e2dd1f400f4 100644
--- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types
+++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types
@@ -1,65 +1,65 @@
=== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts ===
module A {
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>A : typeof A
export interface Point {
->Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
+>Point : Point
x: number;
->x : number, Symbol(x, Decl(part1.ts, 1, 28))
+>x : number
y: number;
->y : number, Symbol(y, Decl(part1.ts, 2, 18))
+>y : number
}
export module Utils {
->Utils : typeof Utils, Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
+>Utils : typeof Utils
export function mirror(p: T) {
->mirror : (p: T) => { x: number; y: number; }, Symbol(mirror, Decl(part1.ts, 6, 25))
->T : T, Symbol(T, Decl(part1.ts, 7, 31))
->Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
->p : T, Symbol(p, Decl(part1.ts, 7, 48))
->T : T, Symbol(T, Decl(part1.ts, 7, 31))
+>mirror : (p: T) => { x: number; y: number; }
+>T : T
+>Point : Point
+>p : T
+>T : T
return { x: p.y, y: p.x };
>{ x: p.y, y: p.x } : { x: number; y: number; }
->x : number, Symbol(x, Decl(part1.ts, 8, 20))
->p.y : number, Symbol(Point.y, Decl(part1.ts, 2, 18))
->p : T, Symbol(p, Decl(part1.ts, 7, 48))
->y : number, Symbol(Point.y, Decl(part1.ts, 2, 18))
->y : number, Symbol(y, Decl(part1.ts, 8, 28))
->p.x : number, Symbol(Point.x, Decl(part1.ts, 1, 28))
->p : T, Symbol(p, Decl(part1.ts, 7, 48))
->x : number, Symbol(Point.x, Decl(part1.ts, 1, 28))
+>x : number
+>p.y : number
+>p : T
+>y : number
+>y : number
+>p.x : number
+>p : T
+>x : number
}
}
}
=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
module A {
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
+>A : typeof A
export var Origin: Point = { x: 0, y: 0 };
->Origin : Point, Symbol(Origin, Decl(part2.ts, 1, 14))
->Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
+>Origin : Point
+>Point : Point
>{ x: 0, y: 0 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(part2.ts, 1, 32))
+>x : number
>0 : number
->y : number, Symbol(y, Decl(part2.ts, 1, 38))
+>y : number
>0 : number
export module Utils {
->Utils : typeof Utils, Symbol(Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
+>Utils : typeof Utils
export class Plane {
->Plane : Plane, Symbol(Plane, Decl(part2.ts, 3, 25))
+>Plane : Plane
constructor(public tl: Point, public br: Point) { }
->tl : Point, Symbol(tl, Decl(part2.ts, 5, 24))
->Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
->br : Point, Symbol(br, Decl(part2.ts, 5, 41))
->Point : Point, Symbol(Point, Decl(part1.ts, 0, 10))
+>tl : Point
+>Point : Point
+>br : Point
+>Point : Point
}
}
}
@@ -68,59 +68,59 @@ module A {
// test the merging actually worked
var o: { x: number; y: number };
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
->x : number, Symbol(x, Decl(part3.ts, 2, 8))
->y : number, Symbol(y, Decl(part3.ts, 2, 19))
+>o : { x: number; y: number; }
+>x : number
+>y : number
var o: A.Point;
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
->A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
+>o : { x: number; y: number; }
+>A : any
+>Point : A.Point
var o = A.Origin;
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
->A.Origin : A.Point, Symbol(A.Origin, Decl(part2.ts, 1, 14))
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Origin : A.Point, Symbol(A.Origin, Decl(part2.ts, 1, 14))
+>o : { x: number; y: number; }
+>A.Origin : A.Point
+>A : typeof A
+>Origin : A.Point
var o = A.Utils.mirror(o);
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>o : { x: number; y: number; }
>A.Utils.mirror(o) : { x: number; y: number; }
->A.Utils.mirror : (p: T) => { x: number; y: number; }, Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
->A.Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
->mirror : (p: T) => { x: number; y: number; }, Symbol(A.Utils.mirror, Decl(part1.ts, 6, 25))
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>A.Utils.mirror : (p: T) => { x: number; y: number; }
+>A.Utils : typeof A.Utils
+>A : typeof A
+>Utils : typeof A.Utils
+>mirror : (p: T) => { x: number; y: number; }
+>o : { x: number; y: number; }
var p: { tl: A.Point; br: A.Point };
->p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
->tl : A.Point, Symbol(tl, Decl(part3.ts, 7, 8))
->A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
->br : A.Point, Symbol(br, Decl(part3.ts, 7, 21))
->A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Point : A.Point, Symbol(A.Point, Decl(part1.ts, 0, 10))
+>p : { tl: A.Point; br: A.Point; }
+>tl : A.Point
+>A : any
+>Point : A.Point
+>br : A.Point
+>A : any
+>Point : A.Point
var p: A.Utils.Plane;
->p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
->A : any, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Utils : any, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
->Plane : A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25))
+>p : { tl: A.Point; br: A.Point; }
+>A : any
+>Utils : any
+>Plane : A.Utils.Plane
var p = new A.Utils.Plane(o, { x: 1, y: 1 });
->p : { tl: A.Point; br: A.Point; }, Symbol(p, Decl(part3.ts, 7, 3), Decl(part3.ts, 8, 3), Decl(part3.ts, 9, 3))
+>p : { tl: A.Point; br: A.Point; }
>new A.Utils.Plane(o, { x: 1, y: 1 }) : A.Utils.Plane
->A.Utils.Plane : typeof A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25))
->A.Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
->A : typeof A, Symbol(A, Decl(part1.ts, 0, 0), Decl(part2.ts, 0, 0))
->Utils : typeof A.Utils, Symbol(A.Utils, Decl(part1.ts, 4, 5), Decl(part2.ts, 1, 46))
->Plane : typeof A.Utils.Plane, Symbol(A.Utils.Plane, Decl(part2.ts, 3, 25))
->o : { x: number; y: number; }, Symbol(o, Decl(part3.ts, 2, 3), Decl(part3.ts, 3, 3), Decl(part3.ts, 4, 3), Decl(part3.ts, 5, 3))
+>A.Utils.Plane : typeof A.Utils.Plane
+>A.Utils : typeof A.Utils
+>A : typeof A
+>Utils : typeof A.Utils
+>Plane : typeof A.Utils.Plane
+>o : { x: number; y: number; }
>{ x: 1, y: 1 } : { x: number; y: number; }
->x : number, Symbol(x, Decl(part3.ts, 9, 30))
+>x : number
>1 : number
->y : number, Symbol(y, Decl(part3.ts, 9, 36))
+>y : number
>1 : number
diff --git a/tests/baselines/reference/TypeGuardWithArrayUnion.symbols b/tests/baselines/reference/TypeGuardWithArrayUnion.symbols
new file mode 100644
index 00000000000..57bcdf70e79
--- /dev/null
+++ b/tests/baselines/reference/TypeGuardWithArrayUnion.symbols
@@ -0,0 +1,25 @@
+=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithArrayUnion.ts ===
+class Message {
+>Message : Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
+
+ value: string;
+>value : Symbol(value, Decl(TypeGuardWithArrayUnion.ts, 0, 15))
+}
+
+function saySize(message: Message | Message[]) {
+>saySize : Symbol(saySize, Decl(TypeGuardWithArrayUnion.ts, 2, 1))
+>message : Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
+>Message : Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
+>Message : Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
+
+ if (message instanceof Array) {
+>message : Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
+>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
+
+ return message.length; // Should have type Message[] here
+>message.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
+>message : Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
+>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
+ }
+}
+
diff --git a/tests/baselines/reference/TypeGuardWithArrayUnion.types b/tests/baselines/reference/TypeGuardWithArrayUnion.types
index 8a81a762fd7..557e305ef74 100644
--- a/tests/baselines/reference/TypeGuardWithArrayUnion.types
+++ b/tests/baselines/reference/TypeGuardWithArrayUnion.types
@@ -1,26 +1,26 @@
=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithArrayUnion.ts ===
class Message {
->Message : Message, Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
+>Message : Message
value: string;
->value : string, Symbol(value, Decl(TypeGuardWithArrayUnion.ts, 0, 15))
+>value : string
}
function saySize(message: Message | Message[]) {
->saySize : (message: Message | Message[]) => number, Symbol(saySize, Decl(TypeGuardWithArrayUnion.ts, 2, 1))
->message : Message | Message[], Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
->Message : Message, Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
->Message : Message, Symbol(Message, Decl(TypeGuardWithArrayUnion.ts, 0, 0))
+>saySize : (message: Message | Message[]) => number
+>message : Message | Message[]
+>Message : Message
+>Message : Message
if (message instanceof Array) {
>message instanceof Array : boolean
->message : Message | Message[], Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
->Array : ArrayConstructor, Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11))
+>message : Message | Message[]
+>Array : ArrayConstructor
return message.length; // Should have type Message[] here
->message.length : number, Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
->message : Message[], Symbol(message, Decl(TypeGuardWithArrayUnion.ts, 4, 17))
->length : number, Symbol(Array.length, Decl(lib.d.ts, 1007, 20))
+>message.length : number
+>message : Message[]
+>length : number
}
}
diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.symbols b/tests/baselines/reference/TypeGuardWithEnumUnion.symbols
new file mode 100644
index 00000000000..92b83f3c56d
--- /dev/null
+++ b/tests/baselines/reference/TypeGuardWithEnumUnion.symbols
@@ -0,0 +1,88 @@
+=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts ===
+enum Color { R, G, B }
+>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+>R : Symbol(Color.R, Decl(TypeGuardWithEnumUnion.ts, 0, 12))
+>G : Symbol(Color.G, Decl(TypeGuardWithEnumUnion.ts, 0, 15))
+>B : Symbol(Color.B, Decl(TypeGuardWithEnumUnion.ts, 0, 18))
+
+function f1(x: Color | string) {
+>f1 : Symbol(f1, Decl(TypeGuardWithEnumUnion.ts, 0, 22))
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
+>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+
+ if (typeof x === "number") {
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
+
+ var y = x;
+>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
+
+ var y: Color;
+>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
+>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+ }
+ else {
+ var z = x;
+>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
+
+ var z: string;
+>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
+ }
+}
+
+function f2(x: Color | string | string[]) {
+>f2 : Symbol(f2, Decl(TypeGuardWithEnumUnion.ts, 11, 1))
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+
+ if (typeof x === "object") {
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+
+ var y = x;
+>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+
+ var y: string[];
+>y : Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
+ }
+ if (typeof x === "number") {
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+
+ var z = x;
+>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+
+ var z: Color;
+>z : Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
+>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+ }
+ else {
+ var w = x;
+>w : Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+
+ var w: string | string[];
+>w : Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
+ }
+ if (typeof x === "string") {
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+
+ var a = x;
+>a : Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+
+ var a: string;
+>a : Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
+ }
+ else {
+ var b = x;
+>b : Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
+>x : Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+
+ var b: Color | string[];
+>b : Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
+>Color : Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+ }
+}
+
diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.types b/tests/baselines/reference/TypeGuardWithEnumUnion.types
index 293b4c431c7..16d999e46f2 100644
--- a/tests/baselines/reference/TypeGuardWithEnumUnion.types
+++ b/tests/baselines/reference/TypeGuardWithEnumUnion.types
@@ -1,100 +1,100 @@
=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts ===
enum Color { R, G, B }
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
->R : Color, Symbol(Color.R, Decl(TypeGuardWithEnumUnion.ts, 0, 12))
->G : Color, Symbol(Color.G, Decl(TypeGuardWithEnumUnion.ts, 0, 15))
->B : Color, Symbol(Color.B, Decl(TypeGuardWithEnumUnion.ts, 0, 18))
+>Color : Color
+>R : Color
+>G : Color
+>B : Color
function f1(x: Color | string) {
->f1 : (x: string | Color) => void, Symbol(f1, Decl(TypeGuardWithEnumUnion.ts, 0, 22))
->x : string | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+>f1 : (x: string | Color) => void
+>x : string | Color
+>Color : Color
if (typeof x === "number") {
>typeof x === "number" : boolean
>typeof x : string
->x : string | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
+>x : string | Color
>"number" : string
var y = x;
->y : Color, Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
->x : Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
+>y : Color
+>x : Color
var y: Color;
->y : Color, Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+>y : Color
+>Color : Color
}
else {
var z = x;
->z : string, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
->x : string, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
+>z : string
+>x : string
var z: string;
->z : string, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
+>z : string
}
}
function f2(x: Color | string | string[]) {
->f2 : (x: string | string[] | Color) => void, Symbol(f2, Decl(TypeGuardWithEnumUnion.ts, 11, 1))
->x : string | string[] | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+>f2 : (x: string | string[] | Color) => void
+>x : string | string[] | Color
+>Color : Color
if (typeof x === "object") {
>typeof x === "object" : boolean
>typeof x : string
->x : string | string[] | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+>x : string | string[] | Color
>"object" : string
var y = x;
->y : string[], Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
->x : string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+>y : string[]
+>x : string[]
var y: string[];
->y : string[], Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
+>y : string[]
}
if (typeof x === "number") {
>typeof x === "number" : boolean
>typeof x : string
->x : string | string[] | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+>x : string | string[] | Color
>"number" : string
var z = x;
->z : Color, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
->x : Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+>z : Color
+>x : Color
var z: Color;
->z : Color, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+>z : Color
+>Color : Color
}
else {
var w = x;
->w : string | string[], Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
->x : string | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+>w : string | string[]
+>x : string | string[]
var w: string | string[];
->w : string | string[], Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
+>w : string | string[]
}
if (typeof x === "string") {
>typeof x === "string" : boolean
>typeof x : string
->x : string | string[] | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+>x : string | string[] | Color
>"string" : string
var a = x;
->a : string, Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
->x : string, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+>a : string
+>x : string
var a: string;
->a : string, Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
+>a : string
}
else {
var b = x;
->b : string[] | Color, Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
->x : string[] | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
+>b : string[] | Color
+>x : string[] | Color
var b: Color | string[];
->b : string[] | Color, Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
+>b : string[] | Color
+>Color : Color
}
}
diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.types.pull b/tests/baselines/reference/TypeGuardWithEnumUnion.types.pull
deleted file mode 100644
index d98eaa13192..00000000000
--- a/tests/baselines/reference/TypeGuardWithEnumUnion.types.pull
+++ /dev/null
@@ -1,100 +0,0 @@
-=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts ===
-enum Color { R, G, B }
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
->R : Color, Symbol(Color.R, Decl(TypeGuardWithEnumUnion.ts, 0, 12))
->G : Color, Symbol(Color.G, Decl(TypeGuardWithEnumUnion.ts, 0, 15))
->B : Color, Symbol(Color.B, Decl(TypeGuardWithEnumUnion.ts, 0, 18))
-
-function f1(x: Color | string) {
->f1 : (x: string | Color) => void, Symbol(f1, Decl(TypeGuardWithEnumUnion.ts, 0, 22))
->x : string | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
-
- if (typeof x === "number") {
->typeof x === "number" : boolean
->typeof x : string
->x : string | Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
->"number" : string
-
- var y = x;
->y : Color, Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
->x : Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
-
- var y: Color;
->y : Color, Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 4, 11), Decl(TypeGuardWithEnumUnion.ts, 5, 11))
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
- }
- else {
- var z = x;
->z : string, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
->x : string, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 2, 12))
-
- var z: string;
->z : string, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 8, 11), Decl(TypeGuardWithEnumUnion.ts, 9, 11))
- }
-}
-
-function f2(x: Color | string | string[]) {
->f2 : (x: string | Color | string[]) => void, Symbol(f2, Decl(TypeGuardWithEnumUnion.ts, 11, 1))
->x : string | Color | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
-
- if (typeof x === "object") {
->typeof x === "object" : boolean
->typeof x : string
->x : string | Color | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
->"object" : string
-
- var y = x;
->y : string[], Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
->x : string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
-
- var y: string[];
->y : string[], Symbol(y, Decl(TypeGuardWithEnumUnion.ts, 15, 11), Decl(TypeGuardWithEnumUnion.ts, 16, 11))
- }
- if (typeof x === "number") {
->typeof x === "number" : boolean
->typeof x : string
->x : string | Color | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
->"number" : string
-
- var z = x;
->z : Color, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
->x : Color, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
-
- var z: Color;
->z : Color, Symbol(z, Decl(TypeGuardWithEnumUnion.ts, 19, 11), Decl(TypeGuardWithEnumUnion.ts, 20, 11))
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
- }
- else {
- var w = x;
->w : string | string[], Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
->x : string | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
-
- var w: string | string[];
->w : string | string[], Symbol(w, Decl(TypeGuardWithEnumUnion.ts, 23, 11), Decl(TypeGuardWithEnumUnion.ts, 24, 11))
- }
- if (typeof x === "string") {
->typeof x === "string" : boolean
->typeof x : string
->x : string | Color | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
->"string" : string
-
- var a = x;
->a : string, Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
->x : string, Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
-
- var a: string;
->a : string, Symbol(a, Decl(TypeGuardWithEnumUnion.ts, 27, 11), Decl(TypeGuardWithEnumUnion.ts, 28, 11))
- }
- else {
- var b = x;
->b : Color | string[], Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
->x : Color | string[], Symbol(x, Decl(TypeGuardWithEnumUnion.ts, 13, 12))
-
- var b: Color | string[];
->b : Color | string[], Symbol(b, Decl(TypeGuardWithEnumUnion.ts, 31, 11), Decl(TypeGuardWithEnumUnion.ts, 32, 11))
->Color : Color, Symbol(Color, Decl(TypeGuardWithEnumUnion.ts, 0, 0))
- }
-}
-
diff --git a/tests/baselines/reference/VariableDeclaration10_es6.symbols b/tests/baselines/reference/VariableDeclaration10_es6.symbols
new file mode 100644
index 00000000000..ce37f77ed6d
--- /dev/null
+++ b/tests/baselines/reference/VariableDeclaration10_es6.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration10_es6.ts ===
+let a: number = 1
+>a : Symbol(a, Decl(VariableDeclaration10_es6.ts, 0, 3))
+
diff --git a/tests/baselines/reference/VariableDeclaration10_es6.types b/tests/baselines/reference/VariableDeclaration10_es6.types
index dc61a2a5431..717de7ed0ff 100644
--- a/tests/baselines/reference/VariableDeclaration10_es6.types
+++ b/tests/baselines/reference/VariableDeclaration10_es6.types
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration10_es6.ts ===
let a: number = 1
->a : number, Symbol(a, Decl(VariableDeclaration10_es6.ts, 0, 3))
+>a : number
>1 : number
diff --git a/tests/baselines/reference/VariableDeclaration3_es6.symbols b/tests/baselines/reference/VariableDeclaration3_es6.symbols
new file mode 100644
index 00000000000..431e15aa60e
--- /dev/null
+++ b/tests/baselines/reference/VariableDeclaration3_es6.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration3_es6.ts ===
+const a = 1
+>a : Symbol(a, Decl(VariableDeclaration3_es6.ts, 0, 5))
+
diff --git a/tests/baselines/reference/VariableDeclaration3_es6.types b/tests/baselines/reference/VariableDeclaration3_es6.types
index dd0bdfc8cc2..1b5bbdb4ea7 100644
--- a/tests/baselines/reference/VariableDeclaration3_es6.types
+++ b/tests/baselines/reference/VariableDeclaration3_es6.types
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration3_es6.ts ===
const a = 1
->a : number, Symbol(a, Decl(VariableDeclaration3_es6.ts, 0, 5))
+>a : number
>1 : number
diff --git a/tests/baselines/reference/VariableDeclaration5_es6.symbols b/tests/baselines/reference/VariableDeclaration5_es6.symbols
new file mode 100644
index 00000000000..e187f78e4d7
--- /dev/null
+++ b/tests/baselines/reference/VariableDeclaration5_es6.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration5_es6.ts ===
+const a: number = 1
+>a : Symbol(a, Decl(VariableDeclaration5_es6.ts, 0, 5))
+
diff --git a/tests/baselines/reference/VariableDeclaration5_es6.types b/tests/baselines/reference/VariableDeclaration5_es6.types
index d063fc53a12..0dce532be51 100644
--- a/tests/baselines/reference/VariableDeclaration5_es6.types
+++ b/tests/baselines/reference/VariableDeclaration5_es6.types
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration5_es6.ts ===
const a: number = 1
->a : number, Symbol(a, Decl(VariableDeclaration5_es6.ts, 0, 5))
+>a : number
>1 : number
diff --git a/tests/baselines/reference/VariableDeclaration7_es6.symbols b/tests/baselines/reference/VariableDeclaration7_es6.symbols
new file mode 100644
index 00000000000..033e10978a3
--- /dev/null
+++ b/tests/baselines/reference/VariableDeclaration7_es6.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration7_es6.ts ===
+let a
+>a : Symbol(a, Decl(VariableDeclaration7_es6.ts, 0, 3))
+
diff --git a/tests/baselines/reference/VariableDeclaration7_es6.types b/tests/baselines/reference/VariableDeclaration7_es6.types
index 00aabe32e65..321c1b07bbc 100644
--- a/tests/baselines/reference/VariableDeclaration7_es6.types
+++ b/tests/baselines/reference/VariableDeclaration7_es6.types
@@ -1,4 +1,4 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration7_es6.ts ===
let a
->a : any, Symbol(a, Decl(VariableDeclaration7_es6.ts, 0, 3))
+>a : any
diff --git a/tests/baselines/reference/VariableDeclaration8_es6.symbols b/tests/baselines/reference/VariableDeclaration8_es6.symbols
new file mode 100644
index 00000000000..9dcd7c4b260
--- /dev/null
+++ b/tests/baselines/reference/VariableDeclaration8_es6.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration8_es6.ts ===
+let a = 1
+>a : Symbol(a, Decl(VariableDeclaration8_es6.ts, 0, 3))
+
diff --git a/tests/baselines/reference/VariableDeclaration8_es6.types b/tests/baselines/reference/VariableDeclaration8_es6.types
index ce6bb6f9bb7..24a3cd85383 100644
--- a/tests/baselines/reference/VariableDeclaration8_es6.types
+++ b/tests/baselines/reference/VariableDeclaration8_es6.types
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration8_es6.ts ===
let a = 1
->a : number, Symbol(a, Decl(VariableDeclaration8_es6.ts, 0, 3))
+>a : number
>1 : number
diff --git a/tests/baselines/reference/VariableDeclaration9_es6.symbols b/tests/baselines/reference/VariableDeclaration9_es6.symbols
new file mode 100644
index 00000000000..a92d00f7fbd
--- /dev/null
+++ b/tests/baselines/reference/VariableDeclaration9_es6.symbols
@@ -0,0 +1,4 @@
+=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration9_es6.ts ===
+let a: number
+>a : Symbol(a, Decl(VariableDeclaration9_es6.ts, 0, 3))
+
diff --git a/tests/baselines/reference/VariableDeclaration9_es6.types b/tests/baselines/reference/VariableDeclaration9_es6.types
index e51fc72eece..6b29a04281b 100644
--- a/tests/baselines/reference/VariableDeclaration9_es6.types
+++ b/tests/baselines/reference/VariableDeclaration9_es6.types
@@ -1,4 +1,4 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration9_es6.ts ===
let a: number
->a : number, Symbol(a, Decl(VariableDeclaration9_es6.ts, 0, 3))
+>a : number
diff --git a/tests/baselines/reference/acceptableAlias1.symbols b/tests/baselines/reference/acceptableAlias1.symbols
new file mode 100644
index 00000000000..cffbc70290f
--- /dev/null
+++ b/tests/baselines/reference/acceptableAlias1.symbols
@@ -0,0 +1,17 @@
+=== tests/cases/compiler/acceptableAlias1.ts ===
+module M {
+>M : Symbol(M, Decl(acceptableAlias1.ts, 0, 0))
+
+ export module N {
+>N : Symbol(N, Decl(acceptableAlias1.ts, 0, 10))
+ }
+ export import X = N;
+>X : Symbol(X, Decl(acceptableAlias1.ts, 2, 5))
+>N : Symbol(N, Decl(acceptableAlias1.ts, 0, 10))
+}
+
+import r = M.X;
+>r : Symbol(r, Decl(acceptableAlias1.ts, 4, 1))
+>M : Symbol(M, Decl(acceptableAlias1.ts, 0, 0))
+>X : Symbol(r, Decl(acceptableAlias1.ts, 0, 10))
+
diff --git a/tests/baselines/reference/acceptableAlias1.types b/tests/baselines/reference/acceptableAlias1.types
index 7aae99a57b2..ccf766d8f2f 100644
--- a/tests/baselines/reference/acceptableAlias1.types
+++ b/tests/baselines/reference/acceptableAlias1.types
@@ -1,17 +1,17 @@
=== tests/cases/compiler/acceptableAlias1.ts ===
module M {
->M : typeof M, Symbol(M, Decl(acceptableAlias1.ts, 0, 0))
+>M : typeof M
export module N {
->N : any, Symbol(N, Decl(acceptableAlias1.ts, 0, 10))
+>N : any
}
export import X = N;
->X : any, Symbol(X, Decl(acceptableAlias1.ts, 2, 5))
->N : any, Symbol(N, Decl(acceptableAlias1.ts, 0, 10))
+>X : any
+>N : any
}
import r = M.X;
->r : any, Symbol(r, Decl(acceptableAlias1.ts, 4, 1))
->M : typeof M, Symbol(M, Decl(acceptableAlias1.ts, 0, 0))
->X : any, Symbol(r, Decl(acceptableAlias1.ts, 0, 10))
+>r : any
+>M : typeof M
+>X : any
diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.symbols b/tests/baselines/reference/accessOverriddenBaseClassMember1.symbols
new file mode 100644
index 00000000000..e5e19030afa
--- /dev/null
+++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.symbols
@@ -0,0 +1,47 @@
+=== tests/cases/compiler/accessOverriddenBaseClassMember1.ts ===
+class Point {
+>Point : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
+
+ constructor(public x: number, public y: number) { }
+>x : Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 1, 16))
+>y : Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 1, 33))
+
+ public toString() {
+>toString : Symbol(toString, Decl(accessOverriddenBaseClassMember1.ts, 1, 55))
+
+ return "x=" + this.x + " y=" + this.y;
+>this.x : Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 1, 16))
+>this : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
+>x : Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 1, 16))
+>this.y : Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 1, 33))
+>this : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
+>y : Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 1, 33))
+ }
+}
+class ColoredPoint extends Point {
+>ColoredPoint : Symbol(ColoredPoint, Decl(accessOverriddenBaseClassMember1.ts, 5, 1))
+>Point : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
+
+ constructor(x: number, y: number, public color: string) {
+>x : Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 7, 16))
+>y : Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 7, 26))
+>color : Symbol(color, Decl(accessOverriddenBaseClassMember1.ts, 7, 37))
+
+ super(x, y);
+>super : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
+>x : Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 7, 16))
+>y : Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 7, 26))
+ }
+ public toString() {
+>toString : Symbol(toString, Decl(accessOverriddenBaseClassMember1.ts, 9, 5))
+
+ return super.toString() + " color=" + this.color;
+>super.toString : Symbol(Point.toString, Decl(accessOverriddenBaseClassMember1.ts, 1, 55))
+>super : Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
+>toString : Symbol(Point.toString, Decl(accessOverriddenBaseClassMember1.ts, 1, 55))
+>this.color : Symbol(color, Decl(accessOverriddenBaseClassMember1.ts, 7, 37))
+>this : Symbol(ColoredPoint, Decl(accessOverriddenBaseClassMember1.ts, 5, 1))
+>color : Symbol(color, Decl(accessOverriddenBaseClassMember1.ts, 7, 37))
+ }
+}
+
diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.types b/tests/baselines/reference/accessOverriddenBaseClassMember1.types
index 4ba32e3ff65..2aeb541d723 100644
--- a/tests/baselines/reference/accessOverriddenBaseClassMember1.types
+++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.types
@@ -1,57 +1,57 @@
=== tests/cases/compiler/accessOverriddenBaseClassMember1.ts ===
class Point {
->Point : Point, Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
+>Point : Point
constructor(public x: number, public y: number) { }
->x : number, Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 1, 16))
->y : number, Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 1, 33))
+>x : number
+>y : number
public toString() {
->toString : () => string, Symbol(toString, Decl(accessOverriddenBaseClassMember1.ts, 1, 55))
+>toString : () => string
return "x=" + this.x + " y=" + this.y;
>"x=" + this.x + " y=" + this.y : string
>"x=" + this.x + " y=" : string
>"x=" + this.x : string
>"x=" : string
->this.x : number, Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 1, 16))
->this : Point, Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
->x : number, Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 1, 16))
+>this.x : number
+>this : Point
+>x : number
>" y=" : string
->this.y : number, Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 1, 33))
->this : Point, Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
->y : number, Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 1, 33))
+>this.y : number
+>this : Point
+>y : number
}
}
class ColoredPoint extends Point {
->ColoredPoint : ColoredPoint, Symbol(ColoredPoint, Decl(accessOverriddenBaseClassMember1.ts, 5, 1))
->Point : Point, Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
+>ColoredPoint : ColoredPoint
+>Point : Point
constructor(x: number, y: number, public color: string) {
->x : number, Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 7, 16))
->y : number, Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 7, 26))
->color : string, Symbol(color, Decl(accessOverriddenBaseClassMember1.ts, 7, 37))
+>x : number
+>y : number
+>color : string
super(x, y);
>super(x, y) : void
->super : typeof Point, Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
->x : number, Symbol(x, Decl(accessOverriddenBaseClassMember1.ts, 7, 16))
->y : number, Symbol(y, Decl(accessOverriddenBaseClassMember1.ts, 7, 26))
+>super : typeof Point
+>x : number
+>y : number
}
public toString() {
->toString : () => string, Symbol(toString, Decl(accessOverriddenBaseClassMember1.ts, 9, 5))
+>toString : () => string
return super.toString() + " color=" + this.color;
>super.toString() + " color=" + this.color : string
>super.toString() + " color=" : string
>super.toString() : string
->super.toString : () => string, Symbol(Point.toString, Decl(accessOverriddenBaseClassMember1.ts, 1, 55))
->super : Point, Symbol(Point, Decl(accessOverriddenBaseClassMember1.ts, 0, 0))
->toString : () => string, Symbol(Point.toString, Decl(accessOverriddenBaseClassMember1.ts, 1, 55))
+>super.toString : () => string
+>super : Point
+>toString : () => string
>" color=" : string
->this.color : string, Symbol(color, Decl(accessOverriddenBaseClassMember1.ts, 7, 37))
->this : ColoredPoint, Symbol(ColoredPoint, Decl(accessOverriddenBaseClassMember1.ts, 5, 1))
->color : string, Symbol(color, Decl(accessOverriddenBaseClassMember1.ts, 7, 37))
+>this.color : string
+>this : ColoredPoint
+>color : string
}
}
diff --git a/tests/baselines/reference/accessorWithES5.symbols b/tests/baselines/reference/accessorWithES5.symbols
new file mode 100644
index 00000000000..dccbd8180bb
--- /dev/null
+++ b/tests/baselines/reference/accessorWithES5.symbols
@@ -0,0 +1,35 @@
+=== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES5.ts ===
+
+class C {
+>C : Symbol(C, Decl(accessorWithES5.ts, 0, 0))
+
+ get x() {
+>x : Symbol(x, Decl(accessorWithES5.ts, 1, 9))
+
+ return 1;
+ }
+}
+
+class D {
+>D : Symbol(D, Decl(accessorWithES5.ts, 5, 1))
+
+ set x(v) {
+>x : Symbol(x, Decl(accessorWithES5.ts, 7, 9))
+>v : Symbol(v, Decl(accessorWithES5.ts, 8, 10))
+ }
+}
+
+var x = {
+>x : Symbol(x, Decl(accessorWithES5.ts, 12, 3))
+
+ get a() { return 1 }
+>a : Symbol(a, Decl(accessorWithES5.ts, 12, 9))
+}
+
+var y = {
+>y : Symbol(y, Decl(accessorWithES5.ts, 16, 3))
+
+ set b(v) { }
+>b : Symbol(b, Decl(accessorWithES5.ts, 16, 9))
+>v : Symbol(v, Decl(accessorWithES5.ts, 17, 10))
+}
diff --git a/tests/baselines/reference/accessorWithES5.types b/tests/baselines/reference/accessorWithES5.types
index 9bbfadce48c..cb54e92b184 100644
--- a/tests/baselines/reference/accessorWithES5.types
+++ b/tests/baselines/reference/accessorWithES5.types
@@ -1,10 +1,10 @@
=== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES5.ts ===
class C {
->C : C, Symbol(C, Decl(accessorWithES5.ts, 0, 0))
+>C : C
get x() {
->x : number, Symbol(x, Decl(accessorWithES5.ts, 1, 9))
+>x : number
return 1;
>1 : number
@@ -12,28 +12,28 @@ class C {
}
class D {
->D : D, Symbol(D, Decl(accessorWithES5.ts, 5, 1))
+>D : D
set x(v) {
->x : any, Symbol(x, Decl(accessorWithES5.ts, 7, 9))
->v : any, Symbol(v, Decl(accessorWithES5.ts, 8, 10))
+>x : any
+>v : any
}
}
var x = {
->x : { a: number; }, Symbol(x, Decl(accessorWithES5.ts, 12, 3))
+>x : { a: number; }
>{ get a() { return 1 }} : { a: number; }
get a() { return 1 }
->a : number, Symbol(a, Decl(accessorWithES5.ts, 12, 9))
+>a : number
>1 : number
}
var y = {
->y : { b: any; }, Symbol(y, Decl(accessorWithES5.ts, 16, 3))
+>y : { b: any; }
>{ set b(v) { }} : { b: any; }
set b(v) { }
->b : any, Symbol(b, Decl(accessorWithES5.ts, 16, 9))
->v : any, Symbol(v, Decl(accessorWithES5.ts, 17, 10))
+>b : any
+>v : any
}
diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.symbols b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.symbols
new file mode 100644
index 00000000000..339f419f5cc
--- /dev/null
+++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.symbols
@@ -0,0 +1,23 @@
+=== tests/cases/compiler/addMoreCallSignaturesToBaseSignature.ts ===
+interface Foo {
+>Foo : Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature.ts, 0, 0))
+
+ (): string;
+}
+
+interface Bar extends Foo {
+>Bar : Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature.ts, 2, 1))
+>Foo : Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature.ts, 0, 0))
+
+ (key: string): string;
+>key : Symbol(key, Decl(addMoreCallSignaturesToBaseSignature.ts, 5, 5))
+}
+
+var a: Bar;
+>a : Symbol(a, Decl(addMoreCallSignaturesToBaseSignature.ts, 8, 3))
+>Bar : Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature.ts, 2, 1))
+
+var kitty = a();
+>kitty : Symbol(kitty, Decl(addMoreCallSignaturesToBaseSignature.ts, 9, 3))
+>a : Symbol(a, Decl(addMoreCallSignaturesToBaseSignature.ts, 8, 3))
+
diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.types b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.types
index da8dcb4d0be..212186ace77 100644
--- a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.types
+++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.types
@@ -1,24 +1,24 @@
=== tests/cases/compiler/addMoreCallSignaturesToBaseSignature.ts ===
interface Foo {
->Foo : Foo, Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature.ts, 0, 0))
+>Foo : Foo
(): string;
}
interface Bar extends Foo {
->Bar : Bar, Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature.ts, 2, 1))
->Foo : Foo, Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature.ts, 0, 0))
+>Bar : Bar
+>Foo : Foo
(key: string): string;
->key : string, Symbol(key, Decl(addMoreCallSignaturesToBaseSignature.ts, 5, 5))
+>key : string
}
var a: Bar;
->a : Bar, Symbol(a, Decl(addMoreCallSignaturesToBaseSignature.ts, 8, 3))
->Bar : Bar, Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature.ts, 2, 1))
+>a : Bar
+>Bar : Bar
var kitty = a();
->kitty : string, Symbol(kitty, Decl(addMoreCallSignaturesToBaseSignature.ts, 9, 3))
+>kitty : string
>a() : string
->a : Bar, Symbol(a, Decl(addMoreCallSignaturesToBaseSignature.ts, 8, 3))
+>a : Bar
diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.symbols b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.symbols
new file mode 100644
index 00000000000..e8185780dcf
--- /dev/null
+++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.symbols
@@ -0,0 +1,24 @@
+=== tests/cases/compiler/addMoreCallSignaturesToBaseSignature2.ts ===
+interface Foo {
+>Foo : Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature2.ts, 0, 0))
+
+ (bar:number): string;
+>bar : Symbol(bar, Decl(addMoreCallSignaturesToBaseSignature2.ts, 1, 5))
+}
+
+interface Bar extends Foo {
+>Bar : Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature2.ts, 2, 1))
+>Foo : Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature2.ts, 0, 0))
+
+ (key: string): string;
+>key : Symbol(key, Decl(addMoreCallSignaturesToBaseSignature2.ts, 5, 5))
+}
+
+var a: Bar;
+>a : Symbol(a, Decl(addMoreCallSignaturesToBaseSignature2.ts, 8, 3))
+>Bar : Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature2.ts, 2, 1))
+
+var kitty = a(1);
+>kitty : Symbol(kitty, Decl(addMoreCallSignaturesToBaseSignature2.ts, 9, 3))
+>a : Symbol(a, Decl(addMoreCallSignaturesToBaseSignature2.ts, 8, 3))
+
diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types
index ed187a820cc..98bd1910241 100644
--- a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types
+++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types
@@ -1,26 +1,26 @@
=== tests/cases/compiler/addMoreCallSignaturesToBaseSignature2.ts ===
interface Foo {
->Foo : Foo, Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature2.ts, 0, 0))
+>Foo : Foo
(bar:number): string;
->bar : number, Symbol(bar, Decl(addMoreCallSignaturesToBaseSignature2.ts, 1, 5))
+>bar : number
}
interface Bar extends Foo {
->Bar : Bar, Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature2.ts, 2, 1))
->Foo : Foo, Symbol(Foo, Decl(addMoreCallSignaturesToBaseSignature2.ts, 0, 0))
+>Bar : Bar
+>Foo : Foo
(key: string): string;
->key : string, Symbol(key, Decl(addMoreCallSignaturesToBaseSignature2.ts, 5, 5))
+>key : string
}
var a: Bar;
->a : Bar, Symbol(a, Decl(addMoreCallSignaturesToBaseSignature2.ts, 8, 3))
->Bar : Bar, Symbol(Bar, Decl(addMoreCallSignaturesToBaseSignature2.ts, 2, 1))
+>a : Bar
+>Bar : Bar
var kitty = a(1);
->kitty : string, Symbol(kitty, Decl(addMoreCallSignaturesToBaseSignature2.ts, 9, 3))
+>kitty : string
>a(1) : string
->a : Bar, Symbol(a, Decl(addMoreCallSignaturesToBaseSignature2.ts, 8, 3))
+>a : Bar
>1 : number
diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.symbols b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.symbols
new file mode 100644
index 00000000000..eff45630aae
--- /dev/null
+++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.symbols
@@ -0,0 +1,143 @@
+=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithAnyAndEveryType.ts ===
+function foo() { }
+>foo : Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0))
+
+class C {
+>C : Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18))
+
+ public a: string;
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 1, 9))
+
+ static foo() { }
+>foo : Symbol(C.foo, Decl(additionOperatorWithAnyAndEveryType.ts, 2, 21))
+}
+enum E { a, b, c }
+>E : Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1))
+>a : Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8))
+>b : Symbol(E.b, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 11))
+>c : Symbol(E.c, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 14))
+
+module M { export var a }
+>M : Symbol(M, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 18))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 6, 21))
+
+var a: any;
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+
+var b: boolean;
+>b : Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3))
+
+var c: number;
+>c : Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3))
+
+var d: string;
+>d : Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3))
+
+var e: Object;
+>e : Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3))
+>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
+
+// any as left operand, result is type Any except plusing string
+var r1 = a + a;
+>r1 : Symbol(r1, Decl(additionOperatorWithAnyAndEveryType.ts, 15, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+
+var r2 = a + b;
+>r2 : Symbol(r2, Decl(additionOperatorWithAnyAndEveryType.ts, 16, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>b : Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3))
+
+var r3 = a + c;
+>r3 : Symbol(r3, Decl(additionOperatorWithAnyAndEveryType.ts, 17, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>c : Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3))
+
+var r4 = a + d;
+>r4 : Symbol(r4, Decl(additionOperatorWithAnyAndEveryType.ts, 18, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>d : Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3))
+
+var r5 = a + e;
+>r5 : Symbol(r5, Decl(additionOperatorWithAnyAndEveryType.ts, 19, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>e : Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3))
+
+// any as right operand, result is type Any except plusing string
+var r6 = b + a;
+>r6 : Symbol(r6, Decl(additionOperatorWithAnyAndEveryType.ts, 22, 3))
+>b : Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+
+var r7 = c + a;
+>r7 : Symbol(r7, Decl(additionOperatorWithAnyAndEveryType.ts, 23, 3))
+>c : Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+
+var r8 = d + a;
+>r8 : Symbol(r8, Decl(additionOperatorWithAnyAndEveryType.ts, 24, 3))
+>d : Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+
+var r9 = e + a;
+>r9 : Symbol(r9, Decl(additionOperatorWithAnyAndEveryType.ts, 25, 3))
+>e : Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+
+// other cases
+var r10 = a + foo;
+>r10 : Symbol(r10, Decl(additionOperatorWithAnyAndEveryType.ts, 28, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>foo : Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0))
+
+var r11 = a + foo();
+>r11 : Symbol(r11, Decl(additionOperatorWithAnyAndEveryType.ts, 29, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>foo : Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0))
+
+var r12 = a + C;
+>r12 : Symbol(r12, Decl(additionOperatorWithAnyAndEveryType.ts, 30, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>C : Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18))
+
+var r13 = a + new C();
+>r13 : Symbol(r13, Decl(additionOperatorWithAnyAndEveryType.ts, 31, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>C : Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18))
+
+var r14 = a + E;
+>r14 : Symbol(r14, Decl(additionOperatorWithAnyAndEveryType.ts, 32, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>E : Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1))
+
+var r15 = a + E.a;
+>r15 : Symbol(r15, Decl(additionOperatorWithAnyAndEveryType.ts, 33, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>E.a : Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8))
+>E : Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1))
+>a : Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8))
+
+var r16 = a + M;
+>r16 : Symbol(r16, Decl(additionOperatorWithAnyAndEveryType.ts, 34, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>M : Symbol(M, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 18))
+
+var r17 = a + '';
+>r17 : Symbol(r17, Decl(additionOperatorWithAnyAndEveryType.ts, 35, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+
+var r18 = a + 123;
+>r18 : Symbol(r18, Decl(additionOperatorWithAnyAndEveryType.ts, 36, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+
+var r19 = a + { a: '' };
+>r19 : Symbol(r19, Decl(additionOperatorWithAnyAndEveryType.ts, 37, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 37, 15))
+
+var r20 = a + ((a: string) => { return a });
+>r20 : Symbol(r20, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 16))
+>a : Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 16))
+
diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types
index e4571680a9b..9f1a9f03898 100644
--- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types
+++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types
@@ -1,171 +1,171 @@
=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithAnyAndEveryType.ts ===
function foo() { }
->foo : () => void, Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0))
+>foo : () => void
class C {
->C : C, Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18))
+>C : C
public a: string;
->a : string, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 1, 9))
+>a : string
static foo() { }
->foo : () => void, Symbol(C.foo, Decl(additionOperatorWithAnyAndEveryType.ts, 2, 21))
+>foo : () => void
}
enum E { a, b, c }
->E : E, Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1))
->a : E, Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8))
->b : E, Symbol(E.b, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 11))
->c : E, Symbol(E.c, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 14))
+>E : E
+>a : E
+>b : E
+>c : E
module M { export var a }
->M : typeof M, Symbol(M, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 18))
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 6, 21))
+>M : typeof M
+>a : any
var a: any;
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : any
var b: boolean;
->b : boolean, Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3))
+>b : boolean
var c: number;
->c : number, Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3))
+>c : number
var d: string;
->d : string, Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3))
+>d : string
var e: Object;
->e : Object, Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3))
->Object : Object, Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
+>e : Object
+>Object : Object
// any as left operand, result is type Any except plusing string
var r1 = a + a;
->r1 : any, Symbol(r1, Decl(additionOperatorWithAnyAndEveryType.ts, 15, 3))
+>r1 : any
>a + a : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : any
+>a : any
var r2 = a + b;
->r2 : any, Symbol(r2, Decl(additionOperatorWithAnyAndEveryType.ts, 16, 3))
+>r2 : any
>a + b : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
->b : boolean, Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3))
+>a : any
+>b : boolean
var r3 = a + c;
->r3 : any, Symbol(r3, Decl(additionOperatorWithAnyAndEveryType.ts, 17, 3))
+>r3 : any
>a + c : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
->c : number, Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3))
+>a : any
+>c : number
var r4 = a + d;
->r4 : string, Symbol(r4, Decl(additionOperatorWithAnyAndEveryType.ts, 18, 3))
+>r4 : string
>a + d : string
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
->d : string, Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3))
+>a : any
+>d : string
var r5 = a + e;
->r5 : any, Symbol(r5, Decl(additionOperatorWithAnyAndEveryType.ts, 19, 3))
+>r5 : any
>a + e : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
->e : Object, Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3))
+>a : any
+>e : Object
// any as right operand, result is type Any except plusing string
var r6 = b + a;
->r6 : any, Symbol(r6, Decl(additionOperatorWithAnyAndEveryType.ts, 22, 3))
+>r6 : any
>b + a : any
->b : boolean, Symbol(b, Decl(additionOperatorWithAnyAndEveryType.ts, 9, 3))
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>b : boolean
+>a : any
var r7 = c + a;
->r7 : any, Symbol(r7, Decl(additionOperatorWithAnyAndEveryType.ts, 23, 3))
+>r7 : any
>c + a : any
->c : number, Symbol(c, Decl(additionOperatorWithAnyAndEveryType.ts, 10, 3))
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>c : number
+>a : any
var r8 = d + a;
->r8 : string, Symbol(r8, Decl(additionOperatorWithAnyAndEveryType.ts, 24, 3))
+>r8 : string
>d + a : string
->d : string, Symbol(d, Decl(additionOperatorWithAnyAndEveryType.ts, 11, 3))
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>d : string
+>a : any
var r9 = e + a;
->r9 : any, Symbol(r9, Decl(additionOperatorWithAnyAndEveryType.ts, 25, 3))
+>r9 : any
>e + a : any
->e : Object, Symbol(e, Decl(additionOperatorWithAnyAndEveryType.ts, 12, 3))
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>e : Object
+>a : any
// other cases
var r10 = a + foo;
->r10 : any, Symbol(r10, Decl(additionOperatorWithAnyAndEveryType.ts, 28, 3))
+>r10 : any
>a + foo : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
->foo : () => void, Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0))
+>a : any
+>foo : () => void
var r11 = a + foo();
->r11 : any, Symbol(r11, Decl(additionOperatorWithAnyAndEveryType.ts, 29, 3))
+>r11 : any
>a + foo() : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : any
>foo() : void
->foo : () => void, Symbol(foo, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 0))
+>foo : () => void
var r12 = a + C;
->r12 : any, Symbol(r12, Decl(additionOperatorWithAnyAndEveryType.ts, 30, 3))
+>r12 : any
>a + C : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
->C : typeof C, Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18))
+>a : any
+>C : typeof C
var r13 = a + new C();
->r13 : any, Symbol(r13, Decl(additionOperatorWithAnyAndEveryType.ts, 31, 3))
+>r13 : any
>a + new C() : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : any
>new C() : C
->C : typeof C, Symbol(C, Decl(additionOperatorWithAnyAndEveryType.ts, 0, 18))
+>C : typeof C
var r14 = a + E;
->r14 : any, Symbol(r14, Decl(additionOperatorWithAnyAndEveryType.ts, 32, 3))
+>r14 : any
>a + E : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
->E : typeof E, Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1))
+>a : any
+>E : typeof E
var r15 = a + E.a;
->r15 : any, Symbol(r15, Decl(additionOperatorWithAnyAndEveryType.ts, 33, 3))
+>r15 : any
>a + E.a : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
->E.a : E, Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8))
->E : typeof E, Symbol(E, Decl(additionOperatorWithAnyAndEveryType.ts, 4, 1))
->a : E, Symbol(E.a, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 8))
+>a : any
+>E.a : E
+>E : typeof E
+>a : E
var r16 = a + M;
->r16 : any, Symbol(r16, Decl(additionOperatorWithAnyAndEveryType.ts, 34, 3))
+>r16 : any
>a + M : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
->M : typeof M, Symbol(M, Decl(additionOperatorWithAnyAndEveryType.ts, 5, 18))
+>a : any
+>M : typeof M
var r17 = a + '';
->r17 : string, Symbol(r17, Decl(additionOperatorWithAnyAndEveryType.ts, 35, 3))
+>r17 : string
>a + '' : string
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : any
>'' : string
var r18 = a + 123;
->r18 : any, Symbol(r18, Decl(additionOperatorWithAnyAndEveryType.ts, 36, 3))
+>r18 : any
>a + 123 : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : any
>123 : number
var r19 = a + { a: '' };
->r19 : any, Symbol(r19, Decl(additionOperatorWithAnyAndEveryType.ts, 37, 3))
+>r19 : any
>a + { a: '' } : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : any
>{ a: '' } : { a: string; }
->a : string, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 37, 15))
+>a : string
>'' : string
var r20 = a + ((a: string) => { return a });
->r20 : any, Symbol(r20, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 3))
+>r20 : any
>a + ((a: string) => { return a }) : any
->a : any, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 8, 3))
+>a : any
>((a: string) => { return a }) : (a: string) => string
>(a: string) => { return a } : (a: string) => string
->a : string, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 16))
->a : string, Symbol(a, Decl(additionOperatorWithAnyAndEveryType.ts, 38, 16))
+>a : string
+>a : string
diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.symbols b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.symbols
new file mode 100644
index 00000000000..ccb53ab5ef1
--- /dev/null
+++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.symbols
@@ -0,0 +1,91 @@
+=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndValidOperator.ts ===
+// If one operand is the null or undefined value, it is treated as having the type of the other operand.
+
+enum E { a, b, c }
+>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+>b : Symbol(E.b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 11))
+>c : Symbol(E.c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 14))
+
+var a: any;
+>a : Symbol(a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 4, 3))
+
+var b: number;
+>b : Symbol(b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 5, 3))
+
+var c: E;
+>c : Symbol(c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 6, 3))
+>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
+
+var d: string;
+>d : Symbol(d, Decl(additionOperatorWithNullValueAndValidOperator.ts, 7, 3))
+
+// null + any
+var r1: any = null + a;
+>r1 : Symbol(r1, Decl(additionOperatorWithNullValueAndValidOperator.ts, 10, 3))
+>a : Symbol(a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 4, 3))
+
+var r2: any = a + null;
+>r2 : Symbol(r2, Decl(additionOperatorWithNullValueAndValidOperator.ts, 11, 3))
+>a : Symbol(a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 4, 3))
+
+// null + number/enum
+var r3 = null + b;
+>r3 : Symbol(r3, Decl(additionOperatorWithNullValueAndValidOperator.ts, 14, 3))
+>b : Symbol(b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 5, 3))
+
+var r4 = null + 1;
+>r4 : Symbol(r4, Decl(additionOperatorWithNullValueAndValidOperator.ts, 15, 3))
+
+var r5 = null + c;
+>r5 : Symbol(r5, Decl(additionOperatorWithNullValueAndValidOperator.ts, 16, 3))
+>c : Symbol(c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 6, 3))
+
+var r6 = null + E.a;
+>r6 : Symbol(r6, Decl(additionOperatorWithNullValueAndValidOperator.ts, 17, 3))
+>E.a : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+
+var r7 = null + E['a'];
+>r7 : Symbol(r7, Decl(additionOperatorWithNullValueAndValidOperator.ts, 18, 3))
+>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
+>'a' : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+
+var r8 = b + null;
+>r8 : Symbol(r8, Decl(additionOperatorWithNullValueAndValidOperator.ts, 19, 3))
+>b : Symbol(b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 5, 3))
+
+var r9 = 1 + null;
+>r9 : Symbol(r9, Decl(additionOperatorWithNullValueAndValidOperator.ts, 20, 3))
+
+var r10 = c + null
+>r10 : Symbol(r10, Decl(additionOperatorWithNullValueAndValidOperator.ts, 21, 3))
+>c : Symbol(c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 6, 3))
+
+var r11 = E.a + null;
+>r11 : Symbol(r11, Decl(additionOperatorWithNullValueAndValidOperator.ts, 22, 3))
+>E.a : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+
+var r12 = E['a'] + null;
+>r12 : Symbol(r12, Decl(additionOperatorWithNullValueAndValidOperator.ts, 23, 3))
+>E : Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
+>'a' : Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+
+// null + string
+var r13 = null + d;
+>r13 : Symbol(r13, Decl(additionOperatorWithNullValueAndValidOperator.ts, 26, 3))
+>d : Symbol(d, Decl(additionOperatorWithNullValueAndValidOperator.ts, 7, 3))
+
+var r14 = null + '';
+>r14 : Symbol(r14, Decl(additionOperatorWithNullValueAndValidOperator.ts, 27, 3))
+
+var r15 = d + null;
+>r15 : Symbol(r15, Decl(additionOperatorWithNullValueAndValidOperator.ts, 28, 3))
+>d : Symbol(d, Decl(additionOperatorWithNullValueAndValidOperator.ts, 7, 3))
+
+var r16 = '' + null;
+>r16 : Symbol(r16, Decl(additionOperatorWithNullValueAndValidOperator.ts, 29, 3))
+
diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types
index 62db775555a..f4ea168ee0d 100644
--- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types
+++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types
@@ -2,127 +2,127 @@
// If one operand is the null or undefined value, it is treated as having the type of the other operand.
enum E { a, b, c }
->E : E, Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
->b : E, Symbol(E.b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 11))
->c : E, Symbol(E.c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 14))
+>E : E
+>a : E
+>b : E
+>c : E
var a: any;
->a : any, Symbol(a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 4, 3))
+>a : any
var b: number;
->b : number, Symbol(b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 5, 3))
+>b : number
var c: E;
->c : E, Symbol(c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 6, 3))
->E : E, Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
+>c : E
+>E : E
var d: string;
->d : string, Symbol(d, Decl(additionOperatorWithNullValueAndValidOperator.ts, 7, 3))
+>d : string
// null + any
var r1: any = null + a;
->r1 : any, Symbol(r1, Decl(additionOperatorWithNullValueAndValidOperator.ts, 10, 3))
+>r1 : any
>null + a : any
>null : null
->a : any, Symbol(a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 4, 3))
+>a : any
var r2: any = a + null;
->r2 : any, Symbol(r2, Decl(additionOperatorWithNullValueAndValidOperator.ts, 11, 3))
+>r2 : any
>a + null : any
->a : any, Symbol(a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 4, 3))
+>a : any
>null : null
// null + number/enum
var r3 = null + b;
->r3 : number, Symbol(r3, Decl(additionOperatorWithNullValueAndValidOperator.ts, 14, 3))
+>r3 : number
>null + b : number
>null : null
->b : number, Symbol(b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 5, 3))
+>b : number
var r4 = null + 1;
->r4 : number, Symbol(r4, Decl(additionOperatorWithNullValueAndValidOperator.ts, 15, 3))
+>r4 : number
>null + 1 : number
>null : null
>1 : number
var r5 = null + c;
->r5 : number, Symbol(r5, Decl(additionOperatorWithNullValueAndValidOperator.ts, 16, 3))
+>r5 : number
>null + c : number
>null : null
->c : E, Symbol(c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 6, 3))
+>c : E
var r6 = null + E.a;
->r6 : number, Symbol(r6, Decl(additionOperatorWithNullValueAndValidOperator.ts, 17, 3))
+>r6 : number
>null + E.a : number
>null : null
->E.a : E, Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
->E : typeof E, Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+>E.a : E
+>E : typeof E
+>a : E
var r7 = null + E['a'];
->r7 : number, Symbol(r7, Decl(additionOperatorWithNullValueAndValidOperator.ts, 18, 3))
+>r7 : number
>null + E['a'] : number
>null : null
>E['a'] : E
->E : typeof E, Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
->'a' : string, Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+>E : typeof E
+>'a' : string
var r8 = b + null;
->r8 : number, Symbol(r8, Decl(additionOperatorWithNullValueAndValidOperator.ts, 19, 3))
+>r8 : number
>b + null : number
->b : number, Symbol(b, Decl(additionOperatorWithNullValueAndValidOperator.ts, 5, 3))
+>b : number
>null : null
var r9 = 1 + null;
->r9 : number, Symbol(r9, Decl(additionOperatorWithNullValueAndValidOperator.ts, 20, 3))
+>r9 : number
>1 + null : number
>1 : number
>null : null
var r10 = c + null
->r10 : number, Symbol(r10, Decl(additionOperatorWithNullValueAndValidOperator.ts, 21, 3))
+>r10 : number
>c + null : number
->c : E, Symbol(c, Decl(additionOperatorWithNullValueAndValidOperator.ts, 6, 3))
+>c : E
>null : null
var r11 = E.a + null;
->r11 : number, Symbol(r11, Decl(additionOperatorWithNullValueAndValidOperator.ts, 22, 3))
+>r11 : number
>E.a + null : number
->E.a : E, Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
->E : typeof E, Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+>E.a : E
+>E : typeof E
+>a : E
>null : null
var r12 = E['a'] + null;
->r12 : number, Symbol(r12, Decl(additionOperatorWithNullValueAndValidOperator.ts, 23, 3))
+>r12 : number
>E['a'] + null : number
>E['a'] : E
->E : typeof E, Symbol(E, Decl(additionOperatorWithNullValueAndValidOperator.ts, 0, 0))
->'a' : string, Symbol(E.a, Decl(additionOperatorWithNullValueAndValidOperator.ts, 2, 8))
+>E : typeof E
+>'a' : string
>null : null
// null + string
var r13 = null + d;
->r13 : string, Symbol(r13, Decl(additionOperatorWithNullValueAndValidOperator.ts, 26, 3))
+>r13 : string
>null + d : string
>null : null
->d : string, Symbol(d, Decl(additionOperatorWithNullValueAndValidOperator.ts, 7, 3))
+>d : string
var r14 = null + '';
->r14 : string, Symbol(r14, Decl(additionOperatorWithNullValueAndValidOperator.ts, 27, 3))
+>r14 : string
>null + '' : string
>null : null
>'' : string
var r15 = d + null;
->r15 : string, Symbol(r15, Decl(additionOperatorWithNullValueAndValidOperator.ts, 28, 3))
+>r15 : string
>d + null : string
->d : string, Symbol(d, Decl(additionOperatorWithNullValueAndValidOperator.ts, 7, 3))
+>d : string
>null : null
var r16 = '' + null;
->r16 : string, Symbol(r16, Decl(additionOperatorWithNullValueAndValidOperator.ts, 29, 3))
+>r16 : string
>'' + null : string
>'' : string
>null : null
diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.symbols b/tests/baselines/reference/additionOperatorWithNumberAndEnum.symbols
new file mode 100644
index 00000000000..835bdbe3a65
--- /dev/null
+++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.symbols
@@ -0,0 +1,101 @@
+=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNumberAndEnum.ts ===
+enum E { a, b }
+>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
+>b : Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11))
+
+enum F { c, d }
+>F : Symbol(F, Decl(additionOperatorWithNumberAndEnum.ts, 0, 15))
+>c : Symbol(F.c, Decl(additionOperatorWithNumberAndEnum.ts, 1, 8))
+>d : Symbol(F.d, Decl(additionOperatorWithNumberAndEnum.ts, 1, 11))
+
+var a: number;
+>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+
+var b: E;
+>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
+>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
+
+var c: E | F;
+>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
+>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
+>F : Symbol(F, Decl(additionOperatorWithNumberAndEnum.ts, 0, 15))
+
+var r1 = a + a;
+>r1 : Symbol(r1, Decl(additionOperatorWithNumberAndEnum.ts, 7, 3))
+>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+
+var r2 = a + b;
+>r2 : Symbol(r2, Decl(additionOperatorWithNumberAndEnum.ts, 8, 3))
+>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
+
+var r3 = b + a;
+>r3 : Symbol(r3, Decl(additionOperatorWithNumberAndEnum.ts, 9, 3))
+>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
+>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+
+var r4 = b + b;
+>r4 : Symbol(r4, Decl(additionOperatorWithNumberAndEnum.ts, 10, 3))
+>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
+>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
+
+var r5 = 0 + a;
+>r5 : Symbol(r5, Decl(additionOperatorWithNumberAndEnum.ts, 12, 3))
+>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+
+var r6 = E.a + 0;
+>r6 : Symbol(r6, Decl(additionOperatorWithNumberAndEnum.ts, 13, 3))
+>E.a : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
+>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
+
+var r7 = E.a + E.b;
+>r7 : Symbol(r7, Decl(additionOperatorWithNumberAndEnum.ts, 14, 3))
+>E.a : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
+>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
+>E.b : Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11))
+>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
+>b : Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11))
+
+var r8 = E['a'] + E['b'];
+>r8 : Symbol(r8, Decl(additionOperatorWithNumberAndEnum.ts, 15, 3))
+>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
+>'a' : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
+>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
+>'b' : Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11))
+
+var r9 = E['a'] + F['c'];
+>r9 : Symbol(r9, Decl(additionOperatorWithNumberAndEnum.ts, 16, 3))
+>E : Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
+>'a' : Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
+>F : Symbol(F, Decl(additionOperatorWithNumberAndEnum.ts, 0, 15))
+>'c' : Symbol(F.c, Decl(additionOperatorWithNumberAndEnum.ts, 1, 8))
+
+var r10 = a + c;
+>r10 : Symbol(r10, Decl(additionOperatorWithNumberAndEnum.ts, 18, 3))
+>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
+
+var r11 = c + a;
+>r11 : Symbol(r11, Decl(additionOperatorWithNumberAndEnum.ts, 19, 3))
+>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
+>a : Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+
+var r12 = b + c;
+>r12 : Symbol(r12, Decl(additionOperatorWithNumberAndEnum.ts, 20, 3))
+>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
+>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
+
+var r13 = c + b;
+>r13 : Symbol(r13, Decl(additionOperatorWithNumberAndEnum.ts, 21, 3))
+>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
+>b : Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
+
+var r14 = c + c;
+>r14 : Symbol(r14, Decl(additionOperatorWithNumberAndEnum.ts, 22, 3))
+>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
+>c : Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
+
diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types
index ffca2d5d5cd..2b1c2794065 100644
--- a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types
+++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types
@@ -1,121 +1,121 @@
=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNumberAndEnum.ts ===
enum E { a, b }
->E : E, Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
->b : E, Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11))
+>E : E
+>a : E
+>b : E
enum F { c, d }
->F : F, Symbol(F, Decl(additionOperatorWithNumberAndEnum.ts, 0, 15))
->c : F, Symbol(F.c, Decl(additionOperatorWithNumberAndEnum.ts, 1, 8))
->d : F, Symbol(F.d, Decl(additionOperatorWithNumberAndEnum.ts, 1, 11))
+>F : F
+>c : F
+>d : F
var a: number;
->a : number, Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+>a : number
var b: E;
->b : E, Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
->E : E, Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
+>b : E
+>E : E
var c: E | F;
->c : E | F, Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
->E : E, Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
->F : F, Symbol(F, Decl(additionOperatorWithNumberAndEnum.ts, 0, 15))
+>c : E | F
+>E : E
+>F : F
var r1 = a + a;
->r1 : number, Symbol(r1, Decl(additionOperatorWithNumberAndEnum.ts, 7, 3))
+>r1 : number
>a + a : number
->a : number, Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
->a : number, Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+>a : number
+>a : number
var r2 = a + b;
->r2 : number, Symbol(r2, Decl(additionOperatorWithNumberAndEnum.ts, 8, 3))
+>r2 : number
>a + b : number
->a : number, Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
->b : E, Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
+>a : number
+>b : E
var r3 = b + a;
->r3 : number, Symbol(r3, Decl(additionOperatorWithNumberAndEnum.ts, 9, 3))
+>r3 : number
>b + a : number
->b : E, Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
->a : number, Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+>b : E
+>a : number
var r4 = b + b;
->r4 : number, Symbol(r4, Decl(additionOperatorWithNumberAndEnum.ts, 10, 3))
+>r4 : number
>b + b : number
->b : E, Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
->b : E, Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
+>b : E
+>b : E
var r5 = 0 + a;
->r5 : number, Symbol(r5, Decl(additionOperatorWithNumberAndEnum.ts, 12, 3))
+>r5 : number
>0 + a : number
>0 : number
->a : number, Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+>a : number
var r6 = E.a + 0;
->r6 : number, Symbol(r6, Decl(additionOperatorWithNumberAndEnum.ts, 13, 3))
+>r6 : number
>E.a + 0 : number
->E.a : E, Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
->E : typeof E, Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
+>E.a : E
+>E : typeof E
+>a : E
>0 : number
var r7 = E.a + E.b;
->r7 : number, Symbol(r7, Decl(additionOperatorWithNumberAndEnum.ts, 14, 3))
+>r7 : number
>E.a + E.b : number
->E.a : E, Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
->E : typeof E, Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
->E.b : E, Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11))
->E : typeof E, Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
->b : E, Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11))
+>E.a : E
+>E : typeof E
+>a : E
+>E.b : E
+>E : typeof E
+>b : E
var r8 = E['a'] + E['b'];
->r8 : number, Symbol(r8, Decl(additionOperatorWithNumberAndEnum.ts, 15, 3))
+>r8 : number
>E['a'] + E['b'] : number
>E['a'] : E
->E : typeof E, Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
->'a' : string, Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
+>E : typeof E
+>'a' : string
>E['b'] : E
->E : typeof E, Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
->'b' : string, Symbol(E.b, Decl(additionOperatorWithNumberAndEnum.ts, 0, 11))
+>E : typeof E
+>'b' : string
var r9 = E['a'] + F['c'];
->r9 : number, Symbol(r9, Decl(additionOperatorWithNumberAndEnum.ts, 16, 3))
+>r9 : number
>E['a'] + F['c'] : number
>E['a'] : E
->E : typeof E, Symbol(E, Decl(additionOperatorWithNumberAndEnum.ts, 0, 0))
->'a' : string, Symbol(E.a, Decl(additionOperatorWithNumberAndEnum.ts, 0, 8))
+>E : typeof E
+>'a' : string
>F['c'] : F
->F : typeof F, Symbol(F, Decl(additionOperatorWithNumberAndEnum.ts, 0, 15))
->'c' : string, Symbol(F.c, Decl(additionOperatorWithNumberAndEnum.ts, 1, 8))
+>F : typeof F
+>'c' : string
var r10 = a + c;
->r10 : number, Symbol(r10, Decl(additionOperatorWithNumberAndEnum.ts, 18, 3))
+>r10 : number
>a + c : number
->a : number, Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
->c : E | F, Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
+>a : number
+>c : E | F
var r11 = c + a;
->r11 : number, Symbol(r11, Decl(additionOperatorWithNumberAndEnum.ts, 19, 3))
+>r11 : number
>c + a : number
->c : E | F, Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
->a : number, Symbol(a, Decl(additionOperatorWithNumberAndEnum.ts, 3, 3))
+>c : E | F
+>a : number
var r12 = b + c;
->r12 : number, Symbol(r12, Decl(additionOperatorWithNumberAndEnum.ts, 20, 3))
+>r12 : number
>b + c : number
->b : E, Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
->c : E | F, Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
+>b : E
+>c : E | F
var r13 = c + b;
->r13 : number, Symbol(r13, Decl(additionOperatorWithNumberAndEnum.ts, 21, 3))
+>r13 : number
>c + b : number
->c : E | F, Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
->b : E, Symbol(b, Decl(additionOperatorWithNumberAndEnum.ts, 4, 3))
+>c : E | F
+>b : E
var r14 = c + c;
->r14 : number, Symbol(r14, Decl(additionOperatorWithNumberAndEnum.ts, 22, 3))
+>r14 : number
>c + c : number
->c : E | F, Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
->c : E | F, Symbol(c, Decl(additionOperatorWithNumberAndEnum.ts, 5, 3))
+>c : E | F
+>c : E | F
diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.symbols b/tests/baselines/reference/additionOperatorWithStringAndEveryType.symbols
new file mode 100644
index 00000000000..0fb0f428716
--- /dev/null
+++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.symbols
@@ -0,0 +1,136 @@
+=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithStringAndEveryType.ts ===
+enum E { a, b, c }
+>E : Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8))
+>b : Symbol(E.b, Decl(additionOperatorWithStringAndEveryType.ts, 0, 11))
+>c : Symbol(E.c, Decl(additionOperatorWithStringAndEveryType.ts, 0, 14))
+
+var a: any;
+>a : Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3))
+
+var b: boolean;
+>b : Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3))
+
+var c: number;
+>c : Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3))
+
+var d: string;
+>d : Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3))
+
+var e: Object;
+>e : Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3))
+>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
+
+var f: void;
+>f : Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3))
+
+var g: E;
+>g : Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3))
+>E : Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
+
+var x: string;
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
+// string could plus every type, and the result is always string
+// string as left operand
+var r1 = x + a;
+>r1 : Symbol(r1, Decl(additionOperatorWithStringAndEveryType.ts, 14, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>a : Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3))
+
+var r2 = x + b;
+>r2 : Symbol(r2, Decl(additionOperatorWithStringAndEveryType.ts, 15, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>b : Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3))
+
+var r3 = x + c;
+>r3 : Symbol(r3, Decl(additionOperatorWithStringAndEveryType.ts, 16, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>c : Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3))
+
+var r4 = x + d;
+>r4 : Symbol(r4, Decl(additionOperatorWithStringAndEveryType.ts, 17, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>d : Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3))
+
+var r5 = x + e;
+>r5 : Symbol(r5, Decl(additionOperatorWithStringAndEveryType.ts, 18, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>e : Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3))
+
+var r6 = x + f;
+>r6 : Symbol(r6, Decl(additionOperatorWithStringAndEveryType.ts, 19, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>f : Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3))
+
+var r7 = x + g;
+>r7 : Symbol(r7, Decl(additionOperatorWithStringAndEveryType.ts, 20, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>g : Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3))
+
+// string as right operand
+var r8 = a + x;
+>r8 : Symbol(r8, Decl(additionOperatorWithStringAndEveryType.ts, 23, 3))
+>a : Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
+var r9 = b + x;
+>r9 : Symbol(r9, Decl(additionOperatorWithStringAndEveryType.ts, 24, 3))
+>b : Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
+var r10 = c + x;
+>r10 : Symbol(r10, Decl(additionOperatorWithStringAndEveryType.ts, 25, 3))
+>c : Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
+var r11 = d + x;
+>r11 : Symbol(r11, Decl(additionOperatorWithStringAndEveryType.ts, 26, 3))
+>d : Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
+var r12 = e + x;
+>r12 : Symbol(r12, Decl(additionOperatorWithStringAndEveryType.ts, 27, 3))
+>e : Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
+var r13 = f + x;
+>r13 : Symbol(r13, Decl(additionOperatorWithStringAndEveryType.ts, 28, 3))
+>f : Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
+var r14 = g + x;
+>r14 : Symbol(r14, Decl(additionOperatorWithStringAndEveryType.ts, 29, 3))
+>g : Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
+// other cases
+var r15 = x + E;
+>r15 : Symbol(r15, Decl(additionOperatorWithStringAndEveryType.ts, 32, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>E : Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
+
+var r16 = x + E.a;
+>r16 : Symbol(r16, Decl(additionOperatorWithStringAndEveryType.ts, 33, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>E.a : Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8))
+>E : Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8))
+
+var r17 = x + '';
+>r17 : Symbol(r17, Decl(additionOperatorWithStringAndEveryType.ts, 34, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
+var r18 = x + 0;
+>r18 : Symbol(r18, Decl(additionOperatorWithStringAndEveryType.ts, 35, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
+var r19 = x + { a: '' };
+>r19 : Symbol(r19, Decl(additionOperatorWithStringAndEveryType.ts, 36, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>a : Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 36, 15))
+
+var r20 = x + [];
+>r20 : Symbol(r20, Decl(additionOperatorWithStringAndEveryType.ts, 37, 3))
+>x : Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+
diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types
index 31fa60a2562..5413f5f5bdf 100644
--- a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types
+++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types
@@ -1,161 +1,161 @@
=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithStringAndEveryType.ts ===
enum E { a, b, c }
->E : E, Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8))
->b : E, Symbol(E.b, Decl(additionOperatorWithStringAndEveryType.ts, 0, 11))
->c : E, Symbol(E.c, Decl(additionOperatorWithStringAndEveryType.ts, 0, 14))
+>E : E
+>a : E
+>b : E
+>c : E
var a: any;
->a : any, Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3))
+>a : any
var b: boolean;
->b : boolean, Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3))
+>b : boolean
var c: number;
->c : number, Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3))
+>c : number
var d: string;
->d : string, Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3))
+>d : string
var e: Object;
->e : Object, Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3))
->Object : Object, Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
+>e : Object
+>Object : Object
var f: void;
->f : void, Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3))
+>f : void
var g: E;
->g : E, Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3))
->E : E, Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
+>g : E
+>E : E
var x: string;
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>x : string
// string could plus every type, and the result is always string
// string as left operand
var r1 = x + a;
->r1 : string, Symbol(r1, Decl(additionOperatorWithStringAndEveryType.ts, 14, 3))
+>r1 : string
>x + a : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
->a : any, Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3))
+>x : string
+>a : any
var r2 = x + b;
->r2 : string, Symbol(r2, Decl(additionOperatorWithStringAndEveryType.ts, 15, 3))
+>r2 : string
>x + b : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
->b : boolean, Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3))
+>x : string
+>b : boolean
var r3 = x + c;
->r3 : string, Symbol(r3, Decl(additionOperatorWithStringAndEveryType.ts, 16, 3))
+>r3 : string
>x + c : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
->c : number, Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3))
+>x : string
+>c : number
var r4 = x + d;
->r4 : string, Symbol(r4, Decl(additionOperatorWithStringAndEveryType.ts, 17, 3))
+>r4 : string
>x + d : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
->d : string, Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3))
+>x : string
+>d : string
var r5 = x + e;
->r5 : string, Symbol(r5, Decl(additionOperatorWithStringAndEveryType.ts, 18, 3))
+>r5 : string
>x + e : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
->e : Object, Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3))
+>x : string
+>e : Object
var r6 = x + f;
->r6 : string, Symbol(r6, Decl(additionOperatorWithStringAndEveryType.ts, 19, 3))
+>r6 : string
>x + f : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
->f : void, Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3))
+>x : string
+>f : void
var r7 = x + g;
->r7 : string, Symbol(r7, Decl(additionOperatorWithStringAndEveryType.ts, 20, 3))
+>r7 : string
>x + g : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
->g : E, Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3))
+>x : string
+>g : E
// string as right operand
var r8 = a + x;
->r8 : string, Symbol(r8, Decl(additionOperatorWithStringAndEveryType.ts, 23, 3))
+>r8 : string
>a + x : string
->a : any, Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 2, 3))
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>a : any
+>x : string
var r9 = b + x;
->r9 : string, Symbol(r9, Decl(additionOperatorWithStringAndEveryType.ts, 24, 3))
+>r9 : string
>b + x : string
->b : boolean, Symbol(b, Decl(additionOperatorWithStringAndEveryType.ts, 3, 3))
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>b : boolean
+>x : string
var r10 = c + x;
->r10 : string, Symbol(r10, Decl(additionOperatorWithStringAndEveryType.ts, 25, 3))
+>r10 : string
>c + x : string
->c : number, Symbol(c, Decl(additionOperatorWithStringAndEveryType.ts, 4, 3))
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>c : number
+>x : string
var r11 = d + x;
->r11 : string, Symbol(r11, Decl(additionOperatorWithStringAndEveryType.ts, 26, 3))
+>r11 : string
>d + x : string
->d : string, Symbol(d, Decl(additionOperatorWithStringAndEveryType.ts, 5, 3))
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>d : string
+>x : string
var r12 = e + x;
->r12 : string, Symbol(r12, Decl(additionOperatorWithStringAndEveryType.ts, 27, 3))
+>r12 : string
>e + x : string
->e : Object, Symbol(e, Decl(additionOperatorWithStringAndEveryType.ts, 6, 3))
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>e : Object
+>x : string
var r13 = f + x;
->r13 : string, Symbol(r13, Decl(additionOperatorWithStringAndEveryType.ts, 28, 3))
+>r13 : string
>f + x : string
->f : void, Symbol(f, Decl(additionOperatorWithStringAndEveryType.ts, 7, 3))
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>f : void
+>x : string
var r14 = g + x;
->r14 : string, Symbol(r14, Decl(additionOperatorWithStringAndEveryType.ts, 29, 3))
+>r14 : string
>g + x : string
->g : E, Symbol(g, Decl(additionOperatorWithStringAndEveryType.ts, 8, 3))
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>g : E
+>x : string
// other cases
var r15 = x + E;
->r15 : string, Symbol(r15, Decl(additionOperatorWithStringAndEveryType.ts, 32, 3))
+>r15 : string
>x + E : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
->E : typeof E, Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
+>x : string
+>E : typeof E
var r16 = x + E.a;
->r16 : string, Symbol(r16, Decl(additionOperatorWithStringAndEveryType.ts, 33, 3))
+>r16 : string
>x + E.a : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
->E.a : E, Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8))
->E : typeof E, Symbol(E, Decl(additionOperatorWithStringAndEveryType.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithStringAndEveryType.ts, 0, 8))
+>x : string
+>E.a : E
+>E : typeof E
+>a : E
var r17 = x + '';
->r17 : string, Symbol(r17, Decl(additionOperatorWithStringAndEveryType.ts, 34, 3))
+>r17 : string
>x + '' : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>x : string
>'' : string
var r18 = x + 0;
->r18 : string, Symbol(r18, Decl(additionOperatorWithStringAndEveryType.ts, 35, 3))
+>r18 : string
>x + 0 : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>x : string
>0 : number
var r19 = x + { a: '' };
->r19 : string, Symbol(r19, Decl(additionOperatorWithStringAndEveryType.ts, 36, 3))
+>r19 : string
>x + { a: '' } : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>x : string
>{ a: '' } : { a: string; }
->a : string, Symbol(a, Decl(additionOperatorWithStringAndEveryType.ts, 36, 15))
+>a : string
>'' : string
var r20 = x + [];
->r20 : string, Symbol(r20, Decl(additionOperatorWithStringAndEveryType.ts, 37, 3))
+>r20 : string
>x + [] : string
->x : string, Symbol(x, Decl(additionOperatorWithStringAndEveryType.ts, 10, 3))
+>x : string
>[] : undefined[]
diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.symbols b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.symbols
new file mode 100644
index 00000000000..d91dd946c83
--- /dev/null
+++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.symbols
@@ -0,0 +1,107 @@
+=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndValidOperator.ts ===
+// If one operand is the null or undefined value, it is treated as having the type of the other operand.
+
+enum E { a, b, c }
+>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
+>b : Symbol(E.b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 11))
+>c : Symbol(E.c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 14))
+
+var a: any;
+>a : Symbol(a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 4, 3))
+
+var b: number;
+>b : Symbol(b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 5, 3))
+
+var c: E;
+>c : Symbol(c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 6, 3))
+>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
+
+var d: string;
+>d : Symbol(d, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 7, 3))
+
+// undefined + any
+var r1: any = undefined + a;
+>r1 : Symbol(r1, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 10, 3))
+>undefined : Symbol(undefined)
+>a : Symbol(a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 4, 3))
+
+var r2: any = a + undefined;
+>r2 : Symbol(r2, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 11, 3))
+>a : Symbol(a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 4, 3))
+>undefined : Symbol(undefined)
+
+// undefined + number/enum
+var r3 = undefined + b;
+>r3 : Symbol(r3, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 14, 3))
+>undefined : Symbol(undefined)
+>b : Symbol(b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 5, 3))
+
+var r4 = undefined + 1;
+>r4 : Symbol(r4, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 15, 3))
+>undefined : Symbol(undefined)
+
+var r5 = undefined + c;
+>r5 : Symbol(r5, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 16, 3))
+>undefined : Symbol(undefined)
+>c : Symbol(c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 6, 3))
+
+var r6 = undefined + E.a;
+>r6 : Symbol(r6, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 17, 3))
+>undefined : Symbol(undefined)
+>E.a : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
+>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
+
+var r7 = undefined + E['a'];
+>r7 : Symbol(r7, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 18, 3))
+>undefined : Symbol(undefined)
+>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
+>'a' : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
+
+var r8 = b + undefined;
+>r8 : Symbol(r8, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 19, 3))
+>b : Symbol(b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 5, 3))
+>undefined : Symbol(undefined)
+
+var r9 = 1 + undefined;
+>r9 : Symbol(r9, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 20, 3))
+>undefined : Symbol(undefined)
+
+var r10 = c + undefined
+>r10 : Symbol(r10, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 21, 3))
+>c : Symbol(c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 6, 3))
+>undefined : Symbol(undefined)
+
+var r11 = E.a + undefined;
+>r11 : Symbol(r11, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 22, 3))
+>E.a : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
+>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
+>a : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
+>undefined : Symbol(undefined)
+
+var r12 = E['a'] + undefined;
+>r12 : Symbol(r12, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 23, 3))
+>E : Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
+>'a' : Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
+>undefined : Symbol(undefined)
+
+// undefined + string
+var r13 = undefined + d;
+>r13 : Symbol(r13, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 26, 3))
+>undefined : Symbol(undefined)
+>d : Symbol(d, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 7, 3))
+
+var r14 = undefined + '';
+>r14 : Symbol(r14, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 27, 3))
+>undefined : Symbol(undefined)
+
+var r15 = d + undefined;
+>r15 : Symbol(r15, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 28, 3))
+>d : Symbol(d, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 7, 3))
+>undefined : Symbol(undefined)
+
+var r16 = '' + undefined;
+>r16 : Symbol(r16, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 29, 3))
+>undefined : Symbol(undefined)
+
diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types
index 966c19aa8c4..16f0a4dfa84 100644
--- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types
+++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types
@@ -2,128 +2,128 @@
// If one operand is the null or undefined value, it is treated as having the type of the other operand.
enum E { a, b, c }
->E : E, Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
->b : E, Symbol(E.b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 11))
->c : E, Symbol(E.c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 14))
+>E : E
+>a : E
+>b : E
+>c : E
var a: any;
->a : any, Symbol(a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 4, 3))
+>a : any
var b: number;
->b : number, Symbol(b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 5, 3))
+>b : number
var c: E;
->c : E, Symbol(c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 6, 3))
->E : E, Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
+>c : E
+>E : E
var d: string;
->d : string, Symbol(d, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 7, 3))
+>d : string
// undefined + any
var r1: any = undefined + a;
->r1 : any, Symbol(r1, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 10, 3))
+>r1 : any
>undefined + a : any
->undefined : undefined, Symbol(undefined)
->a : any, Symbol(a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 4, 3))
+>undefined : undefined
+>a : any
var r2: any = a + undefined;
->r2 : any, Symbol(r2, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 11, 3))
+>r2 : any
>a + undefined : any
->a : any, Symbol(a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 4, 3))
->undefined : undefined, Symbol(undefined)
+>a : any
+>undefined : undefined
// undefined + number/enum
var r3 = undefined + b;
->r3 : number, Symbol(r3, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 14, 3))
+>r3 : number
>undefined + b : number
->undefined : undefined, Symbol(undefined)
->b : number, Symbol(b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 5, 3))
+>undefined : undefined
+>b : number
var r4 = undefined + 1;
->r4 : number, Symbol(r4, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 15, 3))
+>r4 : number
>undefined + 1 : number
->undefined : undefined, Symbol(undefined)
+>undefined : undefined
>1 : number
var r5 = undefined + c;
->r5 : number, Symbol(r5, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 16, 3))
+>r5 : number
>undefined + c : number
->undefined : undefined, Symbol(undefined)
->c : E, Symbol(c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 6, 3))
+>undefined : undefined
+>c : E
var r6 = undefined + E.a;
->r6 : number, Symbol(r6, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 17, 3))
+>r6 : number
>undefined + E.a : number
->undefined : undefined, Symbol(undefined)
->E.a : E, Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
->E : typeof E, Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
+>undefined : undefined
+>E.a : E
+>E : typeof E
+>a : E
var r7 = undefined + E['a'];
->r7 : number, Symbol(r7, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 18, 3))
+>r7 : number
>undefined + E['a'] : number
->undefined : undefined, Symbol(undefined)
+>undefined : undefined
>E['a'] : E
->E : typeof E, Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
->'a' : string, Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
+>E : typeof E
+>'a' : string
var r8 = b + undefined;
->r8 : number, Symbol(r8, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 19, 3))
+>r8 : number
>b + undefined : number
->b : number, Symbol(b, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 5, 3))
->undefined : undefined, Symbol(undefined)
+>b : number
+>undefined : undefined
var r9 = 1 + undefined;
->r9 : number, Symbol(r9, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 20, 3))
+>r9 : number
>1 + undefined : number
>1 : number
->undefined : undefined, Symbol(undefined)
+>undefined : undefined
var r10 = c + undefined
->r10 : number, Symbol(r10, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 21, 3))
+>r10 : number
>c + undefined : number
->c : E, Symbol(c, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 6, 3))
->undefined : undefined, Symbol(undefined)
+>c : E
+>undefined : undefined
var r11 = E.a + undefined;
->r11 : number, Symbol(r11, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 22, 3))
+>r11 : number
>E.a + undefined : number
->E.a : E, Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
->E : typeof E, Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
->a : E, Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
->undefined : undefined, Symbol(undefined)
+>E.a : E
+>E : typeof E
+>a : E
+>undefined : undefined
var r12 = E['a'] + undefined;
->r12 : number, Symbol(r12, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 23, 3))
+>r12 : number
>E['a'] + undefined : number
>E['a'] : E
->E : typeof E, Symbol(E, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 0, 0))
->'a' : string, Symbol(E.a, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 2, 8))
->undefined : undefined, Symbol(undefined)
+>E : typeof E
+>'a' : string
+>undefined : undefined
// undefined + string
var r13 = undefined + d;
->r13 : string, Symbol(r13, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 26, 3))
+>r13 : string
>undefined + d : string
->undefined : undefined, Symbol(undefined)
->d : string, Symbol(d, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 7, 3))
+>undefined : undefined
+>d : string
var r14 = undefined + '';
->r14 : string, Symbol(r14, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 27, 3))
+>r14 : string
>undefined + '' : string
->undefined : undefined, Symbol(undefined)
+>undefined : undefined
>'' : string
var r15 = d + undefined;
->r15 : string, Symbol(r15, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 28, 3))
+>r15 : string
>d + undefined : string
->d : string, Symbol(d, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 7, 3))
->undefined : undefined, Symbol(undefined)
+>d : string
+>undefined : undefined
var r16 = '' + undefined;
->r16 : string, Symbol(r16, Decl(additionOperatorWithUndefinedValueAndValidOperator.ts, 29, 3))
+>r16 : string
>'' + undefined : string
>'' : string
->undefined : undefined, Symbol(undefined)
+>undefined : undefined
diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.symbols b/tests/baselines/reference/aliasUsageInAccessorsOfClass.symbols
new file mode 100644
index 00000000000..3524b1ce31e
--- /dev/null
+++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.symbols
@@ -0,0 +1,61 @@
+=== tests/cases/compiler/aliasUsage1_main.ts ===
+import Backbone = require("aliasUsage1_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsage1_main.ts, 0, 0))
+
+import moduleA = require("aliasUsage1_moduleA");
+>moduleA : Symbol(moduleA, Decl(aliasUsage1_main.ts, 0, 50))
+
+interface IHasVisualizationModel {
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsage1_main.ts, 1, 48))
+
+ VisualizationModel: typeof Backbone.Model;
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsage1_main.ts, 2, 34))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsage1_main.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0))
+}
+class C2 {
+>C2 : Symbol(C2, Decl(aliasUsage1_main.ts, 4, 1))
+
+ x: IHasVisualizationModel;
+>x : Symbol(x, Decl(aliasUsage1_main.ts, 5, 10))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsage1_main.ts, 1, 48))
+
+ get A() {
+>A : Symbol(A, Decl(aliasUsage1_main.ts, 6, 30), Decl(aliasUsage1_main.ts, 9, 5))
+
+ return this.x;
+>this.x : Symbol(x, Decl(aliasUsage1_main.ts, 5, 10))
+>this : Symbol(C2, Decl(aliasUsage1_main.ts, 4, 1))
+>x : Symbol(x, Decl(aliasUsage1_main.ts, 5, 10))
+ }
+ set A(x) {
+>A : Symbol(A, Decl(aliasUsage1_main.ts, 6, 30), Decl(aliasUsage1_main.ts, 9, 5))
+>x : Symbol(x, Decl(aliasUsage1_main.ts, 10, 10))
+
+ x = moduleA;
+>x : Symbol(x, Decl(aliasUsage1_main.ts, 10, 10))
+>moduleA : Symbol(moduleA, Decl(aliasUsage1_main.ts, 0, 50))
+ }
+}
+=== tests/cases/compiler/aliasUsage1_backbone.ts ===
+export class Model {
+>Model : Symbol(Model, Decl(aliasUsage1_backbone.ts, 0, 0))
+
+ public someData: string;
+>someData : Symbol(someData, Decl(aliasUsage1_backbone.ts, 0, 20))
+}
+
+=== tests/cases/compiler/aliasUsage1_moduleA.ts ===
+import Backbone = require("aliasUsage1_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsage1_moduleA.ts, 0, 0))
+
+export class VisualizationModel extends Backbone.Model {
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsage1_moduleA.ts, 0, 50))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsage1_moduleA.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0))
+
+ // interesting stuff here
+}
+
diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types
index 0a580a47b16..eccdbc8528c 100644
--- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types
+++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types
@@ -1,61 +1,61 @@
=== tests/cases/compiler/aliasUsage1_main.ts ===
import Backbone = require("aliasUsage1_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsage1_main.ts, 0, 0))
+>Backbone : typeof Backbone
import moduleA = require("aliasUsage1_moduleA");
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsage1_main.ts, 0, 50))
+>moduleA : typeof moduleA
interface IHasVisualizationModel {
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsage1_main.ts, 1, 48))
+>IHasVisualizationModel : IHasVisualizationModel
VisualizationModel: typeof Backbone.Model;
->VisualizationModel : typeof Backbone.Model, Symbol(VisualizationModel, Decl(aliasUsage1_main.ts, 2, 34))
->Backbone.Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsage1_main.ts, 0, 0))
->Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0))
+>VisualizationModel : typeof Backbone.Model
+>Backbone.Model : typeof Backbone.Model
+>Backbone : typeof Backbone
+>Model : typeof Backbone.Model
}
class C2 {
->C2 : C2, Symbol(C2, Decl(aliasUsage1_main.ts, 4, 1))
+>C2 : C2
x: IHasVisualizationModel;
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsage1_main.ts, 5, 10))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsage1_main.ts, 1, 48))
+>x : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
get A() {
->A : IHasVisualizationModel, Symbol(A, Decl(aliasUsage1_main.ts, 6, 30), Decl(aliasUsage1_main.ts, 9, 5))
+>A : IHasVisualizationModel
return this.x;
->this.x : IHasVisualizationModel, Symbol(x, Decl(aliasUsage1_main.ts, 5, 10))
->this : C2, Symbol(C2, Decl(aliasUsage1_main.ts, 4, 1))
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsage1_main.ts, 5, 10))
+>this.x : IHasVisualizationModel
+>this : C2
+>x : IHasVisualizationModel
}
set A(x) {
->A : IHasVisualizationModel, Symbol(A, Decl(aliasUsage1_main.ts, 6, 30), Decl(aliasUsage1_main.ts, 9, 5))
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsage1_main.ts, 10, 10))
+>A : IHasVisualizationModel
+>x : IHasVisualizationModel
x = moduleA;
>x = moduleA : typeof moduleA
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsage1_main.ts, 10, 10))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsage1_main.ts, 0, 50))
+>x : IHasVisualizationModel
+>moduleA : typeof moduleA
}
}
=== tests/cases/compiler/aliasUsage1_backbone.ts ===
export class Model {
->Model : Model, Symbol(Model, Decl(aliasUsage1_backbone.ts, 0, 0))
+>Model : Model
public someData: string;
->someData : string, Symbol(someData, Decl(aliasUsage1_backbone.ts, 0, 20))
+>someData : string
}
=== tests/cases/compiler/aliasUsage1_moduleA.ts ===
import Backbone = require("aliasUsage1_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsage1_moduleA.ts, 0, 0))
+>Backbone : typeof Backbone
export class VisualizationModel extends Backbone.Model {
->VisualizationModel : VisualizationModel, Symbol(VisualizationModel, Decl(aliasUsage1_moduleA.ts, 0, 50))
->Backbone.Model : any, Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsage1_moduleA.ts, 0, 0))
->Model : Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsage1_backbone.ts, 0, 0))
+>VisualizationModel : VisualizationModel
+>Backbone.Model : any
+>Backbone : typeof Backbone
+>Model : Backbone.Model
// interesting stuff here
}
diff --git a/tests/baselines/reference/aliasUsageInArray.symbols b/tests/baselines/reference/aliasUsageInArray.symbols
new file mode 100644
index 00000000000..7f1e31d2277
--- /dev/null
+++ b/tests/baselines/reference/aliasUsageInArray.symbols
@@ -0,0 +1,48 @@
+=== tests/cases/compiler/aliasUsageInArray_main.ts ===
+import Backbone = require("aliasUsageInArray_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInArray_main.ts, 0, 0))
+
+import moduleA = require("aliasUsageInArray_moduleA");
+>moduleA : Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56))
+
+interface IHasVisualizationModel {
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInArray_main.ts, 1, 54))
+
+ VisualizationModel: typeof Backbone.Model;
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInArray_main.ts, 2, 34))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInArray_main.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0))
+}
+
+var xs: IHasVisualizationModel[] = [moduleA];
+>xs : Symbol(xs, Decl(aliasUsageInArray_main.ts, 6, 3))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInArray_main.ts, 1, 54))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56))
+
+var xs2: typeof moduleA[] = [moduleA];
+>xs2 : Symbol(xs2, Decl(aliasUsageInArray_main.ts, 7, 3))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56))
+
+=== tests/cases/compiler/aliasUsageInArray_backbone.ts ===
+export class Model {
+>Model : Symbol(Model, Decl(aliasUsageInArray_backbone.ts, 0, 0))
+
+ public someData: string;
+>someData : Symbol(someData, Decl(aliasUsageInArray_backbone.ts, 0, 20))
+}
+
+=== tests/cases/compiler/aliasUsageInArray_moduleA.ts ===
+import Backbone = require("aliasUsageInArray_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInArray_moduleA.ts, 0, 0))
+
+export class VisualizationModel extends Backbone.Model {
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInArray_moduleA.ts, 0, 56))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInArray_moduleA.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0))
+
+ // interesting stuff here
+}
+
diff --git a/tests/baselines/reference/aliasUsageInArray.types b/tests/baselines/reference/aliasUsageInArray.types
index b7ff2670cd2..ee54300e7d9 100644
--- a/tests/baselines/reference/aliasUsageInArray.types
+++ b/tests/baselines/reference/aliasUsageInArray.types
@@ -1,49 +1,49 @@
=== tests/cases/compiler/aliasUsageInArray_main.ts ===
import Backbone = require("aliasUsageInArray_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInArray_main.ts, 0, 0))
+>Backbone : typeof Backbone
import moduleA = require("aliasUsageInArray_moduleA");
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56))
+>moduleA : typeof moduleA
interface IHasVisualizationModel {
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInArray_main.ts, 1, 54))
+>IHasVisualizationModel : IHasVisualizationModel
VisualizationModel: typeof Backbone.Model;
->VisualizationModel : typeof Backbone.Model, Symbol(VisualizationModel, Decl(aliasUsageInArray_main.ts, 2, 34))
->Backbone.Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInArray_main.ts, 0, 0))
->Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0))
+>VisualizationModel : typeof Backbone.Model
+>Backbone.Model : typeof Backbone.Model
+>Backbone : typeof Backbone
+>Model : typeof Backbone.Model
}
var xs: IHasVisualizationModel[] = [moduleA];
->xs : IHasVisualizationModel[], Symbol(xs, Decl(aliasUsageInArray_main.ts, 6, 3))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInArray_main.ts, 1, 54))
+>xs : IHasVisualizationModel[]
+>IHasVisualizationModel : IHasVisualizationModel
>[moduleA] : typeof moduleA[]
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56))
+>moduleA : typeof moduleA
var xs2: typeof moduleA[] = [moduleA];
->xs2 : typeof moduleA[], Symbol(xs2, Decl(aliasUsageInArray_main.ts, 7, 3))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56))
+>xs2 : typeof moduleA[]
+>moduleA : typeof moduleA
>[moduleA] : typeof moduleA[]
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInArray_main.ts, 0, 56))
+>moduleA : typeof moduleA
=== tests/cases/compiler/aliasUsageInArray_backbone.ts ===
export class Model {
->Model : Model, Symbol(Model, Decl(aliasUsageInArray_backbone.ts, 0, 0))
+>Model : Model
public someData: string;
->someData : string, Symbol(someData, Decl(aliasUsageInArray_backbone.ts, 0, 20))
+>someData : string
}
=== tests/cases/compiler/aliasUsageInArray_moduleA.ts ===
import Backbone = require("aliasUsageInArray_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInArray_moduleA.ts, 0, 0))
+>Backbone : typeof Backbone
export class VisualizationModel extends Backbone.Model {
->VisualizationModel : VisualizationModel, Symbol(VisualizationModel, Decl(aliasUsageInArray_moduleA.ts, 0, 56))
->Backbone.Model : any, Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInArray_moduleA.ts, 0, 0))
->Model : Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInArray_backbone.ts, 0, 0))
+>VisualizationModel : VisualizationModel
+>Backbone.Model : any
+>Backbone : typeof Backbone
+>Model : Backbone.Model
// interesting stuff here
}
diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.symbols b/tests/baselines/reference/aliasUsageInFunctionExpression.symbols
new file mode 100644
index 00000000000..2afb6be55c5
--- /dev/null
+++ b/tests/baselines/reference/aliasUsageInFunctionExpression.symbols
@@ -0,0 +1,48 @@
+=== tests/cases/compiler/aliasUsageInFunctionExpression_main.ts ===
+import Backbone = require("aliasUsageInFunctionExpression_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInFunctionExpression_main.ts, 0, 0))
+
+import moduleA = require("aliasUsageInFunctionExpression_moduleA");
+>moduleA : Symbol(moduleA, Decl(aliasUsageInFunctionExpression_main.ts, 0, 69))
+
+interface IHasVisualizationModel {
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInFunctionExpression_main.ts, 1, 67))
+
+ VisualizationModel: typeof Backbone.Model;
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInFunctionExpression_main.ts, 2, 34))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInFunctionExpression_main.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0))
+}
+var f = (x: IHasVisualizationModel) => x;
+>f : Symbol(f, Decl(aliasUsageInFunctionExpression_main.ts, 5, 3))
+>x : Symbol(x, Decl(aliasUsageInFunctionExpression_main.ts, 5, 9))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInFunctionExpression_main.ts, 1, 67))
+>x : Symbol(x, Decl(aliasUsageInFunctionExpression_main.ts, 5, 9))
+
+f = (x) => moduleA;
+>f : Symbol(f, Decl(aliasUsageInFunctionExpression_main.ts, 5, 3))
+>x : Symbol(x, Decl(aliasUsageInFunctionExpression_main.ts, 6, 5))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInFunctionExpression_main.ts, 0, 69))
+
+=== tests/cases/compiler/aliasUsageInFunctionExpression_backbone.ts ===
+export class Model {
+>Model : Symbol(Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0))
+
+ public someData: string;
+>someData : Symbol(someData, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 20))
+}
+
+=== tests/cases/compiler/aliasUsageInFunctionExpression_moduleA.ts ===
+import Backbone = require("aliasUsageInFunctionExpression_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInFunctionExpression_moduleA.ts, 0, 0))
+
+export class VisualizationModel extends Backbone.Model {
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInFunctionExpression_moduleA.ts, 0, 69))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInFunctionExpression_moduleA.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0))
+
+ // interesting stuff here
+}
+
diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.types b/tests/baselines/reference/aliasUsageInFunctionExpression.types
index 46ca7a9a76c..17994dcab52 100644
--- a/tests/baselines/reference/aliasUsageInFunctionExpression.types
+++ b/tests/baselines/reference/aliasUsageInFunctionExpression.types
@@ -1,50 +1,50 @@
=== tests/cases/compiler/aliasUsageInFunctionExpression_main.ts ===
import Backbone = require("aliasUsageInFunctionExpression_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInFunctionExpression_main.ts, 0, 0))
+>Backbone : typeof Backbone
import moduleA = require("aliasUsageInFunctionExpression_moduleA");
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInFunctionExpression_main.ts, 0, 69))
+>moduleA : typeof moduleA
interface IHasVisualizationModel {
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInFunctionExpression_main.ts, 1, 67))
+>IHasVisualizationModel : IHasVisualizationModel
VisualizationModel: typeof Backbone.Model;
->VisualizationModel : typeof Backbone.Model, Symbol(VisualizationModel, Decl(aliasUsageInFunctionExpression_main.ts, 2, 34))
->Backbone.Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInFunctionExpression_main.ts, 0, 0))
->Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0))
+>VisualizationModel : typeof Backbone.Model
+>Backbone.Model : typeof Backbone.Model
+>Backbone : typeof Backbone
+>Model : typeof Backbone.Model
}
var f = (x: IHasVisualizationModel) => x;
->f : (x: IHasVisualizationModel) => IHasVisualizationModel, Symbol(f, Decl(aliasUsageInFunctionExpression_main.ts, 5, 3))
+>f : (x: IHasVisualizationModel) => IHasVisualizationModel
>(x: IHasVisualizationModel) => x : (x: IHasVisualizationModel) => IHasVisualizationModel
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInFunctionExpression_main.ts, 5, 9))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInFunctionExpression_main.ts, 1, 67))
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInFunctionExpression_main.ts, 5, 9))
+>x : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
+>x : IHasVisualizationModel
f = (x) => moduleA;
>f = (x) => moduleA : (x: IHasVisualizationModel) => typeof moduleA
->f : (x: IHasVisualizationModel) => IHasVisualizationModel, Symbol(f, Decl(aliasUsageInFunctionExpression_main.ts, 5, 3))
+>f : (x: IHasVisualizationModel) => IHasVisualizationModel
>(x) => moduleA : (x: IHasVisualizationModel) => typeof moduleA
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInFunctionExpression_main.ts, 6, 5))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInFunctionExpression_main.ts, 0, 69))
+>x : IHasVisualizationModel
+>moduleA : typeof moduleA
=== tests/cases/compiler/aliasUsageInFunctionExpression_backbone.ts ===
export class Model {
->Model : Model, Symbol(Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0))
+>Model : Model
public someData: string;
->someData : string, Symbol(someData, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 20))
+>someData : string
}
=== tests/cases/compiler/aliasUsageInFunctionExpression_moduleA.ts ===
import Backbone = require("aliasUsageInFunctionExpression_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInFunctionExpression_moduleA.ts, 0, 0))
+>Backbone : typeof Backbone
export class VisualizationModel extends Backbone.Model {
->VisualizationModel : VisualizationModel, Symbol(VisualizationModel, Decl(aliasUsageInFunctionExpression_moduleA.ts, 0, 69))
->Backbone.Model : any, Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInFunctionExpression_moduleA.ts, 0, 0))
->Model : Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInFunctionExpression_backbone.ts, 0, 0))
+>VisualizationModel : VisualizationModel
+>Backbone.Model : any
+>Backbone : typeof Backbone
+>Model : Backbone.Model
// interesting stuff here
}
diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.symbols b/tests/baselines/reference/aliasUsageInGenericFunction.symbols
new file mode 100644
index 00000000000..3f001e8bd1a
--- /dev/null
+++ b/tests/baselines/reference/aliasUsageInGenericFunction.symbols
@@ -0,0 +1,60 @@
+=== tests/cases/compiler/aliasUsageInGenericFunction_main.ts ===
+import Backbone = require("aliasUsageInGenericFunction_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInGenericFunction_main.ts, 0, 0))
+
+import moduleA = require("aliasUsageInGenericFunction_moduleA");
+>moduleA : Symbol(moduleA, Decl(aliasUsageInGenericFunction_main.ts, 0, 66))
+
+interface IHasVisualizationModel {
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 1, 64))
+
+ VisualizationModel: typeof Backbone.Model;
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 2, 34))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInGenericFunction_main.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0))
+}
+function foo(x: T) {
+>foo : Symbol(foo, Decl(aliasUsageInGenericFunction_main.ts, 4, 1))
+>T : Symbol(T, Decl(aliasUsageInGenericFunction_main.ts, 5, 13))
+>a : Symbol(a, Decl(aliasUsageInGenericFunction_main.ts, 5, 24))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 1, 64))
+>x : Symbol(x, Decl(aliasUsageInGenericFunction_main.ts, 5, 54))
+>T : Symbol(T, Decl(aliasUsageInGenericFunction_main.ts, 5, 13))
+
+ return x;
+>x : Symbol(x, Decl(aliasUsageInGenericFunction_main.ts, 5, 54))
+}
+var r = foo({ a: moduleA });
+>r : Symbol(r, Decl(aliasUsageInGenericFunction_main.ts, 8, 3))
+>foo : Symbol(foo, Decl(aliasUsageInGenericFunction_main.ts, 4, 1))
+>a : Symbol(a, Decl(aliasUsageInGenericFunction_main.ts, 8, 13))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInGenericFunction_main.ts, 0, 66))
+
+var r2 = foo({ a: null });
+>r2 : Symbol(r2, Decl(aliasUsageInGenericFunction_main.ts, 9, 3))
+>foo : Symbol(foo, Decl(aliasUsageInGenericFunction_main.ts, 4, 1))
+>a : Symbol(a, Decl(aliasUsageInGenericFunction_main.ts, 9, 14))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 1, 64))
+
+=== tests/cases/compiler/aliasUsageInGenericFunction_backbone.ts ===
+export class Model {
+>Model : Symbol(Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0))
+
+ public someData: string;
+>someData : Symbol(someData, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 20))
+}
+
+=== tests/cases/compiler/aliasUsageInGenericFunction_moduleA.ts ===
+import Backbone = require("aliasUsageInGenericFunction_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInGenericFunction_moduleA.ts, 0, 0))
+
+export class VisualizationModel extends Backbone.Model {
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInGenericFunction_moduleA.ts, 0, 66))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInGenericFunction_moduleA.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0))
+
+ // interesting stuff here
+}
+
diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.types b/tests/baselines/reference/aliasUsageInGenericFunction.types
index b32eb87fb19..0821732f5fc 100644
--- a/tests/baselines/reference/aliasUsageInGenericFunction.types
+++ b/tests/baselines/reference/aliasUsageInGenericFunction.types
@@ -1,65 +1,65 @@
=== tests/cases/compiler/aliasUsageInGenericFunction_main.ts ===
import Backbone = require("aliasUsageInGenericFunction_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInGenericFunction_main.ts, 0, 0))
+>Backbone : typeof Backbone
import moduleA = require("aliasUsageInGenericFunction_moduleA");
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInGenericFunction_main.ts, 0, 66))
+>moduleA : typeof moduleA
interface IHasVisualizationModel {
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 1, 64))
+>IHasVisualizationModel : IHasVisualizationModel
VisualizationModel: typeof Backbone.Model;
->VisualizationModel : typeof Backbone.Model, Symbol(VisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 2, 34))
->Backbone.Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInGenericFunction_main.ts, 0, 0))
->Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0))
+>VisualizationModel : typeof Backbone.Model
+>Backbone.Model : typeof Backbone.Model
+>Backbone : typeof Backbone
+>Model : typeof Backbone.Model
}
function foo(x: T) {
->foo : (x: T) => T, Symbol(foo, Decl(aliasUsageInGenericFunction_main.ts, 4, 1))
->T : T, Symbol(T, Decl(aliasUsageInGenericFunction_main.ts, 5, 13))
->a : IHasVisualizationModel, Symbol(a, Decl(aliasUsageInGenericFunction_main.ts, 5, 24))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 1, 64))
->x : T, Symbol(x, Decl(aliasUsageInGenericFunction_main.ts, 5, 54))
->T : T, Symbol(T, Decl(aliasUsageInGenericFunction_main.ts, 5, 13))
+>foo : (x: T) => T
+>T : T
+>a : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
+>x : T
+>T : T
return x;
->x : T, Symbol(x, Decl(aliasUsageInGenericFunction_main.ts, 5, 54))
+>x : T
}
var r = foo({ a: moduleA });
->r : { a: typeof moduleA; }, Symbol(r, Decl(aliasUsageInGenericFunction_main.ts, 8, 3))
+>r : { a: typeof moduleA; }
>foo({ a: moduleA }) : { a: typeof moduleA; }
->foo : (x: T) => T, Symbol(foo, Decl(aliasUsageInGenericFunction_main.ts, 4, 1))
+>foo : (x: T) => T
>{ a: moduleA } : { a: typeof moduleA; }
->a : typeof moduleA, Symbol(a, Decl(aliasUsageInGenericFunction_main.ts, 8, 13))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInGenericFunction_main.ts, 0, 66))
+>a : typeof moduleA
+>moduleA : typeof moduleA
var r2 = foo({ a: null });
->r2 : { a: IHasVisualizationModel; }, Symbol(r2, Decl(aliasUsageInGenericFunction_main.ts, 9, 3))
+>r2 : { a: IHasVisualizationModel; }
>foo({ a: null }) : { a: IHasVisualizationModel; }
->foo : (x: T) => T, Symbol(foo, Decl(aliasUsageInGenericFunction_main.ts, 4, 1))
+>foo : (x: T) => T
>{ a: null } : { a: IHasVisualizationModel; }
->a : IHasVisualizationModel, Symbol(a, Decl(aliasUsageInGenericFunction_main.ts, 9, 14))
+>a : IHasVisualizationModel
>null : IHasVisualizationModel
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInGenericFunction_main.ts, 1, 64))
+>IHasVisualizationModel : IHasVisualizationModel
>null : null
=== tests/cases/compiler/aliasUsageInGenericFunction_backbone.ts ===
export class Model {
->Model : Model, Symbol(Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0))
+>Model : Model
public someData: string;
->someData : string, Symbol(someData, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 20))
+>someData : string
}
=== tests/cases/compiler/aliasUsageInGenericFunction_moduleA.ts ===
import Backbone = require("aliasUsageInGenericFunction_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInGenericFunction_moduleA.ts, 0, 0))
+>Backbone : typeof Backbone
export class VisualizationModel extends Backbone.Model {
->VisualizationModel : VisualizationModel, Symbol(VisualizationModel, Decl(aliasUsageInGenericFunction_moduleA.ts, 0, 66))
->Backbone.Model : any, Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInGenericFunction_moduleA.ts, 0, 0))
->Model : Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInGenericFunction_backbone.ts, 0, 0))
+>VisualizationModel : VisualizationModel
+>Backbone.Model : any
+>Backbone : typeof Backbone
+>Model : Backbone.Model
// interesting stuff here
}
diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.symbols b/tests/baselines/reference/aliasUsageInIndexerOfClass.symbols
new file mode 100644
index 00000000000..900653c7fd1
--- /dev/null
+++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.symbols
@@ -0,0 +1,59 @@
+=== tests/cases/compiler/aliasUsageInIndexerOfClass_main.ts ===
+import Backbone = require("aliasUsageInIndexerOfClass_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 0))
+
+import moduleA = require("aliasUsageInIndexerOfClass_moduleA");
+>moduleA : Symbol(moduleA, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 65))
+
+interface IHasVisualizationModel {
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 1, 63))
+
+ VisualizationModel: typeof Backbone.Model;
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 2, 34))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0))
+}
+class N {
+>N : Symbol(N, Decl(aliasUsageInIndexerOfClass_main.ts, 4, 1))
+
+ [idx: string]: IHasVisualizationModel
+>idx : Symbol(idx, Decl(aliasUsageInIndexerOfClass_main.ts, 6, 5))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 1, 63))
+
+ x = moduleA;
+>x : Symbol(x, Decl(aliasUsageInIndexerOfClass_main.ts, 6, 41))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 65))
+}
+class N2 {
+>N2 : Symbol(N2, Decl(aliasUsageInIndexerOfClass_main.ts, 8, 1))
+
+ [idx: string]: typeof moduleA
+>idx : Symbol(idx, Decl(aliasUsageInIndexerOfClass_main.ts, 10, 5))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 65))
+
+ x: IHasVisualizationModel;
+>x : Symbol(x, Decl(aliasUsageInIndexerOfClass_main.ts, 10, 33))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 1, 63))
+}
+=== tests/cases/compiler/aliasUsageInIndexerOfClass_backbone.ts ===
+export class Model {
+>Model : Symbol(Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0))
+
+ public someData: string;
+>someData : Symbol(someData, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 20))
+}
+
+=== tests/cases/compiler/aliasUsageInIndexerOfClass_moduleA.ts ===
+import Backbone = require("aliasUsageInIndexerOfClass_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_moduleA.ts, 0, 0))
+
+export class VisualizationModel extends Backbone.Model {
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInIndexerOfClass_moduleA.ts, 0, 65))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_moduleA.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0))
+
+ // interesting stuff here
+}
+
diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.types b/tests/baselines/reference/aliasUsageInIndexerOfClass.types
index af3a88e9762..fe67655d4f5 100644
--- a/tests/baselines/reference/aliasUsageInIndexerOfClass.types
+++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.types
@@ -1,58 +1,58 @@
=== tests/cases/compiler/aliasUsageInIndexerOfClass_main.ts ===
import Backbone = require("aliasUsageInIndexerOfClass_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 0))
+>Backbone : typeof Backbone
import moduleA = require("aliasUsageInIndexerOfClass_moduleA");
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 65))
+>moduleA : typeof moduleA
interface IHasVisualizationModel {
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 1, 63))
+>IHasVisualizationModel : IHasVisualizationModel
VisualizationModel: typeof Backbone.Model;
->VisualizationModel : typeof Backbone.Model, Symbol(VisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 2, 34))
->Backbone.Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 0))
->Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0))
+>VisualizationModel : typeof Backbone.Model
+>Backbone.Model : typeof Backbone.Model
+>Backbone : typeof Backbone
+>Model : typeof Backbone.Model
}
class N {
->N : N, Symbol(N, Decl(aliasUsageInIndexerOfClass_main.ts, 4, 1))
+>N : N
[idx: string]: IHasVisualizationModel
->idx : string, Symbol(idx, Decl(aliasUsageInIndexerOfClass_main.ts, 6, 5))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 1, 63))
+>idx : string
+>IHasVisualizationModel : IHasVisualizationModel
x = moduleA;
->x : typeof moduleA, Symbol(x, Decl(aliasUsageInIndexerOfClass_main.ts, 6, 41))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 65))
+>x : typeof moduleA
+>moduleA : typeof moduleA
}
class N2 {
->N2 : N2, Symbol(N2, Decl(aliasUsageInIndexerOfClass_main.ts, 8, 1))
+>N2 : N2
[idx: string]: typeof moduleA
->idx : string, Symbol(idx, Decl(aliasUsageInIndexerOfClass_main.ts, 10, 5))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInIndexerOfClass_main.ts, 0, 65))
+>idx : string
+>moduleA : typeof moduleA
x: IHasVisualizationModel;
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInIndexerOfClass_main.ts, 10, 33))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInIndexerOfClass_main.ts, 1, 63))
+>x : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
}
=== tests/cases/compiler/aliasUsageInIndexerOfClass_backbone.ts ===
export class Model {
->Model : Model, Symbol(Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0))
+>Model : Model
public someData: string;
->someData : string, Symbol(someData, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 20))
+>someData : string
}
=== tests/cases/compiler/aliasUsageInIndexerOfClass_moduleA.ts ===
import Backbone = require("aliasUsageInIndexerOfClass_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_moduleA.ts, 0, 0))
+>Backbone : typeof Backbone
export class VisualizationModel extends Backbone.Model {
->VisualizationModel : VisualizationModel, Symbol(VisualizationModel, Decl(aliasUsageInIndexerOfClass_moduleA.ts, 0, 65))
->Backbone.Model : any, Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInIndexerOfClass_moduleA.ts, 0, 0))
->Model : Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInIndexerOfClass_backbone.ts, 0, 0))
+>VisualizationModel : VisualizationModel
+>Backbone.Model : any
+>Backbone : typeof Backbone
+>Model : Backbone.Model
// interesting stuff here
}
diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.symbols b/tests/baselines/reference/aliasUsageInObjectLiteral.symbols
new file mode 100644
index 00000000000..a508e9fafc1
--- /dev/null
+++ b/tests/baselines/reference/aliasUsageInObjectLiteral.symbols
@@ -0,0 +1,60 @@
+=== tests/cases/compiler/aliasUsageInObjectLiteral_main.ts ===
+import Backbone = require("aliasUsageInObjectLiteral_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInObjectLiteral_main.ts, 0, 0))
+
+import moduleA = require("aliasUsageInObjectLiteral_moduleA");
+>moduleA : Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64))
+
+interface IHasVisualizationModel {
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 1, 62))
+
+ VisualizationModel: typeof Backbone.Model;
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 2, 34))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInObjectLiteral_main.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0))
+}
+var a: { x: typeof moduleA } = { x: moduleA };
+>a : Symbol(a, Decl(aliasUsageInObjectLiteral_main.ts, 5, 3))
+>x : Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 5, 8))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64))
+>x : Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 5, 32))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64))
+
+var b: { x: IHasVisualizationModel } = { x: moduleA };
+>b : Symbol(b, Decl(aliasUsageInObjectLiteral_main.ts, 6, 3))
+>x : Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 6, 8))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 1, 62))
+>x : Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 6, 40))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64))
+
+var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } };
+>c : Symbol(c, Decl(aliasUsageInObjectLiteral_main.ts, 7, 3))
+>y : Symbol(y, Decl(aliasUsageInObjectLiteral_main.ts, 7, 8))
+>z : Symbol(z, Decl(aliasUsageInObjectLiteral_main.ts, 7, 13))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 1, 62))
+>y : Symbol(y, Decl(aliasUsageInObjectLiteral_main.ts, 7, 47))
+>z : Symbol(z, Decl(aliasUsageInObjectLiteral_main.ts, 7, 52))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64))
+
+=== tests/cases/compiler/aliasUsageInObjectLiteral_backbone.ts ===
+export class Model {
+>Model : Symbol(Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0))
+
+ public someData: string;
+>someData : Symbol(someData, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 20))
+}
+
+=== tests/cases/compiler/aliasUsageInObjectLiteral_moduleA.ts ===
+import Backbone = require("aliasUsageInObjectLiteral_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInObjectLiteral_moduleA.ts, 0, 0))
+
+export class VisualizationModel extends Backbone.Model {
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInObjectLiteral_moduleA.ts, 0, 64))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInObjectLiteral_moduleA.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0))
+
+ // interesting stuff here
+}
+
diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.types b/tests/baselines/reference/aliasUsageInObjectLiteral.types
index 8d5eed3ca7b..32a78d555b1 100644
--- a/tests/baselines/reference/aliasUsageInObjectLiteral.types
+++ b/tests/baselines/reference/aliasUsageInObjectLiteral.types
@@ -1,63 +1,63 @@
=== tests/cases/compiler/aliasUsageInObjectLiteral_main.ts ===
import Backbone = require("aliasUsageInObjectLiteral_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInObjectLiteral_main.ts, 0, 0))
+>Backbone : typeof Backbone
import moduleA = require("aliasUsageInObjectLiteral_moduleA");
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64))
+>moduleA : typeof moduleA
interface IHasVisualizationModel {
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 1, 62))
+>IHasVisualizationModel : IHasVisualizationModel
VisualizationModel: typeof Backbone.Model;
->VisualizationModel : typeof Backbone.Model, Symbol(VisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 2, 34))
->Backbone.Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInObjectLiteral_main.ts, 0, 0))
->Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0))
+>VisualizationModel : typeof Backbone.Model
+>Backbone.Model : typeof Backbone.Model
+>Backbone : typeof Backbone
+>Model : typeof Backbone.Model
}
var a: { x: typeof moduleA } = { x: moduleA };
->a : { x: typeof moduleA; }, Symbol(a, Decl(aliasUsageInObjectLiteral_main.ts, 5, 3))
->x : typeof moduleA, Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 5, 8))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64))
+>a : { x: typeof moduleA; }
+>x : typeof moduleA
+>moduleA : typeof moduleA
>{ x: moduleA } : { x: typeof moduleA; }
->x : typeof moduleA, Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 5, 32))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64))
+>x : typeof moduleA
+>moduleA : typeof moduleA
var b: { x: IHasVisualizationModel } = { x: moduleA };
->b : { x: IHasVisualizationModel; }, Symbol(b, Decl(aliasUsageInObjectLiteral_main.ts, 6, 3))
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 6, 8))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 1, 62))
+>b : { x: IHasVisualizationModel; }
+>x : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
>{ x: moduleA } : { x: typeof moduleA; }
->x : typeof moduleA, Symbol(x, Decl(aliasUsageInObjectLiteral_main.ts, 6, 40))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64))
+>x : typeof moduleA
+>moduleA : typeof moduleA
var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } };
->c : { y: { z: IHasVisualizationModel; }; }, Symbol(c, Decl(aliasUsageInObjectLiteral_main.ts, 7, 3))
->y : { z: IHasVisualizationModel; }, Symbol(y, Decl(aliasUsageInObjectLiteral_main.ts, 7, 8))
->z : IHasVisualizationModel, Symbol(z, Decl(aliasUsageInObjectLiteral_main.ts, 7, 13))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInObjectLiteral_main.ts, 1, 62))
+>c : { y: { z: IHasVisualizationModel; }; }
+>y : { z: IHasVisualizationModel; }
+>z : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
>{ y: { z: moduleA } } : { y: { z: typeof moduleA; }; }
->y : { z: typeof moduleA; }, Symbol(y, Decl(aliasUsageInObjectLiteral_main.ts, 7, 47))
+>y : { z: typeof moduleA; }
>{ z: moduleA } : { z: typeof moduleA; }
->z : typeof moduleA, Symbol(z, Decl(aliasUsageInObjectLiteral_main.ts, 7, 52))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInObjectLiteral_main.ts, 0, 64))
+>z : typeof moduleA
+>moduleA : typeof moduleA
=== tests/cases/compiler/aliasUsageInObjectLiteral_backbone.ts ===
export class Model {
->Model : Model, Symbol(Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0))
+>Model : Model
public someData: string;
->someData : string, Symbol(someData, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 20))
+>someData : string
}
=== tests/cases/compiler/aliasUsageInObjectLiteral_moduleA.ts ===
import Backbone = require("aliasUsageInObjectLiteral_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInObjectLiteral_moduleA.ts, 0, 0))
+>Backbone : typeof Backbone
export class VisualizationModel extends Backbone.Model {
->VisualizationModel : VisualizationModel, Symbol(VisualizationModel, Decl(aliasUsageInObjectLiteral_moduleA.ts, 0, 64))
->Backbone.Model : any, Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInObjectLiteral_moduleA.ts, 0, 0))
->Model : Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInObjectLiteral_backbone.ts, 0, 0))
+>VisualizationModel : VisualizationModel
+>Backbone.Model : any
+>Backbone : typeof Backbone
+>Model : Backbone.Model
// interesting stuff here
}
diff --git a/tests/baselines/reference/aliasUsageInOrExpression.symbols b/tests/baselines/reference/aliasUsageInOrExpression.symbols
new file mode 100644
index 00000000000..adfba01a119
--- /dev/null
+++ b/tests/baselines/reference/aliasUsageInOrExpression.symbols
@@ -0,0 +1,76 @@
+=== tests/cases/compiler/aliasUsageInOrExpression_main.ts ===
+import Backbone = require("aliasUsageInOrExpression_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInOrExpression_main.ts, 0, 0))
+
+import moduleA = require("aliasUsageInOrExpression_moduleA");
+>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+
+interface IHasVisualizationModel {
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+
+ VisualizationModel: typeof Backbone.Model;
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 2, 34))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInOrExpression_main.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
+}
+var i: IHasVisualizationModel;
+>i : Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+
+var d1 = i || moduleA;
+>d1 : Symbol(d1, Decl(aliasUsageInOrExpression_main.ts, 6, 3))
+>i : Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+
+var d2: IHasVisualizationModel = i || moduleA;
+>d2 : Symbol(d2, Decl(aliasUsageInOrExpression_main.ts, 7, 3), Decl(aliasUsageInOrExpression_main.ts, 8, 3))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>i : Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+
+var d2: IHasVisualizationModel = moduleA || i;
+>d2 : Symbol(d2, Decl(aliasUsageInOrExpression_main.ts, 7, 3), Decl(aliasUsageInOrExpression_main.ts, 8, 3))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+>i : Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
+
+var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA };
+>e : Symbol(e, Decl(aliasUsageInOrExpression_main.ts, 9, 3))
+>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 8))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 41))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 79))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+
+var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null;
+>f : Symbol(f, Decl(aliasUsageInOrExpression_main.ts, 10, 3))
+>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 8))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 41))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>x : Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 78))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+
+=== tests/cases/compiler/aliasUsageInOrExpression_backbone.ts ===
+export class Model {
+>Model : Symbol(Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
+
+ public someData: string;
+>someData : Symbol(someData, Decl(aliasUsageInOrExpression_backbone.ts, 0, 20))
+}
+
+=== tests/cases/compiler/aliasUsageInOrExpression_moduleA.ts ===
+import Backbone = require("aliasUsageInOrExpression_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 0))
+
+export class VisualizationModel extends Backbone.Model {
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 63))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
+
+ // interesting stuff here
+}
+
diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types b/tests/baselines/reference/aliasUsageInOrExpression.types
index dace1e1f7fa..8d3163d481b 100644
--- a/tests/baselines/reference/aliasUsageInOrExpression.types
+++ b/tests/baselines/reference/aliasUsageInOrExpression.types
@@ -1,87 +1,87 @@
=== tests/cases/compiler/aliasUsageInOrExpression_main.ts ===
import Backbone = require("aliasUsageInOrExpression_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInOrExpression_main.ts, 0, 0))
+>Backbone : typeof Backbone
import moduleA = require("aliasUsageInOrExpression_moduleA");
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+>moduleA : typeof moduleA
interface IHasVisualizationModel {
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>IHasVisualizationModel : IHasVisualizationModel
VisualizationModel: typeof Backbone.Model;
->VisualizationModel : typeof Backbone.Model, Symbol(VisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 2, 34))
->Backbone.Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInOrExpression_main.ts, 0, 0))
->Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
+>VisualizationModel : typeof Backbone.Model
+>Backbone.Model : typeof Backbone.Model
+>Backbone : typeof Backbone
+>Model : typeof Backbone.Model
}
var i: IHasVisualizationModel;
->i : IHasVisualizationModel, Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>i : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
var d1 = i || moduleA;
->d1 : IHasVisualizationModel, Symbol(d1, Decl(aliasUsageInOrExpression_main.ts, 6, 3))
+>d1 : IHasVisualizationModel
>i || moduleA : IHasVisualizationModel
->i : IHasVisualizationModel, Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+>i : IHasVisualizationModel
+>moduleA : typeof moduleA
var d2: IHasVisualizationModel = i || moduleA;
->d2 : IHasVisualizationModel, Symbol(d2, Decl(aliasUsageInOrExpression_main.ts, 7, 3), Decl(aliasUsageInOrExpression_main.ts, 8, 3))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>d2 : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
>i || moduleA : IHasVisualizationModel
->i : IHasVisualizationModel, Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+>i : IHasVisualizationModel
+>moduleA : typeof moduleA
var d2: IHasVisualizationModel = moduleA || i;
->d2 : IHasVisualizationModel, Symbol(d2, Decl(aliasUsageInOrExpression_main.ts, 7, 3), Decl(aliasUsageInOrExpression_main.ts, 8, 3))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>d2 : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
>moduleA || i : IHasVisualizationModel
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
->i : IHasVisualizationModel, Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
+>moduleA : typeof moduleA
+>i : IHasVisualizationModel
var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA };
->e : { x: IHasVisualizationModel; }, Symbol(e, Decl(aliasUsageInOrExpression_main.ts, 9, 3))
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 8))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>e : { x: IHasVisualizationModel; }
+>x : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
><{ x: IHasVisualizationModel }>null || { x: moduleA } : { x: IHasVisualizationModel; }
><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; }
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 41))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>x : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
>null : null
>{ x: moduleA } : { x: typeof moduleA; }
->x : typeof moduleA, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 79))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+>x : typeof moduleA
+>moduleA : typeof moduleA
var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null;
->f : { x: IHasVisualizationModel; }, Symbol(f, Decl(aliasUsageInOrExpression_main.ts, 10, 3))
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 8))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>f : { x: IHasVisualizationModel; }
+>x : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: typeof moduleA; }
><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; }
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 41))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
+>x : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
>null : null
>{ x: moduleA } : { x: typeof moduleA; }
->x : typeof moduleA, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 78))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
+>x : typeof moduleA
+>moduleA : typeof moduleA
>null : null
=== tests/cases/compiler/aliasUsageInOrExpression_backbone.ts ===
export class Model {
->Model : Model, Symbol(Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
+>Model : Model
public someData: string;
->someData : string, Symbol(someData, Decl(aliasUsageInOrExpression_backbone.ts, 0, 20))
+>someData : string
}
=== tests/cases/compiler/aliasUsageInOrExpression_moduleA.ts ===
import Backbone = require("aliasUsageInOrExpression_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 0))
+>Backbone : typeof Backbone
export class VisualizationModel extends Backbone.Model {
->VisualizationModel : VisualizationModel, Symbol(VisualizationModel, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 63))
->Backbone.Model : any, Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 0))
->Model : Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
+>VisualizationModel : VisualizationModel
+>Backbone.Model : any
+>Backbone : typeof Backbone
+>Model : Backbone.Model
// interesting stuff here
}
diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types.pull b/tests/baselines/reference/aliasUsageInOrExpression.types.pull
deleted file mode 100644
index 37fc6d54f33..00000000000
--- a/tests/baselines/reference/aliasUsageInOrExpression.types.pull
+++ /dev/null
@@ -1,88 +0,0 @@
-=== tests/cases/compiler/aliasUsageInOrExpression_main.ts ===
-import Backbone = require("aliasUsageInOrExpression_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInOrExpression_main.ts, 0, 0))
-
-import moduleA = require("aliasUsageInOrExpression_moduleA");
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
-
-interface IHasVisualizationModel {
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
-
- VisualizationModel: typeof Backbone.Model;
->VisualizationModel : typeof Backbone.Model, Symbol(VisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 2, 34))
->Backbone.Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInOrExpression_main.ts, 0, 0))
->Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
-}
-var i: IHasVisualizationModel;
->i : IHasVisualizationModel, Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
-
-var d1 = i || moduleA;
->d1 : typeof moduleA, Symbol(d1, Decl(aliasUsageInOrExpression_main.ts, 6, 3))
->i || moduleA : typeof moduleA
->i : IHasVisualizationModel, Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
-
-var d2: IHasVisualizationModel = i || moduleA;
->d2 : IHasVisualizationModel, Symbol(d2, Decl(aliasUsageInOrExpression_main.ts, 7, 3), Decl(aliasUsageInOrExpression_main.ts, 8, 3))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
->i || moduleA : typeof moduleA
->i : IHasVisualizationModel, Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
-
-var d2: IHasVisualizationModel = moduleA || i;
->d2 : IHasVisualizationModel, Symbol(d2, Decl(aliasUsageInOrExpression_main.ts, 7, 3), Decl(aliasUsageInOrExpression_main.ts, 8, 3))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
->moduleA || i : typeof moduleA
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
->i : IHasVisualizationModel, Symbol(i, Decl(aliasUsageInOrExpression_main.ts, 5, 3))
-
-var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA };
->e : { x: IHasVisualizationModel; }, Symbol(e, Decl(aliasUsageInOrExpression_main.ts, 9, 3))
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 8))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
-><{ x: IHasVisualizationModel }>null || { x: moduleA } : { x: IHasVisualizationModel; }
-><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; }
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 41))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
->null : null
->{ x: moduleA } : { x: typeof moduleA; }
->x : typeof moduleA, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 9, 79))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
-
-var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null;
->f : { x: IHasVisualizationModel; }, Symbol(f, Decl(aliasUsageInOrExpression_main.ts, 10, 3))
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 8))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
-><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: typeof moduleA; }
-><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; }
->x : IHasVisualizationModel, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 41))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInOrExpression_main.ts, 1, 61))
->null : null
->{ x: moduleA } : { x: typeof moduleA; }
->x : typeof moduleA, Symbol(x, Decl(aliasUsageInOrExpression_main.ts, 10, 78))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInOrExpression_main.ts, 0, 63))
->null : null
-
-=== tests/cases/compiler/aliasUsageInOrExpression_backbone.ts ===
-export class Model {
->Model : Model, Symbol(Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
-
- public someData: string;
->someData : string, Symbol(someData, Decl(aliasUsageInOrExpression_backbone.ts, 0, 20))
-}
-
-=== tests/cases/compiler/aliasUsageInOrExpression_moduleA.ts ===
-import Backbone = require("aliasUsageInOrExpression_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 0))
-
-export class VisualizationModel extends Backbone.Model {
->VisualizationModel : VisualizationModel, Symbol(VisualizationModel, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 63))
->Backbone.Model : any, Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInOrExpression_moduleA.ts, 0, 0))
->Model : Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInOrExpression_backbone.ts, 0, 0))
-
- // interesting stuff here
-}
-
diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.symbols b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.symbols
new file mode 100644
index 00000000000..f3ca1f7ec37
--- /dev/null
+++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.symbols
@@ -0,0 +1,55 @@
+=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_main.ts ===
+import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 0))
+
+import moduleA = require("aliasUsageInTypeArgumentOfExtendsClause_moduleA");
+>moduleA : Symbol(moduleA, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 78))
+
+interface IHasVisualizationModel {
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 1, 76))
+
+ VisualizationModel: typeof Backbone.Model;
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 2, 34))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0))
+}
+class C {
+>C : Symbol(C, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 4, 1))
+>T : Symbol(T, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 5, 8))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 1, 76))
+
+ x: T;
+>x : Symbol(x, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 5, 43))
+>T : Symbol(T, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 5, 8))
+}
+class D extends C {
+>D : Symbol(D, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 7, 1))
+>C : Symbol(C, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 4, 1))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 1, 76))
+
+ x = moduleA;
+>x : Symbol(x, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 8, 43))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 78))
+}
+=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_backbone.ts ===
+export class Model {
+>Model : Symbol(Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0))
+
+ public someData: string;
+>someData : Symbol(someData, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 20))
+}
+
+=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts ===
+import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts, 0, 0))
+
+export class VisualizationModel extends Backbone.Model {
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts, 0, 78))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0))
+
+ // interesting stuff here
+}
+
diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types
index aef12f4fb23..460b422a2a4 100644
--- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types
+++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types
@@ -1,54 +1,54 @@
=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_main.ts ===
import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 0))
+>Backbone : typeof Backbone
import moduleA = require("aliasUsageInTypeArgumentOfExtendsClause_moduleA");
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 78))
+>moduleA : typeof moduleA
interface IHasVisualizationModel {
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 1, 76))
+>IHasVisualizationModel : IHasVisualizationModel
VisualizationModel: typeof Backbone.Model;
->VisualizationModel : typeof Backbone.Model, Symbol(VisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 2, 34))
->Backbone.Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 0))
->Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0))
+>VisualizationModel : typeof Backbone.Model
+>Backbone.Model : typeof Backbone.Model
+>Backbone : typeof Backbone
+>Model : typeof Backbone.Model
}
class C {
->C : C, Symbol(C, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 4, 1))
->T : T, Symbol(T, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 5, 8))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 1, 76))
+>C : C
+>T : T
+>IHasVisualizationModel : IHasVisualizationModel
x: T;
->x : T, Symbol(x, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 5, 43))
->T : T, Symbol(T, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 5, 8))
+>x : T
+>T : T
}
class D extends C {
->D : D, Symbol(D, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 7, 1))
->C : C, Symbol(C, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 4, 1))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 1, 76))
+>D : D
+>C : C
+>IHasVisualizationModel : IHasVisualizationModel
x = moduleA;
->x : typeof moduleA, Symbol(x, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 8, 43))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInTypeArgumentOfExtendsClause_main.ts, 0, 78))
+>x : typeof moduleA
+>moduleA : typeof moduleA
}
=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_backbone.ts ===
export class Model {
->Model : Model, Symbol(Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0))
+>Model : Model
public someData: string;
->someData : string, Symbol(someData, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 20))
+>someData : string
}
=== tests/cases/compiler/aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts ===
import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts, 0, 0))
+>Backbone : typeof Backbone
export class VisualizationModel extends Backbone.Model {
->VisualizationModel : VisualizationModel, Symbol(VisualizationModel, Decl(aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts, 0, 78))
->Backbone.Model : any, Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts, 0, 0))
->Model : Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInTypeArgumentOfExtendsClause_backbone.ts, 0, 0))
+>VisualizationModel : VisualizationModel
+>Backbone.Model : any
+>Backbone : typeof Backbone
+>Model : Backbone.Model
// interesting stuff here
}
diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.symbols b/tests/baselines/reference/aliasUsageInVarAssignment.symbols
new file mode 100644
index 00000000000..d1996fe8ecb
--- /dev/null
+++ b/tests/baselines/reference/aliasUsageInVarAssignment.symbols
@@ -0,0 +1,46 @@
+=== tests/cases/compiler/aliasUsageInVarAssignment_main.ts ===
+import Backbone = require("aliasUsageInVarAssignment_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInVarAssignment_main.ts, 0, 0))
+
+import moduleA = require("aliasUsageInVarAssignment_moduleA");
+>moduleA : Symbol(moduleA, Decl(aliasUsageInVarAssignment_main.ts, 0, 64))
+
+interface IHasVisualizationModel {
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInVarAssignment_main.ts, 1, 62))
+
+ VisualizationModel: typeof Backbone.Model;
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInVarAssignment_main.ts, 2, 34))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInVarAssignment_main.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0))
+}
+var i: IHasVisualizationModel;
+>i : Symbol(i, Decl(aliasUsageInVarAssignment_main.ts, 5, 3))
+>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(aliasUsageInVarAssignment_main.ts, 1, 62))
+
+var m: typeof moduleA = i;
+>m : Symbol(m, Decl(aliasUsageInVarAssignment_main.ts, 6, 3))
+>moduleA : Symbol(moduleA, Decl(aliasUsageInVarAssignment_main.ts, 0, 64))
+>i : Symbol(i, Decl(aliasUsageInVarAssignment_main.ts, 5, 3))
+
+=== tests/cases/compiler/aliasUsageInVarAssignment_backbone.ts ===
+export class Model {
+>Model : Symbol(Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0))
+
+ public someData: string;
+>someData : Symbol(someData, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 20))
+}
+
+=== tests/cases/compiler/aliasUsageInVarAssignment_moduleA.ts ===
+import Backbone = require("aliasUsageInVarAssignment_backbone");
+>Backbone : Symbol(Backbone, Decl(aliasUsageInVarAssignment_moduleA.ts, 0, 0))
+
+export class VisualizationModel extends Backbone.Model {
+>VisualizationModel : Symbol(VisualizationModel, Decl(aliasUsageInVarAssignment_moduleA.ts, 0, 64))
+>Backbone.Model : Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0))
+>Backbone : Symbol(Backbone, Decl(aliasUsageInVarAssignment_moduleA.ts, 0, 0))
+>Model : Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0))
+
+ // interesting stuff here
+}
+
diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.types b/tests/baselines/reference/aliasUsageInVarAssignment.types
index b31cd522978..b5d20a1b372 100644
--- a/tests/baselines/reference/aliasUsageInVarAssignment.types
+++ b/tests/baselines/reference/aliasUsageInVarAssignment.types
@@ -1,45 +1,45 @@
=== tests/cases/compiler/aliasUsageInVarAssignment_main.ts ===
import Backbone = require("aliasUsageInVarAssignment_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInVarAssignment_main.ts, 0, 0))
+>Backbone : typeof Backbone
import moduleA = require("aliasUsageInVarAssignment_moduleA");
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInVarAssignment_main.ts, 0, 64))
+>moduleA : typeof moduleA
interface IHasVisualizationModel {
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInVarAssignment_main.ts, 1, 62))
+>IHasVisualizationModel : IHasVisualizationModel
VisualizationModel: typeof Backbone.Model;
->VisualizationModel : typeof Backbone.Model, Symbol(VisualizationModel, Decl(aliasUsageInVarAssignment_main.ts, 2, 34))
->Backbone.Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInVarAssignment_main.ts, 0, 0))
->Model : typeof Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0))
+>VisualizationModel : typeof Backbone.Model
+>Backbone.Model : typeof Backbone.Model
+>Backbone : typeof Backbone
+>Model : typeof Backbone.Model
}
var i: IHasVisualizationModel;
->i : IHasVisualizationModel, Symbol(i, Decl(aliasUsageInVarAssignment_main.ts, 5, 3))
->IHasVisualizationModel : IHasVisualizationModel, Symbol(IHasVisualizationModel, Decl(aliasUsageInVarAssignment_main.ts, 1, 62))
+>i : IHasVisualizationModel
+>IHasVisualizationModel : IHasVisualizationModel
var m: typeof moduleA = i;
->m : typeof moduleA, Symbol(m, Decl(aliasUsageInVarAssignment_main.ts, 6, 3))
->moduleA : typeof moduleA, Symbol(moduleA, Decl(aliasUsageInVarAssignment_main.ts, 0, 64))
->i : IHasVisualizationModel, Symbol(i, Decl(aliasUsageInVarAssignment_main.ts, 5, 3))
+>m : typeof moduleA
+>moduleA : typeof moduleA
+>i : IHasVisualizationModel
=== tests/cases/compiler/aliasUsageInVarAssignment_backbone.ts ===
export class Model {
->Model : Model, Symbol(Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0))
+>Model : Model
public someData: string;
->someData : string, Symbol(someData, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 20))
+>someData : string
}
=== tests/cases/compiler/aliasUsageInVarAssignment_moduleA.ts ===
import Backbone = require("aliasUsageInVarAssignment_backbone");
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInVarAssignment_moduleA.ts, 0, 0))
+>Backbone : typeof Backbone
export class VisualizationModel extends Backbone.Model {
->VisualizationModel : VisualizationModel, Symbol(VisualizationModel, Decl(aliasUsageInVarAssignment_moduleA.ts, 0, 64))
->Backbone.Model : any, Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0))
->Backbone : typeof Backbone, Symbol(Backbone, Decl(aliasUsageInVarAssignment_moduleA.ts, 0, 0))
->Model : Backbone.Model, Symbol(Backbone.Model, Decl(aliasUsageInVarAssignment_backbone.ts, 0, 0))
+>VisualizationModel : VisualizationModel
+>Backbone.Model : any
+>Backbone : typeof Backbone
+>Model : Backbone.Model
// interesting stuff here
}
diff --git a/tests/baselines/reference/aliasUsedAsNameValue.symbols b/tests/baselines/reference/aliasUsedAsNameValue.symbols
new file mode 100644
index 00000000000..a816e2b2c63
--- /dev/null
+++ b/tests/baselines/reference/aliasUsedAsNameValue.symbols
@@ -0,0 +1,29 @@
+=== tests/cases/compiler/aliasUsedAsNameValue_2.ts ===
+///
+///
+import mod = require("aliasUsedAsNameValue_0");
+>mod : Symbol(mod, Decl(aliasUsedAsNameValue_2.ts, 0, 0))
+
+import b = require("aliasUsedAsNameValue_1");
+>b : Symbol(b, Decl(aliasUsedAsNameValue_2.ts, 2, 47))
+
+export var a = function () {
+>a : Symbol(a, Decl(aliasUsedAsNameValue_2.ts, 5, 10))
+
+ //var x = mod.id; // TODO needed hack that mod is loaded
+ b.b(mod);
+>b.b : Symbol(b.b, Decl(aliasUsedAsNameValue_1.ts, 0, 0))
+>b : Symbol(b, Decl(aliasUsedAsNameValue_2.ts, 2, 47))
+>b : Symbol(b.b, Decl(aliasUsedAsNameValue_1.ts, 0, 0))
+>mod : Symbol(mod, Decl(aliasUsedAsNameValue_2.ts, 0, 0))
+}
+
+=== tests/cases/compiler/aliasUsedAsNameValue_0.ts ===
+export var id: number;
+>id : Symbol(id, Decl(aliasUsedAsNameValue_0.ts, 0, 10))
+
+=== tests/cases/compiler/aliasUsedAsNameValue_1.ts ===
+export function b(a: any): any { return null; }
+>b : Symbol(b, Decl(aliasUsedAsNameValue_1.ts, 0, 0))
+>a : Symbol(a, Decl(aliasUsedAsNameValue_1.ts, 0, 18))
+
diff --git a/tests/baselines/reference/aliasUsedAsNameValue.types b/tests/baselines/reference/aliasUsedAsNameValue.types
index fc006f03a1b..9c519786c76 100644
--- a/tests/baselines/reference/aliasUsedAsNameValue.types
+++ b/tests/baselines/reference/aliasUsedAsNameValue.types
@@ -2,31 +2,31 @@
///
///
import mod = require("aliasUsedAsNameValue_0");
->mod : typeof mod, Symbol(mod, Decl(aliasUsedAsNameValue_2.ts, 0, 0))
+>mod : typeof mod
import b = require("aliasUsedAsNameValue_1");
->b : typeof b, Symbol(b, Decl(aliasUsedAsNameValue_2.ts, 2, 47))
+>b : typeof b
export var a = function () {
->a : () => void, Symbol(a, Decl(aliasUsedAsNameValue_2.ts, 5, 10))
+>a : () => void
>function () { //var x = mod.id; // TODO needed hack that mod is loaded b.b(mod);} : () => void
//var x = mod.id; // TODO needed hack that mod is loaded
b.b(mod);
>b.b(mod) : any
->b.b : (a: any) => any, Symbol(b.b, Decl(aliasUsedAsNameValue_1.ts, 0, 0))
->b : typeof b, Symbol(b, Decl(aliasUsedAsNameValue_2.ts, 2, 47))
->b : (a: any) => any, Symbol(b.b, Decl(aliasUsedAsNameValue_1.ts, 0, 0))
->mod : typeof mod, Symbol(mod, Decl(aliasUsedAsNameValue_2.ts, 0, 0))
+>b.b : (a: any) => any
+>b : typeof b
+>b : (a: any) => any
+>mod : typeof mod
}
=== tests/cases/compiler/aliasUsedAsNameValue_0.ts ===
export var id: number;
->id : number, Symbol(id, Decl(aliasUsedAsNameValue_0.ts, 0, 10))
+>id : number
=== tests/cases/compiler/aliasUsedAsNameValue_1.ts ===
export function b(a: any): any { return null; }
->b : (a: any) => any, Symbol(b, Decl(aliasUsedAsNameValue_1.ts, 0, 0))
->a : any, Symbol(a, Decl(aliasUsedAsNameValue_1.ts, 0, 18))
+>b : (a: any) => any
+>a : any
>null : null
diff --git a/tests/baselines/reference/ambientClassDeclarationWithExtends.symbols b/tests/baselines/reference/ambientClassDeclarationWithExtends.symbols
new file mode 100644
index 00000000000..71d1e1a66d8
--- /dev/null
+++ b/tests/baselines/reference/ambientClassDeclarationWithExtends.symbols
@@ -0,0 +1,8 @@
+=== tests/cases/compiler/ambientClassDeclarationWithExtends.ts ===
+declare class A { }
+>A : Symbol(A, Decl(ambientClassDeclarationWithExtends.ts, 0, 0))
+
+declare class B extends A { }
+>B : Symbol(B, Decl(ambientClassDeclarationWithExtends.ts, 0, 19))
+>A : Symbol(A, Decl(ambientClassDeclarationWithExtends.ts, 0, 0))
+
diff --git a/tests/baselines/reference/ambientClassDeclarationWithExtends.types b/tests/baselines/reference/ambientClassDeclarationWithExtends.types
index b8d3df42f2b..7609856882b 100644
--- a/tests/baselines/reference/ambientClassDeclarationWithExtends.types
+++ b/tests/baselines/reference/ambientClassDeclarationWithExtends.types
@@ -1,8 +1,8 @@
=== tests/cases/compiler/ambientClassDeclarationWithExtends.ts ===
declare class A { }
->A : A, Symbol(A, Decl(ambientClassDeclarationWithExtends.ts, 0, 0))
+>A : A
declare class B extends A { }
->B : B, Symbol(B, Decl(ambientClassDeclarationWithExtends.ts, 0, 19))
->A : A, Symbol(A, Decl(ambientClassDeclarationWithExtends.ts, 0, 0))
+>B : B
+>A : A
diff --git a/tests/baselines/reference/ambientDeclarations.symbols b/tests/baselines/reference/ambientDeclarations.symbols
new file mode 100644
index 00000000000..e5b85ae7c2c
--- /dev/null
+++ b/tests/baselines/reference/ambientDeclarations.symbols
@@ -0,0 +1,167 @@
+=== tests/cases/conformance/ambient/ambientDeclarations.ts ===
+// Ambient variable without type annotation
+declare var n;
+>n : Symbol(n, Decl(ambientDeclarations.ts, 1, 11))
+
+// Ambient variable with type annotation
+declare var m: string;
+>m : Symbol(m, Decl(ambientDeclarations.ts, 4, 11))
+
+// Ambient function with no type annotations
+declare function fn1();
+>fn1 : Symbol(fn1, Decl(ambientDeclarations.ts, 4, 22))
+
+// Ambient function with type annotations
+declare function fn2(n: string): number;
+>fn2 : Symbol(fn2, Decl(ambientDeclarations.ts, 7, 23))
+>n : Symbol(n, Decl(ambientDeclarations.ts, 10, 21))
+
+// Ambient function with valid overloads
+declare function fn3(n: string): number;
+>fn3 : Symbol(fn3, Decl(ambientDeclarations.ts, 10, 40))
+>n : Symbol(n, Decl(ambientDeclarations.ts, 13, 21))
+
+declare function fn4(n: number, y: number): string;
+>fn4 : Symbol(fn4, Decl(ambientDeclarations.ts, 13, 40))
+>n : Symbol(n, Decl(ambientDeclarations.ts, 14, 21))
+>y : Symbol(y, Decl(ambientDeclarations.ts, 14, 31))
+
+// Ambient function with optional parameters
+declare function fn5(x, y?);
+>fn5 : Symbol(fn5, Decl(ambientDeclarations.ts, 14, 51))
+>x : Symbol(x, Decl(ambientDeclarations.ts, 17, 21))
+>y : Symbol(y, Decl(ambientDeclarations.ts, 17, 23))
+
+declare function fn6(e?);
+>fn6 : Symbol(fn6, Decl(ambientDeclarations.ts, 17, 28))
+>e : Symbol(e, Decl(ambientDeclarations.ts, 18, 21))
+
+declare function fn7(x, y?, ...z);
+>fn7 : Symbol(fn7, Decl(ambientDeclarations.ts, 18, 25))
+>x : Symbol(x, Decl(ambientDeclarations.ts, 19, 21))
+>y : Symbol(y, Decl(ambientDeclarations.ts, 19, 23))
+>z : Symbol(z, Decl(ambientDeclarations.ts, 19, 27))
+
+declare function fn8(y?, ...z: number[]);
+>fn8 : Symbol(fn8, Decl(ambientDeclarations.ts, 19, 34))
+>y : Symbol(y, Decl(ambientDeclarations.ts, 20, 21))
+>z : Symbol(z, Decl(ambientDeclarations.ts, 20, 24))
+
+declare function fn9(...q: {}[]);
+>fn9 : Symbol(fn9, Decl(ambientDeclarations.ts, 20, 41))
+>q : Symbol(q, Decl(ambientDeclarations.ts, 21, 21))
+
+declare function fn10(...q: T[]);
+>fn10 : Symbol(fn10, Decl(ambientDeclarations.ts, 21, 33))
+>T : Symbol(T, Decl(ambientDeclarations.ts, 22, 22))
+>q : Symbol(q, Decl(ambientDeclarations.ts, 22, 25))
+>T : Symbol(T, Decl(ambientDeclarations.ts, 22, 22))
+
+// Ambient class
+declare class cls {
+>cls : Symbol(cls, Decl(ambientDeclarations.ts, 22, 36))
+
+ constructor();
+ method(): cls;
+>method : Symbol(method, Decl(ambientDeclarations.ts, 26, 18))
+>cls : Symbol(cls, Decl(ambientDeclarations.ts, 22, 36))
+
+ static static(p): number;
+>static : Symbol(cls.static, Decl(ambientDeclarations.ts, 27, 18))
+>p : Symbol(p, Decl(ambientDeclarations.ts, 28, 18))
+
+ static q;
+>q : Symbol(cls.q, Decl(ambientDeclarations.ts, 28, 29))
+
+ private fn();
+>fn : Symbol(fn, Decl(ambientDeclarations.ts, 29, 13))
+
+ private static fns();
+>fns : Symbol(cls.fns, Decl(ambientDeclarations.ts, 30, 17))
+}
+
+// Ambient enum
+declare enum E1 {
+>E1 : Symbol(E1, Decl(ambientDeclarations.ts, 32, 1))
+
+ x,
+>x : Symbol(E1.x, Decl(ambientDeclarations.ts, 35, 17))
+
+ y,
+>y : Symbol(E1.y, Decl(ambientDeclarations.ts, 36, 6))
+
+ z
+>z : Symbol(E1.z, Decl(ambientDeclarations.ts, 37, 6))
+}
+
+// Ambient enum with integer literal initializer
+declare enum E2 {
+>E2 : Symbol(E2, Decl(ambientDeclarations.ts, 39, 1))
+
+ q,
+>q : Symbol(E2.q, Decl(ambientDeclarations.ts, 42, 17))
+
+ a = 1,
+>a : Symbol(E2.a, Decl(ambientDeclarations.ts, 43, 6))
+
+ b,
+>b : Symbol(E2.b, Decl(ambientDeclarations.ts, 44, 10))
+
+ c = 2,
+>c : Symbol(E2.c, Decl(ambientDeclarations.ts, 45, 6))
+
+ d
+>d : Symbol(E2.d, Decl(ambientDeclarations.ts, 46, 10))
+}
+
+// Ambient enum members are always exported with or without export keyword
+declare enum E3 {
+>E3 : Symbol(E3, Decl(ambientDeclarations.ts, 48, 1), Decl(ambientDeclarations.ts, 53, 1))
+
+ A
+>A : Symbol(E3.A, Decl(ambientDeclarations.ts, 51, 17))
+}
+declare module E3 {
+>E3 : Symbol(E3, Decl(ambientDeclarations.ts, 48, 1), Decl(ambientDeclarations.ts, 53, 1))
+
+ var B;
+>B : Symbol(B, Decl(ambientDeclarations.ts, 55, 7))
+}
+var x = E3.B;
+>x : Symbol(x, Decl(ambientDeclarations.ts, 57, 3))
+>E3.B : Symbol(E3.B, Decl(ambientDeclarations.ts, 55, 7))
+>E3 : Symbol(E3, Decl(ambientDeclarations.ts, 48, 1), Decl(ambientDeclarations.ts, 53, 1))
+>B : Symbol(E3.B, Decl(ambientDeclarations.ts, 55, 7))
+
+// Ambient module
+declare module M1 {
+>M1 : Symbol(M1, Decl(ambientDeclarations.ts, 57, 13))
+
+ var x;
+>x : Symbol(x, Decl(ambientDeclarations.ts, 61, 7))
+
+ function fn(): number;
+>fn : Symbol(fn, Decl(ambientDeclarations.ts, 61, 10))
+}
+
+// Ambient module members are always exported with or without export keyword
+var p = M1.x;
+>p : Symbol(p, Decl(ambientDeclarations.ts, 66, 3))
+>M1.x : Symbol(M1.x, Decl(ambientDeclarations.ts, 61, 7))
+>M1 : Symbol(M1, Decl(ambientDeclarations.ts, 57, 13))
+>x : Symbol(M1.x, Decl(ambientDeclarations.ts, 61, 7))
+
+var q = M1.fn();
+>q : Symbol(q, Decl(ambientDeclarations.ts, 67, 3))
+>M1.fn : Symbol(M1.fn, Decl(ambientDeclarations.ts, 61, 10))
+>M1 : Symbol(M1, Decl(ambientDeclarations.ts, 57, 13))
+>fn : Symbol(M1.fn, Decl(ambientDeclarations.ts, 61, 10))
+
+// Ambient external module in the global module
+// Ambient external module with a string literal name that is a top level external module name
+declare module 'external1' {
+ var q;
+>q : Symbol(q, Decl(ambientDeclarations.ts, 72, 7))
+}
+
+
diff --git a/tests/baselines/reference/ambientDeclarations.types b/tests/baselines/reference/ambientDeclarations.types
index 0bc407c7ef4..f44d49cfc57 100644
--- a/tests/baselines/reference/ambientDeclarations.types
+++ b/tests/baselines/reference/ambientDeclarations.types
@@ -1,170 +1,170 @@
=== tests/cases/conformance/ambient/ambientDeclarations.ts ===
// Ambient variable without type annotation
declare var n;
->n : any, Symbol(n, Decl(ambientDeclarations.ts, 1, 11))
+>n : any
// Ambient variable with type annotation
declare var m: string;
->m : string, Symbol(m, Decl(ambientDeclarations.ts, 4, 11))
+>m : string
// Ambient function with no type annotations
declare function fn1();
->fn1 : () => any, Symbol(fn1, Decl(ambientDeclarations.ts, 4, 22))
+>fn1 : () => any
// Ambient function with type annotations
declare function fn2(n: string): number;
->fn2 : (n: string) => number, Symbol(fn2, Decl(ambientDeclarations.ts, 7, 23))
->n : string, Symbol(n, Decl(ambientDeclarations.ts, 10, 21))
+>fn2 : (n: string) => number
+>n : string
// Ambient function with valid overloads
declare function fn3(n: string): number;
->fn3 : (n: string) => number, Symbol(fn3, Decl(ambientDeclarations.ts, 10, 40))
->n : string, Symbol(n, Decl(ambientDeclarations.ts, 13, 21))
+>fn3 : (n: string) => number
+>n : string
declare function fn4(n: number, y: number): string;
->fn4 : (n: number, y: number) => string, Symbol(fn4, Decl(ambientDeclarations.ts, 13, 40))
->n : number, Symbol(n, Decl(ambientDeclarations.ts, 14, 21))
->y : number, Symbol(y, Decl(ambientDeclarations.ts, 14, 31))
+>fn4 : (n: number, y: number) => string
+>n : number
+>y : number
// Ambient function with optional parameters
declare function fn5(x, y?);
->fn5 : (x: any, y?: any) => any, Symbol(fn5, Decl(ambientDeclarations.ts, 14, 51))
->x : any, Symbol(x, Decl(ambientDeclarations.ts, 17, 21))
->y : any, Symbol(y, Decl(ambientDeclarations.ts, 17, 23))
+>fn5 : (x: any, y?: any) => any
+>x : any
+>y : any
declare function fn6(e?);
->fn6 : (e?: any) => any, Symbol(fn6, Decl(ambientDeclarations.ts, 17, 28))
->e : any, Symbol(e, Decl(ambientDeclarations.ts, 18, 21))
+>fn6 : (e?: any) => any
+>e : any
declare function fn7(x, y?, ...z);
->fn7 : (x: any, y?: any, ...z: any[]) => any, Symbol(fn7, Decl(ambientDeclarations.ts, 18, 25))
->x : any, Symbol(x, Decl(ambientDeclarations.ts, 19, 21))
->y : any, Symbol(y, Decl(ambientDeclarations.ts, 19, 23))
->z : any[], Symbol(z, Decl(ambientDeclarations.ts, 19, 27))
+>fn7 : (x: any, y?: any, ...z: any[]) => any
+>x : any
+>y : any
+>z : any[]
declare function fn8(y?, ...z: number[]);
->fn8 : (y?: any, ...z: number[]) => any, Symbol(fn8, Decl(ambientDeclarations.ts, 19, 34))
->y : any, Symbol(y, Decl(ambientDeclarations.ts, 20, 21))
->z : number[], Symbol(z, Decl(ambientDeclarations.ts, 20, 24))
+>fn8 : (y?: any, ...z: number[]) => any
+>y : any
+>z : number[]
declare function fn9(...q: {}[]);
->fn9 : (...q: {}[]) => any, Symbol(fn9, Decl(ambientDeclarations.ts, 20, 41))
->q : {}[], Symbol(q, Decl(ambientDeclarations.ts, 21, 21))
+>fn9 : (...q: {}[]) => any
+>q : {}[]
declare function fn10(...q: T[]);
->fn10 : (...q: T[]) => any, Symbol(fn10, Decl(ambientDeclarations.ts, 21, 33))
->T : T, Symbol(T, Decl(ambientDeclarations.ts, 22, 22))
->q : T[], Symbol(q, Decl(ambientDeclarations.ts, 22, 25))
->T : T, Symbol(T, Decl(ambientDeclarations.ts, 22, 22))
+>fn10 : (...q: T[]) => any
+>T : T
+>q : T[]
+>T : T
// Ambient class
declare class cls {
->cls : cls, Symbol(cls, Decl(ambientDeclarations.ts, 22, 36))
+>cls : cls
constructor();
method(): cls;
->method : () => cls, Symbol(method, Decl(ambientDeclarations.ts, 26, 18))
->cls : cls, Symbol(cls, Decl(ambientDeclarations.ts, 22, 36))
+>method : () => cls
+>cls : cls
static static(p): number;
->static : (p: any) => number, Symbol(cls.static, Decl(ambientDeclarations.ts, 27, 18))
->p : any, Symbol(p, Decl(ambientDeclarations.ts, 28, 18))
+>static : (p: any) => number
+>p : any
static q;
->q : any, Symbol(cls.q, Decl(ambientDeclarations.ts, 28, 29))
+>q : any
private fn();
->fn : () => any, Symbol(fn, Decl(ambientDeclarations.ts, 29, 13))
+>fn : () => any
private static fns();
->fns : () => any, Symbol(cls.fns, Decl(ambientDeclarations.ts, 30, 17))
+>fns : () => any
}
// Ambient enum
declare enum E1 {
->E1 : E1, Symbol(E1, Decl(ambientDeclarations.ts, 32, 1))
+>E1 : E1
x,
->x : E1, Symbol(E1.x, Decl(ambientDeclarations.ts, 35, 17))
+>x : E1
y,
->y : E1, Symbol(E1.y, Decl(ambientDeclarations.ts, 36, 6))
+>y : E1
z
->z : E1, Symbol(E1.z, Decl(ambientDeclarations.ts, 37, 6))
+>z : E1
}
// Ambient enum with integer literal initializer
declare enum E2 {
->E2 : E2, Symbol(E2, Decl(ambientDeclarations.ts, 39, 1))
+>E2 : E2
q,
->q : E2, Symbol(E2.q, Decl(ambientDeclarations.ts, 42, 17))
+>q : E2
a = 1,
->a : E2, Symbol(E2.a, Decl(ambientDeclarations.ts, 43, 6))
+>a : E2
>1 : number
b,
->b : E2, Symbol(E2.b, Decl(ambientDeclarations.ts, 44, 10))
+>b : E2
c = 2,
->c : E2, Symbol(E2.c, Decl(ambientDeclarations.ts, 45, 6))
+>c : E2
>2 : number
d
->d : E2, Symbol(E2.d, Decl(ambientDeclarations.ts, 46, 10))
+>d : E2
}
// Ambient enum members are always exported with or without export keyword
declare enum E3 {
->E3 : E3, Symbol(E3, Decl(ambientDeclarations.ts, 48, 1), Decl(ambientDeclarations.ts, 53, 1))
+>E3 : E3
A
->A : E3, Symbol(E3.A, Decl(ambientDeclarations.ts, 51, 17))
+>A : E3
}
declare module E3 {
->E3 : typeof E3, Symbol(E3, Decl(ambientDeclarations.ts, 48, 1), Decl(ambientDeclarations.ts, 53, 1))
+>E3 : typeof E3
var B;
->B : any, Symbol(B, Decl(ambientDeclarations.ts, 55, 7))
+>B : any
}
var x = E3.B;
->x : any, Symbol(x, Decl(ambientDeclarations.ts, 57, 3))
->E3.B : any, Symbol(E3.B, Decl(ambientDeclarations.ts, 55, 7))
->E3 : typeof E3, Symbol(E3, Decl(ambientDeclarations.ts, 48, 1), Decl(ambientDeclarations.ts, 53, 1))
->B : any, Symbol(E3.B, Decl(ambientDeclarations.ts, 55, 7))
+>x : any
+>E3.B : any
+>E3 : typeof E3
+>B : any
// Ambient module
declare module M1 {
->M1 : typeof M1, Symbol(M1, Decl(ambientDeclarations.ts, 57, 13))
+>M1 : typeof M1
var x;
->x : any, Symbol(x, Decl(ambientDeclarations.ts, 61, 7))
+>x : any
function fn(): number;
->fn : () => number, Symbol(fn, Decl(ambientDeclarations.ts, 61, 10))
+>fn : () => number
}
// Ambient module members are always exported with or without export keyword
var p = M1.x;
->p : any, Symbol(p, Decl(ambientDeclarations.ts, 66, 3))
->M1.x : any, Symbol(M1.x, Decl(ambientDeclarations.ts, 61, 7))
->M1 : typeof M1, Symbol(M1, Decl(ambientDeclarations.ts, 57, 13))
->x : any, Symbol(M1.x, Decl(ambientDeclarations.ts, 61, 7))
+>p : any
+>M1.x : any
+>M1 : typeof M1
+>x : any
var q = M1.fn();
->q : number, Symbol(q, Decl(ambientDeclarations.ts, 67, 3))
+>q : number
>M1.fn() : number
->M1.fn : () => number, Symbol(M1.fn, Decl(ambientDeclarations.ts, 61, 10))
->M1 : typeof M1, Symbol(M1, Decl(ambientDeclarations.ts, 57, 13))
->fn : () => number, Symbol(M1.fn, Decl(ambientDeclarations.ts, 61, 10))
+>M1.fn : () => number
+>M1 : typeof M1
+>fn : () => number
// Ambient external module in the global module
// Ambient external module with a string literal name that is a top level external module name
declare module 'external1' {
var q;
->q : any, Symbol(q, Decl(ambientDeclarations.ts, 72, 7))
+>q : any
}
diff --git a/tests/baselines/reference/ambientEnumElementInitializer1.symbols b/tests/baselines/reference/ambientEnumElementInitializer1.symbols
new file mode 100644
index 00000000000..84eb56abcbc
--- /dev/null
+++ b/tests/baselines/reference/ambientEnumElementInitializer1.symbols
@@ -0,0 +1,7 @@
+=== tests/cases/compiler/ambientEnumElementInitializer1.ts ===
+declare enum E {
+>E : Symbol(E, Decl(ambientEnumElementInitializer1.ts, 0, 0))
+
+ e = 3
+>e : Symbol(E.e, Decl(ambientEnumElementInitializer1.ts, 0, 16))
+}
diff --git a/tests/baselines/reference/ambientEnumElementInitializer1.types b/tests/baselines/reference/ambientEnumElementInitializer1.types
index 7239ccac246..97db9f199d3 100644
--- a/tests/baselines/reference/ambientEnumElementInitializer1.types
+++ b/tests/baselines/reference/ambientEnumElementInitializer1.types
@@ -1,8 +1,8 @@
=== tests/cases/compiler/ambientEnumElementInitializer1.ts ===
declare enum E {
->E : E, Symbol(E, Decl(ambientEnumElementInitializer1.ts, 0, 0))
+>E : E
e = 3
->e : E, Symbol(E.e, Decl(ambientEnumElementInitializer1.ts, 0, 16))
+>e : E
>3 : number
}
diff --git a/tests/baselines/reference/ambientEnumElementInitializer2.symbols b/tests/baselines/reference/ambientEnumElementInitializer2.symbols
new file mode 100644
index 00000000000..04939d33896
--- /dev/null
+++ b/tests/baselines/reference/ambientEnumElementInitializer2.symbols
@@ -0,0 +1,7 @@
+=== tests/cases/compiler/ambientEnumElementInitializer2.ts ===
+declare enum E {
+>E : Symbol(E, Decl(ambientEnumElementInitializer2.ts, 0, 0))
+
+ e = -3 // Negative
+>e : Symbol(E.e, Decl(ambientEnumElementInitializer2.ts, 0, 16))
+}
diff --git a/tests/baselines/reference/ambientEnumElementInitializer2.types b/tests/baselines/reference/ambientEnumElementInitializer2.types
index 61ef74cb6bf..7217bc8e6fd 100644
--- a/tests/baselines/reference/ambientEnumElementInitializer2.types
+++ b/tests/baselines/reference/ambientEnumElementInitializer2.types
@@ -1,9 +1,9 @@
=== tests/cases/compiler/ambientEnumElementInitializer2.ts ===
declare enum E {
->E : E, Symbol(E, Decl(ambientEnumElementInitializer2.ts, 0, 0))
+>E : E
e = -3 // Negative
->e : E, Symbol(E.e, Decl(ambientEnumElementInitializer2.ts, 0, 16))
+>e : E
>-3 : number
>3 : number
}
diff --git a/tests/baselines/reference/ambientEnumElementInitializer4.symbols b/tests/baselines/reference/ambientEnumElementInitializer4.symbols
new file mode 100644
index 00000000000..de17c6702bb
--- /dev/null
+++ b/tests/baselines/reference/ambientEnumElementInitializer4.symbols
@@ -0,0 +1,7 @@
+=== tests/cases/compiler/ambientEnumElementInitializer4.ts ===
+declare enum E {
+>E : Symbol(E, Decl(ambientEnumElementInitializer4.ts, 0, 0))
+
+ e = 0xA
+>e : Symbol(E.e, Decl(ambientEnumElementInitializer4.ts, 0, 16))
+}
diff --git a/tests/baselines/reference/ambientEnumElementInitializer4.types b/tests/baselines/reference/ambientEnumElementInitializer4.types
index ea7664ae6c6..b85649d654d 100644
--- a/tests/baselines/reference/ambientEnumElementInitializer4.types
+++ b/tests/baselines/reference/ambientEnumElementInitializer4.types
@@ -1,8 +1,8 @@
=== tests/cases/compiler/ambientEnumElementInitializer4.ts ===
declare enum E {
->E : E, Symbol(E, Decl(ambientEnumElementInitializer4.ts, 0, 0))
+>E : E
e = 0xA
->e : E, Symbol(E.e, Decl(ambientEnumElementInitializer4.ts, 0, 16))
+>e : E
>0xA : number
}
diff --git a/tests/baselines/reference/ambientEnumElementInitializer5.symbols b/tests/baselines/reference/ambientEnumElementInitializer5.symbols
new file mode 100644
index 00000000000..9c58db811f4
--- /dev/null
+++ b/tests/baselines/reference/ambientEnumElementInitializer5.symbols
@@ -0,0 +1,7 @@
+=== tests/cases/compiler/ambientEnumElementInitializer5.ts ===
+declare enum E {
+>E : Symbol(E, Decl(ambientEnumElementInitializer5.ts, 0, 0))
+
+ e = -0xA
+>e : Symbol(E.e, Decl(ambientEnumElementInitializer5.ts, 0, 16))
+}
diff --git a/tests/baselines/reference/ambientEnumElementInitializer5.types b/tests/baselines/reference/ambientEnumElementInitializer5.types
index cb6fdc29fc1..1c5ea0ecdd3 100644
--- a/tests/baselines/reference/ambientEnumElementInitializer5.types
+++ b/tests/baselines/reference/ambientEnumElementInitializer5.types
@@ -1,9 +1,9 @@
=== tests/cases/compiler/ambientEnumElementInitializer5.ts ===
declare enum E {
->E : E, Symbol(E, Decl(ambientEnumElementInitializer5.ts, 0, 0))
+>E : E
e = -0xA
->e : E, Symbol(E.e, Decl(ambientEnumElementInitializer5.ts, 0, 16))
+>e : E
>-0xA : number
>0xA : number
}
diff --git a/tests/baselines/reference/ambientEnumElementInitializer6.symbols b/tests/baselines/reference/ambientEnumElementInitializer6.symbols
new file mode 100644
index 00000000000..3b0b6283ec9
--- /dev/null
+++ b/tests/baselines/reference/ambientEnumElementInitializer6.symbols
@@ -0,0 +1,11 @@
+=== tests/cases/compiler/ambientEnumElementInitializer6.ts ===
+declare module M {
+>M : Symbol(M, Decl(ambientEnumElementInitializer6.ts, 0, 0))
+
+ enum E {
+>E : Symbol(E, Decl(ambientEnumElementInitializer6.ts, 0, 18))
+
+ e = 3
+>e : Symbol(E.e, Decl(ambientEnumElementInitializer6.ts, 1, 12))
+ }
+}
diff --git a/tests/baselines/reference/ambientEnumElementInitializer6.types b/tests/baselines/reference/ambientEnumElementInitializer6.types
index 1756629e4f2..015d3f4e146 100644
--- a/tests/baselines/reference/ambientEnumElementInitializer6.types
+++ b/tests/baselines/reference/ambientEnumElementInitializer6.types
@@ -1,12 +1,12 @@
=== tests/cases/compiler/ambientEnumElementInitializer6.ts ===
declare module M {
->M : typeof M, Symbol(M, Decl(ambientEnumElementInitializer6.ts, 0, 0))
+>M : typeof M
enum E {
->E : E, Symbol(E, Decl(ambientEnumElementInitializer6.ts, 0, 18))
+>E : E
e = 3
->e : E, Symbol(E.e, Decl(ambientEnumElementInitializer6.ts, 1, 12))
+>e : E
>3 : number
}
}
diff --git a/tests/baselines/reference/ambientExternalModuleMerging.symbols b/tests/baselines/reference/ambientExternalModuleMerging.symbols
new file mode 100644
index 00000000000..7fea7fea89f
--- /dev/null
+++ b/tests/baselines/reference/ambientExternalModuleMerging.symbols
@@ -0,0 +1,28 @@
+=== tests/cases/conformance/ambient/ambientExternalModuleMerging_use.ts ===
+import M = require("M");
+>M : Symbol(M, Decl(ambientExternalModuleMerging_use.ts, 0, 0))
+
+// Should be strings
+var x = M.x;
+>x : Symbol(x, Decl(ambientExternalModuleMerging_use.ts, 2, 3))
+>M.x : Symbol(M.x, Decl(ambientExternalModuleMerging_declare.ts, 1, 14))
+>M : Symbol(M, Decl(ambientExternalModuleMerging_use.ts, 0, 0))
+>x : Symbol(M.x, Decl(ambientExternalModuleMerging_declare.ts, 1, 14))
+
+var y = M.y;
+>y : Symbol(y, Decl(ambientExternalModuleMerging_use.ts, 3, 3))
+>M.y : Symbol(M.y, Decl(ambientExternalModuleMerging_declare.ts, 6, 14))
+>M : Symbol(M, Decl(ambientExternalModuleMerging_use.ts, 0, 0))
+>y : Symbol(M.y, Decl(ambientExternalModuleMerging_declare.ts, 6, 14))
+
+=== tests/cases/conformance/ambient/ambientExternalModuleMerging_declare.ts ===
+declare module "M" {
+ export var x: string;
+>x : Symbol(x, Decl(ambientExternalModuleMerging_declare.ts, 1, 14))
+}
+
+// Merge
+declare module "M" {
+ export var y: string;
+>y : Symbol(y, Decl(ambientExternalModuleMerging_declare.ts, 6, 14))
+}
diff --git a/tests/baselines/reference/ambientExternalModuleMerging.types b/tests/baselines/reference/ambientExternalModuleMerging.types
index 716cc64f248..1c1be0fd256 100644
--- a/tests/baselines/reference/ambientExternalModuleMerging.types
+++ b/tests/baselines/reference/ambientExternalModuleMerging.types
@@ -1,28 +1,28 @@
=== tests/cases/conformance/ambient/ambientExternalModuleMerging_use.ts ===
import M = require("M");
->M : typeof M, Symbol(M, Decl(ambientExternalModuleMerging_use.ts, 0, 0))
+>M : typeof M
// Should be strings
var x = M.x;
->x : string, Symbol(x, Decl(ambientExternalModuleMerging_use.ts, 2, 3))
->M.x : string, Symbol(M.x, Decl(ambientExternalModuleMerging_declare.ts, 1, 14))
->M : typeof M, Symbol(M, Decl(ambientExternalModuleMerging_use.ts, 0, 0))
->x : string, Symbol(M.x, Decl(ambientExternalModuleMerging_declare.ts, 1, 14))
+>x : string
+>M.x : string
+>M : typeof M
+>x : string
var y = M.y;
->y : string, Symbol(y, Decl(ambientExternalModuleMerging_use.ts, 3, 3))
->M.y : string, Symbol(M.y, Decl(ambientExternalModuleMerging_declare.ts, 6, 14))
->M : typeof M, Symbol(M, Decl(ambientExternalModuleMerging_use.ts, 0, 0))
->y : string, Symbol(M.y, Decl(ambientExternalModuleMerging_declare.ts, 6, 14))
+>y : string
+>M.y : string
+>M : typeof M
+>y : string
=== tests/cases/conformance/ambient/ambientExternalModuleMerging_declare.ts ===
declare module "M" {
export var x: string;
->x : string, Symbol(x, Decl(ambientExternalModuleMerging_declare.ts, 1, 14))
+>x : string
}
// Merge
declare module "M" {
export var y: string;
->y : string, Symbol(y, Decl(ambientExternalModuleMerging_declare.ts, 6, 14))
+>y : string
}
diff --git a/tests/baselines/reference/ambientExternalModuleReopen.symbols b/tests/baselines/reference/ambientExternalModuleReopen.symbols
new file mode 100644
index 00000000000..a2a1ba72fab
--- /dev/null
+++ b/tests/baselines/reference/ambientExternalModuleReopen.symbols
@@ -0,0 +1,9 @@
+=== tests/cases/compiler/ambientExternalModuleReopen.ts ===
+declare module "fs" {
+ var x: string;
+>x : Symbol(x, Decl(ambientExternalModuleReopen.ts, 1, 7))
+}
+declare module 'fs' {
+ var y: number;
+>y : Symbol(y, Decl(ambientExternalModuleReopen.ts, 4, 7))
+}
diff --git a/tests/baselines/reference/ambientExternalModuleReopen.types b/tests/baselines/reference/ambientExternalModuleReopen.types
index fdc40f4cd4b..842d634344c 100644
--- a/tests/baselines/reference/ambientExternalModuleReopen.types
+++ b/tests/baselines/reference/ambientExternalModuleReopen.types
@@ -1,9 +1,9 @@
=== tests/cases/compiler/ambientExternalModuleReopen.ts ===
declare module "fs" {
var x: string;
->x : string, Symbol(x, Decl(ambientExternalModuleReopen.ts, 1, 7))
+>x : string
}
declare module 'fs' {
var y: number;
->y : number, Symbol(y, Decl(ambientExternalModuleReopen.ts, 4, 7))
+>y : number
}
diff --git a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.symbols b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.symbols
new file mode 100644
index 00000000000..3af41f90957
--- /dev/null
+++ b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.symbols
@@ -0,0 +1,32 @@
+=== tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration_1.ts ===
+///
+import A = require('M');
+>A : Symbol(A, Decl(ambientExternalModuleWithInternalImportDeclaration_1.ts, 0, 0))
+
+var c = new A();
+>c : Symbol(c, Decl(ambientExternalModuleWithInternalImportDeclaration_1.ts, 2, 3))
+>A : Symbol(A, Decl(ambientExternalModuleWithInternalImportDeclaration_1.ts, 0, 0))
+
+=== tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration_0.ts ===
+declare module 'M' {
+ module C {
+>C : Symbol(C, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 3, 5))
+
+ export var f: number;
+>f : Symbol(f, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 2, 18))
+ }
+ class C {
+>C : Symbol(C, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 3, 5))
+
+ foo(): void;
+>foo : Symbol(foo, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 4, 13))
+ }
+ import X = C;
+>X : Symbol(X, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 6, 5))
+>C : Symbol(C, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 3, 5))
+
+ export = X;
+>X : Symbol(X, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 6, 5))
+
+}
+
diff --git a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.types b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.types
index 2bd3929e286..4e9043d1b75 100644
--- a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.types
+++ b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.types
@@ -1,33 +1,33 @@
=== tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration_1.ts ===
///
import A = require('M');
->A : typeof A, Symbol(A, Decl(ambientExternalModuleWithInternalImportDeclaration_1.ts, 0, 0))
+>A : typeof A
var c = new A();
->c : A, Symbol(c, Decl(ambientExternalModuleWithInternalImportDeclaration_1.ts, 2, 3))
+>c : A
>new A() : A
->A : typeof A, Symbol(A, Decl(ambientExternalModuleWithInternalImportDeclaration_1.ts, 0, 0))
+>A : typeof A
=== tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration_0.ts ===
declare module 'M' {
module C {
->C : typeof C, Symbol(C, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 3, 5))
+>C : typeof C
export var f: number;
->f : number, Symbol(f, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 2, 18))
+>f : number
}
class C {
->C : C, Symbol(C, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 3, 5))
+>C : C
foo(): void;
->foo : () => void, Symbol(foo, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 4, 13))
+>foo : () => void
}
import X = C;
->X : typeof C, Symbol(X, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 6, 5))
->C : C, Symbol(C, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 3, 5))
+>X : typeof C
+>C : C
export = X;
->X : C, Symbol(X, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 6, 5))
+>X : C
}
diff --git a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.symbols b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.symbols
new file mode 100644
index 00000000000..baf15f22a4a
--- /dev/null
+++ b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.symbols
@@ -0,0 +1,28 @@
+=== tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration_1.ts ===
+///
+import A = require('M');
+>A : Symbol(A, Decl(ambientExternalModuleWithoutInternalImportDeclaration_1.ts, 0, 0))
+
+var c = new A();
+>c : Symbol(c, Decl(ambientExternalModuleWithoutInternalImportDeclaration_1.ts, 2, 3))
+>A : Symbol(A, Decl(ambientExternalModuleWithoutInternalImportDeclaration_1.ts, 0, 0))
+
+=== tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration_0.ts ===
+declare module 'M' {
+ module C {
+>C : Symbol(C, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 3, 5))
+
+ export var f: number;
+>f : Symbol(f, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 2, 18))
+ }
+ class C {
+>C : Symbol(C, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 3, 5))
+
+ foo(): void;
+>foo : Symbol(foo, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 4, 13))
+ }
+ export = C;
+>C : Symbol(C, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 3, 5))
+
+}
+
diff --git a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.types b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.types
index 7131f7bbe8b..0029817400b 100644
--- a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.types
+++ b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.types
@@ -1,29 +1,29 @@
=== tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration_1.ts ===
///
import A = require('M');
->A : typeof A, Symbol(A, Decl(ambientExternalModuleWithoutInternalImportDeclaration_1.ts, 0, 0))
+>A : typeof A
var c = new A();
->c : A, Symbol(c, Decl(ambientExternalModuleWithoutInternalImportDeclaration_1.ts, 2, 3))
+>c : A
>new A() : A
->A : typeof A, Symbol(A, Decl(ambientExternalModuleWithoutInternalImportDeclaration_1.ts, 0, 0))
+>A : typeof A
=== tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration_0.ts ===
declare module 'M' {
module C {
->C : typeof C, Symbol(C, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 3, 5))
+>C : typeof C
export var f: number;
->f : number, Symbol(f, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 2, 18))
+>f : number
}
class C {
->C : C, Symbol(C, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 3, 5))
+>C : C
foo(): void;
->foo : () => void, Symbol(foo, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 4, 13))
+>foo : () => void
}
export = C;
->C : C, Symbol(C, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 3, 5))
+>C : C
}
diff --git a/tests/baselines/reference/ambientFundule.symbols b/tests/baselines/reference/ambientFundule.symbols
new file mode 100644
index 00000000000..e7e2c5a4a4d
--- /dev/null
+++ b/tests/baselines/reference/ambientFundule.symbols
@@ -0,0 +1,12 @@
+=== tests/cases/compiler/ambientFundule.ts ===
+declare function f();
+>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26))
+
+declare module f { var x }
+>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26))
+>x : Symbol(x, Decl(ambientFundule.ts, 1, 22))
+
+declare function f(x);
+>f : Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26))
+>x : Symbol(x, Decl(ambientFundule.ts, 2, 19))
+
diff --git a/tests/baselines/reference/ambientFundule.types b/tests/baselines/reference/ambientFundule.types
index 686c7c6fb85..edd2290859c 100644
--- a/tests/baselines/reference/ambientFundule.types
+++ b/tests/baselines/reference/ambientFundule.types
@@ -1,12 +1,12 @@
=== tests/cases/compiler/ambientFundule.ts ===
declare function f();
->f : typeof f, Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26))
+>f : typeof f
declare module f { var x }
->f : typeof f, Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26))
->x : any, Symbol(x, Decl(ambientFundule.ts, 1, 22))
+>f : typeof f
+>x : any
declare function f(x);
->f : typeof f, Symbol(f, Decl(ambientFundule.ts, 0, 0), Decl(ambientFundule.ts, 0, 21), Decl(ambientFundule.ts, 1, 26))
->x : any, Symbol(x, Decl(ambientFundule.ts, 2, 19))
+>f : typeof f
+>x : any
diff --git a/tests/baselines/reference/ambientInsideNonAmbient.symbols b/tests/baselines/reference/ambientInsideNonAmbient.symbols
new file mode 100644
index 00000000000..5a668ca9e43
--- /dev/null
+++ b/tests/baselines/reference/ambientInsideNonAmbient.symbols
@@ -0,0 +1,38 @@
+=== tests/cases/conformance/ambient/ambientInsideNonAmbient.ts ===
+module M {
+>M : Symbol(M, Decl(ambientInsideNonAmbient.ts, 0, 0))
+
+ export declare var x;
+>x : Symbol(x, Decl(ambientInsideNonAmbient.ts, 1, 22))
+
+ export declare function f();
+>f : Symbol(f, Decl(ambientInsideNonAmbient.ts, 1, 25))
+
+ export declare class C { }
+>C : Symbol(C, Decl(ambientInsideNonAmbient.ts, 2, 32))
+
+ export declare enum E { }
+>E : Symbol(E, Decl(ambientInsideNonAmbient.ts, 3, 30))
+
+ export declare module M { }
+>M : Symbol(M, Decl(ambientInsideNonAmbient.ts, 4, 29))
+}
+
+module M2 {
+>M2 : Symbol(M2, Decl(ambientInsideNonAmbient.ts, 6, 1))
+
+ declare var x;
+>x : Symbol(x, Decl(ambientInsideNonAmbient.ts, 9, 15))
+
+ declare function f();
+>f : Symbol(f, Decl(ambientInsideNonAmbient.ts, 9, 18))
+
+ declare class C { }
+>C : Symbol(C, Decl(ambientInsideNonAmbient.ts, 10, 25))
+
+ declare enum E { }
+>E : Symbol(E, Decl(ambientInsideNonAmbient.ts, 11, 23))
+
+ declare module M { }
+>M : Symbol(M, Decl(ambientInsideNonAmbient.ts, 12, 22))
+}
diff --git a/tests/baselines/reference/ambientInsideNonAmbient.types b/tests/baselines/reference/ambientInsideNonAmbient.types
index 6ccc20aba93..ae593ab4225 100644
--- a/tests/baselines/reference/ambientInsideNonAmbient.types
+++ b/tests/baselines/reference/ambientInsideNonAmbient.types
@@ -1,38 +1,38 @@
=== tests/cases/conformance/ambient/ambientInsideNonAmbient.ts ===
module M {
->M : typeof M, Symbol(M, Decl(ambientInsideNonAmbient.ts, 0, 0))
+>M : typeof M
export declare var x;
->x : any, Symbol(x, Decl(ambientInsideNonAmbient.ts, 1, 22))
+>x : any
export declare function f();
->f : () => any, Symbol(f, Decl(ambientInsideNonAmbient.ts, 1, 25))
+>f : () => any
export declare class C { }
->C : C, Symbol(C, Decl(ambientInsideNonAmbient.ts, 2, 32))
+>C : C
export declare enum E { }
->E : E, Symbol(E, Decl(ambientInsideNonAmbient.ts, 3, 30))
+>E : E
export declare module M { }
->M : any, Symbol(M, Decl(ambientInsideNonAmbient.ts, 4, 29))
+>M : any
}
module M2 {
->M2 : typeof M2, Symbol(M2, Decl(ambientInsideNonAmbient.ts, 6, 1))
+>M2 : typeof M2
declare var x;
->x : any, Symbol(x, Decl(ambientInsideNonAmbient.ts, 9, 15))
+>x : any
declare function f();
->f : () => any, Symbol(f, Decl(ambientInsideNonAmbient.ts, 9, 18))
+>f : () => any
declare class C { }
->C : C, Symbol(C, Decl(ambientInsideNonAmbient.ts, 10, 25))
+>C : C
declare enum E { }
->E : E, Symbol(E, Decl(ambientInsideNonAmbient.ts, 11, 23))
+>E : E
declare module M { }
->M : any, Symbol(M, Decl(ambientInsideNonAmbient.ts, 12, 22))
+>M : any
}
diff --git a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.symbols b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.symbols
new file mode 100644
index 00000000000..268aeab9171
--- /dev/null
+++ b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.symbols
@@ -0,0 +1,16 @@
+=== tests/cases/conformance/ambient/ambientInsideNonAmbientExternalModule.ts ===
+export declare var x;
+>x : Symbol(x, Decl(ambientInsideNonAmbientExternalModule.ts, 0, 18))
+
+export declare function f();
+>f : Symbol(f, Decl(ambientInsideNonAmbientExternalModule.ts, 0, 21))
+
+export declare class C { }
+>C : Symbol(C, Decl(ambientInsideNonAmbientExternalModule.ts, 1, 28))
+
+export declare enum E { }
+>E : Symbol(E, Decl(ambientInsideNonAmbientExternalModule.ts, 2, 26))
+
+export declare module M { }
+>M : Symbol(M, Decl(ambientInsideNonAmbientExternalModule.ts, 3, 25))
+
diff --git a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types
index 698b963c78d..a8fb61f4280 100644
--- a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types
+++ b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types
@@ -1,16 +1,16 @@
=== tests/cases/conformance/ambient/ambientInsideNonAmbientExternalModule.ts ===
export declare var x;
->x : any, Symbol(x, Decl(ambientInsideNonAmbientExternalModule.ts, 0, 18))
+>x : any
export declare function f();
->f : () => any, Symbol(f, Decl(ambientInsideNonAmbientExternalModule.ts, 0, 21))
+>f : () => any
export declare class C { }
->C : C, Symbol(C, Decl(ambientInsideNonAmbientExternalModule.ts, 1, 28))
+>C : C
export declare enum E { }
->E : E, Symbol(E, Decl(ambientInsideNonAmbientExternalModule.ts, 2, 26))
+>E : E
export declare module M { }
->M : any, Symbol(M, Decl(ambientInsideNonAmbientExternalModule.ts, 3, 25))
+>M : any
diff --git a/tests/baselines/reference/ambientModuleExports.symbols b/tests/baselines/reference/ambientModuleExports.symbols
new file mode 100644
index 00000000000..6af5b669cc9
--- /dev/null
+++ b/tests/baselines/reference/ambientModuleExports.symbols
@@ -0,0 +1,59 @@
+=== tests/cases/compiler/ambientModuleExports.ts ===
+declare module Foo {
+>Foo : Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0))
+
+ function a():void;
+>a : Symbol(a, Decl(ambientModuleExports.ts, 0, 20))
+
+ var b:number;
+>b : Symbol(b, Decl(ambientModuleExports.ts, 2, 4))
+
+ class C {}
+>C : Symbol(C, Decl(ambientModuleExports.ts, 2, 14))
+}
+
+Foo.a();
+>Foo.a : Symbol(Foo.a, Decl(ambientModuleExports.ts, 0, 20))
+>Foo : Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0))
+>a : Symbol(Foo.a, Decl(ambientModuleExports.ts, 0, 20))
+
+Foo.b;
+>Foo.b : Symbol(Foo.b, Decl(ambientModuleExports.ts, 2, 4))
+>Foo : Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0))
+>b : Symbol(Foo.b, Decl(ambientModuleExports.ts, 2, 4))
+
+var c = new Foo.C();
+>c : Symbol(c, Decl(ambientModuleExports.ts, 8, 3))
+>Foo.C : Symbol(Foo.C, Decl(ambientModuleExports.ts, 2, 14))
+>Foo : Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0))
+>C : Symbol(Foo.C, Decl(ambientModuleExports.ts, 2, 14))
+
+declare module Foo2 {
+>Foo2 : Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20))
+
+ export function a(): void;
+>a : Symbol(a, Decl(ambientModuleExports.ts, 10, 21))
+
+ export var b: number;
+>b : Symbol(b, Decl(ambientModuleExports.ts, 12, 14))
+
+ export class C { }
+>C : Symbol(C, Decl(ambientModuleExports.ts, 12, 25))
+}
+
+Foo2.a();
+>Foo2.a : Symbol(Foo2.a, Decl(ambientModuleExports.ts, 10, 21))
+>Foo2 : Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20))
+>a : Symbol(Foo2.a, Decl(ambientModuleExports.ts, 10, 21))
+
+Foo2.b;
+>Foo2.b : Symbol(Foo2.b, Decl(ambientModuleExports.ts, 12, 14))
+>Foo2 : Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20))
+>b : Symbol(Foo2.b, Decl(ambientModuleExports.ts, 12, 14))
+
+var c2 = new Foo2.C();
+>c2 : Symbol(c2, Decl(ambientModuleExports.ts, 18, 3))
+>Foo2.C : Symbol(Foo2.C, Decl(ambientModuleExports.ts, 12, 25))
+>Foo2 : Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20))
+>C : Symbol(Foo2.C, Decl(ambientModuleExports.ts, 12, 25))
+
diff --git a/tests/baselines/reference/ambientModuleExports.types b/tests/baselines/reference/ambientModuleExports.types
index 8149ab0c5f9..3f096afa838 100644
--- a/tests/baselines/reference/ambientModuleExports.types
+++ b/tests/baselines/reference/ambientModuleExports.types
@@ -1,63 +1,63 @@
=== tests/cases/compiler/ambientModuleExports.ts ===
declare module Foo {
->Foo : typeof Foo, Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0))
+>Foo : typeof Foo
function a():void;
->a : () => void, Symbol(a, Decl(ambientModuleExports.ts, 0, 20))
+>a : () => void
var b:number;
->b : number, Symbol(b, Decl(ambientModuleExports.ts, 2, 4))
+>b : number
class C {}
->C : C, Symbol(C, Decl(ambientModuleExports.ts, 2, 14))
+>C : C
}
Foo.a();
>Foo.a() : void
->Foo.a : () => void, Symbol(Foo.a, Decl(ambientModuleExports.ts, 0, 20))
->Foo : typeof Foo, Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0))
->a : () => void, Symbol(Foo.a, Decl(ambientModuleExports.ts, 0, 20))
+>Foo.a : () => void
+>Foo : typeof Foo
+>a : () => void
Foo.b;
->Foo.b : number, Symbol(Foo.b, Decl(ambientModuleExports.ts, 2, 4))
->Foo : typeof Foo, Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0))
->b : number, Symbol(Foo.b, Decl(ambientModuleExports.ts, 2, 4))
+>Foo.b : number
+>Foo : typeof Foo
+>b : number
var c = new Foo.C();
->c : Foo.C, Symbol(c, Decl(ambientModuleExports.ts, 8, 3))
+>c : Foo.C
>new Foo.C() : Foo.C
->Foo.C : typeof Foo.C, Symbol(Foo.C, Decl(ambientModuleExports.ts, 2, 14))
->Foo : typeof Foo, Symbol(Foo, Decl(ambientModuleExports.ts, 0, 0))
->C : typeof Foo.C, Symbol(Foo.C, Decl(ambientModuleExports.ts, 2, 14))
+>Foo.C : typeof Foo.C
+>Foo : typeof Foo
+>C : typeof Foo.C
declare module Foo2 {
->Foo2 : typeof Foo2, Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20))
+>Foo2 : typeof Foo2
export function a(): void;
->a : () => void, Symbol(a, Decl(ambientModuleExports.ts, 10, 21))
+>a : () => void
export var b: number;
->b : number, Symbol(b, Decl(ambientModuleExports.ts, 12, 14))
+>b : number
export class C { }
->C : C, Symbol(C, Decl(ambientModuleExports.ts, 12, 25))
+>C : C
}
Foo2.a();
>Foo2.a() : void
->Foo2.a : () => void, Symbol(Foo2.a, Decl(ambientModuleExports.ts, 10, 21))
->Foo2 : typeof Foo2, Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20))
->a : () => void, Symbol(Foo2.a, Decl(ambientModuleExports.ts, 10, 21))
+>Foo2.a : () => void
+>Foo2 : typeof Foo2
+>a : () => void
Foo2.b;
->Foo2.b : number, Symbol(Foo2.b, Decl(ambientModuleExports.ts, 12, 14))
->Foo2 : typeof Foo2, Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20))
->b : number, Symbol(Foo2.b, Decl(ambientModuleExports.ts, 12, 14))
+>Foo2.b : number
+>Foo2 : typeof Foo2
+>b : number
var c2 = new Foo2.C();
->c2 : Foo2.C, Symbol(c2, Decl(ambientModuleExports.ts, 18, 3))
+>c2 : Foo2.C
>new Foo2.C() : Foo2.C
->Foo2.C : typeof Foo2.C, Symbol(Foo2.C, Decl(ambientModuleExports.ts, 12, 25))
->Foo2 : typeof Foo2, Symbol(Foo2, Decl(ambientModuleExports.ts, 8, 20))
->C : typeof Foo2.C, Symbol(Foo2.C, Decl(ambientModuleExports.ts, 12, 25))
+>Foo2.C : typeof Foo2.C
+>Foo2 : typeof Foo2
+>C : typeof Foo2.C
diff --git a/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.symbols b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.symbols
new file mode 100644
index 00000000000..f24d3a102d5
--- /dev/null
+++ b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.symbols
@@ -0,0 +1,11 @@
+=== tests/cases/compiler/ambientModuleWithClassDeclarationWithExtends.ts ===
+declare module foo {
+>foo : Symbol(foo, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 0, 0))
+
+ class A { }
+>A : Symbol(A, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 0, 20))
+
+ class B extends A { }
+>B : Symbol(B, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 1, 15))
+>A : Symbol(A, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 0, 20))
+}
diff --git a/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.types b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.types
index c2036fd70ae..2708946518f 100644
--- a/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.types
+++ b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.types
@@ -1,11 +1,11 @@
=== tests/cases/compiler/ambientModuleWithClassDeclarationWithExtends.ts ===
declare module foo {
->foo : typeof foo, Symbol(foo, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 0, 0))
+>foo : typeof foo
class A { }
->A : A, Symbol(A, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 0, 20))
+>A : A
class B extends A { }
->B : B, Symbol(B, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 1, 15))
->A : A, Symbol(A, Decl(ambientModuleWithClassDeclarationWithExtends.ts, 0, 20))
+>B : B
+>A : A
}
diff --git a/tests/baselines/reference/ambientModules.symbols b/tests/baselines/reference/ambientModules.symbols
new file mode 100644
index 00000000000..776e36fa933
--- /dev/null
+++ b/tests/baselines/reference/ambientModules.symbols
@@ -0,0 +1,13 @@
+=== tests/cases/compiler/ambientModules.ts ===
+declare module Foo.Bar { export var foo; };
+>Foo : Symbol(Foo, Decl(ambientModules.ts, 0, 0))
+>Bar : Symbol(Bar, Decl(ambientModules.ts, 0, 19))
+>foo : Symbol(foo, Decl(ambientModules.ts, 0, 35))
+
+Foo.Bar.foo = 5;
+>Foo.Bar.foo : Symbol(Foo.Bar.foo, Decl(ambientModules.ts, 0, 35))
+>Foo.Bar : Symbol(Foo.Bar, Decl(ambientModules.ts, 0, 19))
+>Foo : Symbol(Foo, Decl(ambientModules.ts, 0, 0))
+>Bar : Symbol(Foo.Bar, Decl(ambientModules.ts, 0, 19))
+>foo : Symbol(Foo.Bar.foo, Decl(ambientModules.ts, 0, 35))
+
diff --git a/tests/baselines/reference/ambientModules.types b/tests/baselines/reference/ambientModules.types
index 1484888e14e..15e6d51b457 100644
--- a/tests/baselines/reference/ambientModules.types
+++ b/tests/baselines/reference/ambientModules.types
@@ -1,15 +1,15 @@
=== tests/cases/compiler/ambientModules.ts ===
declare module Foo.Bar { export var foo; };
->Foo : typeof Foo, Symbol(Foo, Decl(ambientModules.ts, 0, 0))
->Bar : typeof Bar, Symbol(Bar, Decl(ambientModules.ts, 0, 19))
->foo : any, Symbol(foo, Decl(ambientModules.ts, 0, 35))
+>Foo : typeof Foo
+>Bar : typeof Bar
+>foo : any
Foo.Bar.foo = 5;
>Foo.Bar.foo = 5 : number
->Foo.Bar.foo : any, Symbol(Foo.Bar.foo, Decl(ambientModules.ts, 0, 35))
->Foo.Bar : typeof Foo.Bar, Symbol(Foo.Bar, Decl(ambientModules.ts, 0, 19))
->Foo : typeof Foo, Symbol(Foo, Decl(ambientModules.ts, 0, 0))
->Bar : typeof Foo.Bar, Symbol(Foo.Bar, Decl(ambientModules.ts, 0, 19))
->foo : any, Symbol(Foo.Bar.foo, Decl(ambientModules.ts, 0, 35))
+>Foo.Bar.foo : any
+>Foo.Bar : typeof Foo.Bar
+>Foo : typeof Foo
+>Bar : typeof Foo.Bar
+>foo : any
>5 : number
diff --git a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.symbols b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.symbols
new file mode 100644
index 00000000000..5d6c34f4d68
--- /dev/null
+++ b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.symbols
@@ -0,0 +1,76 @@
+=== tests/cases/compiler/ambiguousCallsWhereReturnTypesAgree.ts ===
+class TestClass {
+>TestClass : Symbol(TestClass, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 0))
+
+ public bar(x: string): void;
+>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 15))
+
+ public bar(x: string[]): void;
+>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 15))
+
+ public bar(x: any): void {
+>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 3, 15))
+
+ }
+
+ public foo(x: string): void;
+>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 5, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 34))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 15))
+
+ public foo(x: string[]): void;
+>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 5, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 34))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 15))
+
+ public foo(x: any): void {
+>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 5, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 34))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 9, 15))
+
+ this.bar(x); // should not error
+>this.bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34))
+>this : Symbol(TestClass, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 0))
+>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 9, 15))
+ }
+}
+
+class TestClass2 {
+>TestClass2 : Symbol(TestClass2, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 12, 1))
+
+ public bar(x: string): number;
+>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 15))
+
+ public bar(x: string[]): number;
+>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 15))
+
+ public bar(x: any): number {
+>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 17, 15))
+
+ return 0;
+ }
+
+ public foo(x: string): number;
+>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 19, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 36))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 15))
+
+ public foo(x: string[]): number;
+>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 19, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 36))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 15))
+
+ public foo(x: any): number {
+>foo : Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 19, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 36))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 23, 15))
+
+ return this.bar(x); // should not error
+>this.bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36))
+>this : Symbol(TestClass2, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 12, 1))
+>bar : Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36))
+>x : Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 23, 15))
+ }
+}
+
diff --git a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types
index 16d4d6f7d40..d4df0f75d16 100644
--- a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types
+++ b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types
@@ -1,79 +1,79 @@
=== tests/cases/compiler/ambiguousCallsWhereReturnTypesAgree.ts ===
class TestClass {
->TestClass : TestClass, Symbol(TestClass, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 0))
+>TestClass : TestClass
public bar(x: string): void;
->bar : { (x: string): void; (x: string[]): void; }, Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34))
->x : string, Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 15))
+>bar : { (x: string): void; (x: string[]): void; }
+>x : string
public bar(x: string[]): void;
->bar : { (x: string): void; (x: string[]): void; }, Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34))
->x : string[], Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 15))
+>bar : { (x: string): void; (x: string[]): void; }
+>x : string[]
public bar(x: any): void {
->bar : { (x: string): void; (x: string[]): void; }, Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34))
->x : any, Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 3, 15))
+>bar : { (x: string): void; (x: string[]): void; }
+>x : any
}
public foo(x: string): void;
->foo : { (x: string): void; (x: string[]): void; }, Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 5, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 34))
->x : string, Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 15))
+>foo : { (x: string): void; (x: string[]): void; }
+>x : string
public foo(x: string[]): void;
->foo : { (x: string): void; (x: string[]): void; }, Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 5, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 34))
->x : string[], Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 15))
+>foo : { (x: string): void; (x: string[]): void; }
+>x : string[]
public foo(x: any): void {
->foo : { (x: string): void; (x: string[]): void; }, Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 5, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 7, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 8, 34))
->x : any, Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 9, 15))
+>foo : { (x: string): void; (x: string[]): void; }
+>x : any
this.bar(x); // should not error
>this.bar(x) : void
->this.bar : { (x: string): void; (x: string[]): void; }, Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34))
->this : TestClass, Symbol(TestClass, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 0))
->bar : { (x: string): void; (x: string[]): void; }, Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 0, 17), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 1, 32), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 2, 34))
->x : any, Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 9, 15))
+>this.bar : { (x: string): void; (x: string[]): void; }
+>this : TestClass
+>bar : { (x: string): void; (x: string[]): void; }
+>x : any
}
}
class TestClass2 {
->TestClass2 : TestClass2, Symbol(TestClass2, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 12, 1))
+>TestClass2 : TestClass2
public bar(x: string): number;
->bar : { (x: string): number; (x: string[]): number; }, Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36))
->x : string, Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 15))
+>bar : { (x: string): number; (x: string[]): number; }
+>x : string
public bar(x: string[]): number;
->bar : { (x: string): number; (x: string[]): number; }, Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36))
->x : string[], Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 15))
+>bar : { (x: string): number; (x: string[]): number; }
+>x : string[]
public bar(x: any): number {
->bar : { (x: string): number; (x: string[]): number; }, Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36))
->x : any, Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 17, 15))
+>bar : { (x: string): number; (x: string[]): number; }
+>x : any
return 0;
>0 : number
}
public foo(x: string): number;
->foo : { (x: string): number; (x: string[]): number; }, Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 19, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 36))
->x : string, Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 15))
+>foo : { (x: string): number; (x: string[]): number; }
+>x : string
public foo(x: string[]): number;
->foo : { (x: string): number; (x: string[]): number; }, Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 19, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 36))
->x : string[], Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 15))
+>foo : { (x: string): number; (x: string[]): number; }
+>x : string[]
public foo(x: any): number {
->foo : { (x: string): number; (x: string[]): number; }, Symbol(foo, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 19, 5), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 21, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 22, 36))
->x : any, Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 23, 15))
+>foo : { (x: string): number; (x: string[]): number; }
+>x : any
return this.bar(x); // should not error
>this.bar(x) : number
->this.bar : { (x: string): number; (x: string[]): number; }, Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36))
->this : TestClass2, Symbol(TestClass2, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 12, 1))
->bar : { (x: string): number; (x: string[]): number; }, Symbol(bar, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 14, 18), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 15, 34), Decl(ambiguousCallsWhereReturnTypesAgree.ts, 16, 36))
->x : any, Symbol(x, Decl(ambiguousCallsWhereReturnTypesAgree.ts, 23, 15))
+>this.bar : { (x: string): number; (x: string[]): number; }
+>this : TestClass2
+>bar : { (x: string): number; (x: string[]): number; }
+>x : any
}
}
diff --git a/tests/baselines/reference/ambiguousOverloadResolution.symbols b/tests/baselines/reference/ambiguousOverloadResolution.symbols
new file mode 100644
index 00000000000..1d848d707de
--- /dev/null
+++ b/tests/baselines/reference/ambiguousOverloadResolution.symbols
@@ -0,0 +1,33 @@
+=== tests/cases/compiler/ambiguousOverloadResolution.ts ===
+class A { }
+>A : Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0))
+
+class B extends A { x: number; }
+>B : Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11))
+>A : Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0))
+>x : Symbol(x, Decl(ambiguousOverloadResolution.ts, 1, 19))
+
+declare function f(p: A, q: B): number;
+>f : Symbol(f, Decl(ambiguousOverloadResolution.ts, 1, 32), Decl(ambiguousOverloadResolution.ts, 3, 39))
+>p : Symbol(p, Decl(ambiguousOverloadResolution.ts, 3, 19))
+>A : Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0))
+>q : Symbol(q, Decl(ambiguousOverloadResolution.ts, 3, 24))
+>B : Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11))
+
+declare function f(p: B, q: A): string;
+>f : Symbol(f, Decl(ambiguousOverloadResolution.ts, 1, 32), Decl(ambiguousOverloadResolution.ts, 3, 39))
+>p : Symbol(p, Decl(ambiguousOverloadResolution.ts, 4, 19))
+>B : Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11))
+>q : Symbol(q, Decl(ambiguousOverloadResolution.ts, 4, 24))
+>A : Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0))
+
+var x: B;
+>x : Symbol(x, Decl(ambiguousOverloadResolution.ts, 6, 3))
+>B : Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11))
+
+var t: number = f(x, x); // Not an error
+>t : Symbol(t, Decl(ambiguousOverloadResolution.ts, 7, 3))
+>f : Symbol(f, Decl(ambiguousOverloadResolution.ts, 1, 32), Decl(ambiguousOverloadResolution.ts, 3, 39))
+>x : Symbol(x, Decl(ambiguousOverloadResolution.ts, 6, 3))
+>x : Symbol(x, Decl(ambiguousOverloadResolution.ts, 6, 3))
+
diff --git a/tests/baselines/reference/ambiguousOverloadResolution.types b/tests/baselines/reference/ambiguousOverloadResolution.types
index 94d8a590155..dd42b44d7c3 100644
--- a/tests/baselines/reference/ambiguousOverloadResolution.types
+++ b/tests/baselines/reference/ambiguousOverloadResolution.types
@@ -1,34 +1,34 @@
=== tests/cases/compiler/ambiguousOverloadResolution.ts ===
class A { }
->A : A, Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0))
+>A : A
class B extends A { x: number; }
->B : B, Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11))
->A : A, Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0))
->x : number, Symbol(x, Decl(ambiguousOverloadResolution.ts, 1, 19))
+>B : B
+>A : A
+>x : number
declare function f(p: A, q: B): number;
->f : { (p: A, q: B): number; (p: B, q: A): string; }, Symbol(f, Decl(ambiguousOverloadResolution.ts, 1, 32), Decl(ambiguousOverloadResolution.ts, 3, 39))
->p : A, Symbol(p, Decl(ambiguousOverloadResolution.ts, 3, 19))
->A : A, Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0))
->q : B, Symbol(q, Decl(ambiguousOverloadResolution.ts, 3, 24))
->B : B, Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11))
+>f : { (p: A, q: B): number; (p: B, q: A): string; }
+>p : A
+>A : A
+>q : B
+>B : B
declare function f(p: B, q: A): string;
->f : { (p: A, q: B): number; (p: B, q: A): string; }, Symbol(f, Decl(ambiguousOverloadResolution.ts, 1, 32), Decl(ambiguousOverloadResolution.ts, 3, 39))
->p : B, Symbol(p, Decl(ambiguousOverloadResolution.ts, 4, 19))
->B : B, Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11))
->q : A, Symbol(q, Decl(ambiguousOverloadResolution.ts, 4, 24))
->A : A, Symbol(A, Decl(ambiguousOverloadResolution.ts, 0, 0))
+>f : { (p: A, q: B): number; (p: B, q: A): string; }
+>p : B
+>B : B
+>q : A
+>A : A
var x: B;
->x : B, Symbol(x, Decl(ambiguousOverloadResolution.ts, 6, 3))
->B : B, Symbol(B, Decl(ambiguousOverloadResolution.ts, 0, 11))
+>x : B
+>B : B
var t: number = f(x, x); // Not an error
->t : number, Symbol(t, Decl(ambiguousOverloadResolution.ts, 7, 3))
+>t : number
>f(x, x) : number
->f : { (p: A, q: B): number; (p: B, q: A): string; }, Symbol(f, Decl(ambiguousOverloadResolution.ts, 1, 32), Decl(ambiguousOverloadResolution.ts, 3, 39))
->x : B, Symbol(x, Decl(ambiguousOverloadResolution.ts, 6, 3))
->x : B, Symbol(x, Decl(ambiguousOverloadResolution.ts, 6, 3))
+>f : { (p: A, q: B): number; (p: B, q: A): string; }
+>x : B
+>x : B
diff --git a/tests/baselines/reference/amdImportAsPrimaryExpression.symbols b/tests/baselines/reference/amdImportAsPrimaryExpression.symbols
new file mode 100644
index 00000000000..9ab71defd86
--- /dev/null
+++ b/tests/baselines/reference/amdImportAsPrimaryExpression.symbols
@@ -0,0 +1,24 @@
+=== tests/cases/conformance/externalModules/foo_1.ts ===
+import foo = require("./foo_0");
+>foo : Symbol(foo, Decl(foo_1.ts, 0, 0))
+
+if(foo.E1.A === 0){
+>foo.E1.A : Symbol(foo.E1.A, Decl(foo_0.ts, 0, 16))
+>foo.E1 : Symbol(foo.E1, Decl(foo_0.ts, 0, 0))
+>foo : Symbol(foo, Decl(foo_1.ts, 0, 0))
+>E1 : Symbol(foo.E1, Decl(foo_0.ts, 0, 0))
+>A : Symbol(foo.E1.A, Decl(foo_0.ts, 0, 16))
+
+ // Should cause runtime import - interesting optimization possibility, as gets inlined to 0.
+}
+
+=== tests/cases/conformance/externalModules/foo_0.ts ===
+export enum E1 {
+>E1 : Symbol(E1, Decl(foo_0.ts, 0, 0))
+
+ A,B,C
+>A : Symbol(E1.A, Decl(foo_0.ts, 0, 16))
+>B : Symbol(E1.B, Decl(foo_0.ts, 1, 3))
+>C : Symbol(E1.C, Decl(foo_0.ts, 1, 5))
+}
+
diff --git a/tests/baselines/reference/amdImportAsPrimaryExpression.types b/tests/baselines/reference/amdImportAsPrimaryExpression.types
index f055c162d09..eab0b168f44 100644
--- a/tests/baselines/reference/amdImportAsPrimaryExpression.types
+++ b/tests/baselines/reference/amdImportAsPrimaryExpression.types
@@ -1,14 +1,14 @@
=== tests/cases/conformance/externalModules/foo_1.ts ===
import foo = require("./foo_0");
->foo : typeof foo, Symbol(foo, Decl(foo_1.ts, 0, 0))
+>foo : typeof foo
if(foo.E1.A === 0){
>foo.E1.A === 0 : boolean
->foo.E1.A : foo.E1, Symbol(foo.E1.A, Decl(foo_0.ts, 0, 16))
->foo.E1 : typeof foo.E1, Symbol(foo.E1, Decl(foo_0.ts, 0, 0))
->foo : typeof foo, Symbol(foo, Decl(foo_1.ts, 0, 0))
->E1 : typeof foo.E1, Symbol(foo.E1, Decl(foo_0.ts, 0, 0))
->A : foo.E1, Symbol(foo.E1.A, Decl(foo_0.ts, 0, 16))
+>foo.E1.A : foo.E1
+>foo.E1 : typeof foo.E1
+>foo : typeof foo
+>E1 : typeof foo.E1
+>A : foo.E1
>0 : number
// Should cause runtime import - interesting optimization possibility, as gets inlined to 0.
@@ -16,11 +16,11 @@ if(foo.E1.A === 0){
=== tests/cases/conformance/externalModules/foo_0.ts ===
export enum E1 {
->E1 : E1, Symbol(E1, Decl(foo_0.ts, 0, 0))
+>E1 : E1
A,B,C
->A : E1, Symbol(E1.A, Decl(foo_0.ts, 0, 16))
->B : E1, Symbol(E1.B, Decl(foo_0.ts, 1, 3))
->C : E1, Symbol(E1.C, Decl(foo_0.ts, 1, 5))
+>A : E1
+>B : E1
+>C : E1
}
diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.symbols b/tests/baselines/reference/amdImportNotAsPrimaryExpression.symbols
new file mode 100644
index 00000000000..68a852c6165
--- /dev/null
+++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.symbols
@@ -0,0 +1,81 @@
+=== tests/cases/conformance/externalModules/foo_1.ts ===
+import foo = require("./foo_0");
+>foo : Symbol(foo, Decl(foo_1.ts, 0, 0))
+
+// None of the below should cause a runtime dependency on foo_0
+import f = foo.M1;
+>f : Symbol(f, Decl(foo_1.ts, 0, 32))
+>foo : Symbol(foo, Decl(foo_0.ts, 0, 0))
+>M1 : Symbol(foo.M1, Decl(foo_0.ts, 8, 1))
+
+var i: f.I2;
+>i : Symbol(i, Decl(foo_1.ts, 3, 3))
+>f : Symbol(f, Decl(foo_1.ts, 0, 32))
+>I2 : Symbol(f.I2, Decl(foo_0.ts, 10, 18))
+
+var x: foo.C1 = <{m1: number}>{};
+>x : Symbol(x, Decl(foo_1.ts, 4, 3))
+>foo : Symbol(foo, Decl(foo_1.ts, 0, 0))
+>C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0))
+>m1 : Symbol(m1, Decl(foo_1.ts, 4, 18))
+
+var y: typeof foo.C1.s1 = false;
+>y : Symbol(y, Decl(foo_1.ts, 5, 3))
+>foo.C1.s1 : Symbol(foo.C1.s1, Decl(foo_0.ts, 1, 9))
+>foo.C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0))
+>foo : Symbol(foo, Decl(foo_1.ts, 0, 0))
+>C1 : Symbol(foo.C1, Decl(foo_0.ts, 0, 0))
+>s1 : Symbol(foo.C1.s1, Decl(foo_0.ts, 1, 9))
+
+var z: foo.M1.I2;
+>z : Symbol(z, Decl(foo_1.ts, 6, 3))
+>foo : Symbol(foo, Decl(foo_1.ts, 0, 0))
+>M1 : Symbol(foo.M1, Decl(foo_0.ts, 8, 1))
+>I2 : Symbol(f.I2, Decl(foo_0.ts, 10, 18))
+
+var e: number = 0;
+>e : Symbol(e, Decl(foo_1.ts, 7, 3))
+>foo : Symbol(foo, Decl(foo_1.ts, 0, 0))
+>E1 : Symbol(foo.E1, Decl(foo_0.ts, 14, 1))
+
+=== tests/cases/conformance/externalModules/foo_0.ts ===
+export class C1 {
+>C1 : Symbol(C1, Decl(foo_0.ts, 0, 0))
+
+ m1 = 42;
+>m1 : Symbol(m1, Decl(foo_0.ts, 0, 17))
+
+ static s1 = true;
+>s1 : Symbol(C1.s1, Decl(foo_0.ts, 1, 9))
+}
+
+export interface I1 {
+>I1 : Symbol(I1, Decl(foo_0.ts, 3, 1))
+
+ name: string;
+>name : Symbol(name, Decl(foo_0.ts, 5, 21))
+
+ age: number;
+>age : Symbol(age, Decl(foo_0.ts, 6, 14))
+}
+
+export module M1 {
+>M1 : Symbol(M1, Decl(foo_0.ts, 8, 1))
+
+ export interface I2 {
+>I2 : Symbol(I2, Decl(foo_0.ts, 10, 18))
+
+ foo: string;
+>foo : Symbol(foo, Decl(foo_0.ts, 11, 22))
+ }
+}
+
+export enum E1 {
+>E1 : Symbol(E1, Decl(foo_0.ts, 14, 1))
+
+ A,B,C
+>A : Symbol(E1.A, Decl(foo_0.ts, 16, 16))
+>B : Symbol(E1.B, Decl(foo_0.ts, 17, 3))
+>C : Symbol(E1.C, Decl(foo_0.ts, 17, 5))
+}
+
diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types
index 61a55d73b0c..6c3978d93aa 100644
--- a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types
+++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types
@@ -1,88 +1,88 @@
=== tests/cases/conformance/externalModules/foo_1.ts ===
import foo = require("./foo_0");
->foo : typeof foo, Symbol(foo, Decl(foo_1.ts, 0, 0))
+>foo : typeof foo
// None of the below should cause a runtime dependency on foo_0
import f = foo.M1;
->f : any, Symbol(f, Decl(foo_1.ts, 0, 32))
->foo : typeof foo, Symbol(foo, Decl(foo_0.ts, 0, 0))
->M1 : any, Symbol(foo.M1, Decl(foo_0.ts, 8, 1))
+>f : any
+>foo : typeof foo
+>M1 : any
var i: f.I2;
->i : f.I2, Symbol(i, Decl(foo_1.ts, 3, 3))
->f : any, Symbol(f, Decl(foo_1.ts, 0, 32))
->I2 : f.I2, Symbol(f.I2, Decl(foo_0.ts, 10, 18))
+>i : f.I2
+>f : any
+>I2 : f.I2
var x: foo.C1 = <{m1: number}>{};
->x : foo.C1, Symbol(x, Decl(foo_1.ts, 4, 3))
->foo : any, Symbol(foo, Decl(foo_1.ts, 0, 0))
->C1 : foo.C1, Symbol(foo.C1, Decl(foo_0.ts, 0, 0))
+>x : foo.C1
+>foo : any
+>C1 : foo.C1
><{m1: number}>{} : { m1: number; }
->m1 : number, Symbol(m1, Decl(foo_1.ts, 4, 18))
+>m1 : number
>{} : {}
var y: typeof foo.C1.s1 = false;
->y : boolean, Symbol(y, Decl(foo_1.ts, 5, 3))
->foo.C1.s1 : boolean, Symbol(foo.C1.s1, Decl(foo_0.ts, 1, 9))
->foo.C1 : typeof foo.C1, Symbol(foo.C1, Decl(foo_0.ts, 0, 0))
->foo : typeof foo, Symbol(foo, Decl(foo_1.ts, 0, 0))
->C1 : typeof foo.C1, Symbol(foo.C1, Decl(foo_0.ts, 0, 0))
->s1 : boolean, Symbol(foo.C1.s1, Decl(foo_0.ts, 1, 9))
+>y : boolean
+>foo.C1.s1 : boolean
+>foo.C1 : typeof foo.C1
+>foo : typeof foo
+>C1 : typeof foo.C1
+>s1 : boolean
>false : boolean
var z: foo.M1.I2;
->z : f.I2, Symbol(z, Decl(foo_1.ts, 6, 3))
->foo : any, Symbol(foo, Decl(foo_1.ts, 0, 0))
->M1 : any, Symbol(foo.M1, Decl(foo_0.ts, 8, 1))
->I2 : f.I2, Symbol(f.I2, Decl(foo_0.ts, 10, 18))
+>z : f.I2
+>foo : any
+>M1 : any
+>I2 : f.I2
var e: number = 0;
->e : number, Symbol(e, Decl(foo_1.ts, 7, 3))
+>e : number
>0 : foo.E1
->foo : any, Symbol(foo, Decl(foo_1.ts, 0, 0))
->E1 : foo.E1, Symbol(foo.E1, Decl(foo_0.ts, 14, 1))
+>foo : any
+>E1 : foo.E1
>0 : number
=== tests/cases/conformance/externalModules/foo_0.ts ===
export class C1 {
->C1 : C1, Symbol(C1, Decl(foo_0.ts, 0, 0))
+>C1 : C1
m1 = 42;
->m1 : number, Symbol(m1, Decl(foo_0.ts, 0, 17))
+>m1 : number
>42 : number
static s1 = true;
->s1 : boolean, Symbol(C1.s1, Decl(foo_0.ts, 1, 9))
+>s1 : boolean
>true : boolean
}
export interface I1 {
->I1 : I1, Symbol(I1, Decl(foo_0.ts, 3, 1))
+>I1 : I1
name: string;
->name : string, Symbol(name, Decl(foo_0.ts, 5, 21))
+>name : string
age: number;
->age : number, Symbol(age, Decl(foo_0.ts, 6, 14))
+>age : number
}
export module M1 {
->M1 : any, Symbol(M1, Decl(foo_0.ts, 8, 1))
+>M1 : any
export interface I2 {
->I2 : I2, Symbol(I2, Decl(foo_0.ts, 10, 18))
+>I2 : I2
foo: string;
->foo : string, Symbol(foo, Decl(foo_0.ts, 11, 22))
+>foo : string
}
}
export enum E1 {
->E1 : E1, Symbol(E1, Decl(foo_0.ts, 14, 1))
+>E1 : E1
A,B,C
->A : E1, Symbol(E1.A, Decl(foo_0.ts, 16, 16))
->B : E1, Symbol(E1.B, Decl(foo_0.ts, 17, 3))
->C : E1, Symbol(E1.C, Decl(foo_0.ts, 17, 5))
+>A : E1
+>B : E1
+>C : E1
}
diff --git a/tests/baselines/reference/amdModuleName1.symbols b/tests/baselines/reference/amdModuleName1.symbols
new file mode 100644
index 00000000000..04f471dc2ad
--- /dev/null
+++ b/tests/baselines/reference/amdModuleName1.symbols
@@ -0,0 +1,18 @@
+=== tests/cases/compiler/amdModuleName1.ts ===
+///
+class Foo {
+>Foo : Symbol(Foo, Decl(amdModuleName1.ts, 0, 0))
+
+ x: number;
+>x : Symbol(x, Decl(amdModuleName1.ts, 1, 11))
+
+ constructor() {
+ this.x = 5;
+>this.x : Symbol(x, Decl(amdModuleName1.ts, 1, 11))
+>this : Symbol(Foo, Decl(amdModuleName1.ts, 0, 0))
+>x : Symbol(x, Decl(amdModuleName1.ts, 1, 11))
+ }
+}
+export = Foo;
+>Foo : Symbol(Foo, Decl(amdModuleName1.ts, 0, 0))
+
diff --git a/tests/baselines/reference/amdModuleName1.types b/tests/baselines/reference/amdModuleName1.types
index 90fdfcc9aa8..64bc7842451 100644
--- a/tests/baselines/reference/amdModuleName1.types
+++ b/tests/baselines/reference/amdModuleName1.types
@@ -1,20 +1,20 @@
=== tests/cases/compiler/amdModuleName1.ts ===
///
class Foo {
->Foo : Foo, Symbol(Foo, Decl(amdModuleName1.ts, 0, 0))
+>Foo : Foo
x: number;
->x : number, Symbol(x, Decl(amdModuleName1.ts, 1, 11))
+>x : number
constructor() {
this.x = 5;
>this.x = 5 : number
->this.x : number, Symbol(x, Decl(amdModuleName1.ts, 1, 11))
->this : Foo, Symbol(Foo, Decl(amdModuleName1.ts, 0, 0))
->x : number, Symbol(x, Decl(amdModuleName1.ts, 1, 11))
+>this.x : number
+>this : Foo
+>x : number
>5 : number
}
}
export = Foo;
->Foo : Foo, Symbol(Foo, Decl(amdModuleName1.ts, 0, 0))
+>Foo : Foo
diff --git a/tests/baselines/reference/anonterface.symbols b/tests/baselines/reference/anonterface.symbols
new file mode 100644
index 00000000000..fccd48043cf
--- /dev/null
+++ b/tests/baselines/reference/anonterface.symbols
@@ -0,0 +1,36 @@
+=== tests/cases/compiler/anonterface.ts ===
+module M {
+>M : Symbol(M, Decl(anonterface.ts, 0, 0))
+
+ export class C {
+>C : Symbol(C, Decl(anonterface.ts, 0, 10))
+
+ m(fn:{ (n:number):string; },n2:number):string {
+>m : Symbol(m, Decl(anonterface.ts, 1, 20))
+>fn : Symbol(fn, Decl(anonterface.ts, 2, 10))
+>n : Symbol(n, Decl(anonterface.ts, 2, 16))
+>n2 : Symbol(n2, Decl(anonterface.ts, 2, 36))
+
+ return fn(n2);
+>fn : Symbol(fn, Decl(anonterface.ts, 2, 10))
+>n2 : Symbol(n2, Decl(anonterface.ts, 2, 36))
+ }
+ }
+}
+
+var c=new M.C();
+>c : Symbol(c, Decl(anonterface.ts, 8, 3))
+>M.C : Symbol(M.C, Decl(anonterface.ts, 0, 10))
+>M : Symbol(M, Decl(anonterface.ts, 0, 0))
+>C : Symbol(M.C, Decl(anonterface.ts, 0, 10))
+
+c.m(function(n) { return "hello: "+n; },18);
+>c.m : Symbol(M.C.m, Decl(anonterface.ts, 1, 20))
+>c : Symbol(c, Decl(anonterface.ts, 8, 3))
+>m : Symbol(M.C.m, Decl(anonterface.ts, 1, 20))
+>n : Symbol(n, Decl(anonterface.ts, 9, 13))
+>n : Symbol(n, Decl(anonterface.ts, 9, 13))
+
+
+
+
diff --git a/tests/baselines/reference/anonterface.types b/tests/baselines/reference/anonterface.types
index 1d84fe8f8e0..b152ce79a1d 100644
--- a/tests/baselines/reference/anonterface.types
+++ b/tests/baselines/reference/anonterface.types
@@ -1,41 +1,41 @@
=== tests/cases/compiler/anonterface.ts ===
module M {
->M : typeof M, Symbol(M, Decl(anonterface.ts, 0, 0))
+>M : typeof M
export class C {
->C : C, Symbol(C, Decl(anonterface.ts, 0, 10))
+>C : C
m(fn:{ (n:number):string; },n2:number):string {
->m : (fn: (n: number) => string, n2: number) => string, Symbol(m, Decl(anonterface.ts, 1, 20))
->fn : (n: number) => string, Symbol(fn, Decl(anonterface.ts, 2, 10))
->n : number, Symbol(n, Decl(anonterface.ts, 2, 16))
->n2 : number, Symbol(n2, Decl(anonterface.ts, 2, 36))
+>m : (fn: (n: number) => string, n2: number) => string
+>fn : (n: number) => string
+>n : number
+>n2 : number
return fn(n2);
>fn(n2) : string
->fn : (n: number) => string, Symbol(fn, Decl(anonterface.ts, 2, 10))
->n2 : number, Symbol(n2, Decl(anonterface.ts, 2, 36))
+>fn : (n: number) => string
+>n2 : number
}
}
}
var c=new M.C();
->c : M.C, Symbol(c, Decl(anonterface.ts, 8, 3))
+>c : M.C
>new M.C() : M.C
->M.C : typeof M.C, Symbol(M.C, Decl(anonterface.ts, 0, 10))
->M : typeof M, Symbol(M, Decl(anonterface.ts, 0, 0))
->C : typeof M.C, Symbol(M.C, Decl(anonterface.ts, 0, 10))
+>M.C : typeof M.C
+>M : typeof M
+>C : typeof M.C
c.m(function(n) { return "hello: "+n; },18);
>c.m(function(n) { return "hello: "+n; },18) : string
->c.m : (fn: (n: number) => string, n2: number) => string, Symbol(M.C.m, Decl(anonterface.ts, 1, 20))
->c : M.C, Symbol(c, Decl(anonterface.ts, 8, 3))
->m : (fn: (n: number) => string, n2: number) => string, Symbol(M.C.m, Decl(anonterface.ts, 1, 20))
+>c.m : (fn: (n: number) => string, n2: number) => string
+>c : M.C
+>m : (fn: (n: number) => string, n2: number) => string
>function(n) { return "hello: "+n; } : (n: number) => string
->n : number, Symbol(n, Decl(anonterface.ts, 9, 13))
+>n : number
>"hello: "+n : string
>"hello: " : string
->n : number, Symbol(n, Decl(anonterface.ts, 9, 13))
+>n : number
>18 : number
diff --git a/tests/baselines/reference/anyAsFunctionCall.symbols b/tests/baselines/reference/anyAsFunctionCall.symbols
new file mode 100644
index 00000000000..14aeb993a6d
--- /dev/null
+++ b/tests/baselines/reference/anyAsFunctionCall.symbols
@@ -0,0 +1,20 @@
+=== tests/cases/conformance/types/any/anyAsFunctionCall.ts ===
+// any is considered an untyped function call
+// can be called except with type arguments which is an error
+
+var x: any;
+>x : Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3))
+
+var a = x();
+>a : Symbol(a, Decl(anyAsFunctionCall.ts, 4, 3))
+>x : Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3))
+
+var b = x('hello');
+>b : Symbol(b, Decl(anyAsFunctionCall.ts, 5, 3))
+>x : Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3))
+
+var c = x(x);
+>c : Symbol(c, Decl(anyAsFunctionCall.ts, 6, 3))
+>x : Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3))
+>x : Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3))
+
diff --git a/tests/baselines/reference/anyAsFunctionCall.types b/tests/baselines/reference/anyAsFunctionCall.types
index 80e039f76dd..340ccac463f 100644
--- a/tests/baselines/reference/anyAsFunctionCall.types
+++ b/tests/baselines/reference/anyAsFunctionCall.types
@@ -3,22 +3,22 @@
// can be called except with type arguments which is an error
var x: any;
->x : any, Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3))
+>x : any
var a = x();
->a : any, Symbol(a, Decl(anyAsFunctionCall.ts, 4, 3))
+>a : any
>x() : any
->x : any, Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3))
+>x : any
var b = x('hello');
->b : any, Symbol(b, Decl(anyAsFunctionCall.ts, 5, 3))
+>b : any
>x('hello') : any
->x : any, Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3))
+>x : any
>'hello' : string
var c = x(x);
->c : any, Symbol(c, Decl(anyAsFunctionCall.ts, 6, 3))
+>c : any
>x(x) : any
->x : any, Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3))
->x : any, Symbol(x, Decl(anyAsFunctionCall.ts, 3, 3))
+>x : any
+>x : any
diff --git a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.symbols b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.symbols
new file mode 100644
index 00000000000..d6d6719240d
--- /dev/null
+++ b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.symbols
@@ -0,0 +1,24 @@
+=== tests/cases/compiler/anyAsReturnTypeForNewOnCall.ts ===
+function Point(x, y) {
+>Point : Symbol(Point, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 0))
+>x : Symbol(x, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 15))
+>y : Symbol(y, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 17))
+
+ this.x = x;
+>x : Symbol(x, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 15))
+
+ this.y = y;
+>y : Symbol(y, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 17))
+
+}
+
+var o = new Point(3, 4);
+>o : Symbol(o, Decl(anyAsReturnTypeForNewOnCall.ts, 8, 3))
+>Point : Symbol(Point, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 0))
+
+var xx = o.x;
+>xx : Symbol(xx, Decl(anyAsReturnTypeForNewOnCall.ts, 10, 3))
+>o : Symbol(o, Decl(anyAsReturnTypeForNewOnCall.ts, 8, 3))
+
+
+
diff --git a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types
index 2abdb1cbeda..bd0d9a9a092 100644
--- a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types
+++ b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types
@@ -1,36 +1,36 @@
=== tests/cases/compiler/anyAsReturnTypeForNewOnCall.ts ===
function Point(x, y) {
->Point : (x: any, y: any) => void, Symbol(Point, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 0))
->x : any, Symbol(x, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 15))
->y : any, Symbol(y, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 17))
+>Point : (x: any, y: any) => void
+>x : any
+>y : any
this.x = x;
>this.x = x : any
>this.x : any
>this : any
>x : any
->x : any, Symbol(x, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 15))
+>x : any
this.y = y;
>this.y = y : any
>this.y : any
>this : any
>y : any
->y : any, Symbol(y, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 17))
+>y : any
}
var o = new Point(3, 4);
->o : any, Symbol(o, Decl(anyAsReturnTypeForNewOnCall.ts, 8, 3))
+>o : any
>new Point(3, 4) : any
->Point : (x: any, y: any) => void, Symbol(Point, Decl(anyAsReturnTypeForNewOnCall.ts, 0, 0))
+>Point : (x: any, y: any) => void
>3 : number
>4 : number
var xx = o.x;
->xx : any, Symbol(xx, Decl(anyAsReturnTypeForNewOnCall.ts, 10, 3))
+>xx : any
>o.x : any
->o : any, Symbol(o, Decl(anyAsReturnTypeForNewOnCall.ts, 8, 3))
+>o : any
>x : any
diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.symbols b/tests/baselines/reference/anyAssignabilityInInheritance.symbols
new file mode 100644
index 00000000000..0f659dddd21
--- /dev/null
+++ b/tests/baselines/reference/anyAssignabilityInInheritance.symbols
@@ -0,0 +1,304 @@
+=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignabilityInInheritance.ts ===
+// any is not a subtype of any other types, errors expected on all the below derived classes unless otherwise noted
+
+interface I {
+>I : Symbol(I, Decl(anyAssignabilityInInheritance.ts, 0, 0))
+
+ [x: string]: any;
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 3, 5))
+
+ foo: any; // ok, any identical to itself
+>foo : Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 3, 21))
+}
+
+var a: any;
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo2(x: number): number;
+>foo2 : Symbol(foo2, Decl(anyAssignabilityInInheritance.ts, 7, 11), Decl(anyAssignabilityInInheritance.ts, 9, 41))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 9, 22))
+
+declare function foo2(x: any): any;
+>foo2 : Symbol(foo2, Decl(anyAssignabilityInInheritance.ts, 7, 11), Decl(anyAssignabilityInInheritance.ts, 9, 41))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 10, 22))
+
+var r3 = foo2(a); // any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload)
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo2 : Symbol(foo2, Decl(anyAssignabilityInInheritance.ts, 7, 11), Decl(anyAssignabilityInInheritance.ts, 9, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo3(x: string): string;
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 13, 22))
+
+declare function foo3(x: any): any;
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 14, 22))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo4(x: boolean): boolean;
+>foo4 : Symbol(foo4, Decl(anyAssignabilityInInheritance.ts, 15, 17), Decl(anyAssignabilityInInheritance.ts, 17, 43))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 17, 22))
+
+declare function foo4(x: any): any;
+>foo4 : Symbol(foo4, Decl(anyAssignabilityInInheritance.ts, 15, 17), Decl(anyAssignabilityInInheritance.ts, 17, 43))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 18, 22))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo5(x: Date): Date;
+>foo5 : Symbol(foo5, Decl(anyAssignabilityInInheritance.ts, 19, 17), Decl(anyAssignabilityInInheritance.ts, 21, 37))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 21, 22))
+>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11))
+>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11))
+
+declare function foo5(x: any): any;
+>foo5 : Symbol(foo5, Decl(anyAssignabilityInInheritance.ts, 19, 17), Decl(anyAssignabilityInInheritance.ts, 21, 37))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 22, 22))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo6(x: RegExp): RegExp;
+>foo6 : Symbol(foo6, Decl(anyAssignabilityInInheritance.ts, 23, 17), Decl(anyAssignabilityInInheritance.ts, 25, 41))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 25, 22))
+>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11))
+>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11))
+
+declare function foo6(x: any): any;
+>foo6 : Symbol(foo6, Decl(anyAssignabilityInInheritance.ts, 23, 17), Decl(anyAssignabilityInInheritance.ts, 25, 41))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 26, 22))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo7(x: { bar: number }): { bar: number };
+>foo7 : Symbol(foo7, Decl(anyAssignabilityInInheritance.ts, 27, 17), Decl(anyAssignabilityInInheritance.ts, 29, 59))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 29, 22))
+>bar : Symbol(bar, Decl(anyAssignabilityInInheritance.ts, 29, 26))
+>bar : Symbol(bar, Decl(anyAssignabilityInInheritance.ts, 29, 44))
+
+declare function foo7(x: any): any;
+>foo7 : Symbol(foo7, Decl(anyAssignabilityInInheritance.ts, 27, 17), Decl(anyAssignabilityInInheritance.ts, 29, 59))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 30, 22))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo8(x: number[]): number[];
+>foo8 : Symbol(foo8, Decl(anyAssignabilityInInheritance.ts, 31, 17), Decl(anyAssignabilityInInheritance.ts, 33, 45))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 33, 22))
+
+declare function foo8(x: any): any;
+>foo8 : Symbol(foo8, Decl(anyAssignabilityInInheritance.ts, 31, 17), Decl(anyAssignabilityInInheritance.ts, 33, 45))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 34, 22))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+interface I8 { foo: string }
+>I8 : Symbol(I8, Decl(anyAssignabilityInInheritance.ts, 35, 17))
+>foo : Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 37, 14))
+
+declare function foo9(x: I8): I8;
+>foo9 : Symbol(foo9, Decl(anyAssignabilityInInheritance.ts, 37, 28), Decl(anyAssignabilityInInheritance.ts, 38, 33))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 38, 22))
+>I8 : Symbol(I8, Decl(anyAssignabilityInInheritance.ts, 35, 17))
+>I8 : Symbol(I8, Decl(anyAssignabilityInInheritance.ts, 35, 17))
+
+declare function foo9(x: any): any;
+>foo9 : Symbol(foo9, Decl(anyAssignabilityInInheritance.ts, 37, 28), Decl(anyAssignabilityInInheritance.ts, 38, 33))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 39, 22))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+class A { foo: number; }
+>A : Symbol(A, Decl(anyAssignabilityInInheritance.ts, 40, 17))
+>foo : Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 42, 9))
+
+declare function foo10(x: A): A;
+>foo10 : Symbol(foo10, Decl(anyAssignabilityInInheritance.ts, 42, 24), Decl(anyAssignabilityInInheritance.ts, 43, 32))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 43, 23))
+>A : Symbol(A, Decl(anyAssignabilityInInheritance.ts, 40, 17))
+>A : Symbol(A, Decl(anyAssignabilityInInheritance.ts, 40, 17))
+
+declare function foo10(x: any): any;
+>foo10 : Symbol(foo10, Decl(anyAssignabilityInInheritance.ts, 42, 24), Decl(anyAssignabilityInInheritance.ts, 43, 32))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 44, 23))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+class A2 { foo: T; }
+>A2 : Symbol(A2, Decl(anyAssignabilityInInheritance.ts, 45, 17))
+>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 47, 9))
+>foo : Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 47, 13))
+>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 47, 9))
+
+declare function foo11(x: A2): A2;
+>foo11 : Symbol(foo11, Decl(anyAssignabilityInInheritance.ts, 47, 23), Decl(anyAssignabilityInInheritance.ts, 48, 50))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 48, 23))
+>A2 : Symbol(A2, Decl(anyAssignabilityInInheritance.ts, 45, 17))
+>A2 : Symbol(A2, Decl(anyAssignabilityInInheritance.ts, 45, 17))
+
+declare function foo11(x: any): any;
+>foo11 : Symbol(foo11, Decl(anyAssignabilityInInheritance.ts, 47, 23), Decl(anyAssignabilityInInheritance.ts, 48, 50))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 49, 23))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo12(x: (x) => number): (x) => number;
+>foo12 : Symbol(foo12, Decl(anyAssignabilityInInheritance.ts, 50, 17), Decl(anyAssignabilityInInheritance.ts, 52, 56))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 52, 23))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 52, 27))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 52, 43))
+
+declare function foo12(x: any): any;
+>foo12 : Symbol(foo12, Decl(anyAssignabilityInInheritance.ts, 50, 17), Decl(anyAssignabilityInInheritance.ts, 52, 56))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 53, 23))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo13(x: (x: T) => T): (x: T) => T;
+>foo13 : Symbol(foo13, Decl(anyAssignabilityInInheritance.ts, 54, 17), Decl(anyAssignabilityInInheritance.ts, 56, 58))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 56, 23))
+>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 27))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 56, 30))
+>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 27))
+>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 27))
+>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 44))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 56, 47))
+>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 44))
+>T : Symbol(T, Decl(anyAssignabilityInInheritance.ts, 56, 44))
+
+declare function foo13(x: any): any;
+>foo13 : Symbol(foo13, Decl(anyAssignabilityInInheritance.ts, 54, 17), Decl(anyAssignabilityInInheritance.ts, 56, 58))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 57, 23))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+enum E { A }
+>E : Symbol(E, Decl(anyAssignabilityInInheritance.ts, 58, 17))
+>A : Symbol(E.A, Decl(anyAssignabilityInInheritance.ts, 60, 8))
+
+declare function foo14(x: E): E;
+>foo14 : Symbol(foo14, Decl(anyAssignabilityInInheritance.ts, 60, 12), Decl(anyAssignabilityInInheritance.ts, 61, 32))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 61, 23))
+>E : Symbol(E, Decl(anyAssignabilityInInheritance.ts, 58, 17))
+>E : Symbol(E, Decl(anyAssignabilityInInheritance.ts, 58, 17))
+
+declare function foo14(x: any): any;
+>foo14 : Symbol(foo14, Decl(anyAssignabilityInInheritance.ts, 60, 12), Decl(anyAssignabilityInInheritance.ts, 61, 32))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 62, 23))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+function f() { }
+>f : Symbol(f, Decl(anyAssignabilityInInheritance.ts, 63, 17), Decl(anyAssignabilityInInheritance.ts, 65, 16))
+
+module f {
+>f : Symbol(f, Decl(anyAssignabilityInInheritance.ts, 63, 17), Decl(anyAssignabilityInInheritance.ts, 65, 16))
+
+ export var bar = 1;
+>bar : Symbol(bar, Decl(anyAssignabilityInInheritance.ts, 67, 14))
+}
+declare function foo15(x: typeof f): typeof f;
+>foo15 : Symbol(foo15, Decl(anyAssignabilityInInheritance.ts, 68, 1), Decl(anyAssignabilityInInheritance.ts, 69, 46))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 69, 23))
+>f : Symbol(f, Decl(anyAssignabilityInInheritance.ts, 63, 17), Decl(anyAssignabilityInInheritance.ts, 65, 16))
+>f : Symbol(f, Decl(anyAssignabilityInInheritance.ts, 63, 17), Decl(anyAssignabilityInInheritance.ts, 65, 16))
+
+declare function foo15(x: any): any;
+>foo15 : Symbol(foo15, Decl(anyAssignabilityInInheritance.ts, 68, 1), Decl(anyAssignabilityInInheritance.ts, 69, 46))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 70, 23))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+class CC { baz: string }
+>CC : Symbol(CC, Decl(anyAssignabilityInInheritance.ts, 71, 17), Decl(anyAssignabilityInInheritance.ts, 73, 24))
+>baz : Symbol(baz, Decl(anyAssignabilityInInheritance.ts, 73, 10))
+
+module CC {
+>CC : Symbol(CC, Decl(anyAssignabilityInInheritance.ts, 71, 17), Decl(anyAssignabilityInInheritance.ts, 73, 24))
+
+ export var bar = 1;
+>bar : Symbol(bar, Decl(anyAssignabilityInInheritance.ts, 75, 14))
+}
+declare function foo16(x: CC): CC;
+>foo16 : Symbol(foo16, Decl(anyAssignabilityInInheritance.ts, 76, 1), Decl(anyAssignabilityInInheritance.ts, 77, 34))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 77, 23))
+>CC : Symbol(CC, Decl(anyAssignabilityInInheritance.ts, 71, 17), Decl(anyAssignabilityInInheritance.ts, 73, 24))
+>CC : Symbol(CC, Decl(anyAssignabilityInInheritance.ts, 71, 17), Decl(anyAssignabilityInInheritance.ts, 73, 24))
+
+declare function foo16(x: any): any;
+>foo16 : Symbol(foo16, Decl(anyAssignabilityInInheritance.ts, 76, 1), Decl(anyAssignabilityInInheritance.ts, 77, 34))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 78, 23))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo17(x: Object): Object;
+>foo17 : Symbol(foo17, Decl(anyAssignabilityInInheritance.ts, 79, 17), Decl(anyAssignabilityInInheritance.ts, 81, 42))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 81, 23))
+>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
+>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
+
+declare function foo17(x: any): any;
+>foo17 : Symbol(foo17, Decl(anyAssignabilityInInheritance.ts, 79, 17), Decl(anyAssignabilityInInheritance.ts, 81, 42))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 82, 23))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
+declare function foo18(x: {}): {};
+>foo18 : Symbol(foo18, Decl(anyAssignabilityInInheritance.ts, 83, 17), Decl(anyAssignabilityInInheritance.ts, 85, 34))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 85, 23))
+
+declare function foo18(x: any): any;
+>foo18 : Symbol(foo18, Decl(anyAssignabilityInInheritance.ts, 83, 17), Decl(anyAssignabilityInInheritance.ts, 85, 34))
+>x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 86, 23))
+
+var r3 = foo3(a); // any
+>r3 : Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>foo3 : Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
+>a : Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+
diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.types b/tests/baselines/reference/anyAssignabilityInInheritance.types
index 8f54b6761c8..b8575e8edb2 100644
--- a/tests/baselines/reference/anyAssignabilityInInheritance.types
+++ b/tests/baselines/reference/anyAssignabilityInInheritance.types
@@ -2,322 +2,322 @@
// any is not a subtype of any other types, errors expected on all the below derived classes unless otherwise noted
interface I {
->I : I, Symbol(I, Decl(anyAssignabilityInInheritance.ts, 0, 0))
+>I : I
[x: string]: any;
->x : string, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 3, 5))
+>x : string
foo: any; // ok, any identical to itself
->foo : any, Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 3, 21))
+>foo : any
}
var a: any;
->a : any, Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+>a : any
declare function foo2(x: number): number;
->foo2 : { (x: number): number; (x: any): any; }, Symbol(foo2, Decl(anyAssignabilityInInheritance.ts, 7, 11), Decl(anyAssignabilityInInheritance.ts, 9, 41))
->x : number, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 9, 22))
+>foo2 : { (x: number): number; (x: any): any; }
+>x : number
declare function foo2(x: any): any;
->foo2 : { (x: number): number; (x: any): any; }, Symbol(foo2, Decl(anyAssignabilityInInheritance.ts, 7, 11), Decl(anyAssignabilityInInheritance.ts, 9, 41))
->x : any, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 10, 22))
+>foo2 : { (x: number): number; (x: any): any; }
+>x : any
var r3 = foo2(a); // any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload)
->r3 : any, Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>r3 : any
>foo2(a) : any
->foo2 : { (x: number): number; (x: any): any; }, Symbol(foo2, Decl(anyAssignabilityInInheritance.ts, 7, 11), Decl(anyAssignabilityInInheritance.ts, 9, 41))
->a : any, Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+>foo2 : { (x: number): number; (x: any): any; }
+>a : any
declare function foo3(x: string): string;
->foo3 : { (x: string): string; (x: any): any; }, Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
->x : string, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 13, 22))
+>foo3 : { (x: string): string; (x: any): any; }
+>x : string
declare function foo3(x: any): any;
->foo3 : { (x: string): string; (x: any): any; }, Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
->x : any, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 14, 22))
+>foo3 : { (x: string): string; (x: any): any; }
+>x : any
var r3 = foo3(a); // any
->r3 : any, Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>r3 : any
>foo3(a) : any
->foo3 : { (x: string): string; (x: any): any; }, Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
->a : any, Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+>foo3 : { (x: string): string; (x: any): any; }
+>a : any
declare function foo4(x: boolean): boolean;
->foo4 : { (x: boolean): boolean; (x: any): any; }, Symbol(foo4, Decl(anyAssignabilityInInheritance.ts, 15, 17), Decl(anyAssignabilityInInheritance.ts, 17, 43))
->x : boolean, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 17, 22))
+>foo4 : { (x: boolean): boolean; (x: any): any; }
+>x : boolean
declare function foo4(x: any): any;
->foo4 : { (x: boolean): boolean; (x: any): any; }, Symbol(foo4, Decl(anyAssignabilityInInheritance.ts, 15, 17), Decl(anyAssignabilityInInheritance.ts, 17, 43))
->x : any, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 18, 22))
+>foo4 : { (x: boolean): boolean; (x: any): any; }
+>x : any
var r3 = foo3(a); // any
->r3 : any, Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>r3 : any
>foo3(a) : any
->foo3 : { (x: string): string; (x: any): any; }, Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
->a : any, Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+>foo3 : { (x: string): string; (x: any): any; }
+>a : any
declare function foo5(x: Date): Date;
->foo5 : { (x: Date): Date; (x: any): any; }, Symbol(foo5, Decl(anyAssignabilityInInheritance.ts, 19, 17), Decl(anyAssignabilityInInheritance.ts, 21, 37))
->x : Date, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 21, 22))
->Date : Date, Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11))
->Date : Date, Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11))
+>foo5 : { (x: Date): Date; (x: any): any; }
+>x : Date
+>Date : Date
+>Date : Date
declare function foo5(x: any): any;
->foo5 : { (x: Date): Date; (x: any): any; }, Symbol(foo5, Decl(anyAssignabilityInInheritance.ts, 19, 17), Decl(anyAssignabilityInInheritance.ts, 21, 37))
->x : any, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 22, 22))
+>foo5 : { (x: Date): Date; (x: any): any; }
+>x : any
var r3 = foo3(a); // any
->r3 : any, Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>r3 : any
>foo3(a) : any
->foo3 : { (x: string): string; (x: any): any; }, Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
->a : any, Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+>foo3 : { (x: string): string; (x: any): any; }
+>a : any
declare function foo6(x: RegExp): RegExp;
->foo6 : { (x: RegExp): RegExp; (x: any): any; }, Symbol(foo6, Decl(anyAssignabilityInInheritance.ts, 23, 17), Decl(anyAssignabilityInInheritance.ts, 25, 41))
->x : RegExp, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 25, 22))
->RegExp : RegExp, Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11))
->RegExp : RegExp, Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11))
+>foo6 : { (x: RegExp): RegExp; (x: any): any; }
+>x : RegExp
+>RegExp : RegExp
+>RegExp : RegExp
declare function foo6(x: any): any;
->foo6 : { (x: RegExp): RegExp; (x: any): any; }, Symbol(foo6, Decl(anyAssignabilityInInheritance.ts, 23, 17), Decl(anyAssignabilityInInheritance.ts, 25, 41))
->x : any, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 26, 22))
+>foo6 : { (x: RegExp): RegExp; (x: any): any; }
+>x : any
var r3 = foo3(a); // any
->r3 : any, Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>r3 : any
>foo3(a) : any
->foo3 : { (x: string): string; (x: any): any; }, Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
->a : any, Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+>foo3 : { (x: string): string; (x: any): any; }
+>a : any
declare function foo7(x: { bar: number }): { bar: number };
->foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; }, Symbol(foo7, Decl(anyAssignabilityInInheritance.ts, 27, 17), Decl(anyAssignabilityInInheritance.ts, 29, 59))
->x : { bar: number; }, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 29, 22))
->bar : number, Symbol(bar, Decl(anyAssignabilityInInheritance.ts, 29, 26))
->bar : number, Symbol(bar, Decl(anyAssignabilityInInheritance.ts, 29, 44))
+>foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; }
+>x : { bar: number; }
+>bar : number
+>bar : number
declare function foo7(x: any): any;
->foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; }, Symbol(foo7, Decl(anyAssignabilityInInheritance.ts, 27, 17), Decl(anyAssignabilityInInheritance.ts, 29, 59))
->x : any, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 30, 22))
+>foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; }
+>x : any
var r3 = foo3(a); // any
->r3 : any, Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>r3 : any
>foo3(a) : any
->foo3 : { (x: string): string; (x: any): any; }, Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
->a : any, Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+>foo3 : { (x: string): string; (x: any): any; }
+>a : any
declare function foo8(x: number[]): number[];
->foo8 : { (x: number[]): number[]; (x: any): any; }, Symbol(foo8, Decl(anyAssignabilityInInheritance.ts, 31, 17), Decl(anyAssignabilityInInheritance.ts, 33, 45))
->x : number[], Symbol(x, Decl(anyAssignabilityInInheritance.ts, 33, 22))
+>foo8 : { (x: number[]): number[]; (x: any): any; }
+>x : number[]
declare function foo8(x: any): any;
->foo8 : { (x: number[]): number[]; (x: any): any; }, Symbol(foo8, Decl(anyAssignabilityInInheritance.ts, 31, 17), Decl(anyAssignabilityInInheritance.ts, 33, 45))
->x : any, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 34, 22))
+>foo8 : { (x: number[]): number[]; (x: any): any; }
+>x : any
var r3 = foo3(a); // any
->r3 : any, Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>r3 : any
>foo3(a) : any
->foo3 : { (x: string): string; (x: any): any; }, Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
->a : any, Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+>foo3 : { (x: string): string; (x: any): any; }
+>a : any
interface I8 { foo: string }
->I8 : I8, Symbol(I8, Decl(anyAssignabilityInInheritance.ts, 35, 17))
->foo : string, Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 37, 14))
+>I8 : I8
+>foo : string
declare function foo9(x: I8): I8;
->foo9 : { (x: I8): I8; (x: any): any; }, Symbol(foo9, Decl(anyAssignabilityInInheritance.ts, 37, 28), Decl(anyAssignabilityInInheritance.ts, 38, 33))
->x : I8, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 38, 22))
->I8 : I8, Symbol(I8, Decl(anyAssignabilityInInheritance.ts, 35, 17))
->I8 : I8, Symbol(I8, Decl(anyAssignabilityInInheritance.ts, 35, 17))
+>foo9 : { (x: I8): I8; (x: any): any; }
+>x : I8
+>I8 : I8
+>I8 : I8
declare function foo9(x: any): any;
->foo9 : { (x: I8): I8; (x: any): any; }, Symbol(foo9, Decl(anyAssignabilityInInheritance.ts, 37, 28), Decl(anyAssignabilityInInheritance.ts, 38, 33))
->x : any, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 39, 22))
+>foo9 : { (x: I8): I8; (x: any): any; }
+>x : any
var r3 = foo3(a); // any
->r3 : any, Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>r3 : any
>foo3(a) : any
->foo3 : { (x: string): string; (x: any): any; }, Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
->a : any, Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+>foo3 : { (x: string): string; (x: any): any; }
+>a : any
class A { foo: number; }
->A : A, Symbol(A, Decl(anyAssignabilityInInheritance.ts, 40, 17))
->foo : number, Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 42, 9))
+>A : A
+>foo : number
declare function foo10(x: A): A;
->foo10 : { (x: A): A; (x: any): any; }, Symbol(foo10, Decl(anyAssignabilityInInheritance.ts, 42, 24), Decl(anyAssignabilityInInheritance.ts, 43, 32))
->x : A, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 43, 23))
->A : A, Symbol(A, Decl(anyAssignabilityInInheritance.ts, 40, 17))
->A : A, Symbol(A, Decl(anyAssignabilityInInheritance.ts, 40, 17))
+>foo10 : { (x: A): A; (x: any): any; }
+>x : A
+>A : A
+>A : A
declare function foo10(x: any): any;
->foo10 : { (x: A): A; (x: any): any; }, Symbol(foo10, Decl(anyAssignabilityInInheritance.ts, 42, 24), Decl(anyAssignabilityInInheritance.ts, 43, 32))
->x : any, Symbol(x, Decl(anyAssignabilityInInheritance.ts, 44, 23))
+>foo10 : { (x: A): A; (x: any): any; }
+>x : any
var r3 = foo3(a); // any
->r3 : any, Symbol(r3, Decl(anyAssignabilityInInheritance.ts, 11, 3), Decl(anyAssignabilityInInheritance.ts, 15, 3), Decl(anyAssignabilityInInheritance.ts, 19, 3), Decl(anyAssignabilityInInheritance.ts, 23, 3), Decl(anyAssignabilityInInheritance.ts, 27, 3), Decl(anyAssignabilityInInheritance.ts, 31, 3), Decl(anyAssignabilityInInheritance.ts, 35, 3), Decl(anyAssignabilityInInheritance.ts, 40, 3), Decl(anyAssignabilityInInheritance.ts, 45, 3), Decl(anyAssignabilityInInheritance.ts, 50, 3), Decl(anyAssignabilityInInheritance.ts, 54, 3), Decl(anyAssignabilityInInheritance.ts, 58, 3), Decl(anyAssignabilityInInheritance.ts, 63, 3), Decl(anyAssignabilityInInheritance.ts, 71, 3), Decl(anyAssignabilityInInheritance.ts, 79, 3), Decl(anyAssignabilityInInheritance.ts, 83, 3), Decl(anyAssignabilityInInheritance.ts, 87, 3))
+>r3 : any
>foo3(a) : any
->foo3 : { (x: string): string; (x: any): any; }, Symbol(foo3, Decl(anyAssignabilityInInheritance.ts, 11, 17), Decl(anyAssignabilityInInheritance.ts, 13, 41))
->a : any, Symbol(a, Decl(anyAssignabilityInInheritance.ts, 7, 3))
+>foo3 : { (x: string): string; (x: any): any; }
+>a : any
class A2 { foo: T; }
->A2 : A2, Symbol(A2, Decl(anyAssignabilityInInheritance.ts, 45, 17))
->T : T, Symbol(T, Decl(anyAssignabilityInInheritance.ts, 47, 9))
->foo : T, Symbol(foo, Decl(anyAssignabilityInInheritance.ts, 47, 13))
->T : T, Symbol(T, Decl(anyAssignabilityInInheritance.ts, 47, 9))
+>A2 : A2
+>T : T
+>foo : T
+>T : T
declare function foo11(x: A2): A2;
->foo11 : { (x: A2): A2; (x: any): any; }, Symbol(foo11, Decl(anyAssignabilityInInheritance.ts, 47, 23), Decl(anyAssignabilityInInheritance.ts, 48, 50))
->x : A2