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/scripts/processDiagnosticMessages.ts b/scripts/processDiagnosticMessages.ts index b97e4a2ea54..9cfde5b2964 100644 --- a/scripts/processDiagnosticMessages.ts +++ b/scripts/processDiagnosticMessages.ts @@ -54,6 +54,7 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap: var result = '// \r\n' + '/// \r\n' + + '/* @internal */\r\n' + 'module ts {\r\n' + ' export var Diagnostics = {\r\n'; var names = Utilities.getObjectKeys(messageTable); diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2490c32fedc..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; } @@ -9412,7 +9453,10 @@ module ts { } if (isArrayLikeType(inputType)) { - return getIndexTypeOfType(inputType, IndexKind.Number); + let indexType = getIndexTypeOfType(inputType, IndexKind.Number); + if (indexType) { + return indexType; + } } error(errorNode, Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); @@ -10390,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 @@ -10416,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. @@ -12243,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); } @@ -12729,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); @@ -12926,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 ea40d118382..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", @@ -2043,19 +2047,19 @@ }, "'import ... =' can only be used in a .ts file.": { "category": "Error", - "code": 8002 + "code": 8002 }, "'export=' can only be used in a .ts file.": { "category": "Error", - "code": 8003 + "code": 8003 }, "'type parameter declarations' can only be used in a .ts file.": { "category": "Error", - "code": 8004 + "code": 8004 }, "'implements clauses' can only be used in a .ts file.": { "category": "Error", - "code": 8005 + "code": 8005 }, "'interface declarations' can only be used in a .ts file.": { "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 4c50e0e0cad..533f90a2d83 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -1,9 +1,9 @@ interface TypeWriterResult { line: number; - column: number; syntaxKind: number; sourceText: string; type: string; + symbol: string; } class TypeWriterWalker { @@ -20,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 = []; @@ -29,90 +29,43 @@ class TypeWriterWalker { } private visitNode(node: ts.Node): void { - switch (node.kind) { - // Should always log expressions that are not tokens - // Also, always log the "this" keyword - // TODO: Ideally we should log all expressions, but to compare to the - // old typeWriter baselines, suppress tokens - case ts.SyntaxKind.ThisKeyword: - case ts.SyntaxKind.SuperKeyword: - case ts.SyntaxKind.ArrayLiteralExpression: - case ts.SyntaxKind.ObjectLiteralExpression: - case ts.SyntaxKind.ElementAccessExpression: - case ts.SyntaxKind.CallExpression: - case ts.SyntaxKind.NewExpression: - case ts.SyntaxKind.TypeAssertionExpression: - case ts.SyntaxKind.ParenthesizedExpression: - case ts.SyntaxKind.FunctionExpression: - case ts.SyntaxKind.ArrowFunction: - case ts.SyntaxKind.TypeOfExpression: - case ts.SyntaxKind.VoidExpression: - case ts.SyntaxKind.DeleteExpression: - case ts.SyntaxKind.PrefixUnaryExpression: - case ts.SyntaxKind.PostfixUnaryExpression: - case ts.SyntaxKind.BinaryExpression: - case ts.SyntaxKind.ConditionalExpression: - case ts.SyntaxKind.SpreadElementExpression: - this.log(node, this.getTypeOfNode(node)); - break; - - case ts.SyntaxKind.PropertyAccessExpression: - for (var current = node; current.kind === ts.SyntaxKind.PropertyAccessExpression; current = current.parent) { - } - if (current.kind !== ts.SyntaxKind.HeritageClauseElement) { - this.log(node, this.getTypeOfNode(node)); - } - break; - - // Should not change expression status (maybe expressions) - // TODO: Again, ideally should log number and string literals too, - // but to be consistent with the old typeWriter, just log identifiers - case ts.SyntaxKind.Identifier: - var identifier = node; - if (!this.isLabel(identifier)) { - var type = this.getTypeOfNode(identifier); - this.log(node, type); - } - break; + if (ts.isExpression(node) || node.kind === ts.SyntaxKind.Identifier) { + this.logTypeAndSymbol(node); } ts.forEachChild(node, child => this.visitNode(child)); } - private isLabel(identifier: ts.Identifier): boolean { - var parent = identifier.parent; - switch (parent.kind) { - case ts.SyntaxKind.ContinueStatement: - case ts.SyntaxKind.BreakStatement: - return (parent).label === identifier; - case ts.SyntaxKind.LabeledStatement: - return (parent).label === identifier; - } - return false; - } - - private log(node: ts.Node, type: ts.Type): void { + private logTypeAndSymbol(node: ts.Node): void { var actualPos = ts.skipTrivia(this.currentSourceFile.text, node.pos); var lineAndCharacter = this.currentSourceFile.getLineAndCharacterOfPosition(actualPos); var sourceText = ts.getTextOfNodeFromSourceText(this.currentSourceFile.text, node); - - // If we got an unknown type, we temporarily want to fall back to just pretending the name - // (source text) of the node is the type. This is to align with the old typeWriter to make - // baseline comparisons easier. In the long term, we will want to just call typeToString - this.results.push({ - line: lineAndCharacter.line, - // todo(cyrusn): Not sure why column is one-based for type-writer. But I'm preserving - // that behavior to prevent having a lot of baselines to fix up. - column: lineAndCharacter.character + 1, - syntaxKind: node.kind, - sourceText: sourceText, - type: this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.WriteOwnNameForAnyLike) - }); - } - private getTypeOfNode(node: ts.Node): ts.Type { var type = this.checker.getTypeAtLocation(node); ts.Debug.assert(type !== undefined, "type doesn't exist"); - return type; + var symbol = this.checker.getSymbolAtLocation(node); + + var typeString = this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation); + var symbolString: string; + if (symbol) { + symbolString = "Symbol(" + this.checker.symbolToString(symbol, node.parent); + if (symbol.declarations) { + for (let declaration of symbol.declarations) { + symbolString += ", "; + let declSourceFile = declaration.getSourceFile(); + let declLineAndCharacter = declSourceFile.getLineAndCharacterOfPosition(declaration.pos); + symbolString += `Decl(${ ts.getBaseFileName(declSourceFile.fileName) }, ${ declLineAndCharacter.line }, ${ declLineAndCharacter.character })` + } + } + symbolString += ")"; + } + + this.results.push({ + line: lineAndCharacter.line, + syntaxKind: node.kind, + sourceText: sourceText, + 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/server/session.ts b/src/server/session.ts index 09373d6bf96..faedce0e1af 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -118,7 +118,7 @@ module ts.server { constructor(private host: ServerHost, private logger: Logger) { this.projectService = - new ProjectService(host, logger, (eventName, project, fileName) => { + new ProjectService(host, logger, (eventName,project,fileName) => { this.handleEvent(eventName, project, fileName); }); } @@ -263,7 +263,7 @@ module ts.server { } } - getDefinition({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.FileSpan[] { + getDefinition(line: number, offset: number, fileName: string): protocol.FileSpan[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -285,7 +285,7 @@ module ts.server { })); } - getOccurrences({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.OccurrencesResponseItem[] { + getOccurrences(line: number, offset: number, fileName: string): protocol.OccurrencesResponseItem[] { fileName = ts.normalizePath(fileName); let project = this.projectService.getProjectForFile(fileName); @@ -315,7 +315,7 @@ module ts.server { }); } - getRenameLocations({line, offset, file: fileName, findInComments, findInStrings }: protocol.RenameRequestArgs): protocol.RenameResponseBody { + getRenameLocations(line: number, offset: number, fileName: string,findInComments: boolean, findInStrings: boolean): protocol.RenameResponseBody { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -383,7 +383,7 @@ module ts.server { return { info: renameInfo, locs: bakedRenameLocs }; } - getReferences({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.ReferencesResponseBody { + getReferences(line: number, offset: number, fileName: string): protocol.ReferencesResponseBody { // TODO: get all projects for this file; report refs for all projects deleting duplicates // can avoid duplicates by eliminating same ref file from subsequent projects var file = ts.normalizePath(fileName); @@ -430,12 +430,12 @@ module ts.server { }; } - openClientFile({ file: fileName }: protocol.OpenRequestArgs) { + openClientFile(fileName: string) { var file = ts.normalizePath(fileName); this.projectService.openClientFile(file); } - getQuickInfo({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.QuickInfoResponseBody { + getQuickInfo(line: number, offset: number, fileName: string): protocol.QuickInfoResponseBody { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -461,7 +461,7 @@ module ts.server { }; } - getFormattingEditsForRange({line, offset, endLine, endOffset, file: fileName}: protocol.FormatRequestArgs): protocol.CodeEdit[] { + getFormattingEditsForRange(line: number, offset: number, endLine: number, endOffset: number, fileName: string): protocol.CodeEdit[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -488,7 +488,7 @@ module ts.server { }); } - getFormattingEditsAfterKeystroke({line, offset, key, file: fileName}: protocol.FormatOnKeyRequestArgs): protocol.CodeEdit[] { + getFormattingEditsAfterKeystroke(line: number, offset: number, key: string, fileName: string): protocol.CodeEdit[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); @@ -561,7 +561,7 @@ module ts.server { }); } - getCompletions({ line, offset, prefix, file: fileName}: protocol.CompletionsRequestArgs): protocol.CompletionEntry[] { + getCompletions(line: number, offset: number, prefix: string, fileName: string): protocol.CompletionEntry[] { if (!prefix) { prefix = ""; } @@ -587,7 +587,8 @@ module ts.server { }, []).sort((a, b) => a.name.localeCompare(b.name)); } - getCompletionEntryDetails({ line, offset, entryNames, file: fileName}: protocol.CompletionDetailsRequestArgs): protocol.CompletionEntryDetails[] { + getCompletionEntryDetails(line: number, offset: number, + entryNames: string[], fileName: string): protocol.CompletionEntryDetails[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -606,20 +607,20 @@ module ts.server { }, []); } - getSignatureHelpItems({ line, offset, file: fileName }: protocol.SignatureHelpRequestArgs): protocol.SignatureHelpItems { + getSignatureHelpItems(line: number, offset: number, fileName: string): protocol.SignatureHelpItems { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { throw Errors.NoProject; } - + var compilerService = project.compilerService; var position = compilerService.host.lineOffsetToPosition(file, line, offset); var helpItems = compilerService.languageService.getSignatureHelpItems(file, position); if (!helpItems) { return undefined; } - + var span = helpItems.applicableSpan; var result: protocol.SignatureHelpItems = { items: helpItems.items, @@ -631,11 +632,11 @@ module ts.server { argumentIndex: helpItems.argumentIndex, argumentCount: helpItems.argumentCount, } - + return result; } - - getDiagnostics({ delay, files: fileNames }: protocol.GeterrRequestArgs): void { + + getDiagnostics(delay: number, fileNames: string[]) { var checkList = fileNames.reduce((accum: PendingErrorCheck[], fileName: string) => { fileName = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(fileName); @@ -646,11 +647,11 @@ module ts.server { }, []); if (checkList.length > 0) { - this.updateErrorCheck(checkList, this.changeSeq, (n) => n == this.changeSeq, delay) + this.updateErrorCheck(checkList, this.changeSeq,(n) => n == this.changeSeq, delay) } } - change({ line, offset, endLine, endOffset, insertString, file: fileName }: protocol.ChangeRequestArgs): void { + change(line: number, offset: number, endLine: number, endOffset: number, insertString: string, fileName: string) { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (project) { @@ -665,7 +666,7 @@ module ts.server { } } - reload({ file: fileName, tmpfile: tempFileName }: protocol.ReloadRequestArgs, reqSeq = 0): void { + reload(fileName: string, tempFileName: string, reqSeq = 0) { var file = ts.normalizePath(fileName); var tmpfile = ts.normalizePath(tempFileName); var project = this.projectService.getProjectForFile(file); @@ -678,7 +679,7 @@ module ts.server { } } - saveToTmp({ file: fileName, tmpfile: tempFileName }: protocol.SavetoRequestArgs): void { + saveToTmp(fileName: string, tempFileName: string) { var file = ts.normalizePath(fileName); var tmpfile = ts.normalizePath(tempFileName); @@ -688,7 +689,7 @@ module ts.server { } } - closeClientFile({ file: fileName }: protocol.FileRequestArgs) { + closeClientFile(fileName: string) { var file = ts.normalizePath(fileName); this.projectService.closeClientFile(file); } @@ -712,7 +713,7 @@ module ts.server { })); } - getNavigationBarItems({ file: fileName }: protocol.FileRequestArgs): protocol.NavigationBarItem[]{ + getNavigationBarItems(fileName: string): protocol.NavigationBarItem[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -728,7 +729,7 @@ module ts.server { return this.decorateNavigationBarItem(project, fileName, items); } - getNavigateToItems({ searchValue, file: fileName, maxResultCount }: protocol.NavtoRequestArgs): protocol.NavtoItem[]{ + getNavigateToItems(searchValue: string, fileName: string, maxResultCount?: number): protocol.NavtoItem[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); if (!project) { @@ -767,7 +768,7 @@ module ts.server { }); } - getBraceMatching({ line, offset, file: fileName }: protocol.FileLocationRequestArgs): protocol.TextSpan[]{ + getBraceMatching(line: number, offset: number, fileName: string): protocol.TextSpan[] { var file = ts.normalizePath(fileName); var project = this.projectService.getProjectForFile(file); @@ -809,91 +810,114 @@ module ts.server { 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 { line, offset, file: fileName } = request.arguments; + response = this.getOccurrences(line, offset, fileName); break; } default: { 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 1d006e0b14c..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; @@ -3109,6 +3118,7 @@ module ts { case SyntaxKind.SemicolonToken: return containingNodeKind === SyntaxKind.PropertySignature && + previousToken.parent && previousToken.parent.parent && (previousToken.parent.parent.kind === SyntaxKind.InterfaceDeclaration || // interface a { f; | previousToken.parent.parent.kind === SyntaxKind.TypeLiteral); // let x : { a; | @@ -3124,7 +3134,8 @@ module ts { case SyntaxKind.DotDotDotToken: return containingNodeKind === SyntaxKind.Parameter || containingNodeKind === SyntaxKind.Constructor || - (previousToken.parent.parent.kind === SyntaxKind.ArrayBindingPattern); // var [ ...z| + (previousToken.parent && previousToken.parent.parent && + previousToken.parent.parent.kind === SyntaxKind.ArrayBindingPattern); // var [ ...z| case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: @@ -3283,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[] = []; @@ -3290,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)) { @@ -3322,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, @@ -3349,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; @@ -3358,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; @@ -3369,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) { @@ -3397,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; @@ -3407,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; } @@ -3440,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; @@ -3460,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; @@ -3481,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]; @@ -3530,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; @@ -3547,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]; @@ -3591,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(); @@ -3627,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()); @@ -3635,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)); @@ -3669,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)); @@ -3694,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 || @@ -3714,7 +3753,7 @@ module ts { } } else { - symbolKind = getSymbolKind(symbol, typeResolver, location); + symbolKind = getSymbolKind(symbol, location); } } @@ -3731,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); } @@ -3763,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)); @@ -3778,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); } @@ -3797,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) { @@ -3807,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 }; } @@ -3822,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), @@ -3878,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 @@ -3893,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); } } @@ -3903,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)) { @@ -3987,7 +4029,7 @@ module ts { // Get occurrences only supports reporting occurrences for the file queried. So // filter down to that list. - results = filter(results, r => r.fileName === fileName); + results = filter(results, r => getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile); } return results; @@ -4680,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)) { @@ -4703,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) { @@ -4754,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) { @@ -4804,7 +4848,7 @@ module ts { return location.getText(); } - name = typeInfoResolver.symbolToString(symbol); + name = typeChecker.symbolToString(symbol); return stripQuotes(name); } @@ -5040,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) { @@ -5268,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 @@ -5276,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 @@ -5290,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); } @@ -5298,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); } @@ -5328,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); } @@ -5350,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; } @@ -5361,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; @@ -5388,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) { @@ -5680,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 @@ -5761,6 +5805,7 @@ module ts { synchronizeHostData(); let sourceFile = getValidSourceFile(fileName); + let typeChecker = program.getTypeChecker(); let result: ClassifiedSpan[] = []; processNode(sourceFile); @@ -5813,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) { @@ -6295,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) { @@ -6317,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/APISample_compile.types b/tests/baselines/reference/APISample_compile.types deleted file mode 100644 index 7ccbae38212..00000000000 --- a/tests/baselines/reference/APISample_compile.types +++ /dev/null @@ -1,158 +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 - -declare var console: any; ->console : any - -declare var os: any; ->os : any - -import ts = require("typescript"); ->ts : typeof ts - -export function compile(fileNames: string[], options: ts.CompilerOptions): void { ->compile : (fileNames: string[], options: ts.CompilerOptions) => void ->fileNames : string[] ->options : ts.CompilerOptions ->ts : unknown ->CompilerOptions : ts.CompilerOptions - - var program = ts.createProgram(fileNames, options); ->program : ts.Program ->ts.createProgram(fileNames, options) : ts.Program ->ts.createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program ->ts : typeof ts ->createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program ->fileNames : string[] ->options : ts.CompilerOptions - - var emitResult = program.emit(); ->emitResult : ts.EmitResult ->program.emit() : ts.EmitResult ->program.emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult ->program : ts.Program ->emit : (targetSourceFile?: ts.SourceFile, writeFile?: ts.WriteFileCallback) => ts.EmitResult - - var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); ->allDiagnostics : ts.Diagnostic[] ->ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics) : ts.Diagnostic[] ->ts.getPreEmitDiagnostics(program).concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->ts.getPreEmitDiagnostics(program) : ts.Diagnostic[] ->ts.getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[] ->ts : typeof ts ->getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[] ->program : ts.Program ->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->emitResult.diagnostics : ts.Diagnostic[] ->emitResult : ts.EmitResult ->diagnostics : ts.Diagnostic[] - - 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 ->allDiagnostics : ts.Diagnostic[] ->forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void ->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 - - var { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); ->line : number ->character : number ->diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter ->diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->diagnostic.file : ts.SourceFile ->diagnostic : ts.Diagnostic ->file : ts.SourceFile ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->diagnostic.start : number ->diagnostic : ts.Diagnostic ->start : number - - var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); ->message : string ->ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n') : string ->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->ts : typeof ts ->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->diagnostic.messageText : string | ts.DiagnosticMessageChain ->diagnostic : ts.Diagnostic ->messageText : string | ts.DiagnosticMessageChain - - 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 ->log : any ->diagnostic.file.fileName : string ->diagnostic.file : ts.SourceFile ->diagnostic : ts.Diagnostic ->file : ts.SourceFile ->fileName : string ->line + 1 : number ->line : number ->character + 1 : number ->character : number ->message : string - - }); - - var exitCode = emitResult.emitSkipped ? 1 : 0; ->exitCode : number ->emitResult.emitSkipped ? 1 : 0 : number ->emitResult.emitSkipped : boolean ->emitResult : ts.EmitResult ->emitSkipped : boolean - - console.log(`Process exiting with code '${exitCode}'.`); ->console.log(`Process exiting with code '${exitCode}'.`) : any ->console.log : any ->console : any ->log : any ->exitCode : number - - process.exit(exitCode); ->process.exit(exitCode) : any ->process.exit : any ->process : any ->exit : any ->exitCode : number -} - -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 ->process.argv.slice(2) : any ->process.argv.slice : any ->process.argv : any ->process : any ->argv : any ->slice : any ->{ 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 ->noImplicitAny : boolean - - target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS ->target : ts.ScriptTarget ->ts.ScriptTarget.ES5 : ts.ScriptTarget ->ts.ScriptTarget : typeof ts.ScriptTarget ->ts : typeof ts ->ScriptTarget : typeof ts.ScriptTarget ->ES5 : ts.ScriptTarget ->module : ts.ModuleKind ->ts.ModuleKind.CommonJS : ts.ModuleKind ->ts.ModuleKind : typeof ts.ModuleKind ->ts : typeof ts ->ModuleKind : typeof ts.ModuleKind ->CommonJS : ts.ModuleKind - -}); diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types deleted file mode 100644 index 609f08f3a76..00000000000 --- a/tests/baselines/reference/APISample_linter.types +++ /dev/null @@ -1,303 +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 - -declare var console: any; ->console : any - -declare var readFileSync: any; ->readFileSync : any - -import * as ts from "typescript"; ->ts : typeof ts - -export function delint(sourceFile: ts.SourceFile) { ->delint : (sourceFile: ts.SourceFile) => void ->sourceFile : ts.SourceFile ->ts : unknown ->SourceFile : ts.SourceFile - - delintNode(sourceFile); ->delintNode(sourceFile) : void ->delintNode : (node: ts.Node) => void ->sourceFile : ts.SourceFile - - function delintNode(node: ts.Node) { ->delintNode : (node: ts.Node) => void ->node : ts.Node ->ts : unknown ->Node : ts.Node - - switch (node.kind) { ->node.kind : ts.SyntaxKind ->node : ts.Node ->kind : ts.SyntaxKind - - case ts.SyntaxKind.ForStatement: ->ts.SyntaxKind.ForStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->ForStatement : ts.SyntaxKind - - case ts.SyntaxKind.ForInStatement: ->ts.SyntaxKind.ForInStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->ForInStatement : ts.SyntaxKind - - case ts.SyntaxKind.WhileStatement: ->ts.SyntaxKind.WhileStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->WhileStatement : ts.SyntaxKind - - case ts.SyntaxKind.DoStatement: ->ts.SyntaxKind.DoStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->DoStatement : ts.SyntaxKind - - if ((node).statement.kind !== ts.SyntaxKind.Block) { ->(node).statement.kind !== ts.SyntaxKind.Block : boolean ->(node).statement.kind : ts.SyntaxKind ->(node).statement : ts.Statement ->(node) : ts.IterationStatement ->node : ts.IterationStatement ->ts : unknown ->IterationStatement : ts.IterationStatement ->node : ts.Node ->statement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.Block : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->Block : ts.SyntaxKind - - 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 ->node : ts.Node - } - break; - - case ts.SyntaxKind.IfStatement: ->ts.SyntaxKind.IfStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->IfStatement : ts.SyntaxKind - - let ifStatement = (node); ->ifStatement : ts.IfStatement ->(node) : ts.IfStatement ->node : ts.IfStatement ->ts : unknown ->IfStatement : ts.IfStatement ->node : ts.Node - - if (ifStatement.thenStatement.kind !== ts.SyntaxKind.Block) { ->ifStatement.thenStatement.kind !== ts.SyntaxKind.Block : boolean ->ifStatement.thenStatement.kind : ts.SyntaxKind ->ifStatement.thenStatement : ts.Statement ->ifStatement : ts.IfStatement ->thenStatement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.Block : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->Block : ts.SyntaxKind - - 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 ->ifStatement.thenStatement : ts.Statement ->ifStatement : ts.IfStatement ->thenStatement : ts.Statement - } - 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 ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement - - ifStatement.elseStatement.kind !== ts.SyntaxKind.Block && ->ifStatement.elseStatement.kind !== ts.SyntaxKind.Block : boolean ->ifStatement.elseStatement.kind : ts.SyntaxKind ->ifStatement.elseStatement : ts.Statement ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.Block : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->Block : ts.SyntaxKind - - ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement) { ->ifStatement.elseStatement.kind !== ts.SyntaxKind.IfStatement : boolean ->ifStatement.elseStatement.kind : ts.SyntaxKind ->ifStatement.elseStatement : ts.Statement ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement ->kind : ts.SyntaxKind ->ts.SyntaxKind.IfStatement : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->IfStatement : ts.SyntaxKind - - 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 ->ifStatement.elseStatement : ts.Statement ->ifStatement : ts.IfStatement ->elseStatement : ts.Statement - } - break; - - case ts.SyntaxKind.BinaryExpression: ->ts.SyntaxKind.BinaryExpression : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->BinaryExpression : ts.SyntaxKind - - let op = (node).operatorToken.kind; ->op : ts.SyntaxKind ->(node).operatorToken.kind : ts.SyntaxKind ->(node).operatorToken : ts.Node ->(node) : ts.BinaryExpression ->node : ts.BinaryExpression ->ts : unknown ->BinaryExpression : ts.BinaryExpression ->node : ts.Node ->operatorToken : ts.Node ->kind : ts.SyntaxKind - - 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 ->ts.SyntaxKind.EqualsEqualsToken : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->EqualsEqualsToken : ts.SyntaxKind ->op == ts.SyntaxKind.ExclamationEqualsToken : boolean ->op : ts.SyntaxKind ->ts.SyntaxKind.ExclamationEqualsToken : ts.SyntaxKind ->ts.SyntaxKind : typeof ts.SyntaxKind ->ts : typeof ts ->SyntaxKind : typeof ts.SyntaxKind ->ExclamationEqualsToken : ts.SyntaxKind - - report(node, "Use '===' and '!=='.") ->report(node, "Use '===' and '!=='.") : void ->report : (node: ts.Node, message: string) => void ->node : ts.Node - } - 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 ->ts : typeof ts ->forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T ->node : ts.Node ->delintNode : (node: ts.Node) => void - } - - function report(node: ts.Node, message: string) { ->report : (node: ts.Node, message: string) => void ->node : ts.Node ->ts : unknown ->Node : ts.Node ->message : string - - let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart()); ->line : number ->character : number ->sourceFile.getLineAndCharacterOfPosition(node.getStart()) : ts.LineAndCharacter ->sourceFile.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->sourceFile : ts.SourceFile ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->node.getStart() : number ->node.getStart : (sourceFile?: ts.SourceFile) => number ->node : ts.Node ->getStart : (sourceFile?: ts.SourceFile) => number - - console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); ->console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`) : any ->console.log : any ->console : any ->log : any ->sourceFile.fileName : string ->sourceFile : ts.SourceFile ->fileName : string ->line + 1 : number ->line : number ->character + 1 : number ->character : number ->message : string - } -} - -const fileNames = process.argv.slice(2); ->fileNames : any ->process.argv.slice(2) : any ->process.argv.slice : any ->process.argv : any ->process : any ->argv : any ->slice : any - -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 ->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 - - // Parse a file - let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); ->sourceFile : ts.SourceFile ->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 ->ts : typeof ts ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile ->fileName : any ->readFileSync(fileName).toString() : any ->readFileSync(fileName).toString : any ->readFileSync(fileName) : any ->readFileSync : any ->fileName : any ->toString : any ->ts.ScriptTarget.ES6 : ts.ScriptTarget ->ts.ScriptTarget : typeof ts.ScriptTarget ->ts : typeof ts ->ScriptTarget : typeof ts.ScriptTarget ->ES6 : ts.ScriptTarget - - // delint it - delint(sourceFile); ->delint(sourceFile) : void ->delint : (sourceFile: ts.SourceFile) => void ->sourceFile : ts.SourceFile - -}); diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types deleted file mode 100644 index d98d2cfad00..00000000000 --- a/tests/baselines/reference/APISample_transform.types +++ /dev/null @@ -1,43 +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 - -import * as ts from "typescript"; ->ts : typeof ts - -const source = "let x: string = 'string'"; ->source : string - -let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS }); ->result : string ->ts.transpile(source, { module: ts.ModuleKind.CommonJS }) : string ->ts.transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string ->ts : typeof ts ->transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string ->source : string ->{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; } ->module : ts.ModuleKind ->ts.ModuleKind.CommonJS : ts.ModuleKind ->ts.ModuleKind : typeof ts.ModuleKind ->ts : typeof ts ->ModuleKind : typeof ts.ModuleKind ->CommonJS : ts.ModuleKind - -console.log(JSON.stringify(result)); ->console.log(JSON.stringify(result)) : any ->console.log : any ->console : any ->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; } ->JSON : 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; } ->result : string - diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types deleted file mode 100644 index 5f123ea839b..00000000000 --- a/tests/baselines/reference/APISample_watcher.types +++ /dev/null @@ -1,428 +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 - -declare var console: any; ->console : any - -declare var fs: any; ->fs : any - -declare var path: any; ->path : any - -import * as ts from "typescript"; ->ts : typeof ts - -function watch(rootFileNames: string[], options: ts.CompilerOptions) { ->watch : (rootFileNames: string[], options: ts.CompilerOptions) => void ->rootFileNames : string[] ->options : ts.CompilerOptions ->ts : unknown ->CompilerOptions : ts.CompilerOptions - - const files: ts.Map<{ version: number }> = {}; ->files : ts.Map<{ version: number; }> ->ts : unknown ->Map : ts.Map ->version : number ->{} : { [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 ->rootFileNames : string[] ->forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void ->fileName => { files[fileName] = { version: 0 }; } : (fileName: string) => void ->fileName : string - - files[fileName] = { version: 0 }; ->files[fileName] = { version: 0 } : { version: number; } ->files[fileName] : { version: number; } ->files : ts.Map<{ version: number; }> ->fileName : string ->{ version: 0 } : { version: number; } ->version : number - - }); - - // Create the language service host to allow the LS to communicate with the host - const servicesHost: ts.LanguageServiceHost = { ->servicesHost : ts.LanguageServiceHost ->ts : unknown ->LanguageServiceHost : ts.LanguageServiceHost ->{ 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[] ->() => rootFileNames : () => string[] ->rootFileNames : string[] - - getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), ->getScriptVersion : (fileName: string) => string ->(fileName) => files[fileName] && files[fileName].version.toString() : (fileName: string) => string ->fileName : string ->files[fileName] && files[fileName].version.toString() : string ->files[fileName] : { version: number; } ->files : ts.Map<{ version: number; }> ->fileName : string ->files[fileName].version.toString() : string ->files[fileName].version.toString : (radix?: number) => string ->files[fileName].version : number ->files[fileName] : { version: number; } ->files : ts.Map<{ version: number; }> ->fileName : string ->version : number ->toString : (radix?: number) => string - - getScriptSnapshot: (fileName) => { ->getScriptSnapshot : (fileName: string) => ts.IScriptSnapshot ->(fileName) => { if (!fs.existsSync(fileName)) { return undefined; } return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); } : (fileName: string) => ts.IScriptSnapshot ->fileName : string - - if (!fs.existsSync(fileName)) { ->!fs.existsSync(fileName) : boolean ->fs.existsSync(fileName) : any ->fs.existsSync : any ->fs : any ->existsSync : any ->fileName : string - - return undefined; ->undefined : 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 ->ts.ScriptSnapshot : typeof ts.ScriptSnapshot ->ts : typeof ts ->ScriptSnapshot : typeof ts.ScriptSnapshot ->fromString : (text: string) => ts.IScriptSnapshot ->fs.readFileSync(fileName).toString() : any ->fs.readFileSync(fileName).toString : any ->fs.readFileSync(fileName) : any ->fs.readFileSync : any ->fs : any ->readFileSync : any ->fileName : string ->toString : any - - }, - getCurrentDirectory: () => process.cwd(), ->getCurrentDirectory : () => any ->() => process.cwd() : () => any ->process.cwd() : any ->process.cwd : any ->process : any ->cwd : any - - getCompilationSettings: () => options, ->getCompilationSettings : () => ts.CompilerOptions ->() => options : () => ts.CompilerOptions ->options : ts.CompilerOptions - - getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), ->getDefaultLibFileName : (options: ts.CompilerOptions) => string ->(options) => ts.getDefaultLibFilePath(options) : (options: ts.CompilerOptions) => string ->options : ts.CompilerOptions ->ts.getDefaultLibFilePath(options) : string ->ts.getDefaultLibFilePath : (options: ts.CompilerOptions) => string ->ts : typeof ts ->getDefaultLibFilePath : (options: ts.CompilerOptions) => string ->options : ts.CompilerOptions - - }; - - // Create the language service files - const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) ->services : ts.LanguageService ->ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) : ts.LanguageService ->ts.createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService ->ts : typeof ts ->createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService ->servicesHost : ts.LanguageServiceHost ->ts.createDocumentRegistry() : ts.DocumentRegistry ->ts.createDocumentRegistry : () => ts.DocumentRegistry ->ts : typeof ts ->createDocumentRegistry : () => ts.DocumentRegistry - - // 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 ->rootFileNames : string[] ->forEach : (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void ->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 - - // First time around, emit all files - emitFile(fileName); ->emitFile(fileName) : void ->emitFile : (fileName: string) => void ->fileName : string - - // 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 ->watchFile : any ->fileName : string - - { persistent: true, interval: 250 }, ->{ persistent: true, interval: 250 } : { persistent: boolean; interval: number; } ->persistent : boolean ->interval : 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 ->prev : any - - // Check timestamp - if (+curr.mtime <= +prev.mtime) { ->+curr.mtime <= +prev.mtime : boolean ->+curr.mtime : number ->curr.mtime : any ->curr : any ->mtime : any ->+prev.mtime : number ->prev.mtime : any ->prev : any ->mtime : any - - return; - } - - // Update the version to signal a change in the file - files[fileName].version++; ->files[fileName].version++ : number ->files[fileName].version : number ->files[fileName] : { version: number; } ->files : ts.Map<{ version: number; }> ->fileName : string ->version : number - - // write the changes to disk - emitFile(fileName); ->emitFile(fileName) : void ->emitFile : (fileName: string) => void ->fileName : string - - }); - }); - - function emitFile(fileName: string) { ->emitFile : (fileName: string) => void ->fileName : string - - let output = services.getEmitOutput(fileName); ->output : ts.EmitOutput ->services.getEmitOutput(fileName) : ts.EmitOutput ->services.getEmitOutput : (fileName: string) => ts.EmitOutput ->services : ts.LanguageService ->getEmitOutput : (fileName: string) => ts.EmitOutput ->fileName : string - - if (!output.emitSkipped) { ->!output.emitSkipped : boolean ->output.emitSkipped : boolean ->output : ts.EmitOutput ->emitSkipped : boolean - - console.log(`Emitting ${fileName}`); ->console.log(`Emitting ${fileName}`) : any ->console.log : any ->console : any ->log : any ->fileName : string - } - else { - console.log(`Emitting ${fileName} failed`); ->console.log(`Emitting ${fileName} failed`) : any ->console.log : any ->console : any ->log : any ->fileName : string - - logErrors(fileName); ->logErrors(fileName) : void ->logErrors : (fileName: string) => void ->fileName : string - } - - 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 ->output.outputFiles : ts.OutputFile[] ->output : ts.EmitOutput ->outputFiles : ts.OutputFile[] ->forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void ->o => { fs.writeFileSync(o.name, o.text, "utf8"); } : (o: ts.OutputFile) => void ->o : ts.OutputFile - - fs.writeFileSync(o.name, o.text, "utf8"); ->fs.writeFileSync(o.name, o.text, "utf8") : any ->fs.writeFileSync : any ->fs : any ->writeFileSync : any ->o.name : string ->o : ts.OutputFile ->name : string ->o.text : string ->o : ts.OutputFile ->text : string - - }); - } - - function logErrors(fileName: string) { ->logErrors : (fileName: string) => void ->fileName : string - - let allDiagnostics = services.getCompilerOptionsDiagnostics() ->allDiagnostics : ts.Diagnostic[] ->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[]; } ->services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) : ts.Diagnostic[] ->services.getCompilerOptionsDiagnostics() .concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->services.getCompilerOptionsDiagnostics() : ts.Diagnostic[] ->services.getCompilerOptionsDiagnostics : () => ts.Diagnostic[] ->services : ts.LanguageService ->getCompilerOptionsDiagnostics : () => ts.Diagnostic[] - - .concat(services.getSyntacticDiagnostics(fileName)) ->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->services.getSyntacticDiagnostics(fileName) : ts.Diagnostic[] ->services.getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[] ->services : ts.LanguageService ->getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[] ->fileName : string - - .concat(services.getSemanticDiagnostics(fileName)); ->concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; } ->services.getSemanticDiagnostics(fileName) : ts.Diagnostic[] ->services.getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[] ->services : ts.LanguageService ->getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[] ->fileName : string - - 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 ->allDiagnostics : ts.Diagnostic[] ->forEach : (callbackfn: (value: ts.Diagnostic, index: number, array: ts.Diagnostic[]) => void, thisArg?: any) => void ->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 - - let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); ->message : string ->ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n") : string ->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->ts : typeof ts ->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string ->diagnostic.messageText : string | ts.DiagnosticMessageChain ->diagnostic : ts.Diagnostic ->messageText : string | ts.DiagnosticMessageChain - - if (diagnostic.file) { ->diagnostic.file : ts.SourceFile ->diagnostic : ts.Diagnostic ->file : ts.SourceFile - - let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start); ->line : number ->character : number ->diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter ->diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->diagnostic.file : ts.SourceFile ->diagnostic : ts.Diagnostic ->file : ts.SourceFile ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter ->diagnostic.start : number ->diagnostic : ts.Diagnostic ->start : number - - 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 ->log : any ->diagnostic.file.fileName : string ->diagnostic.file : ts.SourceFile ->diagnostic : ts.Diagnostic ->file : ts.SourceFile ->fileName : string ->line + 1 : number ->line : number ->character + 1 : number ->character : number ->message : string - } - else { - console.log(` Error: ${message}`); ->console.log(` Error: ${message}`) : any ->console.log : any ->console : any ->log : any ->message : string - } - }); - } -} - -// Initialize files constituting the program as all .ts files in the current directory -const currentDirectoryFiles = fs.readdirSync(process.cwd()). ->currentDirectoryFiles : any ->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 ->readdirSync : any ->process.cwd() : any ->process.cwd : any ->process : any ->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 ->fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts" : boolean ->fileName.length >= 3 : boolean ->fileName.length : any ->fileName : any ->length : any ->fileName.substr(fileName.length - 3, 3) === ".ts" : boolean ->fileName.substr(fileName.length - 3, 3) : any ->fileName.substr : any ->fileName : any ->substr : any ->fileName.length - 3 : number ->fileName.length : any ->fileName : any ->length : any - -// Start the watcher -watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }); ->watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }) : void ->watch : (rootFileNames: string[], options: ts.CompilerOptions) => void ->currentDirectoryFiles : any ->{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; } ->module : ts.ModuleKind ->ts.ModuleKind.CommonJS : ts.ModuleKind ->ts.ModuleKind : typeof ts.ModuleKind ->ts : typeof ts ->ModuleKind : typeof ts.ModuleKind ->CommonJS : ts.ModuleKind - 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/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 8846d2c3a37..fec7593a993 100644 --- a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.types @@ -56,4 +56,6 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000 >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 975f0f65a68..cd57c0c503d 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.types @@ -50,4 +50,6 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000 >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 cf4aeb6bcc0..035f2a50c37 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.types @@ -15,7 +15,9 @@ function Point() { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } === tests/cases/conformance/internalModules/DeclarationMerging/test.ts === 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/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 3ea1919ecae..9d943ab354c 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types @@ -11,7 +11,9 @@ class Point { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } module Point { @@ -19,6 +21,7 @@ module Point { function Origin() { return ""; }// not an error, since not exported >Origin : () => string +>"" : string } @@ -37,7 +40,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } export module Point { @@ -45,5 +50,6 @@ module A { function Origin() { return ""; }// not an error since not exported >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 827089847e2..8f8ffc8839f 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types @@ -11,7 +11,9 @@ class Point { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } module Point { @@ -19,6 +21,7 @@ module Point { var Origin = ""; // not an error, since not exported >Origin : string +>"" : string } @@ -37,7 +40,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } export module Point { @@ -45,5 +50,6 @@ module A { var Origin = ""; // not an error since not exported >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 f5ca0ab17e8..81230c9cea4 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck2.types +++ b/tests/baselines/reference/ES3For-ofTypeCheck2.types @@ -2,4 +2,5 @@ for (var v of [true]) { } >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/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 32a2adcf3da..d31f8972038 100644 --- a/tests/baselines/reference/ES5For-of10.types +++ b/tests/baselines/reference/ES5For-of10.types @@ -5,6 +5,7 @@ function foo() { return { x: 0 }; >{ x: 0 } : { x: number; } >x : number +>0 : number } for (foo().x of []) { >foo().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-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 64aac2ae4b2..46125af551e 100644 --- a/tests/baselines/reference/ES5For-of13.types +++ b/tests/baselines/reference/ES5For-of13.types @@ -2,6 +2,9 @@ for (let v of ['a', 'b', 'c']) { >v : string >['a', 'b', 'c'] : string[] +>'a' : string +>'b' : string +>'c' : string var x = v; >x : 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-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-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-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-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-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-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-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 7170073b5d9..c0c4666fbf5 100644 --- a/tests/baselines/reference/ES5For-of24.types +++ b/tests/baselines/reference/ES5For-of24.types @@ -2,6 +2,9 @@ var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number for (var v of a) { >v : number @@ -9,4 +12,5 @@ for (var v of a) { let a = 0; >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 7b306ee9a26..4650e3244d3 100644 --- a/tests/baselines/reference/ES5For-of25.types +++ b/tests/baselines/reference/ES5For-of25.types @@ -2,6 +2,9 @@ var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number for (var v of a) { >v : 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 c47328816e8..65267fe3f70 100644 --- a/tests/baselines/reference/ES5For-of3.types +++ b/tests/baselines/reference/ES5For-of3.types @@ -2,6 +2,9 @@ for (var v of ['a', 'b', 'c']) >v : string >['a', 'b', 'c'] : string[] +>'a' : string +>'b' : string +>'c' : string var x = v; >x : 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-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-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-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 60870c2d642..ec41df704c6 100644 --- a/tests/baselines/reference/ES5For-of9.types +++ b/tests/baselines/reference/ES5For-of9.types @@ -5,6 +5,7 @@ function foo() { return { x: 0 }; >{ x: 0 } : { x: number; } >x : number +>0 : number } for (foo().x of []) { >foo().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 4da0ecc0e36..395900d683b 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck1.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck1.types @@ -1,4 +1,5 @@ === tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck1.ts === for (var v of "") { } >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 e6b86ce1d81..d28a2803216 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck2.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck2.types @@ -2,4 +2,5 @@ for (var v of [true]) { } >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 5293634c6c5..a62dcc94f98 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck3.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck3.types @@ -2,6 +2,8 @@ var tuple: [string, number] = ["", 0]; >tuple : [string, number] >["", 0] : [string, number] +>"" : string +>0 : number for (var v of tuple) { } >v : 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-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-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/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/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 3cbd14c78bb..205335c7eb6 100644 --- a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types @@ -40,4 +40,6 @@ var y = new enumdule.Point(0, 0); >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 6d69109e542..e47b38a0b61 100644 --- a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types +++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types @@ -31,6 +31,7 @@ module A { >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 17b4a25cde3..a5cefcc521e 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -17,7 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export class Point3d extends Point { >Point3d : Point3d @@ -32,8 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number +>0 : number >y : number +>0 : number >z : number +>0 : number export class Line{ >Line : Line 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/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 6f4452fce4c..ba174d9bbba 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types @@ -17,7 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export class Point3d extends Point { >Point3d : Point3d @@ -32,8 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number +>0 : number >y : number +>0 : number >z : number +>0 : number export class Line{ >Line : Line @@ -54,6 +59,7 @@ module A { >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 ac1845a533c..60a6e122a78 100644 --- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types @@ -33,7 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number >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 3f3a670ee8e..ba862ad77cf 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types @@ -33,7 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number >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 7634e2cde3e..ef72f80ffde 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types @@ -33,7 +33,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number >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 f6f4e6a441a..b4a331b9140 100644 --- a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -17,7 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export interface Point3d extends Point { >Point3d : Point3d @@ -32,8 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number +>0 : number >y : number +>0 : number >z : number +>0 : number export interface Line{ >Line : Line 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 6caed8a138a..8be90b5946e 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types @@ -1,6 +1,6 @@ === tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts === module A { ->A : unknown +>A : any interface Point { >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 53484780474..366e21b6472 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types @@ -17,7 +17,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export interface Point3d extends Point { >Point3d : Point3d @@ -32,8 +34,11 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number +>0 : number >y : number +>0 : number >z : number +>0 : number export interface Line{ >Line : Line 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 a3a80cb06ad..cd8526242fa 100644 --- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types @@ -18,6 +18,8 @@ module A { >Point : Point >new Point(0, 0) : Point >Point : typeof Point +>0 : number +>0 : number export class Line { >Line : Line @@ -40,7 +42,9 @@ module A { >Line : typeof Line >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number >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 82bdf732173..e08a4345a95 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types @@ -15,7 +15,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export var Unity = { start: new Point(0, 0), end: new Point(1, 0) }; >Unity : { start: Point; end: Point; } @@ -23,8 +25,12 @@ module A { >start : Point >new Point(0, 0) : Point >Point : typeof Point +>0 : number +>0 : number >end : Point >new Point(1, 0) : Point >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 a4284a8f410..12a8cd974ad 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types @@ -28,4 +28,5 @@ module A { >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/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 945a4be6fe5..faf86ea6982 100644 --- a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types @@ -18,6 +18,8 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >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 9ae05f87416..4ce1912d441 100644 --- a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types @@ -18,7 +18,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number interface Point3d extends Point { >Point3d : Point3d @@ -34,7 +36,10 @@ module A { >Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number +>0 : number >y : number +>0 : number >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 879088f93df..fe976cd0a3b 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types @@ -8,7 +8,9 @@ module A { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } } @@ -23,7 +25,9 @@ module B { >Origin : { x: number; y: number; } >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : 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/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/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 023511c8c4d..343b69954b0 100644 --- a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types @@ -40,4 +40,6 @@ var y = new enumdule.Point(0, 0); >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/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/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/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/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/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 a856b699dd5..25c23b83273 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types @@ -22,7 +22,7 @@ module A { fromCarthesian(p: A.Point) { >fromCarthesian : (p: A.Point) => { x: number; y: number; } >p : A.Point ->A : unknown +>A : any >Point : A.Point return { x: p.x, y: p.y }; @@ -47,7 +47,7 @@ var p: { x: number; y: number; }; var p: A.Point; >p : { x: number; y: number; } ->A : unknown +>A : any >Point : A.Point module X.Y.Z { @@ -89,9 +89,9 @@ var l: { length: number; } var l: X.Y.Z.Line; >l : { length: number; } ->X : unknown ->Y : unknown ->Z : unknown +>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 a8fc56495dd..309ad35d54f 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types @@ -1,6 +1,6 @@ === tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts === module A { ->A : unknown +>A : any export interface Point { >Point : Point @@ -18,7 +18,7 @@ module A { } module A { ->A : unknown +>A : any interface Point { >Point : Point @@ -35,50 +35,50 @@ var p: { x: number; y: number; toCarth(): A.Point; }; >x : number >y : number >toCarth : () => A.Point ->A : unknown +>A : any >Point : A.Point var p: A.Point; >p : { x: number; y: number; toCarth(): A.Point; } ->A : unknown +>A : any >Point : A.Point module X.Y.Z { ->X : unknown ->Y : unknown ->Z : unknown +>X : any +>Y : any +>Z : any export interface Line { >Line : Line new (start: A.Point, end: A.Point); >start : A.Point ->A : unknown +>A : any >Point : A.Point >end : A.Point ->A : unknown +>A : any >Point : A.Point } } module X { ->X : unknown +>X : any export module Y.Z { ->Y : unknown ->Z : unknown +>Y : any +>Z : any interface Line { >Line : Line start: A.Point; >start : A.Point ->A : unknown +>A : any >Point : A.Point end: A.Point; >end : A.Point ->A : unknown +>A : any >Point : A.Point } } @@ -88,16 +88,16 @@ module X { var l: { new (s: A.Point, e: A.Point); } >l : new (s: A.Point, e: A.Point) => any >s : A.Point ->A : unknown +>A : any >Point : A.Point >e : A.Point ->A : unknown +>A : any >Point : A.Point var l: X.Y.Z.Line; >l : new (s: A.Point, e: A.Point) => any ->X : unknown ->Y : unknown ->Z : unknown +>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 003fb5fa15a..af3c0776b56 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types @@ -39,7 +39,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } === tests/cases/conformance/internalModules/DeclarationMerging/part2.ts === @@ -49,6 +51,7 @@ module A { // not a collision, since we don't export var Origin: string = "0,0"; >Origin : string +>"0,0" : string export module Utils { >Utils : typeof Utils @@ -75,7 +78,7 @@ var o: { x: number; y: number }; var o: A.Point; >o : { x: number; y: number; } ->A : unknown +>A : any >Point : A.Point var o = A.Origin; @@ -97,16 +100,16 @@ var o = A.Utils.mirror(o); var p: { tl: A.Point; br: A.Point }; >p : { tl: A.Point; br: A.Point; } >tl : A.Point ->A : unknown +>A : any >Point : A.Point >br : A.Point ->A : unknown +>A : any >Point : A.Point var p: A.Utils.Plane; >p : { tl: A.Point; br: A.Point; } ->A : unknown ->Utils : unknown +>A : any +>Utils : any >Plane : A.Utils.Plane var p = new A.Utils.Plane(o, { x: 1, y: 1 }); @@ -120,6 +123,8 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >o : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } >x : number +>1 : number >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 c54ad5f3ad9..5795beda4a9 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types @@ -1,6 +1,6 @@ === tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts === module A { ->A : unknown +>A : any export interface Point { >Point : Point @@ -18,7 +18,7 @@ module A { } module A { ->A : unknown +>A : any export interface Point { >Point : Point @@ -35,53 +35,53 @@ var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }; >x : number >y : number >toCarth : () => A.Point ->A : unknown +>A : any >Point : A.Point >fromCarth : () => A.Point ->A : unknown +>A : any >Point : A.Point var p: A.Point; >p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; } ->A : unknown +>A : any >Point : A.Point module X.Y.Z { ->X : unknown ->Y : unknown ->Z : unknown +>X : any +>Y : any +>Z : any export interface Line { >Line : Line new (start: A.Point, end: A.Point); >start : A.Point ->A : unknown +>A : any >Point : A.Point >end : A.Point ->A : unknown +>A : any >Point : A.Point } } module X { ->X : unknown +>X : any export module Y.Z { ->Y : unknown ->Z : unknown +>Y : any +>Z : any export interface Line { >Line : Line start: A.Point; >start : A.Point ->A : unknown +>A : any >Point : A.Point end: A.Point; >end : A.Point ->A : unknown +>A : any >Point : A.Point } } @@ -91,22 +91,22 @@ module X { 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; } >start : A.Point ->A : unknown +>A : any >Point : A.Point >end : A.Point ->A : unknown +>A : any >Point : A.Point >s : A.Point ->A : unknown +>A : any >Point : A.Point >e : A.Point ->A : unknown +>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; } ->X : unknown ->Y : unknown ->Z : unknown +>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 9232af469ac..a19e0839901 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types @@ -69,8 +69,8 @@ var l: { length: number }; var l: X.Y.Z.Line; >l : { length: number; } ->X : unknown ->Y : unknown ->Z : unknown +>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 b31bb4b22ac..e005522ddfc 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types @@ -50,12 +50,14 @@ module otherRoot { // have to be fully qualified since in different root export var Origin: Root.A.Point = { x: 0, y: 0 }; >Origin : Root.A.Point ->Root : unknown ->A : unknown +>Root : any +>A : any >Point : Root.A.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export module Utils { >Utils : typeof Utils @@ -65,12 +67,12 @@ module otherRoot { constructor(public tl: Root.A.Point, public br: Root.A.Point) { } >tl : Root.A.Point ->Root : unknown ->A : unknown +>Root : any +>A : any >Point : Root.A.Point >br : Root.A.Point ->Root : unknown ->A : unknown +>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 b13cbde5522..e2dd1f400f4 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types @@ -45,7 +45,9 @@ module A { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number export module Utils { >Utils : typeof Utils @@ -72,7 +74,7 @@ var o: { x: number; y: number }; var o: A.Point; >o : { x: number; y: number; } ->A : unknown +>A : any >Point : A.Point var o = A.Origin; @@ -94,16 +96,16 @@ var o = A.Utils.mirror(o); var p: { tl: A.Point; br: A.Point }; >p : { tl: A.Point; br: A.Point; } >tl : A.Point ->A : unknown +>A : any >Point : A.Point >br : A.Point ->A : unknown +>A : any >Point : A.Point var p: A.Utils.Plane; >p : { tl: A.Point; br: A.Point; } ->A : unknown ->Utils : unknown +>A : any +>Utils : any >Plane : A.Utils.Plane var p = new A.Utils.Plane(o, { x: 1, y: 1 }); @@ -117,6 +119,8 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >o : { x: number; y: number; } >{ x: 1, y: 1 } : { x: number; y: number; } >x : number +>1 : number >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/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 9296e0ad04e..16d999e46f2 100644 --- a/tests/baselines/reference/TypeGuardWithEnumUnion.types +++ b/tests/baselines/reference/TypeGuardWithEnumUnion.types @@ -14,6 +14,7 @@ function f1(x: Color | string) { >typeof x === "number" : boolean >typeof x : string >x : string | Color +>"number" : string var y = x; >y : Color @@ -42,6 +43,7 @@ function f2(x: Color | string | string[]) { >typeof x === "object" : boolean >typeof x : string >x : string | string[] | Color +>"object" : string var y = x; >y : string[] @@ -54,6 +56,7 @@ function f2(x: Color | string | string[]) { >typeof x === "number" : boolean >typeof x : string >x : string | string[] | Color +>"number" : string var z = x; >z : Color @@ -75,6 +78,7 @@ function f2(x: Color | string | string[]) { >typeof x === "string" : boolean >typeof x : string >x : string | string[] | Color +>"string" : string var a = x; >a : string diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.types.pull b/tests/baselines/reference/TypeGuardWithEnumUnion.types.pull deleted file mode 100644 index 33a40762445..00000000000 --- a/tests/baselines/reference/TypeGuardWithEnumUnion.types.pull +++ /dev/null @@ -1,96 +0,0 @@ -=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts === -enum Color { R, G, B } ->Color : Color ->R : Color ->G : Color ->B : Color - -function f1(x: Color | string) { ->f1 : (x: string | Color) => void ->x : string | Color ->Color : Color - - if (typeof x === "number") { ->typeof x === "number" : boolean ->typeof x : string ->x : string | Color - - var y = x; ->y : Color ->x : Color - - var y: Color; ->y : Color ->Color : Color - } - else { - var z = x; ->z : string ->x : string - - var z: string; ->z : string - } -} - -function f2(x: Color | string | string[]) { ->f2 : (x: string | Color | string[]) => void ->x : string | Color | string[] ->Color : Color - - if (typeof x === "object") { ->typeof x === "object" : boolean ->typeof x : string ->x : string | Color | string[] - - var y = x; ->y : string[] ->x : string[] - - var y: string[]; ->y : string[] - } - if (typeof x === "number") { ->typeof x === "number" : boolean ->typeof x : string ->x : string | Color | string[] - - var z = x; ->z : Color ->x : Color - - var z: Color; ->z : Color ->Color : Color - } - else { - var w = x; ->w : string | string[] ->x : string | string[] - - var w: string | string[]; ->w : string | string[] - } - if (typeof x === "string") { ->typeof x === "string" : boolean ->typeof x : string ->x : string | Color | string[] - - var a = x; ->a : string ->x : string - - var a: string; ->a : string - } - else { - var b = x; ->b : Color | string[] ->x : Color | string[] - - var b: Color | string[]; ->b : Color | string[] ->Color : Color - } -} - 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 47238fdd5a8..717de7ed0ff 100644 --- a/tests/baselines/reference/VariableDeclaration10_es6.types +++ b/tests/baselines/reference/VariableDeclaration10_es6.types @@ -1,4 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration10_es6.ts === let a: number = 1 >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 a172c8114cb..1b5bbdb4ea7 100644 --- a/tests/baselines/reference/VariableDeclaration3_es6.types +++ b/tests/baselines/reference/VariableDeclaration3_es6.types @@ -1,4 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration3_es6.ts === const a = 1 >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 a07894d533d..0dce532be51 100644 --- a/tests/baselines/reference/VariableDeclaration5_es6.types +++ b/tests/baselines/reference/VariableDeclaration5_es6.types @@ -1,4 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration5_es6.ts === const a: number = 1 >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/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 530b147136d..24a3cd85383 100644 --- a/tests/baselines/reference/VariableDeclaration8_es6.types +++ b/tests/baselines/reference/VariableDeclaration8_es6.types @@ -1,4 +1,5 @@ === tests/cases/conformance/es6/variableDeclarations/VariableDeclaration8_es6.ts === let a = 1 >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/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 213e5ad5bc3..ccf766d8f2f 100644 --- a/tests/baselines/reference/acceptableAlias1.types +++ b/tests/baselines/reference/acceptableAlias1.types @@ -3,15 +3,15 @@ module M { >M : typeof M export module N { ->N : unknown +>N : any } export import X = N; ->X : unknown ->N : unknown +>X : any +>N : any } import r = M.X; ->r : unknown +>r : any >M : typeof M ->X : unknown +>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 15007cebf4c..2aeb541d723 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.types +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.types @@ -13,9 +13,11 @@ class Point { >"x=" + this.x + " y=" + this.y : string >"x=" + this.x + " y=" : string >"x=" + this.x : string +>"x=" : string >this.x : number >this : Point >x : number +>" y=" : string >this.y : number >this : Point >y : number @@ -46,6 +48,7 @@ class ColoredPoint extends Point { >super.toString : () => string >super : Point >toString : () => string +>" color=" : string >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 9d4976dd91a..cb54e92b184 100644 --- a/tests/baselines/reference/accessorWithES5.types +++ b/tests/baselines/reference/accessorWithES5.types @@ -7,6 +7,7 @@ class C { >x : number return 1; +>1 : number } } @@ -25,6 +26,7 @@ var x = { get a() { return 1 } >a : number +>1 : number } var y = { 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/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 a80986c8cd1..98bd1910241 100644 --- a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types @@ -22,4 +22,5 @@ var kitty = a(1); >kitty : string >a(1) : string >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 da534c68ad6..9f1a9f03898 100644 --- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types @@ -144,11 +144,13 @@ var r17 = a + ''; >r17 : string >a + '' : string >a : any +>'' : string var r18 = a + 123; >r18 : any >a + 123 : any >a : any +>123 : number var r19 = a + { a: '' }; >r19 : any @@ -156,6 +158,7 @@ var r19 = a + { a: '' }; >a : any >{ a: '' } : { a: string; } >a : string +>'' : string var r20 = a + ((a: string) => { return a }); >r20 : any 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 4dade89f5e4..f4ea168ee0d 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types @@ -24,31 +24,38 @@ var d: string; var r1: any = null + a; >r1 : any >null + a : any +>null : null >a : any var r2: any = a + null; >r2 : any >a + null : any >a : any +>null : null // null + number/enum var r3 = null + b; >r3 : number >null + b : number +>null : null >b : number var r4 = null + 1; >r4 : number >null + 1 : number +>null : null +>1 : number var r5 = null + c; >r5 : number >null + c : number +>null : null >c : E var r6 = null + E.a; >r6 : number >null + E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -56,22 +63,28 @@ var r6 = null + E.a; var r7 = null + E['a']; >r7 : number >null + E['a'] : number +>null : null >E['a'] : E >E : typeof E +>'a' : string var r8 = b + null; >r8 : number >b + null : number >b : number +>null : null var r9 = 1 + null; >r9 : number >1 + null : number +>1 : number +>null : null var r10 = c + null >r10 : number >c + null : number >c : E +>null : null var r11 = E.a + null; >r11 : number @@ -79,29 +92,38 @@ var r11 = E.a + null; >E.a : E >E : typeof E >a : E +>null : null var r12 = E['a'] + null; >r12 : number >E['a'] + null : number >E['a'] : E >E : typeof E +>'a' : string +>null : null // null + string var r13 = null + d; >r13 : string >null + d : string +>null : null >d : string var r14 = null + ''; >r14 : string >null + '' : string +>null : null +>'' : string var r15 = d + null; >r15 : string >d + null : string >d : string +>null : null var r16 = '' + null; >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 c22939ffd98..2b1c2794065 100644 --- a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types @@ -48,6 +48,7 @@ var r4 = b + b; var r5 = 0 + a; >r5 : number >0 + a : number +>0 : number >a : number var r6 = E.a + 0; @@ -56,6 +57,7 @@ var r6 = E.a + 0; >E.a : E >E : typeof E >a : E +>0 : number var r7 = E.a + E.b; >r7 : number @@ -72,16 +74,20 @@ var r8 = E['a'] + E['b']; >E['a'] + E['b'] : number >E['a'] : E >E : typeof E +>'a' : string >E['b'] : E >E : typeof E +>'b' : string var r9 = E['a'] + F['c']; >r9 : number >E['a'] + F['c'] : number >E['a'] : E >E : typeof E +>'a' : string >F['c'] : F >F : typeof F +>'c' : string var r10 = a + c; >r10 : number 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 9d5a926c427..5413f5f5bdf 100644 --- a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types @@ -137,11 +137,13 @@ var r17 = x + ''; >r17 : string >x + '' : string >x : string +>'' : string var r18 = x + 0; >r18 : string >x + 0 : string >x : string +>0 : number var r19 = x + { a: '' }; >r19 : string @@ -149,6 +151,7 @@ var r19 = x + { a: '' }; >x : string >{ a: '' } : { a: string; } >a : string +>'' : string var r20 = x + []; >r20 : string 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 9a67b25024c..16f0a4dfa84 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types @@ -44,6 +44,7 @@ var r4 = undefined + 1; >r4 : number >undefined + 1 : number >undefined : undefined +>1 : number var r5 = undefined + c; >r5 : number @@ -65,6 +66,7 @@ var r7 = undefined + E['a']; >undefined : undefined >E['a'] : E >E : typeof E +>'a' : string var r8 = b + undefined; >r8 : number @@ -75,6 +77,7 @@ var r8 = b + undefined; var r9 = 1 + undefined; >r9 : number >1 + undefined : number +>1 : number >undefined : undefined var r10 = c + undefined @@ -96,6 +99,7 @@ var r12 = E['a'] + undefined; >E['a'] + undefined : number >E['a'] : E >E : typeof E +>'a' : string >undefined : undefined // undefined + string @@ -109,6 +113,7 @@ var r14 = undefined + ''; >r14 : string >undefined + '' : string >undefined : undefined +>'' : string var r15 = d + undefined; >r15 : string @@ -119,5 +124,6 @@ var r15 = d + undefined; var r16 = '' + undefined; >r16 : string >'' + undefined : string +>'' : string >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 a666d2cee98..eccdbc8528c 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -52,6 +53,7 @@ import Backbone = require("aliasUsage1_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model 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 f7e2beb49dd..ee54300e7d9 100644 --- a/tests/baselines/reference/aliasUsageInArray.types +++ b/tests/baselines/reference/aliasUsageInArray.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -40,6 +41,7 @@ import Backbone = require("aliasUsageInArray_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model 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 392481d2d02..17994dcab52 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.types +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -41,6 +42,7 @@ import Backbone = require("aliasUsageInFunctionExpression_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model 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 568e885f51f..0821732f5fc 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.types +++ b/tests/baselines/reference/aliasUsageInGenericFunction.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -40,6 +41,7 @@ var r2 = foo({ a: null }); >a : IHasVisualizationModel >null : IHasVisualizationModel >IHasVisualizationModel : IHasVisualizationModel +>null : null === tests/cases/compiler/aliasUsageInGenericFunction_backbone.ts === export class Model { @@ -55,6 +57,7 @@ import Backbone = require("aliasUsageInGenericFunction_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model 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 e968abe597f..fe67655d4f5 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.types +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -49,6 +50,7 @@ import Backbone = require("aliasUsageInIndexerOfClass_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model 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 2e631a41cdf..32a78d555b1 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.types +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -54,6 +55,7 @@ import Backbone = require("aliasUsageInObjectLiteral_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model 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 1a4dae90356..8d3163d481b 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.types +++ b/tests/baselines/reference/aliasUsageInOrExpression.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -45,6 +46,7 @@ var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { ><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } >x : IHasVisualizationModel >IHasVisualizationModel : IHasVisualizationModel +>null : null >{ x: moduleA } : { x: typeof moduleA; } >x : typeof moduleA >moduleA : typeof moduleA @@ -57,9 +59,11 @@ var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x ><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } >x : IHasVisualizationModel >IHasVisualizationModel : IHasVisualizationModel +>null : null >{ x: moduleA } : { x: typeof moduleA; } >x : typeof moduleA >moduleA : typeof moduleA +>null : null === tests/cases/compiler/aliasUsageInOrExpression_backbone.ts === export class Model { @@ -75,6 +79,7 @@ import Backbone = require("aliasUsageInOrExpression_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types.pull b/tests/baselines/reference/aliasUsageInOrExpression.types.pull deleted file mode 100644 index 3b138d1404a..00000000000 --- a/tests/baselines/reference/aliasUsageInOrExpression.types.pull +++ /dev/null @@ -1,83 +0,0 @@ -=== tests/cases/compiler/aliasUsageInOrExpression_main.ts === -import Backbone = require("aliasUsageInOrExpression_backbone"); ->Backbone : typeof Backbone - -import moduleA = require("aliasUsageInOrExpression_moduleA"); ->moduleA : typeof moduleA - -interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - - VisualizationModel: typeof Backbone.Model; ->VisualizationModel : typeof Backbone.Model ->Backbone : typeof Backbone ->Model : typeof Backbone.Model -} -var i: IHasVisualizationModel; ->i : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel - -var d1 = i || moduleA; ->d1 : typeof moduleA ->i || moduleA : typeof moduleA ->i : IHasVisualizationModel ->moduleA : typeof moduleA - -var d2: IHasVisualizationModel = i || moduleA; ->d2 : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel ->i || moduleA : typeof moduleA ->i : IHasVisualizationModel ->moduleA : typeof moduleA - -var d2: IHasVisualizationModel = moduleA || i; ->d2 : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel ->moduleA || i : typeof moduleA ->moduleA : typeof moduleA ->i : IHasVisualizationModel - -var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA }; ->e : { x: IHasVisualizationModel; } ->x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel -><{ x: IHasVisualizationModel }>null || { x: moduleA } : { x: IHasVisualizationModel; } -><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } ->x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel ->{ x: moduleA } : { x: typeof moduleA; } ->x : typeof moduleA ->moduleA : typeof moduleA - -var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null; ->f : { x: IHasVisualizationModel; } ->x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel -><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: typeof moduleA; } -><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } ->x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel ->{ x: moduleA } : { x: typeof moduleA; } ->x : typeof moduleA ->moduleA : typeof moduleA - -=== tests/cases/compiler/aliasUsageInOrExpression_backbone.ts === -export class Model { ->Model : Model - - public someData: string; ->someData : string -} - -=== tests/cases/compiler/aliasUsageInOrExpression_moduleA.ts === -import Backbone = require("aliasUsageInOrExpression_backbone"); ->Backbone : typeof Backbone - -export class VisualizationModel extends Backbone.Model { ->VisualizationModel : VisualizationModel ->Backbone : typeof Backbone ->Model : Backbone.Model - - // 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 72f0aaf9e20..460b422a2a4 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -45,6 +46,7 @@ import Backbone = require("aliasUsageInTypeArgumentOfExtendsClause_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model 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 6b1c097ad97..b5d20a1b372 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.types +++ b/tests/baselines/reference/aliasUsageInVarAssignment.types @@ -10,6 +10,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -36,6 +37,7 @@ import Backbone = require("aliasUsageInVarAssignment_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model 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 b8d92f28496..9c519786c76 100644 --- a/tests/baselines/reference/aliasUsedAsNameValue.types +++ b/tests/baselines/reference/aliasUsedAsNameValue.types @@ -28,4 +28,5 @@ export var id: number; export function b(a: any): any { return null; } >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/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 38814405521..f44d49cfc57 100644 --- a/tests/baselines/reference/ambientDeclarations.types +++ b/tests/baselines/reference/ambientDeclarations.types @@ -103,12 +103,14 @@ declare enum E2 { a = 1, >a : E2 +>1 : number b, >b : E2 c = 2, >c : E2 +>2 : number d >d : E2 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 da80015cbd5..97db9f199d3 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer1.types +++ b/tests/baselines/reference/ambientEnumElementInitializer1.types @@ -4,4 +4,5 @@ declare enum E { e = 3 >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 cb1414630b9..7217bc8e6fd 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer2.types +++ b/tests/baselines/reference/ambientEnumElementInitializer2.types @@ -5,4 +5,5 @@ declare enum E { e = -3 // Negative >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 566c03103a1..b85649d654d 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer4.types +++ b/tests/baselines/reference/ambientEnumElementInitializer4.types @@ -4,4 +4,5 @@ declare enum E { e = 0xA >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 3b6198f0e24..1c5ea0ecdd3 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer5.types +++ b/tests/baselines/reference/ambientEnumElementInitializer5.types @@ -5,4 +5,5 @@ declare enum E { e = -0xA >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 3a38fd6912d..015d3f4e146 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer6.types +++ b/tests/baselines/reference/ambientEnumElementInitializer6.types @@ -7,5 +7,6 @@ declare module M { e = 3 >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/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/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/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/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/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 ee654aee333..ae593ab4225 100644 --- a/tests/baselines/reference/ambientInsideNonAmbient.types +++ b/tests/baselines/reference/ambientInsideNonAmbient.types @@ -15,7 +15,7 @@ module M { >E : E export declare module M { } ->M : unknown +>M : any } module M2 { @@ -34,5 +34,5 @@ module M2 { >E : E declare module M { } ->M : unknown +>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 bda7a61a7f3..a8fb61f4280 100644 --- a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types +++ b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types @@ -12,5 +12,5 @@ export declare enum E { } >E : E export declare module M { } ->M : unknown +>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/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/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 fe0aceef810..15e6d51b457 100644 --- a/tests/baselines/reference/ambientModules.types +++ b/tests/baselines/reference/ambientModules.types @@ -11,4 +11,5 @@ Foo.Bar.foo = 5; >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 4e508ba2df5..d4df0f75d16 100644 --- a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types +++ b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.types @@ -53,6 +53,7 @@ class TestClass2 { >x : any return 0; +>0 : number } public foo(x: string): number; 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/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 f88bc9a1ffe..eab0b168f44 100644 --- a/tests/baselines/reference/amdImportAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportAsPrimaryExpression.types @@ -9,6 +9,7 @@ if(foo.E1.A === 0){ >foo : typeof foo >E1 : typeof foo.E1 >A : foo.E1 +>0 : number // Should cause runtime import - interesting optimization possibility, as gets inlined to 0. } 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 bde0cb02b1e..6c3978d93aa 100644 --- a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types @@ -4,18 +4,18 @@ import foo = require("./foo_0"); // None of the below should cause a runtime dependency on foo_0 import f = foo.M1; ->f : unknown +>f : any >foo : typeof foo ->M1 : unknown +>M1 : any var i: f.I2; >i : f.I2 ->f : unknown +>f : any >I2 : f.I2 var x: foo.C1 = <{m1: number}>{}; >x : foo.C1 ->foo : unknown +>foo : any >C1 : foo.C1 ><{m1: number}>{} : { m1: number; } >m1 : number @@ -23,21 +23,25 @@ var x: foo.C1 = <{m1: number}>{}; var y: typeof foo.C1.s1 = false; >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 ->foo : unknown ->M1 : unknown +>foo : any +>M1 : any >I2 : f.I2 var e: number = 0; >e : number >0 : foo.E1 ->foo : unknown +>foo : any >E1 : foo.E1 +>0 : number === tests/cases/conformance/externalModules/foo_0.ts === export class C1 { @@ -45,9 +49,11 @@ export class C1 { m1 = 42; >m1 : number +>42 : number static s1 = true; >s1 : boolean +>true : boolean } export interface I1 { @@ -61,7 +67,7 @@ export interface I1 { } export module M1 { ->M1 : unknown +>M1 : any export interface I2 { >I2 : I2 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 02ad9472354..64bc7842451 100644 --- a/tests/baselines/reference/amdModuleName1.types +++ b/tests/baselines/reference/amdModuleName1.types @@ -12,6 +12,7 @@ class Foo { >this.x : number >this : Foo >x : number +>5 : number } } export = 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 7b5b1401cac..b152ce79a1d 100644 --- a/tests/baselines/reference/anonterface.types +++ b/tests/baselines/reference/anonterface.types @@ -34,7 +34,9 @@ c.m(function(n) { return "hello: "+n; },18); >function(n) { return "hello: "+n; } : (n: number) => string >n : number >"hello: "+n : string +>"hello: " : string >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 6492dce37d2..340ccac463f 100644 --- a/tests/baselines/reference/anyAsFunctionCall.types +++ b/tests/baselines/reference/anyAsFunctionCall.types @@ -14,6 +14,7 @@ var b = x('hello'); >b : any >x('hello') : any >x : any +>'hello' : string var c = x(x); >c : 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 f25cd57831b..bd0d9a9a092 100644 --- a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types +++ b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types @@ -24,6 +24,8 @@ var o = new Point(3, 4); >o : any >new Point(3, 4) : any >Point : (x: any, y: any) => void +>3 : number +>4 : number var xx = o.x; >xx : 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 f5a4f22ef3f..b8575e8edb2 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.types +++ b/tests/baselines/reference/anyAssignabilityInInheritance.types @@ -246,6 +246,7 @@ module f { export var bar = 1; >bar : number +>1 : number } declare function foo15(x: typeof f): typeof f; >foo15 : { (x: typeof f): typeof f; (x: any): any; } @@ -272,6 +273,7 @@ module CC { export var bar = 1; >bar : number +>1 : number } declare function foo16(x: CC): CC; >foo16 : { (x: CC): CC; (x: any): any; } diff --git a/tests/baselines/reference/anyAssignableToEveryType.symbols b/tests/baselines/reference/anyAssignableToEveryType.symbols new file mode 100644 index 00000000000..19dc94c7a43 --- /dev/null +++ b/tests/baselines/reference/anyAssignableToEveryType.symbols @@ -0,0 +1,150 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType.ts === +var a: any; +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +class C { +>C : Symbol(C, Decl(anyAssignableToEveryType.ts, 0, 11)) + + foo: string; +>foo : Symbol(foo, Decl(anyAssignableToEveryType.ts, 2, 9)) +} +var ac: C; +>ac : Symbol(ac, Decl(anyAssignableToEveryType.ts, 5, 3)) +>C : Symbol(C, Decl(anyAssignableToEveryType.ts, 0, 11)) + +interface I { +>I : Symbol(I, Decl(anyAssignableToEveryType.ts, 5, 10)) + + foo: string; +>foo : Symbol(foo, Decl(anyAssignableToEveryType.ts, 6, 13)) +} +var ai: I; +>ai : Symbol(ai, Decl(anyAssignableToEveryType.ts, 9, 3)) +>I : Symbol(I, Decl(anyAssignableToEveryType.ts, 5, 10)) + +enum E { A } +>E : Symbol(E, Decl(anyAssignableToEveryType.ts, 9, 10)) +>A : Symbol(E.A, Decl(anyAssignableToEveryType.ts, 11, 8)) + +var ae: E; +>ae : Symbol(ae, Decl(anyAssignableToEveryType.ts, 12, 3)) +>E : Symbol(E, Decl(anyAssignableToEveryType.ts, 9, 10)) + +var b: number = a; +>b : Symbol(b, Decl(anyAssignableToEveryType.ts, 14, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var c: string = a; +>c : Symbol(c, Decl(anyAssignableToEveryType.ts, 15, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var d: boolean = a; +>d : Symbol(d, Decl(anyAssignableToEveryType.ts, 16, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var e: Date = a; +>e : Symbol(e, Decl(anyAssignableToEveryType.ts, 17, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var f: any = a; +>f : Symbol(f, Decl(anyAssignableToEveryType.ts, 18, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var g: void = a; +>g : Symbol(g, Decl(anyAssignableToEveryType.ts, 19, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var h: Object = a; +>h : Symbol(h, Decl(anyAssignableToEveryType.ts, 20, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var i: {} = a; +>i : Symbol(i, Decl(anyAssignableToEveryType.ts, 21, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var j: () => {} = a; +>j : Symbol(j, Decl(anyAssignableToEveryType.ts, 22, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var k: Function = a; +>k : Symbol(k, Decl(anyAssignableToEveryType.ts, 23, 3)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var l: (x: number) => string = a; +>l : Symbol(l, Decl(anyAssignableToEveryType.ts, 24, 3)) +>x : Symbol(x, Decl(anyAssignableToEveryType.ts, 24, 8)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +ac = a; +>ac : Symbol(ac, Decl(anyAssignableToEveryType.ts, 5, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +ai = a; +>ai : Symbol(ai, Decl(anyAssignableToEveryType.ts, 9, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +ae = a; +>ae : Symbol(ae, Decl(anyAssignableToEveryType.ts, 12, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var m: number[] = a; +>m : Symbol(m, Decl(anyAssignableToEveryType.ts, 28, 3)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var n: { foo: string } = a; +>n : Symbol(n, Decl(anyAssignableToEveryType.ts, 29, 3)) +>foo : Symbol(foo, Decl(anyAssignableToEveryType.ts, 29, 8)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var o: (x: T) => T = a; +>o : Symbol(o, Decl(anyAssignableToEveryType.ts, 30, 3)) +>T : Symbol(T, Decl(anyAssignableToEveryType.ts, 30, 8)) +>x : Symbol(x, Decl(anyAssignableToEveryType.ts, 30, 11)) +>T : Symbol(T, Decl(anyAssignableToEveryType.ts, 30, 8)) +>T : Symbol(T, Decl(anyAssignableToEveryType.ts, 30, 8)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var p: Number = a; +>p : Symbol(p, Decl(anyAssignableToEveryType.ts, 31, 3)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +var q: String = a; +>q : Symbol(q, Decl(anyAssignableToEveryType.ts, 32, 3)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + +function foo(x: T, y: U, z: V) { +>foo : Symbol(foo, Decl(anyAssignableToEveryType.ts, 32, 18)) +>T : Symbol(T, Decl(anyAssignableToEveryType.ts, 34, 13)) +>U : Symbol(U, Decl(anyAssignableToEveryType.ts, 34, 15)) +>V : Symbol(V, Decl(anyAssignableToEveryType.ts, 34, 32)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(anyAssignableToEveryType.ts, 34, 49)) +>T : Symbol(T, Decl(anyAssignableToEveryType.ts, 34, 13)) +>y : Symbol(y, Decl(anyAssignableToEveryType.ts, 34, 54)) +>U : Symbol(U, Decl(anyAssignableToEveryType.ts, 34, 15)) +>z : Symbol(z, Decl(anyAssignableToEveryType.ts, 34, 60)) +>V : Symbol(V, Decl(anyAssignableToEveryType.ts, 34, 32)) + + x = a; +>x : Symbol(x, Decl(anyAssignableToEveryType.ts, 34, 49)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + + y = a; +>y : Symbol(y, Decl(anyAssignableToEveryType.ts, 34, 54)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) + + z = a; +>z : Symbol(z, Decl(anyAssignableToEveryType.ts, 34, 60)) +>a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) +} + +//function foo(x: T, y: U, z: V) { +// x = a; +// y = a; +// z = a; +//} diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols b/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols new file mode 100644 index 00000000000..daf7947e694 --- /dev/null +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols @@ -0,0 +1,50 @@ +=== tests/cases/compiler/anyInferenceAnonymousFunctions.ts === +var paired: any[]; +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) + +paired.reduce(function (a1, a2) { +>paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>a1 : Symbol(a1, Decl(anyInferenceAnonymousFunctions.ts, 2, 24)) +>a2 : Symbol(a2, Decl(anyInferenceAnonymousFunctions.ts, 2, 27)) + + return a1.concat({}); +>a1 : Symbol(a1, Decl(anyInferenceAnonymousFunctions.ts, 2, 24)) + +} , []); + +paired.reduce((b1, b2) => { +>paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>b1 : Symbol(b1, Decl(anyInferenceAnonymousFunctions.ts, 8, 15)) +>b2 : Symbol(b2, Decl(anyInferenceAnonymousFunctions.ts, 8, 18)) + + return b1.concat({}); +>b1 : Symbol(b1, Decl(anyInferenceAnonymousFunctions.ts, 8, 15)) + +} , []); + +paired.reduce((b3, b4) => b3.concat({}), []); +>paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15)) +>b4 : Symbol(b4, Decl(anyInferenceAnonymousFunctions.ts, 13, 18)) +>b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15)) + +paired.map((c1) => c1.count); +>paired.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>c1 : Symbol(c1, Decl(anyInferenceAnonymousFunctions.ts, 15, 12)) +>c1 : Symbol(c1, Decl(anyInferenceAnonymousFunctions.ts, 15, 12)) + +paired.map(function (c2) { return c2.count; }); +>paired.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>c2 : Symbol(c2, Decl(anyInferenceAnonymousFunctions.ts, 16, 21)) +>c2 : Symbol(c2, Decl(anyInferenceAnonymousFunctions.ts, 16, 21)) + diff --git a/tests/baselines/reference/anyIsAssignableToObject.symbols b/tests/baselines/reference/anyIsAssignableToObject.symbols new file mode 100644 index 00000000000..a9650fa58b8 --- /dev/null +++ b/tests/baselines/reference/anyIsAssignableToObject.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/anyIsAssignableToObject.ts === +interface P { +>P : Symbol(P, Decl(anyIsAssignableToObject.ts, 0, 0)) + + p: {}; +>p : Symbol(p, Decl(anyIsAssignableToObject.ts, 0, 13)) +} + +interface Q extends P { // Check assignability here. Any is assignable to {} +>Q : Symbol(Q, Decl(anyIsAssignableToObject.ts, 2, 1)) +>P : Symbol(P, Decl(anyIsAssignableToObject.ts, 0, 0)) + + p: any; +>p : Symbol(p, Decl(anyIsAssignableToObject.ts, 4, 23)) +} diff --git a/tests/baselines/reference/anyIsAssignableToVoid.symbols b/tests/baselines/reference/anyIsAssignableToVoid.symbols new file mode 100644 index 00000000000..f5ee5ce7b23 --- /dev/null +++ b/tests/baselines/reference/anyIsAssignableToVoid.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/anyIsAssignableToVoid.ts === +interface P { +>P : Symbol(P, Decl(anyIsAssignableToVoid.ts, 0, 0)) + + p: void; +>p : Symbol(p, Decl(anyIsAssignableToVoid.ts, 0, 13)) +} + +interface Q extends P { // check assignability here. any is assignable to void. +>Q : Symbol(Q, Decl(anyIsAssignableToVoid.ts, 2, 1)) +>P : Symbol(P, Decl(anyIsAssignableToVoid.ts, 0, 0)) + + p: any; +>p : Symbol(p, Decl(anyIsAssignableToVoid.ts, 4, 23)) +} diff --git a/tests/baselines/reference/anyPlusAny1.symbols b/tests/baselines/reference/anyPlusAny1.symbols new file mode 100644 index 00000000000..e0552e4541f --- /dev/null +++ b/tests/baselines/reference/anyPlusAny1.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/anyPlusAny1.ts === +var x; +>x : Symbol(x, Decl(anyPlusAny1.ts, 0, 3)) + +x.name = "hello"; +>x : Symbol(x, Decl(anyPlusAny1.ts, 0, 3)) + +var z = x + x; +>z : Symbol(z, Decl(anyPlusAny1.ts, 2, 3)) +>x : Symbol(x, Decl(anyPlusAny1.ts, 0, 3)) +>x : Symbol(x, Decl(anyPlusAny1.ts, 0, 3)) + diff --git a/tests/baselines/reference/anyPlusAny1.types b/tests/baselines/reference/anyPlusAny1.types index aeda001eeaa..406d432f06e 100644 --- a/tests/baselines/reference/anyPlusAny1.types +++ b/tests/baselines/reference/anyPlusAny1.types @@ -7,6 +7,7 @@ x.name = "hello"; >x.name : any >x : any >name : any +>"hello" : string var z = x + x; >z : any diff --git a/tests/baselines/reference/anyPropertyAccess.symbols b/tests/baselines/reference/anyPropertyAccess.symbols new file mode 100644 index 00000000000..e99b494853e --- /dev/null +++ b/tests/baselines/reference/anyPropertyAccess.symbols @@ -0,0 +1,28 @@ +=== tests/cases/conformance/types/any/anyPropertyAccess.ts === +var x: any; +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var a = x.foo; +>a : Symbol(a, Decl(anyPropertyAccess.ts, 1, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var b = x['foo']; +>b : Symbol(b, Decl(anyPropertyAccess.ts, 2, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var c = x['fn'](); +>c : Symbol(c, Decl(anyPropertyAccess.ts, 3, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var d = x.bar.baz; +>d : Symbol(d, Decl(anyPropertyAccess.ts, 4, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var e = x[0].foo; +>e : Symbol(e, Decl(anyPropertyAccess.ts, 5, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + +var f = x['0'].bar; +>f : Symbol(f, Decl(anyPropertyAccess.ts, 6, 3)) +>x : Symbol(x, Decl(anyPropertyAccess.ts, 0, 3)) + diff --git a/tests/baselines/reference/anyPropertyAccess.types b/tests/baselines/reference/anyPropertyAccess.types index 5ea20cefdd6..13eec6b53b2 100644 --- a/tests/baselines/reference/anyPropertyAccess.types +++ b/tests/baselines/reference/anyPropertyAccess.types @@ -12,12 +12,14 @@ var b = x['foo']; >b : any >x['foo'] : any >x : any +>'foo' : string var c = x['fn'](); >c : any >x['fn']() : any >x['fn'] : any >x : any +>'fn' : string var d = x.bar.baz; >d : any @@ -32,6 +34,7 @@ var e = x[0].foo; >x[0].foo : any >x[0] : any >x : any +>0 : number >foo : any var f = x['0'].bar; @@ -39,5 +42,6 @@ var f = x['0'].bar; >x['0'].bar : any >x['0'] : any >x : any +>'0' : string >bar : any diff --git a/tests/baselines/reference/argsInScope.symbols b/tests/baselines/reference/argsInScope.symbols new file mode 100644 index 00000000000..7ea039819aa --- /dev/null +++ b/tests/baselines/reference/argsInScope.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/argsInScope.ts === +class C { +>C : Symbol(C, Decl(argsInScope.ts, 0, 0)) + + P(ii:number, j:number, k:number) { +>P : Symbol(P, Decl(argsInScope.ts, 0, 9)) +>ii : Symbol(ii, Decl(argsInScope.ts, 1, 6)) +>j : Symbol(j, Decl(argsInScope.ts, 1, 16)) +>k : Symbol(k, Decl(argsInScope.ts, 1, 26)) + + for (var i = 0; i < arguments.length; i++) { +>i : Symbol(i, Decl(argsInScope.ts, 2, 15)) +>i : Symbol(i, Decl(argsInScope.ts, 2, 15)) +>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, 272, 25)) +>arguments : Symbol(arguments) +>length : Symbol(IArguments.length, Decl(lib.d.ts, 272, 25)) +>i : Symbol(i, Decl(argsInScope.ts, 2, 15)) + + // WScript.Echo("param: " + arguments[i]); + } + } +} + +var c = new C(); +>c : Symbol(c, Decl(argsInScope.ts, 8, 3)) +>C : Symbol(C, Decl(argsInScope.ts, 0, 0)) + +c.P(1,2,3); +>c.P : Symbol(C.P, Decl(argsInScope.ts, 0, 9)) +>c : Symbol(c, Decl(argsInScope.ts, 8, 3)) +>P : Symbol(C.P, Decl(argsInScope.ts, 0, 9)) + diff --git a/tests/baselines/reference/argsInScope.types b/tests/baselines/reference/argsInScope.types index 010e5624039..745ae249359 100644 --- a/tests/baselines/reference/argsInScope.types +++ b/tests/baselines/reference/argsInScope.types @@ -10,6 +10,7 @@ class C { for (var i = 0; i < arguments.length; i++) { >i : number +>0 : number >i < arguments.length : boolean >i : number >arguments.length : number @@ -33,4 +34,7 @@ c.P(1,2,3); >c.P : (ii: number, j: number, k: number) => void >c : C >P : (ii: number, j: number, k: number) => void +>1 : number +>2 : number +>3 : number diff --git a/tests/baselines/reference/arguments.symbols b/tests/baselines/reference/arguments.symbols new file mode 100644 index 00000000000..2825d792715 --- /dev/null +++ b/tests/baselines/reference/arguments.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/arguments.ts === +function f() { +>f : Symbol(f, Decl(arguments.ts, 0, 0)) + + var x=arguments[12]; +>x : Symbol(x, Decl(arguments.ts, 1, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/arguments.types b/tests/baselines/reference/arguments.types index 1902e459316..4699d463b34 100644 --- a/tests/baselines/reference/arguments.types +++ b/tests/baselines/reference/arguments.types @@ -6,4 +6,5 @@ function f() { >x : any >arguments[12] : any >arguments : IArguments +>12 : number } diff --git a/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.symbols b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.symbols new file mode 100644 index 00000000000..1c3b54ef427 --- /dev/null +++ b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/argumentsUsedInObjectLiteralProperty.ts === +class A { +>A : Symbol(A, Decl(argumentsUsedInObjectLiteralProperty.ts, 0, 0)) + + public static createSelectableViewModel(initialState?: any, selectedValue?: any) { +>createSelectableViewModel : Symbol(A.createSelectableViewModel, Decl(argumentsUsedInObjectLiteralProperty.ts, 0, 9)) +>initialState : Symbol(initialState, Decl(argumentsUsedInObjectLiteralProperty.ts, 1, 44)) +>selectedValue : Symbol(selectedValue, Decl(argumentsUsedInObjectLiteralProperty.ts, 1, 63)) + + return { + selectedValue: arguments.length +>selectedValue : Symbol(selectedValue, Decl(argumentsUsedInObjectLiteralProperty.ts, 2, 16)) +>arguments.length : Symbol(IArguments.length, Decl(lib.d.ts, 272, 25)) +>arguments : Symbol(arguments) +>length : Symbol(IArguments.length, Decl(lib.d.ts, 272, 25)) + + }; + } +} diff --git a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.symbols b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.symbols new file mode 100644 index 00000000000..e45db3637f0 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.symbols @@ -0,0 +1,357 @@ +=== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithAnyAndNumber.ts === +var a: any; +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var b: number; +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator * +var ra1 = a * a; +>ra1 : Symbol(ra1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 4, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ra2 = a * b; +>ra2 : Symbol(ra2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 5, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ra3 = a * 0; +>ra3 : Symbol(ra3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 6, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ra4 = 0 * a; +>ra4 : Symbol(ra4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 7, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ra5 = 0 * 0; +>ra5 : Symbol(ra5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 8, 3)) + +var ra6 = b * 0; +>ra6 : Symbol(ra6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ra7 = 0 * b; +>ra7 : Symbol(ra7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 10, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ra8 = b * b; +>ra8 : Symbol(ra8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 11, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator / +var rb1 = a / a; +>rb1 : Symbol(rb1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 14, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rb2 = a / b; +>rb2 : Symbol(rb2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 15, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rb3 = a / 0; +>rb3 : Symbol(rb3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 16, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rb4 = 0 / a; +>rb4 : Symbol(rb4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 17, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rb5 = 0 / 0; +>rb5 : Symbol(rb5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 18, 3)) + +var rb6 = b / 0; +>rb6 : Symbol(rb6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 19, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rb7 = 0 / b; +>rb7 : Symbol(rb7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 20, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rb8 = b / b; +>rb8 : Symbol(rb8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 21, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator % +var rc1 = a % a; +>rc1 : Symbol(rc1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 24, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rc2 = a % b; +>rc2 : Symbol(rc2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 25, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rc3 = a % 0; +>rc3 : Symbol(rc3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 26, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rc4 = 0 % a; +>rc4 : Symbol(rc4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 27, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rc5 = 0 % 0; +>rc5 : Symbol(rc5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 28, 3)) + +var rc6 = b % 0; +>rc6 : Symbol(rc6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 29, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rc7 = 0 % b; +>rc7 : Symbol(rc7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 30, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rc8 = b % b; +>rc8 : Symbol(rc8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 31, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator - +var rd1 = a - a; +>rd1 : Symbol(rd1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 34, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rd2 = a - b; +>rd2 : Symbol(rd2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 35, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rd3 = a - 0; +>rd3 : Symbol(rd3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 36, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rd4 = 0 - a; +>rd4 : Symbol(rd4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 37, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rd5 = 0 - 0; +>rd5 : Symbol(rd5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 38, 3)) + +var rd6 = b - 0; +>rd6 : Symbol(rd6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 39, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rd7 = 0 - b; +>rd7 : Symbol(rd7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 40, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rd8 = b - b; +>rd8 : Symbol(rd8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 41, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator << +var re1 = a << a; +>re1 : Symbol(re1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 44, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var re2 = a << b; +>re2 : Symbol(re2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 45, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var re3 = a << 0; +>re3 : Symbol(re3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 46, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var re4 = 0 << a; +>re4 : Symbol(re4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 47, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var re5 = 0 << 0; +>re5 : Symbol(re5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 48, 3)) + +var re6 = b << 0; +>re6 : Symbol(re6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 49, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var re7 = 0 << b; +>re7 : Symbol(re7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 50, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var re8 = b << b; +>re8 : Symbol(re8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 51, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator >> +var rf1 = a >> a; +>rf1 : Symbol(rf1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 54, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rf2 = a >> b; +>rf2 : Symbol(rf2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 55, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rf3 = a >> 0; +>rf3 : Symbol(rf3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 56, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rf4 = 0 >> a; +>rf4 : Symbol(rf4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 57, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rf5 = 0 >> 0; +>rf5 : Symbol(rf5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 58, 3)) + +var rf6 = b >> 0; +>rf6 : Symbol(rf6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 59, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rf7 = 0 >> b; +>rf7 : Symbol(rf7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 60, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rf8 = b >> b; +>rf8 : Symbol(rf8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 61, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator >>> +var rg1 = a >>> a; +>rg1 : Symbol(rg1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 64, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rg2 = a >>> b; +>rg2 : Symbol(rg2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 65, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rg3 = a >>> 0; +>rg3 : Symbol(rg3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 66, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rg4 = 0 >>> a; +>rg4 : Symbol(rg4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 67, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rg5 = 0 >>> 0; +>rg5 : Symbol(rg5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 68, 3)) + +var rg6 = b >>> 0; +>rg6 : Symbol(rg6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 69, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rg7 = 0 >>> b; +>rg7 : Symbol(rg7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 70, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rg8 = b >>> b; +>rg8 : Symbol(rg8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 71, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator & +var rh1 = a & a; +>rh1 : Symbol(rh1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 74, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rh2 = a & b; +>rh2 : Symbol(rh2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 75, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rh3 = a & 0; +>rh3 : Symbol(rh3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 76, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rh4 = 0 & a; +>rh4 : Symbol(rh4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 77, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rh5 = 0 & 0; +>rh5 : Symbol(rh5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 78, 3)) + +var rh6 = b & 0; +>rh6 : Symbol(rh6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 79, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rh7 = 0 & b; +>rh7 : Symbol(rh7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 80, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rh8 = b & b; +>rh8 : Symbol(rh8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 81, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator ^ +var ri1 = a ^ a; +>ri1 : Symbol(ri1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 84, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ri2 = a ^ b; +>ri2 : Symbol(ri2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 85, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ri3 = a ^ 0; +>ri3 : Symbol(ri3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 86, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ri4 = 0 ^ a; +>ri4 : Symbol(ri4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 87, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var ri5 = 0 ^ 0; +>ri5 : Symbol(ri5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 88, 3)) + +var ri6 = b ^ 0; +>ri6 : Symbol(ri6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 89, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ri7 = 0 ^ b; +>ri7 : Symbol(ri7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 90, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var ri8 = b ^ b; +>ri8 : Symbol(ri8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 91, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +// operator | +var rj1 = a | a; +>rj1 : Symbol(rj1, Decl(arithmeticOperatorWithAnyAndNumber.ts, 94, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rj2 = a | b; +>rj2 : Symbol(rj2, Decl(arithmeticOperatorWithAnyAndNumber.ts, 95, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rj3 = a | 0; +>rj3 : Symbol(rj3, Decl(arithmeticOperatorWithAnyAndNumber.ts, 96, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rj4 = 0 | a; +>rj4 : Symbol(rj4, Decl(arithmeticOperatorWithAnyAndNumber.ts, 97, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithAnyAndNumber.ts, 0, 3)) + +var rj5 = 0 | 0; +>rj5 : Symbol(rj5, Decl(arithmeticOperatorWithAnyAndNumber.ts, 98, 3)) + +var rj6 = b | 0; +>rj6 : Symbol(rj6, Decl(arithmeticOperatorWithAnyAndNumber.ts, 99, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rj7 = 0 | b; +>rj7 : Symbol(rj7, Decl(arithmeticOperatorWithAnyAndNumber.ts, 100, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + +var rj8 = b | b; +>rj8 : Symbol(rj8, Decl(arithmeticOperatorWithAnyAndNumber.ts, 101, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithAnyAndNumber.ts, 1, 3)) + diff --git a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types index f0120f328c4..8845a52760d 100644 --- a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types +++ b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types @@ -22,24 +22,30 @@ var ra3 = a * 0; >ra3 : number >a * 0 : number >a : any +>0 : number var ra4 = 0 * a; >ra4 : number >0 * a : number +>0 : number >a : any var ra5 = 0 * 0; >ra5 : number >0 * 0 : number +>0 : number +>0 : number var ra6 = b * 0; >ra6 : number >b * 0 : number >b : number +>0 : number var ra7 = 0 * b; >ra7 : number >0 * b : number +>0 : number >b : number var ra8 = b * b; @@ -65,24 +71,30 @@ var rb3 = a / 0; >rb3 : number >a / 0 : number >a : any +>0 : number var rb4 = 0 / a; >rb4 : number >0 / a : number +>0 : number >a : any var rb5 = 0 / 0; >rb5 : number >0 / 0 : number +>0 : number +>0 : number var rb6 = b / 0; >rb6 : number >b / 0 : number >b : number +>0 : number var rb7 = 0 / b; >rb7 : number >0 / b : number +>0 : number >b : number var rb8 = b / b; @@ -108,24 +120,30 @@ var rc3 = a % 0; >rc3 : number >a % 0 : number >a : any +>0 : number var rc4 = 0 % a; >rc4 : number >0 % a : number +>0 : number >a : any var rc5 = 0 % 0; >rc5 : number >0 % 0 : number +>0 : number +>0 : number var rc6 = b % 0; >rc6 : number >b % 0 : number >b : number +>0 : number var rc7 = 0 % b; >rc7 : number >0 % b : number +>0 : number >b : number var rc8 = b % b; @@ -151,24 +169,30 @@ var rd3 = a - 0; >rd3 : number >a - 0 : number >a : any +>0 : number var rd4 = 0 - a; >rd4 : number >0 - a : number +>0 : number >a : any var rd5 = 0 - 0; >rd5 : number >0 - 0 : number +>0 : number +>0 : number var rd6 = b - 0; >rd6 : number >b - 0 : number >b : number +>0 : number var rd7 = 0 - b; >rd7 : number >0 - b : number +>0 : number >b : number var rd8 = b - b; @@ -194,24 +218,30 @@ var re3 = a << 0; >re3 : number >a << 0 : number >a : any +>0 : number var re4 = 0 << a; >re4 : number >0 << a : number +>0 : number >a : any var re5 = 0 << 0; >re5 : number >0 << 0 : number +>0 : number +>0 : number var re6 = b << 0; >re6 : number >b << 0 : number >b : number +>0 : number var re7 = 0 << b; >re7 : number >0 << b : number +>0 : number >b : number var re8 = b << b; @@ -237,24 +267,30 @@ var rf3 = a >> 0; >rf3 : number >a >> 0 : number >a : any +>0 : number var rf4 = 0 >> a; >rf4 : number >0 >> a : number +>0 : number >a : any var rf5 = 0 >> 0; >rf5 : number >0 >> 0 : number +>0 : number +>0 : number var rf6 = b >> 0; >rf6 : number >b >> 0 : number >b : number +>0 : number var rf7 = 0 >> b; >rf7 : number >0 >> b : number +>0 : number >b : number var rf8 = b >> b; @@ -280,24 +316,30 @@ var rg3 = a >>> 0; >rg3 : number >a >>> 0 : number >a : any +>0 : number var rg4 = 0 >>> a; >rg4 : number >0 >>> a : number +>0 : number >a : any var rg5 = 0 >>> 0; >rg5 : number >0 >>> 0 : number +>0 : number +>0 : number var rg6 = b >>> 0; >rg6 : number >b >>> 0 : number >b : number +>0 : number var rg7 = 0 >>> b; >rg7 : number >0 >>> b : number +>0 : number >b : number var rg8 = b >>> b; @@ -323,24 +365,30 @@ var rh3 = a & 0; >rh3 : number >a & 0 : number >a : any +>0 : number var rh4 = 0 & a; >rh4 : number >0 & a : number +>0 : number >a : any var rh5 = 0 & 0; >rh5 : number >0 & 0 : number +>0 : number +>0 : number var rh6 = b & 0; >rh6 : number >b & 0 : number >b : number +>0 : number var rh7 = 0 & b; >rh7 : number >0 & b : number +>0 : number >b : number var rh8 = b & b; @@ -366,24 +414,30 @@ var ri3 = a ^ 0; >ri3 : number >a ^ 0 : number >a : any +>0 : number var ri4 = 0 ^ a; >ri4 : number >0 ^ a : number +>0 : number >a : any var ri5 = 0 ^ 0; >ri5 : number >0 ^ 0 : number +>0 : number +>0 : number var ri6 = b ^ 0; >ri6 : number >b ^ 0 : number >b : number +>0 : number var ri7 = 0 ^ b; >ri7 : number >0 ^ b : number +>0 : number >b : number var ri8 = b ^ b; @@ -409,24 +463,30 @@ var rj3 = a | 0; >rj3 : number >a | 0 : number >a : any +>0 : number var rj4 = 0 | a; >rj4 : number >0 | a : number +>0 : number >a : any var rj5 = 0 | 0; >rj5 : number >0 | 0 : number +>0 : number +>0 : number var rj6 = b | 0; >rj6 : number >b | 0 : number >b : number +>0 : number var rj7 = 0 | b; >rj7 : number >0 | b : number +>0 : number >b : number var rj8 = b | b; diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.symbols b/tests/baselines/reference/arithmeticOperatorWithEnum.symbols new file mode 100644 index 00000000000..066f429a181 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.symbols @@ -0,0 +1,773 @@ +=== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithEnum.ts === +// operands of an enum type are treated as having the primitive type Number. + +enum E { +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + + b +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +} + +var a: any; +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var b: number; +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var c: E; +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) + +// operator * +var ra1 = c * a; +>ra1 : Symbol(ra1, Decl(arithmeticOperatorWithEnum.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var ra2 = c * b; +>ra2 : Symbol(ra2, Decl(arithmeticOperatorWithEnum.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var ra3 = c * c; +>ra3 : Symbol(ra3, Decl(arithmeticOperatorWithEnum.ts, 14, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ra4 = a * c; +>ra4 : Symbol(ra4, Decl(arithmeticOperatorWithEnum.ts, 15, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ra5 = b * c; +>ra5 : Symbol(ra5, Decl(arithmeticOperatorWithEnum.ts, 16, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ra6 = E.a * a; +>ra6 : Symbol(ra6, Decl(arithmeticOperatorWithEnum.ts, 17, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var ra7 = E.a * b; +>ra7 : Symbol(ra7, Decl(arithmeticOperatorWithEnum.ts, 18, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var ra8 = E.a * E.b; +>ra8 : Symbol(ra8, Decl(arithmeticOperatorWithEnum.ts, 19, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ra9 = E.a * 1; +>ra9 : Symbol(ra9, Decl(arithmeticOperatorWithEnum.ts, 20, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var ra10 = a * E.b; +>ra10 : Symbol(ra10, Decl(arithmeticOperatorWithEnum.ts, 21, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ra11 = b * E.b; +>ra11 : Symbol(ra11, Decl(arithmeticOperatorWithEnum.ts, 22, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ra12 = 1 * E.b; +>ra12 : Symbol(ra12, Decl(arithmeticOperatorWithEnum.ts, 23, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator / +var rb1 = c / a; +>rb1 : Symbol(rb1, Decl(arithmeticOperatorWithEnum.ts, 26, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rb2 = c / b; +>rb2 : Symbol(rb2, Decl(arithmeticOperatorWithEnum.ts, 27, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rb3 = c / c; +>rb3 : Symbol(rb3, Decl(arithmeticOperatorWithEnum.ts, 28, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rb4 = a / c; +>rb4 : Symbol(rb4, Decl(arithmeticOperatorWithEnum.ts, 29, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rb5 = b / c; +>rb5 : Symbol(rb5, Decl(arithmeticOperatorWithEnum.ts, 30, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rb6 = E.a / a; +>rb6 : Symbol(rb6, Decl(arithmeticOperatorWithEnum.ts, 31, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rb7 = E.a / b; +>rb7 : Symbol(rb7, Decl(arithmeticOperatorWithEnum.ts, 32, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rb8 = E.a / E.b; +>rb8 : Symbol(rb8, Decl(arithmeticOperatorWithEnum.ts, 33, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rb9 = E.a / 1; +>rb9 : Symbol(rb9, Decl(arithmeticOperatorWithEnum.ts, 34, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rb10 = a / E.b; +>rb10 : Symbol(rb10, Decl(arithmeticOperatorWithEnum.ts, 35, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rb11 = b / E.b; +>rb11 : Symbol(rb11, Decl(arithmeticOperatorWithEnum.ts, 36, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rb12 = 1 / E.b; +>rb12 : Symbol(rb12, Decl(arithmeticOperatorWithEnum.ts, 37, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator % +var rc1 = c % a; +>rc1 : Symbol(rc1, Decl(arithmeticOperatorWithEnum.ts, 40, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rc2 = c % b; +>rc2 : Symbol(rc2, Decl(arithmeticOperatorWithEnum.ts, 41, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rc3 = c % c; +>rc3 : Symbol(rc3, Decl(arithmeticOperatorWithEnum.ts, 42, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rc4 = a % c; +>rc4 : Symbol(rc4, Decl(arithmeticOperatorWithEnum.ts, 43, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rc5 = b % c; +>rc5 : Symbol(rc5, Decl(arithmeticOperatorWithEnum.ts, 44, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rc6 = E.a % a; +>rc6 : Symbol(rc6, Decl(arithmeticOperatorWithEnum.ts, 45, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rc7 = E.a % b; +>rc7 : Symbol(rc7, Decl(arithmeticOperatorWithEnum.ts, 46, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rc8 = E.a % E.b; +>rc8 : Symbol(rc8, Decl(arithmeticOperatorWithEnum.ts, 47, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rc9 = E.a % 1; +>rc9 : Symbol(rc9, Decl(arithmeticOperatorWithEnum.ts, 48, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rc10 = a % E.b; +>rc10 : Symbol(rc10, Decl(arithmeticOperatorWithEnum.ts, 49, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rc11 = b % E.b; +>rc11 : Symbol(rc11, Decl(arithmeticOperatorWithEnum.ts, 50, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rc12 = 1 % E.b; +>rc12 : Symbol(rc12, Decl(arithmeticOperatorWithEnum.ts, 51, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator - +var rd1 = c - a; +>rd1 : Symbol(rd1, Decl(arithmeticOperatorWithEnum.ts, 54, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rd2 = c - b; +>rd2 : Symbol(rd2, Decl(arithmeticOperatorWithEnum.ts, 55, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rd3 = c - c; +>rd3 : Symbol(rd3, Decl(arithmeticOperatorWithEnum.ts, 56, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rd4 = a - c; +>rd4 : Symbol(rd4, Decl(arithmeticOperatorWithEnum.ts, 57, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rd5 = b - c; +>rd5 : Symbol(rd5, Decl(arithmeticOperatorWithEnum.ts, 58, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rd6 = E.a - a; +>rd6 : Symbol(rd6, Decl(arithmeticOperatorWithEnum.ts, 59, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rd7 = E.a - b; +>rd7 : Symbol(rd7, Decl(arithmeticOperatorWithEnum.ts, 60, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rd8 = E.a - E.b; +>rd8 : Symbol(rd8, Decl(arithmeticOperatorWithEnum.ts, 61, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rd9 = E.a - 1; +>rd9 : Symbol(rd9, Decl(arithmeticOperatorWithEnum.ts, 62, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rd10 = a - E.b; +>rd10 : Symbol(rd10, Decl(arithmeticOperatorWithEnum.ts, 63, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rd11 = b - E.b; +>rd11 : Symbol(rd11, Decl(arithmeticOperatorWithEnum.ts, 64, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rd12 = 1 - E.b; +>rd12 : Symbol(rd12, Decl(arithmeticOperatorWithEnum.ts, 65, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator << +var re1 = c << a; +>re1 : Symbol(re1, Decl(arithmeticOperatorWithEnum.ts, 68, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var re2 = c << b; +>re2 : Symbol(re2, Decl(arithmeticOperatorWithEnum.ts, 69, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var re3 = c << c; +>re3 : Symbol(re3, Decl(arithmeticOperatorWithEnum.ts, 70, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var re4 = a << c; +>re4 : Symbol(re4, Decl(arithmeticOperatorWithEnum.ts, 71, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var re5 = b << c; +>re5 : Symbol(re5, Decl(arithmeticOperatorWithEnum.ts, 72, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var re6 = E.a << a; +>re6 : Symbol(re6, Decl(arithmeticOperatorWithEnum.ts, 73, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var re7 = E.a << b; +>re7 : Symbol(re7, Decl(arithmeticOperatorWithEnum.ts, 74, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var re8 = E.a << E.b; +>re8 : Symbol(re8, Decl(arithmeticOperatorWithEnum.ts, 75, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var re9 = E.a << 1; +>re9 : Symbol(re9, Decl(arithmeticOperatorWithEnum.ts, 76, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var re10 = a << E.b; +>re10 : Symbol(re10, Decl(arithmeticOperatorWithEnum.ts, 77, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var re11 = b << E.b; +>re11 : Symbol(re11, Decl(arithmeticOperatorWithEnum.ts, 78, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var re12 = 1 << E.b; +>re12 : Symbol(re12, Decl(arithmeticOperatorWithEnum.ts, 79, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator >> +var rf1 = c >> a; +>rf1 : Symbol(rf1, Decl(arithmeticOperatorWithEnum.ts, 82, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rf2 = c >> b; +>rf2 : Symbol(rf2, Decl(arithmeticOperatorWithEnum.ts, 83, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rf3 = c >> c; +>rf3 : Symbol(rf3, Decl(arithmeticOperatorWithEnum.ts, 84, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rf4 = a >> c; +>rf4 : Symbol(rf4, Decl(arithmeticOperatorWithEnum.ts, 85, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rf5 = b >> c; +>rf5 : Symbol(rf5, Decl(arithmeticOperatorWithEnum.ts, 86, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rf6 = E.a >> a; +>rf6 : Symbol(rf6, Decl(arithmeticOperatorWithEnum.ts, 87, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rf7 = E.a >> b; +>rf7 : Symbol(rf7, Decl(arithmeticOperatorWithEnum.ts, 88, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rf8 = E.a >> E.b; +>rf8 : Symbol(rf8, Decl(arithmeticOperatorWithEnum.ts, 89, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rf9 = E.a >> 1; +>rf9 : Symbol(rf9, Decl(arithmeticOperatorWithEnum.ts, 90, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rf10 = a >> E.b; +>rf10 : Symbol(rf10, Decl(arithmeticOperatorWithEnum.ts, 91, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rf11 = b >> E.b; +>rf11 : Symbol(rf11, Decl(arithmeticOperatorWithEnum.ts, 92, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rf12 = 1 >> E.b; +>rf12 : Symbol(rf12, Decl(arithmeticOperatorWithEnum.ts, 93, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator >>> +var rg1 = c >>> a; +>rg1 : Symbol(rg1, Decl(arithmeticOperatorWithEnum.ts, 96, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rg2 = c >>> b; +>rg2 : Symbol(rg2, Decl(arithmeticOperatorWithEnum.ts, 97, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rg3 = c >>> c; +>rg3 : Symbol(rg3, Decl(arithmeticOperatorWithEnum.ts, 98, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rg4 = a >>> c; +>rg4 : Symbol(rg4, Decl(arithmeticOperatorWithEnum.ts, 99, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rg5 = b >>> c; +>rg5 : Symbol(rg5, Decl(arithmeticOperatorWithEnum.ts, 100, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rg6 = E.a >>> a; +>rg6 : Symbol(rg6, Decl(arithmeticOperatorWithEnum.ts, 101, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rg7 = E.a >>> b; +>rg7 : Symbol(rg7, Decl(arithmeticOperatorWithEnum.ts, 102, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rg8 = E.a >>> E.b; +>rg8 : Symbol(rg8, Decl(arithmeticOperatorWithEnum.ts, 103, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rg9 = E.a >>> 1; +>rg9 : Symbol(rg9, Decl(arithmeticOperatorWithEnum.ts, 104, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rg10 = a >>> E.b; +>rg10 : Symbol(rg10, Decl(arithmeticOperatorWithEnum.ts, 105, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rg11 = b >>> E.b; +>rg11 : Symbol(rg11, Decl(arithmeticOperatorWithEnum.ts, 106, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rg12 = 1 >>> E.b; +>rg12 : Symbol(rg12, Decl(arithmeticOperatorWithEnum.ts, 107, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator & +var rh1 = c & a; +>rh1 : Symbol(rh1, Decl(arithmeticOperatorWithEnum.ts, 110, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rh2 = c & b; +>rh2 : Symbol(rh2, Decl(arithmeticOperatorWithEnum.ts, 111, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rh3 = c & c; +>rh3 : Symbol(rh3, Decl(arithmeticOperatorWithEnum.ts, 112, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rh4 = a & c; +>rh4 : Symbol(rh4, Decl(arithmeticOperatorWithEnum.ts, 113, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rh5 = b & c; +>rh5 : Symbol(rh5, Decl(arithmeticOperatorWithEnum.ts, 114, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rh6 = E.a & a; +>rh6 : Symbol(rh6, Decl(arithmeticOperatorWithEnum.ts, 115, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rh7 = E.a & b; +>rh7 : Symbol(rh7, Decl(arithmeticOperatorWithEnum.ts, 116, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rh8 = E.a & E.b; +>rh8 : Symbol(rh8, Decl(arithmeticOperatorWithEnum.ts, 117, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rh9 = E.a & 1; +>rh9 : Symbol(rh9, Decl(arithmeticOperatorWithEnum.ts, 118, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rh10 = a & E.b; +>rh10 : Symbol(rh10, Decl(arithmeticOperatorWithEnum.ts, 119, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rh11 = b & E.b; +>rh11 : Symbol(rh11, Decl(arithmeticOperatorWithEnum.ts, 120, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rh12 = 1 & E.b; +>rh12 : Symbol(rh12, Decl(arithmeticOperatorWithEnum.ts, 121, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator ^ +var ri1 = c ^ a; +>ri1 : Symbol(ri1, Decl(arithmeticOperatorWithEnum.ts, 124, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var ri2 = c ^ b; +>ri2 : Symbol(ri2, Decl(arithmeticOperatorWithEnum.ts, 125, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var ri3 = c ^ c; +>ri3 : Symbol(ri3, Decl(arithmeticOperatorWithEnum.ts, 126, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ri4 = a ^ c; +>ri4 : Symbol(ri4, Decl(arithmeticOperatorWithEnum.ts, 127, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ri5 = b ^ c; +>ri5 : Symbol(ri5, Decl(arithmeticOperatorWithEnum.ts, 128, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var ri6 = E.a ^ a; +>ri6 : Symbol(ri6, Decl(arithmeticOperatorWithEnum.ts, 129, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var ri7 = E.a ^ b; +>ri7 : Symbol(ri7, Decl(arithmeticOperatorWithEnum.ts, 130, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var ri8 = E.a ^ E.b; +>ri8 : Symbol(ri8, Decl(arithmeticOperatorWithEnum.ts, 131, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ri9 = E.a ^ 1; +>ri9 : Symbol(ri9, Decl(arithmeticOperatorWithEnum.ts, 132, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var ri10 = a ^ E.b; +>ri10 : Symbol(ri10, Decl(arithmeticOperatorWithEnum.ts, 133, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ri11 = b ^ E.b; +>ri11 : Symbol(ri11, Decl(arithmeticOperatorWithEnum.ts, 134, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var ri12 = 1 ^ E.b; +>ri12 : Symbol(ri12, Decl(arithmeticOperatorWithEnum.ts, 135, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +// operator | +var rj1 = c | a; +>rj1 : Symbol(rj1, Decl(arithmeticOperatorWithEnum.ts, 138, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rj2 = c | b; +>rj2 : Symbol(rj2, Decl(arithmeticOperatorWithEnum.ts, 139, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rj3 = c | c; +>rj3 : Symbol(rj3, Decl(arithmeticOperatorWithEnum.ts, 140, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rj4 = a | c; +>rj4 : Symbol(rj4, Decl(arithmeticOperatorWithEnum.ts, 141, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rj5 = b | c; +>rj5 : Symbol(rj5, Decl(arithmeticOperatorWithEnum.ts, 142, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnum.ts, 9, 3)) + +var rj6 = E.a | a; +>rj6 : Symbol(rj6, Decl(arithmeticOperatorWithEnum.ts, 143, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) + +var rj7 = E.a | b; +>rj7 : Symbol(rj7, Decl(arithmeticOperatorWithEnum.ts, 144, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) + +var rj8 = E.a | E.b; +>rj8 : Symbol(rj8, Decl(arithmeticOperatorWithEnum.ts, 145, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rj9 = E.a | 1; +>rj9 : Symbol(rj9, Decl(arithmeticOperatorWithEnum.ts, 146, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnum.ts, 2, 8)) + +var rj10 = a | E.b; +>rj10 : Symbol(rj10, Decl(arithmeticOperatorWithEnum.ts, 147, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnum.ts, 7, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rj11 = b | E.b; +>rj11 : Symbol(rj11, Decl(arithmeticOperatorWithEnum.ts, 148, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnum.ts, 8, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + +var rj12 = 1 | E.b; +>rj12 : Symbol(rj12, Decl(arithmeticOperatorWithEnum.ts, 149, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnum.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnum.ts, 3, 6)) + diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.types b/tests/baselines/reference/arithmeticOperatorWithEnum.types index 2f4ebce8f32..3aca5c31798 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnum.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.types @@ -84,6 +84,7 @@ var ra9 = E.a * 1; >E.a : E >E : typeof E >a : E +>1 : number var ra10 = a * E.b; >ra10 : number @@ -104,6 +105,7 @@ var ra11 = b * E.b; var ra12 = 1 * E.b; >ra12 : number >1 * E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -171,6 +173,7 @@ var rb9 = E.a / 1; >E.a : E >E : typeof E >a : E +>1 : number var rb10 = a / E.b; >rb10 : number @@ -191,6 +194,7 @@ var rb11 = b / E.b; var rb12 = 1 / E.b; >rb12 : number >1 / E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -258,6 +262,7 @@ var rc9 = E.a % 1; >E.a : E >E : typeof E >a : E +>1 : number var rc10 = a % E.b; >rc10 : number @@ -278,6 +283,7 @@ var rc11 = b % E.b; var rc12 = 1 % E.b; >rc12 : number >1 % E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -345,6 +351,7 @@ var rd9 = E.a - 1; >E.a : E >E : typeof E >a : E +>1 : number var rd10 = a - E.b; >rd10 : number @@ -365,6 +372,7 @@ var rd11 = b - E.b; var rd12 = 1 - E.b; >rd12 : number >1 - E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -432,6 +440,7 @@ var re9 = E.a << 1; >E.a : E >E : typeof E >a : E +>1 : number var re10 = a << E.b; >re10 : number @@ -452,6 +461,7 @@ var re11 = b << E.b; var re12 = 1 << E.b; >re12 : number >1 << E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -519,6 +529,7 @@ var rf9 = E.a >> 1; >E.a : E >E : typeof E >a : E +>1 : number var rf10 = a >> E.b; >rf10 : number @@ -539,6 +550,7 @@ var rf11 = b >> E.b; var rf12 = 1 >> E.b; >rf12 : number >1 >> E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -606,6 +618,7 @@ var rg9 = E.a >>> 1; >E.a : E >E : typeof E >a : E +>1 : number var rg10 = a >>> E.b; >rg10 : number @@ -626,6 +639,7 @@ var rg11 = b >>> E.b; var rg12 = 1 >>> E.b; >rg12 : number >1 >>> E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -693,6 +707,7 @@ var rh9 = E.a & 1; >E.a : E >E : typeof E >a : E +>1 : number var rh10 = a & E.b; >rh10 : number @@ -713,6 +728,7 @@ var rh11 = b & E.b; var rh12 = 1 & E.b; >rh12 : number >1 & E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -780,6 +796,7 @@ var ri9 = E.a ^ 1; >E.a : E >E : typeof E >a : E +>1 : number var ri10 = a ^ E.b; >ri10 : number @@ -800,6 +817,7 @@ var ri11 = b ^ E.b; var ri12 = 1 ^ E.b; >ri12 : number >1 ^ E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -867,6 +885,7 @@ var rj9 = E.a | 1; >E.a : E >E : typeof E >a : E +>1 : number var rj10 = a | E.b; >rj10 : number @@ -887,6 +906,7 @@ var rj11 = b | E.b; var rj12 = 1 | E.b; >rj12 : number >1 | E.b : number +>1 : number >E.b : E >E : typeof E >b : E diff --git a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.symbols b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.symbols new file mode 100644 index 00000000000..0fa9a5b8fe3 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.symbols @@ -0,0 +1,783 @@ +=== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithEnumUnion.ts === +// operands of an enum type are treated as having the primitive type Number. + +enum E { +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + + b +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +} +enum F { +>F : Symbol(F, Decl(arithmeticOperatorWithEnumUnion.ts, 5, 1)) + + c, +>c : Symbol(F.c, Decl(arithmeticOperatorWithEnumUnion.ts, 6, 8)) + + d +>d : Symbol(F.d, Decl(arithmeticOperatorWithEnumUnion.ts, 7, 6)) +} + +var a: any; +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var b: number; +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var c: E | F; +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>F : Symbol(F, Decl(arithmeticOperatorWithEnumUnion.ts, 5, 1)) + +// operator * +var ra1 = c * a; +>ra1 : Symbol(ra1, Decl(arithmeticOperatorWithEnumUnion.ts, 16, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var ra2 = c * b; +>ra2 : Symbol(ra2, Decl(arithmeticOperatorWithEnumUnion.ts, 17, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var ra3 = c * c; +>ra3 : Symbol(ra3, Decl(arithmeticOperatorWithEnumUnion.ts, 18, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ra4 = a * c; +>ra4 : Symbol(ra4, Decl(arithmeticOperatorWithEnumUnion.ts, 19, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ra5 = b * c; +>ra5 : Symbol(ra5, Decl(arithmeticOperatorWithEnumUnion.ts, 20, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ra6 = E.a * a; +>ra6 : Symbol(ra6, Decl(arithmeticOperatorWithEnumUnion.ts, 21, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var ra7 = E.a * b; +>ra7 : Symbol(ra7, Decl(arithmeticOperatorWithEnumUnion.ts, 22, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var ra8 = E.a * E.b; +>ra8 : Symbol(ra8, Decl(arithmeticOperatorWithEnumUnion.ts, 23, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ra9 = E.a * 1; +>ra9 : Symbol(ra9, Decl(arithmeticOperatorWithEnumUnion.ts, 24, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var ra10 = a * E.b; +>ra10 : Symbol(ra10, Decl(arithmeticOperatorWithEnumUnion.ts, 25, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ra11 = b * E.b; +>ra11 : Symbol(ra11, Decl(arithmeticOperatorWithEnumUnion.ts, 26, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ra12 = 1 * E.b; +>ra12 : Symbol(ra12, Decl(arithmeticOperatorWithEnumUnion.ts, 27, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator / +var rb1 = c / a; +>rb1 : Symbol(rb1, Decl(arithmeticOperatorWithEnumUnion.ts, 30, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rb2 = c / b; +>rb2 : Symbol(rb2, Decl(arithmeticOperatorWithEnumUnion.ts, 31, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rb3 = c / c; +>rb3 : Symbol(rb3, Decl(arithmeticOperatorWithEnumUnion.ts, 32, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rb4 = a / c; +>rb4 : Symbol(rb4, Decl(arithmeticOperatorWithEnumUnion.ts, 33, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rb5 = b / c; +>rb5 : Symbol(rb5, Decl(arithmeticOperatorWithEnumUnion.ts, 34, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rb6 = E.a / a; +>rb6 : Symbol(rb6, Decl(arithmeticOperatorWithEnumUnion.ts, 35, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rb7 = E.a / b; +>rb7 : Symbol(rb7, Decl(arithmeticOperatorWithEnumUnion.ts, 36, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rb8 = E.a / E.b; +>rb8 : Symbol(rb8, Decl(arithmeticOperatorWithEnumUnion.ts, 37, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rb9 = E.a / 1; +>rb9 : Symbol(rb9, Decl(arithmeticOperatorWithEnumUnion.ts, 38, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rb10 = a / E.b; +>rb10 : Symbol(rb10, Decl(arithmeticOperatorWithEnumUnion.ts, 39, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rb11 = b / E.b; +>rb11 : Symbol(rb11, Decl(arithmeticOperatorWithEnumUnion.ts, 40, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rb12 = 1 / E.b; +>rb12 : Symbol(rb12, Decl(arithmeticOperatorWithEnumUnion.ts, 41, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator % +var rc1 = c % a; +>rc1 : Symbol(rc1, Decl(arithmeticOperatorWithEnumUnion.ts, 44, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rc2 = c % b; +>rc2 : Symbol(rc2, Decl(arithmeticOperatorWithEnumUnion.ts, 45, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rc3 = c % c; +>rc3 : Symbol(rc3, Decl(arithmeticOperatorWithEnumUnion.ts, 46, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rc4 = a % c; +>rc4 : Symbol(rc4, Decl(arithmeticOperatorWithEnumUnion.ts, 47, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rc5 = b % c; +>rc5 : Symbol(rc5, Decl(arithmeticOperatorWithEnumUnion.ts, 48, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rc6 = E.a % a; +>rc6 : Symbol(rc6, Decl(arithmeticOperatorWithEnumUnion.ts, 49, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rc7 = E.a % b; +>rc7 : Symbol(rc7, Decl(arithmeticOperatorWithEnumUnion.ts, 50, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rc8 = E.a % E.b; +>rc8 : Symbol(rc8, Decl(arithmeticOperatorWithEnumUnion.ts, 51, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rc9 = E.a % 1; +>rc9 : Symbol(rc9, Decl(arithmeticOperatorWithEnumUnion.ts, 52, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rc10 = a % E.b; +>rc10 : Symbol(rc10, Decl(arithmeticOperatorWithEnumUnion.ts, 53, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rc11 = b % E.b; +>rc11 : Symbol(rc11, Decl(arithmeticOperatorWithEnumUnion.ts, 54, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rc12 = 1 % E.b; +>rc12 : Symbol(rc12, Decl(arithmeticOperatorWithEnumUnion.ts, 55, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator - +var rd1 = c - a; +>rd1 : Symbol(rd1, Decl(arithmeticOperatorWithEnumUnion.ts, 58, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rd2 = c - b; +>rd2 : Symbol(rd2, Decl(arithmeticOperatorWithEnumUnion.ts, 59, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rd3 = c - c; +>rd3 : Symbol(rd3, Decl(arithmeticOperatorWithEnumUnion.ts, 60, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rd4 = a - c; +>rd4 : Symbol(rd4, Decl(arithmeticOperatorWithEnumUnion.ts, 61, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rd5 = b - c; +>rd5 : Symbol(rd5, Decl(arithmeticOperatorWithEnumUnion.ts, 62, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rd6 = E.a - a; +>rd6 : Symbol(rd6, Decl(arithmeticOperatorWithEnumUnion.ts, 63, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rd7 = E.a - b; +>rd7 : Symbol(rd7, Decl(arithmeticOperatorWithEnumUnion.ts, 64, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rd8 = E.a - E.b; +>rd8 : Symbol(rd8, Decl(arithmeticOperatorWithEnumUnion.ts, 65, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rd9 = E.a - 1; +>rd9 : Symbol(rd9, Decl(arithmeticOperatorWithEnumUnion.ts, 66, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rd10 = a - E.b; +>rd10 : Symbol(rd10, Decl(arithmeticOperatorWithEnumUnion.ts, 67, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rd11 = b - E.b; +>rd11 : Symbol(rd11, Decl(arithmeticOperatorWithEnumUnion.ts, 68, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rd12 = 1 - E.b; +>rd12 : Symbol(rd12, Decl(arithmeticOperatorWithEnumUnion.ts, 69, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator << +var re1 = c << a; +>re1 : Symbol(re1, Decl(arithmeticOperatorWithEnumUnion.ts, 72, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var re2 = c << b; +>re2 : Symbol(re2, Decl(arithmeticOperatorWithEnumUnion.ts, 73, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var re3 = c << c; +>re3 : Symbol(re3, Decl(arithmeticOperatorWithEnumUnion.ts, 74, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var re4 = a << c; +>re4 : Symbol(re4, Decl(arithmeticOperatorWithEnumUnion.ts, 75, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var re5 = b << c; +>re5 : Symbol(re5, Decl(arithmeticOperatorWithEnumUnion.ts, 76, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var re6 = E.a << a; +>re6 : Symbol(re6, Decl(arithmeticOperatorWithEnumUnion.ts, 77, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var re7 = E.a << b; +>re7 : Symbol(re7, Decl(arithmeticOperatorWithEnumUnion.ts, 78, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var re8 = E.a << E.b; +>re8 : Symbol(re8, Decl(arithmeticOperatorWithEnumUnion.ts, 79, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var re9 = E.a << 1; +>re9 : Symbol(re9, Decl(arithmeticOperatorWithEnumUnion.ts, 80, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var re10 = a << E.b; +>re10 : Symbol(re10, Decl(arithmeticOperatorWithEnumUnion.ts, 81, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var re11 = b << E.b; +>re11 : Symbol(re11, Decl(arithmeticOperatorWithEnumUnion.ts, 82, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var re12 = 1 << E.b; +>re12 : Symbol(re12, Decl(arithmeticOperatorWithEnumUnion.ts, 83, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator >> +var rf1 = c >> a; +>rf1 : Symbol(rf1, Decl(arithmeticOperatorWithEnumUnion.ts, 86, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rf2 = c >> b; +>rf2 : Symbol(rf2, Decl(arithmeticOperatorWithEnumUnion.ts, 87, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rf3 = c >> c; +>rf3 : Symbol(rf3, Decl(arithmeticOperatorWithEnumUnion.ts, 88, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rf4 = a >> c; +>rf4 : Symbol(rf4, Decl(arithmeticOperatorWithEnumUnion.ts, 89, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rf5 = b >> c; +>rf5 : Symbol(rf5, Decl(arithmeticOperatorWithEnumUnion.ts, 90, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rf6 = E.a >> a; +>rf6 : Symbol(rf6, Decl(arithmeticOperatorWithEnumUnion.ts, 91, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rf7 = E.a >> b; +>rf7 : Symbol(rf7, Decl(arithmeticOperatorWithEnumUnion.ts, 92, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rf8 = E.a >> E.b; +>rf8 : Symbol(rf8, Decl(arithmeticOperatorWithEnumUnion.ts, 93, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rf9 = E.a >> 1; +>rf9 : Symbol(rf9, Decl(arithmeticOperatorWithEnumUnion.ts, 94, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rf10 = a >> E.b; +>rf10 : Symbol(rf10, Decl(arithmeticOperatorWithEnumUnion.ts, 95, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rf11 = b >> E.b; +>rf11 : Symbol(rf11, Decl(arithmeticOperatorWithEnumUnion.ts, 96, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rf12 = 1 >> E.b; +>rf12 : Symbol(rf12, Decl(arithmeticOperatorWithEnumUnion.ts, 97, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator >>> +var rg1 = c >>> a; +>rg1 : Symbol(rg1, Decl(arithmeticOperatorWithEnumUnion.ts, 100, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rg2 = c >>> b; +>rg2 : Symbol(rg2, Decl(arithmeticOperatorWithEnumUnion.ts, 101, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rg3 = c >>> c; +>rg3 : Symbol(rg3, Decl(arithmeticOperatorWithEnumUnion.ts, 102, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rg4 = a >>> c; +>rg4 : Symbol(rg4, Decl(arithmeticOperatorWithEnumUnion.ts, 103, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rg5 = b >>> c; +>rg5 : Symbol(rg5, Decl(arithmeticOperatorWithEnumUnion.ts, 104, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rg6 = E.a >>> a; +>rg6 : Symbol(rg6, Decl(arithmeticOperatorWithEnumUnion.ts, 105, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rg7 = E.a >>> b; +>rg7 : Symbol(rg7, Decl(arithmeticOperatorWithEnumUnion.ts, 106, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rg8 = E.a >>> E.b; +>rg8 : Symbol(rg8, Decl(arithmeticOperatorWithEnumUnion.ts, 107, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rg9 = E.a >>> 1; +>rg9 : Symbol(rg9, Decl(arithmeticOperatorWithEnumUnion.ts, 108, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rg10 = a >>> E.b; +>rg10 : Symbol(rg10, Decl(arithmeticOperatorWithEnumUnion.ts, 109, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rg11 = b >>> E.b; +>rg11 : Symbol(rg11, Decl(arithmeticOperatorWithEnumUnion.ts, 110, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rg12 = 1 >>> E.b; +>rg12 : Symbol(rg12, Decl(arithmeticOperatorWithEnumUnion.ts, 111, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator & +var rh1 = c & a; +>rh1 : Symbol(rh1, Decl(arithmeticOperatorWithEnumUnion.ts, 114, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rh2 = c & b; +>rh2 : Symbol(rh2, Decl(arithmeticOperatorWithEnumUnion.ts, 115, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rh3 = c & c; +>rh3 : Symbol(rh3, Decl(arithmeticOperatorWithEnumUnion.ts, 116, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rh4 = a & c; +>rh4 : Symbol(rh4, Decl(arithmeticOperatorWithEnumUnion.ts, 117, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rh5 = b & c; +>rh5 : Symbol(rh5, Decl(arithmeticOperatorWithEnumUnion.ts, 118, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rh6 = E.a & a; +>rh6 : Symbol(rh6, Decl(arithmeticOperatorWithEnumUnion.ts, 119, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rh7 = E.a & b; +>rh7 : Symbol(rh7, Decl(arithmeticOperatorWithEnumUnion.ts, 120, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rh8 = E.a & E.b; +>rh8 : Symbol(rh8, Decl(arithmeticOperatorWithEnumUnion.ts, 121, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rh9 = E.a & 1; +>rh9 : Symbol(rh9, Decl(arithmeticOperatorWithEnumUnion.ts, 122, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rh10 = a & E.b; +>rh10 : Symbol(rh10, Decl(arithmeticOperatorWithEnumUnion.ts, 123, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rh11 = b & E.b; +>rh11 : Symbol(rh11, Decl(arithmeticOperatorWithEnumUnion.ts, 124, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rh12 = 1 & E.b; +>rh12 : Symbol(rh12, Decl(arithmeticOperatorWithEnumUnion.ts, 125, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator ^ +var ri1 = c ^ a; +>ri1 : Symbol(ri1, Decl(arithmeticOperatorWithEnumUnion.ts, 128, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var ri2 = c ^ b; +>ri2 : Symbol(ri2, Decl(arithmeticOperatorWithEnumUnion.ts, 129, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var ri3 = c ^ c; +>ri3 : Symbol(ri3, Decl(arithmeticOperatorWithEnumUnion.ts, 130, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ri4 = a ^ c; +>ri4 : Symbol(ri4, Decl(arithmeticOperatorWithEnumUnion.ts, 131, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ri5 = b ^ c; +>ri5 : Symbol(ri5, Decl(arithmeticOperatorWithEnumUnion.ts, 132, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var ri6 = E.a ^ a; +>ri6 : Symbol(ri6, Decl(arithmeticOperatorWithEnumUnion.ts, 133, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var ri7 = E.a ^ b; +>ri7 : Symbol(ri7, Decl(arithmeticOperatorWithEnumUnion.ts, 134, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var ri8 = E.a ^ E.b; +>ri8 : Symbol(ri8, Decl(arithmeticOperatorWithEnumUnion.ts, 135, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ri9 = E.a ^ 1; +>ri9 : Symbol(ri9, Decl(arithmeticOperatorWithEnumUnion.ts, 136, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var ri10 = a ^ E.b; +>ri10 : Symbol(ri10, Decl(arithmeticOperatorWithEnumUnion.ts, 137, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ri11 = b ^ E.b; +>ri11 : Symbol(ri11, Decl(arithmeticOperatorWithEnumUnion.ts, 138, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var ri12 = 1 ^ E.b; +>ri12 : Symbol(ri12, Decl(arithmeticOperatorWithEnumUnion.ts, 139, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +// operator | +var rj1 = c | a; +>rj1 : Symbol(rj1, Decl(arithmeticOperatorWithEnumUnion.ts, 142, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rj2 = c | b; +>rj2 : Symbol(rj2, Decl(arithmeticOperatorWithEnumUnion.ts, 143, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rj3 = c | c; +>rj3 : Symbol(rj3, Decl(arithmeticOperatorWithEnumUnion.ts, 144, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rj4 = a | c; +>rj4 : Symbol(rj4, Decl(arithmeticOperatorWithEnumUnion.ts, 145, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rj5 = b | c; +>rj5 : Symbol(rj5, Decl(arithmeticOperatorWithEnumUnion.ts, 146, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>c : Symbol(c, Decl(arithmeticOperatorWithEnumUnion.ts, 13, 3)) + +var rj6 = E.a | a; +>rj6 : Symbol(rj6, Decl(arithmeticOperatorWithEnumUnion.ts, 147, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) + +var rj7 = E.a | b; +>rj7 : Symbol(rj7, Decl(arithmeticOperatorWithEnumUnion.ts, 148, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) + +var rj8 = E.a | E.b; +>rj8 : Symbol(rj8, Decl(arithmeticOperatorWithEnumUnion.ts, 149, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rj9 = E.a | 1; +>rj9 : Symbol(rj9, Decl(arithmeticOperatorWithEnumUnion.ts, 150, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithEnumUnion.ts, 2, 8)) + +var rj10 = a | E.b; +>rj10 : Symbol(rj10, Decl(arithmeticOperatorWithEnumUnion.ts, 151, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithEnumUnion.ts, 11, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rj11 = b | E.b; +>rj11 : Symbol(rj11, Decl(arithmeticOperatorWithEnumUnion.ts, 152, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithEnumUnion.ts, 12, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + +var rj12 = 1 | E.b; +>rj12 : Symbol(rj12, Decl(arithmeticOperatorWithEnumUnion.ts, 153, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithEnumUnion.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithEnumUnion.ts, 3, 6)) + diff --git a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types index 7b65ddf7f00..cb9bf3d45b0 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types @@ -94,6 +94,7 @@ var ra9 = E.a * 1; >E.a : E >E : typeof E >a : E +>1 : number var ra10 = a * E.b; >ra10 : number @@ -114,6 +115,7 @@ var ra11 = b * E.b; var ra12 = 1 * E.b; >ra12 : number >1 * E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -181,6 +183,7 @@ var rb9 = E.a / 1; >E.a : E >E : typeof E >a : E +>1 : number var rb10 = a / E.b; >rb10 : number @@ -201,6 +204,7 @@ var rb11 = b / E.b; var rb12 = 1 / E.b; >rb12 : number >1 / E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -268,6 +272,7 @@ var rc9 = E.a % 1; >E.a : E >E : typeof E >a : E +>1 : number var rc10 = a % E.b; >rc10 : number @@ -288,6 +293,7 @@ var rc11 = b % E.b; var rc12 = 1 % E.b; >rc12 : number >1 % E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -355,6 +361,7 @@ var rd9 = E.a - 1; >E.a : E >E : typeof E >a : E +>1 : number var rd10 = a - E.b; >rd10 : number @@ -375,6 +382,7 @@ var rd11 = b - E.b; var rd12 = 1 - E.b; >rd12 : number >1 - E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -442,6 +450,7 @@ var re9 = E.a << 1; >E.a : E >E : typeof E >a : E +>1 : number var re10 = a << E.b; >re10 : number @@ -462,6 +471,7 @@ var re11 = b << E.b; var re12 = 1 << E.b; >re12 : number >1 << E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -529,6 +539,7 @@ var rf9 = E.a >> 1; >E.a : E >E : typeof E >a : E +>1 : number var rf10 = a >> E.b; >rf10 : number @@ -549,6 +560,7 @@ var rf11 = b >> E.b; var rf12 = 1 >> E.b; >rf12 : number >1 >> E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -616,6 +628,7 @@ var rg9 = E.a >>> 1; >E.a : E >E : typeof E >a : E +>1 : number var rg10 = a >>> E.b; >rg10 : number @@ -636,6 +649,7 @@ var rg11 = b >>> E.b; var rg12 = 1 >>> E.b; >rg12 : number >1 >>> E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -703,6 +717,7 @@ var rh9 = E.a & 1; >E.a : E >E : typeof E >a : E +>1 : number var rh10 = a & E.b; >rh10 : number @@ -723,6 +738,7 @@ var rh11 = b & E.b; var rh12 = 1 & E.b; >rh12 : number >1 & E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -790,6 +806,7 @@ var ri9 = E.a ^ 1; >E.a : E >E : typeof E >a : E +>1 : number var ri10 = a ^ E.b; >ri10 : number @@ -810,6 +827,7 @@ var ri11 = b ^ E.b; var ri12 = 1 ^ E.b; >ri12 : number >1 ^ E.b : number +>1 : number >E.b : E >E : typeof E >b : E @@ -877,6 +895,7 @@ var rj9 = E.a | 1; >E.a : E >E : typeof E >a : E +>1 : number var rj10 = a | E.b; >rj10 : number @@ -897,6 +916,7 @@ var rj11 = b | E.b; var rj12 = 1 | E.b; >rj12 : number >1 | E.b : number +>1 : number >E.b : E >E : typeof E >b : E diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.symbols b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.symbols new file mode 100644 index 00000000000..fe7e683bb8c --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.symbols @@ -0,0 +1,370 @@ +=== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndValidOperands.ts === +// If one operand is the null or undefined value, it is treated as having the type of the +// other operand. + +enum E { +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + + b +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +} + +var a: any; +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var b: number; +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +// operator * +var ra1 = null * a; +>ra1 : Symbol(ra1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 12, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var ra2 = null * b; +>ra2 : Symbol(ra2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 13, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var ra3 = null * 1; +>ra3 : Symbol(ra3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 14, 3)) + +var ra4 = null * E.a; +>ra4 : Symbol(ra4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 15, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var ra5 = a * null; +>ra5 : Symbol(ra5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 16, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var ra6 = b * null; +>ra6 : Symbol(ra6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 17, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var ra7 = 0 * null; +>ra7 : Symbol(ra7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 18, 3)) + +var ra8 = E.b * null; +>ra8 : Symbol(ra8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 19, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator / +var rb1 = null / a; +>rb1 : Symbol(rb1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 22, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rb2 = null / b; +>rb2 : Symbol(rb2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 23, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rb3 = null / 1; +>rb3 : Symbol(rb3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 24, 3)) + +var rb4 = null / E.a; +>rb4 : Symbol(rb4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 25, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rb5 = a / null; +>rb5 : Symbol(rb5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 26, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rb6 = b / null; +>rb6 : Symbol(rb6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 27, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rb7 = 0 / null; +>rb7 : Symbol(rb7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 28, 3)) + +var rb8 = E.b / null; +>rb8 : Symbol(rb8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 29, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator % +var rc1 = null % a; +>rc1 : Symbol(rc1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 32, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rc2 = null % b; +>rc2 : Symbol(rc2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 33, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rc3 = null % 1; +>rc3 : Symbol(rc3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 34, 3)) + +var rc4 = null % E.a; +>rc4 : Symbol(rc4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 35, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rc5 = a % null; +>rc5 : Symbol(rc5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 36, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rc6 = b % null; +>rc6 : Symbol(rc6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 37, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rc7 = 0 % null; +>rc7 : Symbol(rc7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 38, 3)) + +var rc8 = E.b % null; +>rc8 : Symbol(rc8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 39, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator - +var rd1 = null - a; +>rd1 : Symbol(rd1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 42, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rd2 = null - b; +>rd2 : Symbol(rd2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 43, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rd3 = null - 1; +>rd3 : Symbol(rd3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 44, 3)) + +var rd4 = null - E.a; +>rd4 : Symbol(rd4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 45, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rd5 = a - null; +>rd5 : Symbol(rd5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 46, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rd6 = b - null; +>rd6 : Symbol(rd6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 47, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rd7 = 0 - null; +>rd7 : Symbol(rd7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 48, 3)) + +var rd8 = E.b - null; +>rd8 : Symbol(rd8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 49, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator << +var re1 = null << a; +>re1 : Symbol(re1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 52, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var re2 = null << b; +>re2 : Symbol(re2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 53, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var re3 = null << 1; +>re3 : Symbol(re3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 54, 3)) + +var re4 = null << E.a; +>re4 : Symbol(re4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 55, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var re5 = a << null; +>re5 : Symbol(re5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 56, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var re6 = b << null; +>re6 : Symbol(re6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 57, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var re7 = 0 << null; +>re7 : Symbol(re7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 58, 3)) + +var re8 = E.b << null; +>re8 : Symbol(re8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 59, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator >> +var rf1 = null >> a; +>rf1 : Symbol(rf1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 62, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rf2 = null >> b; +>rf2 : Symbol(rf2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 63, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rf3 = null >> 1; +>rf3 : Symbol(rf3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 64, 3)) + +var rf4 = null >> E.a; +>rf4 : Symbol(rf4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 65, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rf5 = a >> null; +>rf5 : Symbol(rf5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 66, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rf6 = b >> null; +>rf6 : Symbol(rf6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 67, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rf7 = 0 >> null; +>rf7 : Symbol(rf7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 68, 3)) + +var rf8 = E.b >> null; +>rf8 : Symbol(rf8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 69, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator >>> +var rg1 = null >>> a; +>rg1 : Symbol(rg1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 72, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rg2 = null >>> b; +>rg2 : Symbol(rg2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 73, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rg3 = null >>> 1; +>rg3 : Symbol(rg3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 74, 3)) + +var rg4 = null >>> E.a; +>rg4 : Symbol(rg4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 75, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rg5 = a >>> null; +>rg5 : Symbol(rg5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 76, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rg6 = b >>> null; +>rg6 : Symbol(rg6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 77, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rg7 = 0 >>> null; +>rg7 : Symbol(rg7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 78, 3)) + +var rg8 = E.b >>> null; +>rg8 : Symbol(rg8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 79, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator & +var rh1 = null & a; +>rh1 : Symbol(rh1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 82, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rh2 = null & b; +>rh2 : Symbol(rh2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 83, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rh3 = null & 1; +>rh3 : Symbol(rh3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 84, 3)) + +var rh4 = null & E.a; +>rh4 : Symbol(rh4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 85, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rh5 = a & null; +>rh5 : Symbol(rh5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 86, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rh6 = b & null; +>rh6 : Symbol(rh6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 87, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rh7 = 0 & null; +>rh7 : Symbol(rh7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 88, 3)) + +var rh8 = E.b & null; +>rh8 : Symbol(rh8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 89, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator ^ +var ri1 = null ^ a; +>ri1 : Symbol(ri1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 92, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var ri2 = null ^ b; +>ri2 : Symbol(ri2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 93, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var ri3 = null ^ 1; +>ri3 : Symbol(ri3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 94, 3)) + +var ri4 = null ^ E.a; +>ri4 : Symbol(ri4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 95, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var ri5 = a ^ null; +>ri5 : Symbol(ri5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 96, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var ri6 = b ^ null; +>ri6 : Symbol(ri6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 97, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var ri7 = 0 ^ null; +>ri7 : Symbol(ri7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 98, 3)) + +var ri8 = E.b ^ null; +>ri8 : Symbol(ri8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 99, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + +// operator | +var rj1 = null | a; +>rj1 : Symbol(rj1, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 102, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rj2 = null | b; +>rj2 : Symbol(rj2, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 103, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rj3 = null | 1; +>rj3 : Symbol(rj3, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 104, 3)) + +var rj4 = null | E.a; +>rj4 : Symbol(rj4, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 105, 3)) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 3, 8)) + +var rj5 = a | null; +>rj5 : Symbol(rj5, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 106, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 8, 3)) + +var rj6 = b | null; +>rj6 : Symbol(rj6, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 107, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 9, 3)) + +var rj7 = 0 | null; +>rj7 : Symbol(rj7, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 108, 3)) + +var rj8 = E.b | null; +>rj8 : Symbol(rj8, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 109, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithNullValueAndValidOperands.ts, 4, 6)) + diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types index 711ccd0c66c..521fb4d7313 100644 --- a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.types @@ -22,20 +22,25 @@ var b: number; var ra1 = null * a; >ra1 : number >null * a : number +>null : null >a : any var ra2 = null * b; >ra2 : number >null * b : number +>null : null >b : number var ra3 = null * 1; >ra3 : number >null * 1 : number +>null : null +>1 : number var ra4 = null * E.a; >ra4 : number >null * E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -44,15 +49,19 @@ var ra5 = a * null; >ra5 : number >a * null : number >a : any +>null : null var ra6 = b * null; >ra6 : number >b * null : number >b : number +>null : null var ra7 = 0 * null; >ra7 : number >0 * null : number +>0 : number +>null : null var ra8 = E.b * null; >ra8 : number @@ -60,25 +69,31 @@ var ra8 = E.b * null; >E.b : E >E : typeof E >b : E +>null : null // operator / var rb1 = null / a; >rb1 : number >null / a : number +>null : null >a : any var rb2 = null / b; >rb2 : number >null / b : number +>null : null >b : number var rb3 = null / 1; >rb3 : number >null / 1 : number +>null : null +>1 : number var rb4 = null / E.a; >rb4 : number >null / E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -87,15 +102,19 @@ var rb5 = a / null; >rb5 : number >a / null : number >a : any +>null : null var rb6 = b / null; >rb6 : number >b / null : number >b : number +>null : null var rb7 = 0 / null; >rb7 : number >0 / null : number +>0 : number +>null : null var rb8 = E.b / null; >rb8 : number @@ -103,25 +122,31 @@ var rb8 = E.b / null; >E.b : E >E : typeof E >b : E +>null : null // operator % var rc1 = null % a; >rc1 : number >null % a : number +>null : null >a : any var rc2 = null % b; >rc2 : number >null % b : number +>null : null >b : number var rc3 = null % 1; >rc3 : number >null % 1 : number +>null : null +>1 : number var rc4 = null % E.a; >rc4 : number >null % E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -130,15 +155,19 @@ var rc5 = a % null; >rc5 : number >a % null : number >a : any +>null : null var rc6 = b % null; >rc6 : number >b % null : number >b : number +>null : null var rc7 = 0 % null; >rc7 : number >0 % null : number +>0 : number +>null : null var rc8 = E.b % null; >rc8 : number @@ -146,25 +175,31 @@ var rc8 = E.b % null; >E.b : E >E : typeof E >b : E +>null : null // operator - var rd1 = null - a; >rd1 : number >null - a : number +>null : null >a : any var rd2 = null - b; >rd2 : number >null - b : number +>null : null >b : number var rd3 = null - 1; >rd3 : number >null - 1 : number +>null : null +>1 : number var rd4 = null - E.a; >rd4 : number >null - E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -173,15 +208,19 @@ var rd5 = a - null; >rd5 : number >a - null : number >a : any +>null : null var rd6 = b - null; >rd6 : number >b - null : number >b : number +>null : null var rd7 = 0 - null; >rd7 : number >0 - null : number +>0 : number +>null : null var rd8 = E.b - null; >rd8 : number @@ -189,25 +228,31 @@ var rd8 = E.b - null; >E.b : E >E : typeof E >b : E +>null : null // operator << var re1 = null << a; >re1 : number >null << a : number +>null : null >a : any var re2 = null << b; >re2 : number >null << b : number +>null : null >b : number var re3 = null << 1; >re3 : number >null << 1 : number +>null : null +>1 : number var re4 = null << E.a; >re4 : number >null << E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -216,15 +261,19 @@ var re5 = a << null; >re5 : number >a << null : number >a : any +>null : null var re6 = b << null; >re6 : number >b << null : number >b : number +>null : null var re7 = 0 << null; >re7 : number >0 << null : number +>0 : number +>null : null var re8 = E.b << null; >re8 : number @@ -232,25 +281,31 @@ var re8 = E.b << null; >E.b : E >E : typeof E >b : E +>null : null // operator >> var rf1 = null >> a; >rf1 : number >null >> a : number +>null : null >a : any var rf2 = null >> b; >rf2 : number >null >> b : number +>null : null >b : number var rf3 = null >> 1; >rf3 : number >null >> 1 : number +>null : null +>1 : number var rf4 = null >> E.a; >rf4 : number >null >> E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -259,15 +314,19 @@ var rf5 = a >> null; >rf5 : number >a >> null : number >a : any +>null : null var rf6 = b >> null; >rf6 : number >b >> null : number >b : number +>null : null var rf7 = 0 >> null; >rf7 : number >0 >> null : number +>0 : number +>null : null var rf8 = E.b >> null; >rf8 : number @@ -275,25 +334,31 @@ var rf8 = E.b >> null; >E.b : E >E : typeof E >b : E +>null : null // operator >>> var rg1 = null >>> a; >rg1 : number >null >>> a : number +>null : null >a : any var rg2 = null >>> b; >rg2 : number >null >>> b : number +>null : null >b : number var rg3 = null >>> 1; >rg3 : number >null >>> 1 : number +>null : null +>1 : number var rg4 = null >>> E.a; >rg4 : number >null >>> E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -302,15 +367,19 @@ var rg5 = a >>> null; >rg5 : number >a >>> null : number >a : any +>null : null var rg6 = b >>> null; >rg6 : number >b >>> null : number >b : number +>null : null var rg7 = 0 >>> null; >rg7 : number >0 >>> null : number +>0 : number +>null : null var rg8 = E.b >>> null; >rg8 : number @@ -318,25 +387,31 @@ var rg8 = E.b >>> null; >E.b : E >E : typeof E >b : E +>null : null // operator & var rh1 = null & a; >rh1 : number >null & a : number +>null : null >a : any var rh2 = null & b; >rh2 : number >null & b : number +>null : null >b : number var rh3 = null & 1; >rh3 : number >null & 1 : number +>null : null +>1 : number var rh4 = null & E.a; >rh4 : number >null & E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -345,15 +420,19 @@ var rh5 = a & null; >rh5 : number >a & null : number >a : any +>null : null var rh6 = b & null; >rh6 : number >b & null : number >b : number +>null : null var rh7 = 0 & null; >rh7 : number >0 & null : number +>0 : number +>null : null var rh8 = E.b & null; >rh8 : number @@ -361,25 +440,31 @@ var rh8 = E.b & null; >E.b : E >E : typeof E >b : E +>null : null // operator ^ var ri1 = null ^ a; >ri1 : number >null ^ a : number +>null : null >a : any var ri2 = null ^ b; >ri2 : number >null ^ b : number +>null : null >b : number var ri3 = null ^ 1; >ri3 : number >null ^ 1 : number +>null : null +>1 : number var ri4 = null ^ E.a; >ri4 : number >null ^ E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -388,15 +473,19 @@ var ri5 = a ^ null; >ri5 : number >a ^ null : number >a : any +>null : null var ri6 = b ^ null; >ri6 : number >b ^ null : number >b : number +>null : null var ri7 = 0 ^ null; >ri7 : number >0 ^ null : number +>0 : number +>null : null var ri8 = E.b ^ null; >ri8 : number @@ -404,25 +493,31 @@ var ri8 = E.b ^ null; >E.b : E >E : typeof E >b : E +>null : null // operator | var rj1 = null | a; >rj1 : number >null | a : number +>null : null >a : any var rj2 = null | b; >rj2 : number >null | b : number +>null : null >b : number var rj3 = null | 1; >rj3 : number >null | 1 : number +>null : null +>1 : number var rj4 = null | E.a; >rj4 : number >null | E.a : number +>null : null >E.a : E >E : typeof E >a : E @@ -431,15 +526,19 @@ var rj5 = a | null; >rj5 : number >a | null : number >a : any +>null : null var rj6 = b | null; >rj6 : number >b | null : number >b : number +>null : null var rj7 = 0 | null; >rj7 : number >0 | null : number +>0 : number +>null : null var rj8 = E.b | null; >rj8 : number @@ -447,4 +546,5 @@ var rj8 = E.b | null; >E.b : E >E : typeof E >b : E +>null : null diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.symbols b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.symbols new file mode 100644 index 00000000000..5ba1d7f9728 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.symbols @@ -0,0 +1,450 @@ +=== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndValidOperands.ts === +// If one operand is the undefined or undefined value, it is treated as having the type of the +// other operand. + +enum E { +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) + + a, +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + + b +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +} + +var a: any; +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var b: number; +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +// operator * +var ra1 = undefined * a; +>ra1 : Symbol(ra1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 12, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var ra2 = undefined * b; +>ra2 : Symbol(ra2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 13, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var ra3 = undefined * 1; +>ra3 : Symbol(ra3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 14, 3)) +>undefined : Symbol(undefined) + +var ra4 = undefined * E.a; +>ra4 : Symbol(ra4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 15, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var ra5 = a * undefined; +>ra5 : Symbol(ra5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 16, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var ra6 = b * undefined; +>ra6 : Symbol(ra6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 17, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var ra7 = 0 * undefined; +>ra7 : Symbol(ra7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 18, 3)) +>undefined : Symbol(undefined) + +var ra8 = E.b * undefined; +>ra8 : Symbol(ra8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 19, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator / +var rb1 = undefined / a; +>rb1 : Symbol(rb1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 22, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rb2 = undefined / b; +>rb2 : Symbol(rb2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 23, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rb3 = undefined / 1; +>rb3 : Symbol(rb3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 24, 3)) +>undefined : Symbol(undefined) + +var rb4 = undefined / E.a; +>rb4 : Symbol(rb4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 25, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rb5 = a / undefined; +>rb5 : Symbol(rb5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 26, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rb6 = b / undefined; +>rb6 : Symbol(rb6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 27, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rb7 = 0 / undefined; +>rb7 : Symbol(rb7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 28, 3)) +>undefined : Symbol(undefined) + +var rb8 = E.b / undefined; +>rb8 : Symbol(rb8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 29, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator % +var rc1 = undefined % a; +>rc1 : Symbol(rc1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 32, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rc2 = undefined % b; +>rc2 : Symbol(rc2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 33, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rc3 = undefined % 1; +>rc3 : Symbol(rc3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 34, 3)) +>undefined : Symbol(undefined) + +var rc4 = undefined % E.a; +>rc4 : Symbol(rc4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 35, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rc5 = a % undefined; +>rc5 : Symbol(rc5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 36, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rc6 = b % undefined; +>rc6 : Symbol(rc6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 37, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rc7 = 0 % undefined; +>rc7 : Symbol(rc7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 38, 3)) +>undefined : Symbol(undefined) + +var rc8 = E.b % undefined; +>rc8 : Symbol(rc8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 39, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator - +var rd1 = undefined - a; +>rd1 : Symbol(rd1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 42, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rd2 = undefined - b; +>rd2 : Symbol(rd2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 43, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rd3 = undefined - 1; +>rd3 : Symbol(rd3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 44, 3)) +>undefined : Symbol(undefined) + +var rd4 = undefined - E.a; +>rd4 : Symbol(rd4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 45, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rd5 = a - undefined; +>rd5 : Symbol(rd5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 46, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rd6 = b - undefined; +>rd6 : Symbol(rd6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 47, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rd7 = 0 - undefined; +>rd7 : Symbol(rd7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 48, 3)) +>undefined : Symbol(undefined) + +var rd8 = E.b - undefined; +>rd8 : Symbol(rd8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 49, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator << +var re1 = undefined << a; +>re1 : Symbol(re1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 52, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var re2 = undefined << b; +>re2 : Symbol(re2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 53, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var re3 = undefined << 1; +>re3 : Symbol(re3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 54, 3)) +>undefined : Symbol(undefined) + +var re4 = undefined << E.a; +>re4 : Symbol(re4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 55, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var re5 = a << undefined; +>re5 : Symbol(re5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 56, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var re6 = b << undefined; +>re6 : Symbol(re6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 57, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var re7 = 0 << undefined; +>re7 : Symbol(re7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 58, 3)) +>undefined : Symbol(undefined) + +var re8 = E.b << undefined; +>re8 : Symbol(re8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 59, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator >> +var rf1 = undefined >> a; +>rf1 : Symbol(rf1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 62, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rf2 = undefined >> b; +>rf2 : Symbol(rf2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 63, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rf3 = undefined >> 1; +>rf3 : Symbol(rf3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 64, 3)) +>undefined : Symbol(undefined) + +var rf4 = undefined >> E.a; +>rf4 : Symbol(rf4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 65, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rf5 = a >> undefined; +>rf5 : Symbol(rf5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 66, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rf6 = b >> undefined; +>rf6 : Symbol(rf6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 67, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rf7 = 0 >> undefined; +>rf7 : Symbol(rf7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 68, 3)) +>undefined : Symbol(undefined) + +var rf8 = E.b >> undefined; +>rf8 : Symbol(rf8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 69, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator >>> +var rg1 = undefined >>> a; +>rg1 : Symbol(rg1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 72, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rg2 = undefined >>> b; +>rg2 : Symbol(rg2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 73, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rg3 = undefined >>> 1; +>rg3 : Symbol(rg3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 74, 3)) +>undefined : Symbol(undefined) + +var rg4 = undefined >>> E.a; +>rg4 : Symbol(rg4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 75, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rg5 = a >>> undefined; +>rg5 : Symbol(rg5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 76, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rg6 = b >>> undefined; +>rg6 : Symbol(rg6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 77, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rg7 = 0 >>> undefined; +>rg7 : Symbol(rg7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 78, 3)) +>undefined : Symbol(undefined) + +var rg8 = E.b >>> undefined; +>rg8 : Symbol(rg8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 79, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator & +var rh1 = undefined & a; +>rh1 : Symbol(rh1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 82, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rh2 = undefined & b; +>rh2 : Symbol(rh2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 83, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rh3 = undefined & 1; +>rh3 : Symbol(rh3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 84, 3)) +>undefined : Symbol(undefined) + +var rh4 = undefined & E.a; +>rh4 : Symbol(rh4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 85, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rh5 = a & undefined; +>rh5 : Symbol(rh5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 86, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rh6 = b & undefined; +>rh6 : Symbol(rh6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 87, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rh7 = 0 & undefined; +>rh7 : Symbol(rh7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 88, 3)) +>undefined : Symbol(undefined) + +var rh8 = E.b & undefined; +>rh8 : Symbol(rh8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 89, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator ^ +var ri1 = undefined ^ a; +>ri1 : Symbol(ri1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 92, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var ri2 = undefined ^ b; +>ri2 : Symbol(ri2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 93, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var ri3 = undefined ^ 1; +>ri3 : Symbol(ri3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 94, 3)) +>undefined : Symbol(undefined) + +var ri4 = undefined ^ E.a; +>ri4 : Symbol(ri4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 95, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var ri5 = a ^ undefined; +>ri5 : Symbol(ri5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 96, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var ri6 = b ^ undefined; +>ri6 : Symbol(ri6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 97, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var ri7 = 0 ^ undefined; +>ri7 : Symbol(ri7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 98, 3)) +>undefined : Symbol(undefined) + +var ri8 = E.b ^ undefined; +>ri8 : Symbol(ri8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 99, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + +// operator | +var rj1 = undefined | a; +>rj1 : Symbol(rj1, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 102, 3)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) + +var rj2 = undefined | b; +>rj2 : Symbol(rj2, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 103, 3)) +>undefined : Symbol(undefined) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) + +var rj3 = undefined | 1; +>rj3 : Symbol(rj3, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 104, 3)) +>undefined : Symbol(undefined) + +var rj4 = undefined | E.a; +>rj4 : Symbol(rj4, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 105, 3)) +>undefined : Symbol(undefined) +>E.a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>a : Symbol(E.a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 3, 8)) + +var rj5 = a | undefined; +>rj5 : Symbol(rj5, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 106, 3)) +>a : Symbol(a, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rj6 = b | undefined; +>rj6 : Symbol(rj6, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 107, 3)) +>b : Symbol(b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rj7 = 0 | undefined; +>rj7 : Symbol(rj7, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 108, 3)) +>undefined : Symbol(undefined) + +var rj8 = E.b | undefined; +>rj8 : Symbol(rj8, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 109, 3)) +>E.b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>E : Symbol(E, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 0, 0)) +>b : Symbol(E.b, Decl(arithmeticOperatorWithUndefinedValueAndValidOperands.ts, 4, 6)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types index 7db074df8bb..77dbe1c1441 100644 --- a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.types @@ -35,6 +35,7 @@ var ra3 = undefined * 1; >ra3 : number >undefined * 1 : number >undefined : undefined +>1 : number var ra4 = undefined * E.a; >ra4 : number @@ -59,6 +60,7 @@ var ra6 = b * undefined; var ra7 = 0 * undefined; >ra7 : number >0 * undefined : number +>0 : number >undefined : undefined var ra8 = E.b * undefined; @@ -86,6 +88,7 @@ var rb3 = undefined / 1; >rb3 : number >undefined / 1 : number >undefined : undefined +>1 : number var rb4 = undefined / E.a; >rb4 : number @@ -110,6 +113,7 @@ var rb6 = b / undefined; var rb7 = 0 / undefined; >rb7 : number >0 / undefined : number +>0 : number >undefined : undefined var rb8 = E.b / undefined; @@ -137,6 +141,7 @@ var rc3 = undefined % 1; >rc3 : number >undefined % 1 : number >undefined : undefined +>1 : number var rc4 = undefined % E.a; >rc4 : number @@ -161,6 +166,7 @@ var rc6 = b % undefined; var rc7 = 0 % undefined; >rc7 : number >0 % undefined : number +>0 : number >undefined : undefined var rc8 = E.b % undefined; @@ -188,6 +194,7 @@ var rd3 = undefined - 1; >rd3 : number >undefined - 1 : number >undefined : undefined +>1 : number var rd4 = undefined - E.a; >rd4 : number @@ -212,6 +219,7 @@ var rd6 = b - undefined; var rd7 = 0 - undefined; >rd7 : number >0 - undefined : number +>0 : number >undefined : undefined var rd8 = E.b - undefined; @@ -239,6 +247,7 @@ var re3 = undefined << 1; >re3 : number >undefined << 1 : number >undefined : undefined +>1 : number var re4 = undefined << E.a; >re4 : number @@ -263,6 +272,7 @@ var re6 = b << undefined; var re7 = 0 << undefined; >re7 : number >0 << undefined : number +>0 : number >undefined : undefined var re8 = E.b << undefined; @@ -290,6 +300,7 @@ var rf3 = undefined >> 1; >rf3 : number >undefined >> 1 : number >undefined : undefined +>1 : number var rf4 = undefined >> E.a; >rf4 : number @@ -314,6 +325,7 @@ var rf6 = b >> undefined; var rf7 = 0 >> undefined; >rf7 : number >0 >> undefined : number +>0 : number >undefined : undefined var rf8 = E.b >> undefined; @@ -341,6 +353,7 @@ var rg3 = undefined >>> 1; >rg3 : number >undefined >>> 1 : number >undefined : undefined +>1 : number var rg4 = undefined >>> E.a; >rg4 : number @@ -365,6 +378,7 @@ var rg6 = b >>> undefined; var rg7 = 0 >>> undefined; >rg7 : number >0 >>> undefined : number +>0 : number >undefined : undefined var rg8 = E.b >>> undefined; @@ -392,6 +406,7 @@ var rh3 = undefined & 1; >rh3 : number >undefined & 1 : number >undefined : undefined +>1 : number var rh4 = undefined & E.a; >rh4 : number @@ -416,6 +431,7 @@ var rh6 = b & undefined; var rh7 = 0 & undefined; >rh7 : number >0 & undefined : number +>0 : number >undefined : undefined var rh8 = E.b & undefined; @@ -443,6 +459,7 @@ var ri3 = undefined ^ 1; >ri3 : number >undefined ^ 1 : number >undefined : undefined +>1 : number var ri4 = undefined ^ E.a; >ri4 : number @@ -467,6 +484,7 @@ var ri6 = b ^ undefined; var ri7 = 0 ^ undefined; >ri7 : number >0 ^ undefined : number +>0 : number >undefined : undefined var ri8 = E.b ^ undefined; @@ -494,6 +512,7 @@ var rj3 = undefined | 1; >rj3 : number >undefined | 1 : number >undefined : undefined +>1 : number var rj4 = undefined | E.a; >rj4 : number @@ -518,6 +537,7 @@ var rj6 = b | undefined; var rj7 = 0 | undefined; >rj7 : number >0 | undefined : number +>0 : number >undefined : undefined var rj8 = E.b | undefined; diff --git a/tests/baselines/reference/arrayAssignmentPatternWithAny.js b/tests/baselines/reference/arrayAssignmentPatternWithAny.js new file mode 100644 index 00000000000..c81b5f1f38d --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentPatternWithAny.js @@ -0,0 +1,9 @@ +//// [arrayAssignmentPatternWithAny.ts] +var a: any; +var x: string; +[x] = a; + +//// [arrayAssignmentPatternWithAny.js] +var a; +var x; +x = a[0]; diff --git a/tests/baselines/reference/arrayAssignmentPatternWithAny.symbols b/tests/baselines/reference/arrayAssignmentPatternWithAny.symbols new file mode 100644 index 00000000000..a55febc1422 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentPatternWithAny.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/destructuring/arrayAssignmentPatternWithAny.ts === +var a: any; +>a : Symbol(a, Decl(arrayAssignmentPatternWithAny.ts, 0, 3)) + +var x: string; +>x : Symbol(x, Decl(arrayAssignmentPatternWithAny.ts, 1, 3)) + +[x] = a; +>x : Symbol(x, Decl(arrayAssignmentPatternWithAny.ts, 1, 3)) +>a : Symbol(a, Decl(arrayAssignmentPatternWithAny.ts, 0, 3)) + diff --git a/tests/baselines/reference/arrayAssignmentPatternWithAny.types b/tests/baselines/reference/arrayAssignmentPatternWithAny.types new file mode 100644 index 00000000000..452fc0737a1 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentPatternWithAny.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/destructuring/arrayAssignmentPatternWithAny.ts === +var a: any; +>a : any + +var x: string; +>x : string + +[x] = a; +>[x] = a : any +>[x] : [string] +>x : string +>a : any + diff --git a/tests/baselines/reference/arrayAssignmentTest6.symbols b/tests/baselines/reference/arrayAssignmentTest6.symbols new file mode 100644 index 00000000000..c4d4ba76a5f --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest6.symbols @@ -0,0 +1,52 @@ +=== tests/cases/compiler/arrayAssignmentTest6.ts === +module Test { +>Test : Symbol(Test, Decl(arrayAssignmentTest6.ts, 0, 0)) + + interface IState { +>IState : Symbol(IState, Decl(arrayAssignmentTest6.ts, 0, 13)) + } + interface IToken { +>IToken : Symbol(IToken, Decl(arrayAssignmentTest6.ts, 2, 5)) + + startIndex: number; +>startIndex : Symbol(startIndex, Decl(arrayAssignmentTest6.ts, 3, 22)) + } + interface ILineTokens { +>ILineTokens : Symbol(ILineTokens, Decl(arrayAssignmentTest6.ts, 5, 5)) + + tokens: IToken[]; +>tokens : Symbol(tokens, Decl(arrayAssignmentTest6.ts, 6, 27)) +>IToken : Symbol(IToken, Decl(arrayAssignmentTest6.ts, 2, 5)) + + endState: IState; +>endState : Symbol(endState, Decl(arrayAssignmentTest6.ts, 7, 25)) +>IState : Symbol(IState, Decl(arrayAssignmentTest6.ts, 0, 13)) + } + interface IMode { +>IMode : Symbol(IMode, Decl(arrayAssignmentTest6.ts, 9, 5)) + + tokenize(line:string, state:IState, includeStates:boolean):ILineTokens; +>tokenize : Symbol(tokenize, Decl(arrayAssignmentTest6.ts, 10, 21)) +>line : Symbol(line, Decl(arrayAssignmentTest6.ts, 11, 17)) +>state : Symbol(state, Decl(arrayAssignmentTest6.ts, 11, 29)) +>IState : Symbol(IState, Decl(arrayAssignmentTest6.ts, 0, 13)) +>includeStates : Symbol(includeStates, Decl(arrayAssignmentTest6.ts, 11, 43)) +>ILineTokens : Symbol(ILineTokens, Decl(arrayAssignmentTest6.ts, 5, 5)) + } + export class Bug implements IMode { +>Bug : Symbol(Bug, Decl(arrayAssignmentTest6.ts, 12, 5)) +>IMode : Symbol(IMode, Decl(arrayAssignmentTest6.ts, 9, 5)) + + public tokenize(line:string, tokens:IToken[], includeStates:boolean):ILineTokens { +>tokenize : Symbol(tokenize, Decl(arrayAssignmentTest6.ts, 13, 39)) +>line : Symbol(line, Decl(arrayAssignmentTest6.ts, 14, 24)) +>tokens : Symbol(tokens, Decl(arrayAssignmentTest6.ts, 14, 36)) +>IToken : Symbol(IToken, Decl(arrayAssignmentTest6.ts, 2, 5)) +>includeStates : Symbol(includeStates, Decl(arrayAssignmentTest6.ts, 14, 53)) +>ILineTokens : Symbol(ILineTokens, Decl(arrayAssignmentTest6.ts, 5, 5)) + + return null; + } + } +} + diff --git a/tests/baselines/reference/arrayAssignmentTest6.types b/tests/baselines/reference/arrayAssignmentTest6.types index 0c932cb7556..411144d4426 100644 --- a/tests/baselines/reference/arrayAssignmentTest6.types +++ b/tests/baselines/reference/arrayAssignmentTest6.types @@ -46,6 +46,7 @@ module Test { >ILineTokens : ILineTokens return null; +>null : null } } } diff --git a/tests/baselines/reference/arrayAugment.symbols b/tests/baselines/reference/arrayAugment.symbols new file mode 100644 index 00000000000..8310729032f --- /dev/null +++ b/tests/baselines/reference/arrayAugment.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/arrayAugment.ts === +interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(arrayAugment.ts, 0, 0)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(arrayAugment.ts, 0, 16)) + + split: (parts: number) => T[][]; +>split : Symbol(split, Decl(arrayAugment.ts, 0, 20)) +>parts : Symbol(parts, Decl(arrayAugment.ts, 1, 12)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(arrayAugment.ts, 0, 16)) +} + +var x = ['']; +>x : Symbol(x, Decl(arrayAugment.ts, 4, 3)) + +var y = x.split(4); +>y : Symbol(y, Decl(arrayAugment.ts, 5, 3), Decl(arrayAugment.ts, 6, 3)) +>x.split : Symbol(Array.split, Decl(arrayAugment.ts, 0, 20)) +>x : Symbol(x, Decl(arrayAugment.ts, 4, 3)) +>split : Symbol(Array.split, Decl(arrayAugment.ts, 0, 20)) + +var y: string[][]; // Expect no error here +>y : Symbol(y, Decl(arrayAugment.ts, 5, 3), Decl(arrayAugment.ts, 6, 3)) + diff --git a/tests/baselines/reference/arrayAugment.types b/tests/baselines/reference/arrayAugment.types index b338d7f5c5f..042b7265ec8 100644 --- a/tests/baselines/reference/arrayAugment.types +++ b/tests/baselines/reference/arrayAugment.types @@ -12,6 +12,7 @@ interface Array { var x = ['']; >x : string[] >[''] : string[] +>'' : string var y = x.split(4); >y : string[][] @@ -19,6 +20,7 @@ var y = x.split(4); >x.split : (parts: number) => string[][] >x : string[] >split : (parts: number) => string[][] +>4 : number var y: string[][]; // Expect no error here >y : string[][] diff --git a/tests/baselines/reference/arrayBestCommonTypes.symbols b/tests/baselines/reference/arrayBestCommonTypes.symbols new file mode 100644 index 00000000000..c4b42f66991 --- /dev/null +++ b/tests/baselines/reference/arrayBestCommonTypes.symbols @@ -0,0 +1,462 @@ +=== tests/cases/compiler/arrayBestCommonTypes.ts === +module EmptyTypes { +>EmptyTypes : Symbol(EmptyTypes, Decl(arrayBestCommonTypes.ts, 0, 0)) + + interface iface { } +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 0, 19)) + + class base implements iface { } +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 0, 19)) + + class base2 implements iface { } +>base2 : Symbol(base2, Decl(arrayBestCommonTypes.ts, 2, 35)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 0, 19)) + + class derived extends base { } +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 3, 36)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) + + + class f { +>f : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) + + public voidIfAny(x: boolean, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 8, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 8, 36)) + + public voidIfAny(x: string, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 9, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 9, 35)) + + public voidIfAny(x: number, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 10, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 10, 35)) + + public voidIfAny(x: any, y = false): any { return null; } +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 11, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 11, 32)) + + public x() { +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 11, 65)) + + (this.voidIfAny([4, 2][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny([4, 2, undefined][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([undefined, 2, 4][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([null, 2, 4][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny([2, 4, null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny([undefined, 4, null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny(['', "q"][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny(['', "q", undefined][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([undefined, "q", ''][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([null, "q", ''][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny(["q", '', null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + (this.voidIfAny([undefined, '', null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([[3, 4], [null]][0][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 4, 34)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 7, 13), Decl(arrayBestCommonTypes.ts, 8, 58), Decl(arrayBestCommonTypes.ts, 9, 57), Decl(arrayBestCommonTypes.ts, 10, 57)) + + + var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; +>t1 : Symbol(t1, Decl(arrayBestCommonTypes.ts, 31, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 31, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 31, 32)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 31, 50)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 31, 56)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 3, 36)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 31, 78)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 31, 84)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) + + var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }]; +>t2 : Symbol(t2, Decl(arrayBestCommonTypes.ts, 32, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 32, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 32, 33)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 32, 51)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 32, 60)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 3, 36)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 32, 82)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 32, 92)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) + + var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; +>t3 : Symbol(t3, Decl(arrayBestCommonTypes.ts, 33, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 33, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 33, 32)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 33, 50)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 33, 64)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 33, 83)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 33, 90)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 3, 36)) + + var anyObj: any = null; +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 35, 15)) + + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; +>a1 : Symbol(a1, Decl(arrayBestCommonTypes.ts, 37, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 37, 23)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 37, 29)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 37, 41)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 37, 49)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 37, 61)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 35, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 37, 72)) + + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; +>a2 : Symbol(a2, Decl(arrayBestCommonTypes.ts, 38, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 38, 23)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 35, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 38, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 38, 46)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 38, 52)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 38, 64)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 38, 72)) + + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; +>a3 : Symbol(a3, Decl(arrayBestCommonTypes.ts, 39, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 39, 23)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 39, 29)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 39, 41)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 35, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 39, 52)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 39, 64)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 39, 72)) + + var ifaceObj: iface = null; +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 41, 15)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 0, 19)) + + var baseObj = new base(); +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 42, 15)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 1, 23)) + + var base2Obj = new base2(); +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 43, 15)) +>base2 : Symbol(base2, Decl(arrayBestCommonTypes.ts, 2, 35)) + + var b1 = [baseObj, base2Obj, ifaceObj]; +>b1 : Symbol(b1, Decl(arrayBestCommonTypes.ts, 45, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 42, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 43, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 41, 15)) + + var b2 = [base2Obj, baseObj, ifaceObj]; +>b2 : Symbol(b2, Decl(arrayBestCommonTypes.ts, 46, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 43, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 42, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 41, 15)) + + var b3 = [baseObj, ifaceObj, base2Obj]; +>b3 : Symbol(b3, Decl(arrayBestCommonTypes.ts, 47, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 42, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 41, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 43, 15)) + + var b4 = [ifaceObj, baseObj, base2Obj]; +>b4 : Symbol(b4, Decl(arrayBestCommonTypes.ts, 48, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 41, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 42, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 43, 15)) + } + } +} + +module NonEmptyTypes { +>NonEmptyTypes : Symbol(NonEmptyTypes, Decl(arrayBestCommonTypes.ts, 51, 1)) + + interface iface { x: string; } +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 53, 22)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 54, 21)) + + class base implements iface { x: string; y: string; } +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 53, 22)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 55, 33)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 55, 44)) + + class base2 implements iface { x: string; z: string; } +>base2 : Symbol(base2, Decl(arrayBestCommonTypes.ts, 55, 57)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 53, 22)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 56, 34)) +>z : Symbol(z, Decl(arrayBestCommonTypes.ts, 56, 45)) + + class derived extends base { a: string; } +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 56, 58)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>a : Symbol(a, Decl(arrayBestCommonTypes.ts, 57, 32)) + + + class f { +>f : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) + + public voidIfAny(x: boolean, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 61, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 61, 36)) + + public voidIfAny(x: string, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 62, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 62, 35)) + + public voidIfAny(x: number, y?: boolean): number; +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 63, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 63, 35)) + + public voidIfAny(x: any, y = false): any { return null; } +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 64, 25)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 64, 32)) + + public x() { +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 64, 65)) + + (this.voidIfAny([4, 2][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny([4, 2, undefined][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([undefined, 2, 4][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([null, 2, 4][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny([2, 4, null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny([undefined, 4, null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny(['', "q"][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny(['', "q", undefined][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([undefined, "q", ''][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([null, "q", ''][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny(["q", '', null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + (this.voidIfAny([undefined, '', null][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>undefined : Symbol(undefined) + + (this.voidIfAny([[3, 4], [null]][0][0])); +>this.voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) +>this : Symbol(f, Decl(arrayBestCommonTypes.ts, 57, 45)) +>voidIfAny : Symbol(voidIfAny, Decl(arrayBestCommonTypes.ts, 60, 13), Decl(arrayBestCommonTypes.ts, 61, 58), Decl(arrayBestCommonTypes.ts, 62, 57), Decl(arrayBestCommonTypes.ts, 63, 57)) + + + var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; +>t1 : Symbol(t1, Decl(arrayBestCommonTypes.ts, 84, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 84, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 84, 32)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 84, 50)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 84, 56)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 56, 58)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 84, 78)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 84, 84)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) + + var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }]; +>t2 : Symbol(t2, Decl(arrayBestCommonTypes.ts, 85, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 85, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 85, 33)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 85, 51)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 85, 60)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 56, 58)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 85, 82)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 85, 92)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) + + var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; +>t3 : Symbol(t3, Decl(arrayBestCommonTypes.ts, 86, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 86, 21)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 86, 32)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 86, 50)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 86, 64)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 86, 83)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 86, 90)) +>derived : Symbol(derived, Decl(arrayBestCommonTypes.ts, 56, 58)) + + var anyObj: any = null; +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 88, 15)) + + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; +>a1 : Symbol(a1, Decl(arrayBestCommonTypes.ts, 90, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 90, 23)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 90, 29)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 90, 41)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 90, 49)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 90, 61)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 88, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 90, 72)) + + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; +>a2 : Symbol(a2, Decl(arrayBestCommonTypes.ts, 91, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 91, 23)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 88, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 91, 34)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 91, 46)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 91, 52)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 91, 64)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 91, 72)) + + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; +>a3 : Symbol(a3, Decl(arrayBestCommonTypes.ts, 92, 15)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 92, 23)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 92, 29)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 92, 41)) +>anyObj : Symbol(anyObj, Decl(arrayBestCommonTypes.ts, 88, 15)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 92, 52)) +>x : Symbol(x, Decl(arrayBestCommonTypes.ts, 92, 64)) +>y : Symbol(y, Decl(arrayBestCommonTypes.ts, 92, 72)) + + var ifaceObj: iface = null; +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 94, 15)) +>iface : Symbol(iface, Decl(arrayBestCommonTypes.ts, 53, 22)) + + var baseObj = new base(); +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 95, 15)) +>base : Symbol(base, Decl(arrayBestCommonTypes.ts, 54, 34)) + + var base2Obj = new base2(); +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 96, 15)) +>base2 : Symbol(base2, Decl(arrayBestCommonTypes.ts, 55, 57)) + + var b1 = [baseObj, base2Obj, ifaceObj]; +>b1 : Symbol(b1, Decl(arrayBestCommonTypes.ts, 98, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 95, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 96, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 94, 15)) + + var b2 = [base2Obj, baseObj, ifaceObj]; +>b2 : Symbol(b2, Decl(arrayBestCommonTypes.ts, 99, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 96, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 95, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 94, 15)) + + var b3 = [baseObj, ifaceObj, base2Obj]; +>b3 : Symbol(b3, Decl(arrayBestCommonTypes.ts, 100, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 95, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 94, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 96, 15)) + + var b4 = [ifaceObj, baseObj, base2Obj]; +>b4 : Symbol(b4, Decl(arrayBestCommonTypes.ts, 101, 15)) +>ifaceObj : Symbol(ifaceObj, Decl(arrayBestCommonTypes.ts, 94, 15)) +>baseObj : Symbol(baseObj, Decl(arrayBestCommonTypes.ts, 95, 15)) +>base2Obj : Symbol(base2Obj, Decl(arrayBestCommonTypes.ts, 96, 15)) + } + } +} + + diff --git a/tests/baselines/reference/arrayBestCommonTypes.types b/tests/baselines/reference/arrayBestCommonTypes.types index 5e34380673d..5650efc9ae7 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.types +++ b/tests/baselines/reference/arrayBestCommonTypes.types @@ -40,6 +40,8 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : any >y : boolean +>false : boolean +>null : null public x() { >x : () => void @@ -53,6 +55,9 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2][0] : number >[4, 2] : number[] +>4 : number +>2 : number +>0 : number (this.voidIfAny([4, 2, undefined][0])); >(this.voidIfAny([4, 2, undefined][0])) : number @@ -63,7 +68,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2, undefined][0] : number >[4, 2, undefined] : number[] +>4 : number +>2 : number >undefined : undefined +>0 : number (this.voidIfAny([undefined, 2, 4][0])); >(this.voidIfAny([undefined, 2, 4][0])) : number @@ -75,6 +83,9 @@ module EmptyTypes { >[undefined, 2, 4][0] : number >[undefined, 2, 4] : number[] >undefined : undefined +>2 : number +>4 : number +>0 : number (this.voidIfAny([null, 2, 4][0])); >(this.voidIfAny([null, 2, 4][0])) : number @@ -85,6 +96,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[null, 2, 4][0] : number >[null, 2, 4] : number[] +>null : null +>2 : number +>4 : number +>0 : number (this.voidIfAny([2, 4, null][0])); >(this.voidIfAny([2, 4, null][0])) : number @@ -95,6 +110,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[2, 4, null][0] : number >[2, 4, null] : number[] +>2 : number +>4 : number +>null : null +>0 : number (this.voidIfAny([undefined, 4, null][0])); >(this.voidIfAny([undefined, 4, null][0])) : number @@ -106,6 +125,9 @@ module EmptyTypes { >[undefined, 4, null][0] : number >[undefined, 4, null] : number[] >undefined : undefined +>4 : number +>null : null +>0 : number (this.voidIfAny(['', "q"][0])); >(this.voidIfAny(['', "q"][0])) : number @@ -116,6 +138,9 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q"][0] : string >['', "q"] : string[] +>'' : string +>"q" : string +>0 : number (this.voidIfAny(['', "q", undefined][0])); >(this.voidIfAny(['', "q", undefined][0])) : number @@ -126,7 +151,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q", undefined][0] : string >['', "q", undefined] : string[] +>'' : string +>"q" : string >undefined : undefined +>0 : number (this.voidIfAny([undefined, "q", ''][0])); >(this.voidIfAny([undefined, "q", ''][0])) : number @@ -138,6 +166,9 @@ module EmptyTypes { >[undefined, "q", ''][0] : string >[undefined, "q", ''] : string[] >undefined : undefined +>"q" : string +>'' : string +>0 : number (this.voidIfAny([null, "q", ''][0])); >(this.voidIfAny([null, "q", ''][0])) : number @@ -148,6 +179,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[null, "q", ''][0] : string >[null, "q", ''] : string[] +>null : null +>"q" : string +>'' : string +>0 : number (this.voidIfAny(["q", '', null][0])); >(this.voidIfAny(["q", '', null][0])) : number @@ -158,6 +193,10 @@ module EmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >["q", '', null][0] : string >["q", '', null] : string[] +>"q" : string +>'' : string +>null : null +>0 : number (this.voidIfAny([undefined, '', null][0])); >(this.voidIfAny([undefined, '', null][0])) : number @@ -169,6 +208,9 @@ module EmptyTypes { >[undefined, '', null][0] : string >[undefined, '', null] : string[] >undefined : undefined +>'' : string +>null : null +>0 : number (this.voidIfAny([[3, 4], [null]][0][0])); >(this.voidIfAny([[3, 4], [null]][0][0])) : number @@ -181,7 +223,12 @@ module EmptyTypes { >[[3, 4], [null]][0] : number[] >[[3, 4], [null]] : number[][] >[3, 4] : number[] +>3 : number +>4 : number >[null] : null[] +>null : null +>0 : number +>0 : number var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; @@ -192,11 +239,13 @@ module EmptyTypes { >[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: derived; }[] >{ x: 7, y: new derived() } : { x: number; y: derived; } >x : number +>7 : number >y : derived >new derived() : derived >derived : typeof derived >{ x: 5, y: new base() } : { x: number; y: base; } >x : number +>5 : number >y : base >new base() : base >base : typeof base @@ -209,11 +258,13 @@ module EmptyTypes { >[{ x: true, y: new derived() }, { x: false, y: new base() }] : { x: boolean; y: derived; }[] >{ x: true, y: new derived() } : { x: boolean; y: derived; } >x : boolean +>true : boolean >y : derived >new derived() : derived >derived : typeof derived >{ x: false, y: new base() } : { x: boolean; y: base; } >x : boolean +>false : boolean >y : base >new base() : base >base : typeof base @@ -232,12 +283,14 @@ module EmptyTypes { >base : typeof base >{ x: '', y: new derived() } : { x: string; y: derived; } >x : string +>'' : string >y : derived >new derived() : derived >derived : typeof derived var anyObj: any = null; >anyObj : any +>null : null // Order matters here so test all the variants var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; @@ -245,14 +298,19 @@ module EmptyTypes { >[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string +>'a' : string var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; >a2 : { x: any; y: string; }[] @@ -261,30 +319,41 @@ module EmptyTypes { >x : any >anyObj : any >y : string +>'a' : string >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; >a3 : { x: any; y: string; }[] >[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string var ifaceObj: iface = null; >ifaceObj : iface >iface : iface +>null : null var baseObj = new base(); >baseObj : base @@ -374,6 +443,8 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >x : any >y : boolean +>false : boolean +>null : null public x() { >x : () => void @@ -387,6 +458,9 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2][0] : number >[4, 2] : number[] +>4 : number +>2 : number +>0 : number (this.voidIfAny([4, 2, undefined][0])); >(this.voidIfAny([4, 2, undefined][0])) : number @@ -397,7 +471,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[4, 2, undefined][0] : number >[4, 2, undefined] : number[] +>4 : number +>2 : number >undefined : undefined +>0 : number (this.voidIfAny([undefined, 2, 4][0])); >(this.voidIfAny([undefined, 2, 4][0])) : number @@ -409,6 +486,9 @@ module NonEmptyTypes { >[undefined, 2, 4][0] : number >[undefined, 2, 4] : number[] >undefined : undefined +>2 : number +>4 : number +>0 : number (this.voidIfAny([null, 2, 4][0])); >(this.voidIfAny([null, 2, 4][0])) : number @@ -419,6 +499,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[null, 2, 4][0] : number >[null, 2, 4] : number[] +>null : null +>2 : number +>4 : number +>0 : number (this.voidIfAny([2, 4, null][0])); >(this.voidIfAny([2, 4, null][0])) : number @@ -429,6 +513,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[2, 4, null][0] : number >[2, 4, null] : number[] +>2 : number +>4 : number +>null : null +>0 : number (this.voidIfAny([undefined, 4, null][0])); >(this.voidIfAny([undefined, 4, null][0])) : number @@ -440,6 +528,9 @@ module NonEmptyTypes { >[undefined, 4, null][0] : number >[undefined, 4, null] : number[] >undefined : undefined +>4 : number +>null : null +>0 : number (this.voidIfAny(['', "q"][0])); >(this.voidIfAny(['', "q"][0])) : number @@ -450,6 +541,9 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q"][0] : string >['', "q"] : string[] +>'' : string +>"q" : string +>0 : number (this.voidIfAny(['', "q", undefined][0])); >(this.voidIfAny(['', "q", undefined][0])) : number @@ -460,7 +554,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >['', "q", undefined][0] : string >['', "q", undefined] : string[] +>'' : string +>"q" : string >undefined : undefined +>0 : number (this.voidIfAny([undefined, "q", ''][0])); >(this.voidIfAny([undefined, "q", ''][0])) : number @@ -472,6 +569,9 @@ module NonEmptyTypes { >[undefined, "q", ''][0] : string >[undefined, "q", ''] : string[] >undefined : undefined +>"q" : string +>'' : string +>0 : number (this.voidIfAny([null, "q", ''][0])); >(this.voidIfAny([null, "q", ''][0])) : number @@ -482,6 +582,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >[null, "q", ''][0] : string >[null, "q", ''] : string[] +>null : null +>"q" : string +>'' : string +>0 : number (this.voidIfAny(["q", '', null][0])); >(this.voidIfAny(["q", '', null][0])) : number @@ -492,6 +596,10 @@ module NonEmptyTypes { >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } >["q", '', null][0] : string >["q", '', null] : string[] +>"q" : string +>'' : string +>null : null +>0 : number (this.voidIfAny([undefined, '', null][0])); >(this.voidIfAny([undefined, '', null][0])) : number @@ -503,6 +611,9 @@ module NonEmptyTypes { >[undefined, '', null][0] : string >[undefined, '', null] : string[] >undefined : undefined +>'' : string +>null : null +>0 : number (this.voidIfAny([[3, 4], [null]][0][0])); >(this.voidIfAny([[3, 4], [null]][0][0])) : number @@ -515,7 +626,12 @@ module NonEmptyTypes { >[[3, 4], [null]][0] : number[] >[[3, 4], [null]] : number[][] >[3, 4] : number[] +>3 : number +>4 : number >[null] : null[] +>null : null +>0 : number +>0 : number var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; @@ -526,11 +642,13 @@ module NonEmptyTypes { >[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: base; }[] >{ x: 7, y: new derived() } : { x: number; y: derived; } >x : number +>7 : number >y : derived >new derived() : derived >derived : typeof derived >{ x: 5, y: new base() } : { x: number; y: base; } >x : number +>5 : number >y : base >new base() : base >base : typeof base @@ -543,11 +661,13 @@ module NonEmptyTypes { >[{ x: true, y: new derived() }, { x: false, y: new base() }] : { x: boolean; y: base; }[] >{ x: true, y: new derived() } : { x: boolean; y: derived; } >x : boolean +>true : boolean >y : derived >new derived() : derived >derived : typeof derived >{ x: false, y: new base() } : { x: boolean; y: base; } >x : boolean +>false : boolean >y : base >new base() : base >base : typeof base @@ -566,12 +686,14 @@ module NonEmptyTypes { >base : typeof base >{ x: '', y: new derived() } : { x: string; y: derived; } >x : string +>'' : string >y : derived >new derived() : derived >derived : typeof derived var anyObj: any = null; >anyObj : any +>null : null // Order matters here so test all the variants var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; @@ -579,14 +701,19 @@ module NonEmptyTypes { >[{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string +>'a' : string var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; >a2 : { x: any; y: string; }[] @@ -595,30 +722,41 @@ module NonEmptyTypes { >x : any >anyObj : any >y : string +>'a' : string >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; >a3 : { x: any; y: string; }[] >[{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }] : { x: any; y: string; }[] >{ x: 0, y: 'a' } : { x: number; y: string; } >x : number +>0 : number >y : string +>'a' : string >{ x: anyObj, y: 'a' } : { x: any; y: string; } >x : any >anyObj : any >y : string +>'a' : string >{ x: 'a', y: 'a' } : { x: string; y: string; } >x : string +>'a' : string >y : string +>'a' : string var ifaceObj: iface = null; >ifaceObj : iface >iface : iface +>null : null var baseObj = new base(); >baseObj : base diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.symbols b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.symbols new file mode 100644 index 00000000000..41d04ee623a --- /dev/null +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/arrayBindingPatternOmittedExpressions.ts === + +var results: string[]; +>results : Symbol(results, Decl(arrayBindingPatternOmittedExpressions.ts, 1, 3)) + +{ + let [, b, , a] = results; +>b : Symbol(b, Decl(arrayBindingPatternOmittedExpressions.ts, 4, 10)) +>a : Symbol(a, Decl(arrayBindingPatternOmittedExpressions.ts, 4, 15)) +>results : Symbol(results, Decl(arrayBindingPatternOmittedExpressions.ts, 1, 3)) + + let x = { +>x : Symbol(x, Decl(arrayBindingPatternOmittedExpressions.ts, 5, 7)) + + a, +>a : Symbol(a, Decl(arrayBindingPatternOmittedExpressions.ts, 5, 13)) + + b +>b : Symbol(b, Decl(arrayBindingPatternOmittedExpressions.ts, 6, 10)) + } +} + + +function f([, a, , b, , , , s, , , ] = results) { +>f : Symbol(f, Decl(arrayBindingPatternOmittedExpressions.ts, 9, 1)) +>a : Symbol(a, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 13)) +>b : Symbol(b, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 18)) +>s : Symbol(s, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 27)) +>results : Symbol(results, Decl(arrayBindingPatternOmittedExpressions.ts, 1, 3)) + + a = s[1]; +>a : Symbol(a, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 13)) +>s : Symbol(s, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 27)) + + b = s[2]; +>b : Symbol(b, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 18)) +>s : Symbol(s, Decl(arrayBindingPatternOmittedExpressions.ts, 12, 27)) +} diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types index ba1ac955b85..e83aa6a17de 100644 --- a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.types @@ -5,7 +5,9 @@ var results: string[]; { let [, b, , a] = results; +> : undefined >b : string +> : undefined >a : string >results : string[] @@ -24,9 +26,16 @@ var results: string[]; function f([, a, , b, , , , s, , , ] = results) { >f : ([, a, , b, , , , s, , , ]?: string[]) => void +> : undefined >a : string +> : undefined >b : string +> : undefined +> : undefined +> : undefined >s : string +> : undefined +> : undefined >results : string[] a = s[1]; @@ -34,10 +43,12 @@ function f([, a, , b, , , , s, , , ] = results) { >a : string >s[1] : string >s : string +>1 : number b = s[2]; >b = s[2] : string >b : string >s[2] : string >s : string +>2 : number } diff --git a/tests/baselines/reference/arrayConcat2.symbols b/tests/baselines/reference/arrayConcat2.symbols new file mode 100644 index 00000000000..8c0af7be702 --- /dev/null +++ b/tests/baselines/reference/arrayConcat2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/arrayConcat2.ts === +var a: string[] = []; +>a : Symbol(a, Decl(arrayConcat2.ts, 0, 3)) + +a.concat("hello", 'world'); +>a.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>a : Symbol(a, Decl(arrayConcat2.ts, 0, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) + +a.concat('Hello'); +>a.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>a : Symbol(a, Decl(arrayConcat2.ts, 0, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) + +var b = new Array(); +>b : Symbol(b, Decl(arrayConcat2.ts, 5, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +b.concat('hello'); +>b.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>b : Symbol(b, Decl(arrayConcat2.ts, 5, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) + diff --git a/tests/baselines/reference/arrayConcat2.types b/tests/baselines/reference/arrayConcat2.types index aa0e0478033..a49046c871f 100644 --- a/tests/baselines/reference/arrayConcat2.types +++ b/tests/baselines/reference/arrayConcat2.types @@ -8,12 +8,15 @@ a.concat("hello", 'world'); >a.concat : { (...items: U[]): string[]; (...items: string[]): string[]; } >a : string[] >concat : { (...items: U[]): string[]; (...items: string[]): string[]; } +>"hello" : string +>'world' : string a.concat('Hello'); >a.concat('Hello') : string[] >a.concat : { (...items: U[]): string[]; (...items: string[]): string[]; } >a : string[] >concat : { (...items: U[]): string[]; (...items: string[]): string[]; } +>'Hello' : string var b = new Array(); >b : string[] @@ -25,4 +28,5 @@ b.concat('hello'); >b.concat : { (...items: U[]): string[]; (...items: string[]): string[]; } >b : string[] >concat : { (...items: U[]): string[]; (...items: string[]): string[]; } +>'hello' : string diff --git a/tests/baselines/reference/arrayConcatMap.symbols b/tests/baselines/reference/arrayConcatMap.symbols new file mode 100644 index 00000000000..1ff4bc3bff5 --- /dev/null +++ b/tests/baselines/reference/arrayConcatMap.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/arrayConcatMap.ts === +var x = [].concat([{ a: 1 }], [{ a: 2 }]) +>x : Symbol(x, Decl(arrayConcatMap.ts, 0, 3)) +>[].concat([{ a: 1 }], [{ a: 2 }]) .map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>[].concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>a : Symbol(a, Decl(arrayConcatMap.ts, 0, 20)) +>a : Symbol(a, Decl(arrayConcatMap.ts, 0, 32)) + + .map(b => b.a); +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>b : Symbol(b, Decl(arrayConcatMap.ts, 1, 15)) +>b : Symbol(b, Decl(arrayConcatMap.ts, 1, 15)) + diff --git a/tests/baselines/reference/arrayConcatMap.types b/tests/baselines/reference/arrayConcatMap.types index 92da3edf93f..11342ee848a 100644 --- a/tests/baselines/reference/arrayConcatMap.types +++ b/tests/baselines/reference/arrayConcatMap.types @@ -10,9 +10,11 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) >[{ a: 1 }] : { a: number; }[] >{ a: 1 } : { a: number; } >a : number +>1 : number >[{ a: 2 }] : { a: number; }[] >{ a: 2 } : { a: number; } >a : number +>2 : number .map(b => b.a); >map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] diff --git a/tests/baselines/reference/arrayConstructors1.symbols b/tests/baselines/reference/arrayConstructors1.symbols new file mode 100644 index 00000000000..cab2b0dc68a --- /dev/null +++ b/tests/baselines/reference/arrayConstructors1.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/arrayConstructors1.ts === +var x: string[]; +>x : Symbol(x, Decl(arrayConstructors1.ts, 0, 3)) + +x = new Array(1); +>x : Symbol(x, Decl(arrayConstructors1.ts, 0, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +x = new Array('hi', 'bye'); +>x : Symbol(x, Decl(arrayConstructors1.ts, 0, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +x = new Array('hi', 'bye'); +>x : Symbol(x, Decl(arrayConstructors1.ts, 0, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +var y: number[]; +>y : Symbol(y, Decl(arrayConstructors1.ts, 5, 3)) + +y = new Array(1); +>y : Symbol(y, Decl(arrayConstructors1.ts, 5, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +y = new Array(1,2); +>y : Symbol(y, Decl(arrayConstructors1.ts, 5, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +y = new Array(1, 2); +>y : Symbol(y, Decl(arrayConstructors1.ts, 5, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + diff --git a/tests/baselines/reference/arrayConstructors1.types b/tests/baselines/reference/arrayConstructors1.types index 6dbdc0cd8f2..89807cd0348 100644 --- a/tests/baselines/reference/arrayConstructors1.types +++ b/tests/baselines/reference/arrayConstructors1.types @@ -7,18 +7,23 @@ x = new Array(1); >x : string[] >new Array(1) : any[] >Array : ArrayConstructor +>1 : number x = new Array('hi', 'bye'); >x = new Array('hi', 'bye') : string[] >x : string[] >new Array('hi', 'bye') : string[] >Array : ArrayConstructor +>'hi' : string +>'bye' : string x = new Array('hi', 'bye'); >x = new Array('hi', 'bye') : string[] >x : string[] >new Array('hi', 'bye') : string[] >Array : ArrayConstructor +>'hi' : string +>'bye' : string var y: number[]; >y : number[] @@ -28,16 +33,21 @@ y = new Array(1); >y : number[] >new Array(1) : any[] >Array : ArrayConstructor +>1 : number y = new Array(1,2); >y = new Array(1,2) : number[] >y : number[] >new Array(1,2) : number[] >Array : ArrayConstructor +>1 : number +>2 : number y = new Array(1, 2); >y = new Array(1, 2) : number[] >y : number[] >new Array(1, 2) : number[] >Array : ArrayConstructor +>1 : number +>2 : number diff --git a/tests/baselines/reference/arrayLiteral.symbols b/tests/baselines/reference/arrayLiteral.symbols new file mode 100644 index 00000000000..77673863b64 --- /dev/null +++ b/tests/baselines/reference/arrayLiteral.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayLiteral.ts === +// valid uses of array literals + +var x = []; +>x : Symbol(x, Decl(arrayLiteral.ts, 2, 3), Decl(arrayLiteral.ts, 3, 3)) + +var x = new Array(1); +>x : Symbol(x, Decl(arrayLiteral.ts, 2, 3), Decl(arrayLiteral.ts, 3, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +var y = [1]; +>y : Symbol(y, Decl(arrayLiteral.ts, 5, 3), Decl(arrayLiteral.ts, 6, 3), Decl(arrayLiteral.ts, 7, 3)) + +var y = [1, 2]; +>y : Symbol(y, Decl(arrayLiteral.ts, 5, 3), Decl(arrayLiteral.ts, 6, 3), Decl(arrayLiteral.ts, 7, 3)) + +var y = new Array(); +>y : Symbol(y, Decl(arrayLiteral.ts, 5, 3), Decl(arrayLiteral.ts, 6, 3), Decl(arrayLiteral.ts, 7, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +var x2: number[] = []; +>x2 : Symbol(x2, Decl(arrayLiteral.ts, 9, 3), Decl(arrayLiteral.ts, 10, 3)) + +var x2: number[] = new Array(1); +>x2 : Symbol(x2, Decl(arrayLiteral.ts, 9, 3), Decl(arrayLiteral.ts, 10, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +var y2: number[] = [1]; +>y2 : Symbol(y2, Decl(arrayLiteral.ts, 12, 3), Decl(arrayLiteral.ts, 13, 3), Decl(arrayLiteral.ts, 14, 3)) + +var y2: number[] = [1, 2]; +>y2 : Symbol(y2, Decl(arrayLiteral.ts, 12, 3), Decl(arrayLiteral.ts, 13, 3), Decl(arrayLiteral.ts, 14, 3)) + +var y2: number[] = new Array(); +>y2 : Symbol(y2, Decl(arrayLiteral.ts, 12, 3), Decl(arrayLiteral.ts, 13, 3), Decl(arrayLiteral.ts, 14, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + diff --git a/tests/baselines/reference/arrayLiteral.types b/tests/baselines/reference/arrayLiteral.types index a5ab7368937..a7b915de79d 100644 --- a/tests/baselines/reference/arrayLiteral.types +++ b/tests/baselines/reference/arrayLiteral.types @@ -9,14 +9,18 @@ var x = new Array(1); >x : any[] >new Array(1) : any[] >Array : ArrayConstructor +>1 : number var y = [1]; >y : number[] >[1] : number[] +>1 : number var y = [1, 2]; >y : number[] >[1, 2] : number[] +>1 : number +>2 : number var y = new Array(); >y : number[] @@ -31,14 +35,18 @@ var x2: number[] = new Array(1); >x2 : number[] >new Array(1) : any[] >Array : ArrayConstructor +>1 : number var y2: number[] = [1]; >y2 : number[] >[1] : number[] +>1 : number var y2: number[] = [1, 2]; >y2 : number[] >[1, 2] : number[] +>1 : number +>2 : number var y2: number[] = new Array(); >y2 : number[] diff --git a/tests/baselines/reference/arrayLiteral1.symbols b/tests/baselines/reference/arrayLiteral1.symbols new file mode 100644 index 00000000000..9f2e04138b7 --- /dev/null +++ b/tests/baselines/reference/arrayLiteral1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/arrayLiteral1.ts === +var v30 = [1, 2]; +>v30 : Symbol(v30, Decl(arrayLiteral1.ts, 0, 3)) + diff --git a/tests/baselines/reference/arrayLiteral1.types b/tests/baselines/reference/arrayLiteral1.types index 79d00f5f46f..eb83fa87035 100644 --- a/tests/baselines/reference/arrayLiteral1.types +++ b/tests/baselines/reference/arrayLiteral1.types @@ -2,4 +2,6 @@ var v30 = [1, 2]; >v30 : number[] >[1, 2] : number[] +>1 : number +>2 : number diff --git a/tests/baselines/reference/arrayLiteral2.symbols b/tests/baselines/reference/arrayLiteral2.symbols new file mode 100644 index 00000000000..e06077736e5 --- /dev/null +++ b/tests/baselines/reference/arrayLiteral2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/arrayLiteral2.ts === +var v30 = [1, 2], v31; +>v30 : Symbol(v30, Decl(arrayLiteral2.ts, 0, 3)) +>v31 : Symbol(v31, Decl(arrayLiteral2.ts, 0, 17)) + diff --git a/tests/baselines/reference/arrayLiteral2.types b/tests/baselines/reference/arrayLiteral2.types index cd370c0f1a9..1c3c81117d9 100644 --- a/tests/baselines/reference/arrayLiteral2.types +++ b/tests/baselines/reference/arrayLiteral2.types @@ -2,5 +2,7 @@ var v30 = [1, 2], v31; >v30 : number[] >[1, 2] : number[] +>1 : number +>2 : number >v31 : any diff --git a/tests/baselines/reference/arrayLiteralContextualType.symbols b/tests/baselines/reference/arrayLiteralContextualType.symbols new file mode 100644 index 00000000000..500c1d522f6 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralContextualType.symbols @@ -0,0 +1,73 @@ +=== tests/cases/compiler/arrayLiteralContextualType.ts === +interface IAnimal { +>IAnimal : Symbol(IAnimal, Decl(arrayLiteralContextualType.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(arrayLiteralContextualType.ts, 0, 19)) +} + +class Giraffe { +>Giraffe : Symbol(Giraffe, Decl(arrayLiteralContextualType.ts, 2, 1)) + + name = "Giraffe"; +>name : Symbol(name, Decl(arrayLiteralContextualType.ts, 4, 15)) + + neckLength = "3m"; +>neckLength : Symbol(neckLength, Decl(arrayLiteralContextualType.ts, 5, 21)) +} + +class Elephant { +>Elephant : Symbol(Elephant, Decl(arrayLiteralContextualType.ts, 7, 1)) + + name = "Elephant"; +>name : Symbol(name, Decl(arrayLiteralContextualType.ts, 9, 16)) + + trunkDiameter = "20cm"; +>trunkDiameter : Symbol(trunkDiameter, Decl(arrayLiteralContextualType.ts, 10, 22)) +} + +function foo(animals: IAnimal[]) { } +>foo : Symbol(foo, Decl(arrayLiteralContextualType.ts, 12, 1)) +>animals : Symbol(animals, Decl(arrayLiteralContextualType.ts, 14, 13)) +>IAnimal : Symbol(IAnimal, Decl(arrayLiteralContextualType.ts, 0, 0)) + +function bar(animals: { [n: number]: IAnimal }) { } +>bar : Symbol(bar, Decl(arrayLiteralContextualType.ts, 14, 36)) +>animals : Symbol(animals, Decl(arrayLiteralContextualType.ts, 15, 13)) +>n : Symbol(n, Decl(arrayLiteralContextualType.ts, 15, 25)) +>IAnimal : Symbol(IAnimal, Decl(arrayLiteralContextualType.ts, 0, 0)) + +foo([ +>foo : Symbol(foo, Decl(arrayLiteralContextualType.ts, 12, 1)) + + new Giraffe(), +>Giraffe : Symbol(Giraffe, Decl(arrayLiteralContextualType.ts, 2, 1)) + + new Elephant() +>Elephant : Symbol(Elephant, Decl(arrayLiteralContextualType.ts, 7, 1)) + +]); // Legal because of the contextual type IAnimal provided by the parameter +bar([ +>bar : Symbol(bar, Decl(arrayLiteralContextualType.ts, 14, 36)) + + new Giraffe(), +>Giraffe : Symbol(Giraffe, Decl(arrayLiteralContextualType.ts, 2, 1)) + + new Elephant() +>Elephant : Symbol(Elephant, Decl(arrayLiteralContextualType.ts, 7, 1)) + +]); // Legal because of the contextual type IAnimal provided by the parameter + +var arr = [new Giraffe(), new Elephant()]; +>arr : Symbol(arr, Decl(arrayLiteralContextualType.ts, 26, 3)) +>Giraffe : Symbol(Giraffe, Decl(arrayLiteralContextualType.ts, 2, 1)) +>Elephant : Symbol(Elephant, Decl(arrayLiteralContextualType.ts, 7, 1)) + +foo(arr); // ok because arr is Array not {}[] +>foo : Symbol(foo, Decl(arrayLiteralContextualType.ts, 12, 1)) +>arr : Symbol(arr, Decl(arrayLiteralContextualType.ts, 26, 3)) + +bar(arr); // ok because arr is Array not {}[] +>bar : Symbol(bar, Decl(arrayLiteralContextualType.ts, 14, 36)) +>arr : Symbol(arr, Decl(arrayLiteralContextualType.ts, 26, 3)) + diff --git a/tests/baselines/reference/arrayLiteralContextualType.types b/tests/baselines/reference/arrayLiteralContextualType.types index b6d8377d012..0513908929e 100644 --- a/tests/baselines/reference/arrayLiteralContextualType.types +++ b/tests/baselines/reference/arrayLiteralContextualType.types @@ -11,9 +11,11 @@ class Giraffe { name = "Giraffe"; >name : string +>"Giraffe" : string neckLength = "3m"; >neckLength : string +>"3m" : string } class Elephant { @@ -21,9 +23,11 @@ class Elephant { name = "Elephant"; >name : string +>"Elephant" : string trunkDiameter = "20cm"; >trunkDiameter : string +>"20cm" : string } function foo(animals: IAnimal[]) { } diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.symbols b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.symbols new file mode 100644 index 00000000000..9ce5cebf0c2 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/arrayLiteralInNonVarArgParameter.ts === +function panic(val: string[], ...opt: string[]) { } +>panic : Symbol(panic, Decl(arrayLiteralInNonVarArgParameter.ts, 0, 0)) +>val : Symbol(val, Decl(arrayLiteralInNonVarArgParameter.ts, 0, 15)) +>opt : Symbol(opt, Decl(arrayLiteralInNonVarArgParameter.ts, 0, 29)) + +panic([], 'one', 'two'); +>panic : Symbol(panic, Decl(arrayLiteralInNonVarArgParameter.ts, 0, 0)) + diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types index 4743504c33e..fcbaa22bc6a 100644 --- a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types @@ -8,4 +8,6 @@ panic([], 'one', 'two'); >panic([], 'one', 'two') : void >panic : (val: string[], ...opt: string[]) => void >[] : undefined[] +>'one' : string +>'two' : string diff --git a/tests/baselines/reference/arrayLiteralSpread.symbols b/tests/baselines/reference/arrayLiteralSpread.symbols new file mode 100644 index 00000000000..d7bcee44fef --- /dev/null +++ b/tests/baselines/reference/arrayLiteralSpread.symbols @@ -0,0 +1,67 @@ +=== tests/cases/conformance/es6/spread/arrayLiteralSpread.ts === +function f0() { +>f0 : Symbol(f0, Decl(arrayLiteralSpread.ts, 0, 0)) + + var a = [1, 2, 3]; +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a1 = [...a]; +>a1 : Symbol(a1, Decl(arrayLiteralSpread.ts, 2, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a2 = [1, ...a]; +>a2 : Symbol(a2, Decl(arrayLiteralSpread.ts, 3, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a3 = [1, 2, ...a]; +>a3 : Symbol(a3, Decl(arrayLiteralSpread.ts, 4, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a4 = [...a, 1]; +>a4 : Symbol(a4, Decl(arrayLiteralSpread.ts, 5, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a5 = [...a, 1, 2]; +>a5 : Symbol(a5, Decl(arrayLiteralSpread.ts, 6, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a6 = [1, 2, ...a, 1, 2]; +>a6 : Symbol(a6, Decl(arrayLiteralSpread.ts, 7, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a7 = [1, ...a, 2, ...a]; +>a7 : Symbol(a7, Decl(arrayLiteralSpread.ts, 8, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) + + var a8 = [...a, ...a, ...a]; +>a8 : Symbol(a8, Decl(arrayLiteralSpread.ts, 9, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 1, 7)) +} + +function f1() { +>f1 : Symbol(f1, Decl(arrayLiteralSpread.ts, 10, 1)) + + var a = [1, 2, 3]; +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 13, 7)) + + var b = ["hello", ...a, true]; +>b : Symbol(b, Decl(arrayLiteralSpread.ts, 14, 7), Decl(arrayLiteralSpread.ts, 15, 7)) +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 13, 7)) + + var b: (string | number | boolean)[]; +>b : Symbol(b, Decl(arrayLiteralSpread.ts, 14, 7), Decl(arrayLiteralSpread.ts, 15, 7)) +} + +function f2() { +>f2 : Symbol(f2, Decl(arrayLiteralSpread.ts, 16, 1)) + + var a = [...[...[...[...[...[]]]]]]; +>a : Symbol(a, Decl(arrayLiteralSpread.ts, 19, 7)) + + var b = [...[...[...[...[...[5]]]]]]; +>b : Symbol(b, Decl(arrayLiteralSpread.ts, 20, 7)) +} + diff --git a/tests/baselines/reference/arrayLiteralSpread.types b/tests/baselines/reference/arrayLiteralSpread.types index 73d4f6013ed..7b9a34c0abe 100644 --- a/tests/baselines/reference/arrayLiteralSpread.types +++ b/tests/baselines/reference/arrayLiteralSpread.types @@ -5,6 +5,9 @@ function f0() { var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var a1 = [...a]; >a1 : number[] @@ -15,12 +18,15 @@ function f0() { var a2 = [1, ...a]; >a2 : number[] >[1, ...a] : number[] +>1 : number >...a : number >a : number[] var a3 = [1, 2, ...a]; >a3 : number[] >[1, 2, ...a] : number[] +>1 : number +>2 : number >...a : number >a : number[] @@ -29,24 +35,33 @@ function f0() { >[...a, 1] : number[] >...a : number >a : number[] +>1 : number var a5 = [...a, 1, 2]; >a5 : number[] >[...a, 1, 2] : number[] >...a : number >a : number[] +>1 : number +>2 : number var a6 = [1, 2, ...a, 1, 2]; >a6 : number[] >[1, 2, ...a, 1, 2] : number[] +>1 : number +>2 : number >...a : number >a : number[] +>1 : number +>2 : number var a7 = [1, ...a, 2, ...a]; >a7 : number[] >[1, ...a, 2, ...a] : number[] +>1 : number >...a : number >a : number[] +>2 : number >...a : number >a : number[] @@ -67,12 +82,17 @@ function f1() { var a = [1, 2, 3]; >a : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var b = ["hello", ...a, true]; >b : (string | number | boolean)[] >["hello", ...a, true] : (string | number | boolean)[] +>"hello" : string >...a : number >a : number[] +>true : boolean var b: (string | number | boolean)[]; >b : (string | number | boolean)[] @@ -108,5 +128,6 @@ function f2() { >[...[5]] : number[] >...[5] : number >[5] : number[] +>5 : number } diff --git a/tests/baselines/reference/arrayLiteralTypeInference.symbols b/tests/baselines/reference/arrayLiteralTypeInference.symbols new file mode 100644 index 00000000000..005cb57f6c4 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralTypeInference.symbols @@ -0,0 +1,113 @@ +=== tests/cases/compiler/arrayLiteralTypeInference.ts === +class Action { +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 0, 14)) +} + +class ActionA extends Action { +>ActionA : Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1)) +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + value: string; +>value : Symbol(value, Decl(arrayLiteralTypeInference.ts, 4, 30)) +} + +class ActionB extends Action { +>ActionB : Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1)) +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + trueNess: boolean; +>trueNess : Symbol(trueNess, Decl(arrayLiteralTypeInference.ts, 8, 30)) +} + +var x1: Action[] = [ +>x1 : Symbol(x1, Decl(arrayLiteralTypeInference.ts, 12, 3)) +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + { id: 2, trueness: false }, +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 13, 5)) +>trueness : Symbol(trueness, Decl(arrayLiteralTypeInference.ts, 13, 12)) + + { id: 3, name: "three" } +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 14, 5)) +>name : Symbol(name, Decl(arrayLiteralTypeInference.ts, 14, 12)) + +] + +var x2: Action[] = [ +>x2 : Symbol(x2, Decl(arrayLiteralTypeInference.ts, 17, 3)) +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + new ActionA(), +>ActionA : Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1)) + + new ActionB() +>ActionB : Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1)) + +] + +var x3: Action[] = [ +>x3 : Symbol(x3, Decl(arrayLiteralTypeInference.ts, 22, 3)) +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + new Action(), +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + new ActionA(), +>ActionA : Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1)) + + new ActionB() +>ActionB : Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1)) + +] + +var z1: { id: number }[] = +>z1 : Symbol(z1, Decl(arrayLiteralTypeInference.ts, 28, 3)) +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 28, 9)) + + [ + { id: 2, trueness: false }, +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 30, 9)) +>trueness : Symbol(trueness, Decl(arrayLiteralTypeInference.ts, 30, 16)) + + { id: 3, name: "three" } +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 31, 9)) +>name : Symbol(name, Decl(arrayLiteralTypeInference.ts, 31, 16)) + + ] + +var z2: { id: number }[] = +>z2 : Symbol(z2, Decl(arrayLiteralTypeInference.ts, 34, 3)) +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 34, 9)) + + [ + new ActionA(), +>ActionA : Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1)) + + new ActionB() +>ActionB : Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1)) + + ] + +var z3: { id: number }[] = +>z3 : Symbol(z3, Decl(arrayLiteralTypeInference.ts, 40, 3)) +>id : Symbol(id, Decl(arrayLiteralTypeInference.ts, 40, 9)) + + [ + new Action(), +>Action : Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0)) + + new ActionA(), +>ActionA : Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1)) + + new ActionB() +>ActionB : Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1)) + + ] + + + + + diff --git a/tests/baselines/reference/arrayLiteralTypeInference.types b/tests/baselines/reference/arrayLiteralTypeInference.types index adcc28c7440..660592fceb8 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.types +++ b/tests/baselines/reference/arrayLiteralTypeInference.types @@ -30,12 +30,16 @@ var x1: Action[] = [ { id: 2, trueness: false }, >{ id: 2, trueness: false } : { id: number; trueness: boolean; } >id : number +>2 : number >trueness : boolean +>false : boolean { id: 3, name: "three" } >{ id: 3, name: "three" } : { id: number; name: string; } >id : number +>3 : number >name : string +>"three" : string ] @@ -83,12 +87,16 @@ var z1: { id: number }[] = { id: 2, trueness: false }, >{ id: 2, trueness: false } : { id: number; trueness: boolean; } >id : number +>2 : number >trueness : boolean +>false : boolean { id: 3, name: "three" } >{ id: 3, name: "three" } : { id: number; name: string; } >id : number +>3 : number >name : string +>"three" : string ] diff --git a/tests/baselines/reference/arrayLiteralWidened.symbols b/tests/baselines/reference/arrayLiteralWidened.symbols new file mode 100644 index 00000000000..ba058aeded1 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralWidened.symbols @@ -0,0 +1,32 @@ +=== tests/cases/conformance/types/typeRelationships/widenedTypes/arrayLiteralWidened.ts === +// array literals are widened upon assignment according to their element type + +var a = []; // any[] +>a : Symbol(a, Decl(arrayLiteralWidened.ts, 2, 3), Decl(arrayLiteralWidened.ts, 4, 3), Decl(arrayLiteralWidened.ts, 5, 3)) + +var a = [null, null]; +>a : Symbol(a, Decl(arrayLiteralWidened.ts, 2, 3), Decl(arrayLiteralWidened.ts, 4, 3), Decl(arrayLiteralWidened.ts, 5, 3)) + +var a = [undefined, undefined]; +>a : Symbol(a, Decl(arrayLiteralWidened.ts, 2, 3), Decl(arrayLiteralWidened.ts, 4, 3), Decl(arrayLiteralWidened.ts, 5, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +var b = [[], [null, null]]; // any[][] +>b : Symbol(b, Decl(arrayLiteralWidened.ts, 7, 3), Decl(arrayLiteralWidened.ts, 8, 3), Decl(arrayLiteralWidened.ts, 9, 3)) + +var b = [[], []]; +>b : Symbol(b, Decl(arrayLiteralWidened.ts, 7, 3), Decl(arrayLiteralWidened.ts, 8, 3), Decl(arrayLiteralWidened.ts, 9, 3)) + +var b = [[undefined, undefined]]; +>b : Symbol(b, Decl(arrayLiteralWidened.ts, 7, 3), Decl(arrayLiteralWidened.ts, 8, 3), Decl(arrayLiteralWidened.ts, 9, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +var c = [[[]]]; // any[][][] +>c : Symbol(c, Decl(arrayLiteralWidened.ts, 11, 3), Decl(arrayLiteralWidened.ts, 12, 3)) + +var c = [[[null]],[undefined]] +>c : Symbol(c, Decl(arrayLiteralWidened.ts, 11, 3), Decl(arrayLiteralWidened.ts, 12, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/arrayLiteralWidened.types b/tests/baselines/reference/arrayLiteralWidened.types index 6e89bc50892..9599db2dff5 100644 --- a/tests/baselines/reference/arrayLiteralWidened.types +++ b/tests/baselines/reference/arrayLiteralWidened.types @@ -8,6 +8,8 @@ var a = []; // any[] var a = [null, null]; >a : any[] >[null, null] : null[] +>null : null +>null : null var a = [undefined, undefined]; >a : any[] @@ -20,6 +22,8 @@ var b = [[], [null, null]]; // any[][] >[[], [null, null]] : null[][] >[] : undefined[] >[null, null] : null[] +>null : null +>null : null var b = [[], []]; >b : any[][] @@ -45,6 +49,7 @@ var c = [[[null]],[undefined]] >[[[null]],[undefined]] : null[][][] >[[null]] : null[][] >[null] : null[] +>null : null >[undefined] : undefined[] >undefined : undefined diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.symbols b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.symbols new file mode 100644 index 00000000000..071596c9af1 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.symbols @@ -0,0 +1,64 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/arrayLiteralWithMultipleBestCommonTypes.ts === +// when multiple best common types exist we will choose the first candidate + +var a: { x: number; y?: number }; +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 8)) +>y : Symbol(y, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 19)) + +var b: { x: number; z?: number }; +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 8)) +>z : Symbol(z, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 19)) + +var c: { x: number; a?: number }; +>c : Symbol(c, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 3)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 8)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 19)) + +var as = [a, b]; // { x: number; y?: number };[] +>as : Symbol(as, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 6, 3)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3)) +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3)) + +var bs = [b, a]; // { x: number; z?: number };[] +>bs : Symbol(bs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 7, 3)) +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3)) + +var cs = [a, b, c]; // { x: number; y?: number };[] +>cs : Symbol(cs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 8, 3)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3)) +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3)) +>c : Symbol(c, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 3)) + +var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] +>ds : Symbol(ds, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 10, 3)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 10, 11)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 10, 29)) + +var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] +>es : Symbol(es, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 11, 3)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 11, 11)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 11, 29)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[] +>fs : Symbol(fs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 3)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 11)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 15)) +>y : Symbol(y, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 26)) +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 48)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 52)) +>z : Symbol(z, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 63)) + +var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[] +>gs : Symbol(gs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 3)) +>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 11)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 15)) +>z : Symbol(z, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 26)) +>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 48)) +>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 52)) +>y : Symbol(y, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 63)) + diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types index bc21ec39073..aad515b62ee 100644 --- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types @@ -41,17 +41,21 @@ var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] >(x: Object) => 1 : (x: Object) => number >x : Object >Object : Object +>1 : number >(x: string) => 2 : (x: string) => number >x : string +>2 : number var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] >es : ((x: string) => number)[] >[(x: string) => 2, (x: Object) => 1] : ((x: string) => number)[] >(x: string) => 2 : (x: string) => number >x : string +>2 : number >(x: Object) => 1 : (x: Object) => number >x : Object >Object : Object +>1 : number var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[] >fs : (((a: { x: number; y?: number; }) => number) | ((b: { x: number; z?: number; }) => number))[] @@ -60,10 +64,12 @@ var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => >a : { x: number; y?: number; } >x : number >y : number +>1 : number >(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number; }) => number >b : { x: number; z?: number; } >x : number >z : number +>2 : number var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[] >gs : (((b: { x: number; z?: number; }) => number) | ((a: { x: number; y?: number; }) => number))[] @@ -72,8 +78,10 @@ var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => >b : { x: number; z?: number; } >x : number >z : number +>2 : number >(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number; }) => number >a : { x: number; y?: number; } >x : number >y : number +>1 : number diff --git a/tests/baselines/reference/arrayLiterals.symbols b/tests/baselines/reference/arrayLiterals.symbols new file mode 100644 index 00000000000..b338e7ff6e6 --- /dev/null +++ b/tests/baselines/reference/arrayLiterals.symbols @@ -0,0 +1,94 @@ +=== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals.ts === +// Empty array literal with no contextual type has type Undefined[] + +var arr1= [[], [1], ['']]; +>arr1 : Symbol(arr1, Decl(arrayLiterals.ts, 2, 3)) + +var arr2 = [[null], [1], ['']]; +>arr2 : Symbol(arr2, Decl(arrayLiterals.ts, 4, 3)) + + +// Array literal with elements of only EveryType E has type E[] +var stringArrArr = [[''], [""]]; +>stringArrArr : Symbol(stringArrArr, Decl(arrayLiterals.ts, 8, 3)) + +var stringArr = ['', ""]; +>stringArr : Symbol(stringArr, Decl(arrayLiterals.ts, 10, 3)) + +var numberArr = [0, 0.0, 0x00, 1e1]; +>numberArr : Symbol(numberArr, Decl(arrayLiterals.ts, 12, 3)) + +var boolArr = [false, true, false, true]; +>boolArr : Symbol(boolArr, Decl(arrayLiterals.ts, 14, 3)) + +class C { private p; } +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) +>p : Symbol(p, Decl(arrayLiterals.ts, 16, 9)) + +var classArr = [new C(), new C()]; +>classArr : Symbol(classArr, Decl(arrayLiterals.ts, 17, 3)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) + +var classTypeArray = [C, C, C]; +>classTypeArray : Symbol(classTypeArray, Decl(arrayLiterals.ts, 19, 3), Decl(arrayLiterals.ts, 20, 3)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) + +var classTypeArray: Array; // Should OK, not be a parse error +>classTypeArray : Symbol(classTypeArray, Decl(arrayLiterals.ts, 19, 3), Decl(arrayLiterals.ts, 20, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>C : Symbol(C, Decl(arrayLiterals.ts, 14, 41)) + +// Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] +var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; +>context1 : Symbol(context1, Decl(arrayLiterals.ts, 23, 3)) +>n : Symbol(n, Decl(arrayLiterals.ts, 23, 17)) +>a : Symbol(a, Decl(arrayLiterals.ts, 23, 30)) +>b : Symbol(b, Decl(arrayLiterals.ts, 23, 41)) +>a : Symbol(a, Decl(arrayLiterals.ts, 23, 62)) +>b : Symbol(b, Decl(arrayLiterals.ts, 23, 69)) +>c : Symbol(c, Decl(arrayLiterals.ts, 23, 75)) +>a : Symbol(a, Decl(arrayLiterals.ts, 23, 86)) +>b : Symbol(b, Decl(arrayLiterals.ts, 23, 93)) +>c : Symbol(c, Decl(arrayLiterals.ts, 23, 99)) + +var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; +>context2 : Symbol(context2, Decl(arrayLiterals.ts, 24, 3)) +>a : Symbol(a, Decl(arrayLiterals.ts, 24, 17)) +>b : Symbol(b, Decl(arrayLiterals.ts, 24, 24)) +>c : Symbol(c, Decl(arrayLiterals.ts, 24, 30)) +>a : Symbol(a, Decl(arrayLiterals.ts, 24, 41)) +>b : Symbol(b, Decl(arrayLiterals.ts, 24, 48)) +>c : Symbol(c, Decl(arrayLiterals.ts, 24, 54)) + +// Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] +class Base { private p; } +>Base : Symbol(Base, Decl(arrayLiterals.ts, 24, 63)) +>p : Symbol(p, Decl(arrayLiterals.ts, 27, 12)) + +class Derived1 extends Base { private m }; +>Derived1 : Symbol(Derived1, Decl(arrayLiterals.ts, 27, 25)) +>Base : Symbol(Base, Decl(arrayLiterals.ts, 24, 63)) +>m : Symbol(m, Decl(arrayLiterals.ts, 28, 29)) + +class Derived2 extends Base { private n }; +>Derived2 : Symbol(Derived2, Decl(arrayLiterals.ts, 28, 42)) +>Base : Symbol(Base, Decl(arrayLiterals.ts, 24, 63)) +>n : Symbol(n, Decl(arrayLiterals.ts, 29, 29)) + +var context3: Base[] = [new Derived1(), new Derived2()]; +>context3 : Symbol(context3, Decl(arrayLiterals.ts, 30, 3)) +>Base : Symbol(Base, Decl(arrayLiterals.ts, 24, 63)) +>Derived1 : Symbol(Derived1, Decl(arrayLiterals.ts, 27, 25)) +>Derived2 : Symbol(Derived2, Decl(arrayLiterals.ts, 28, 42)) + +// Contextual type C with numeric index signature of type Base makes array literal of Derived1 and Derived2 have type Base[] +var context4: Base[] = [new Derived1(), new Derived1()]; +>context4 : Symbol(context4, Decl(arrayLiterals.ts, 33, 3)) +>Base : Symbol(Base, Decl(arrayLiterals.ts, 24, 63)) +>Derived1 : Symbol(Derived1, Decl(arrayLiterals.ts, 27, 25)) +>Derived1 : Symbol(Derived1, Decl(arrayLiterals.ts, 27, 25)) + + diff --git a/tests/baselines/reference/arrayLiterals.types b/tests/baselines/reference/arrayLiterals.types index b22543d3edf..841de336965 100644 --- a/tests/baselines/reference/arrayLiterals.types +++ b/tests/baselines/reference/arrayLiterals.types @@ -6,14 +6,19 @@ var arr1= [[], [1], ['']]; >[[], [1], ['']] : (string[] | number[])[] >[] : undefined[] >[1] : number[] +>1 : number >[''] : string[] +>'' : string var arr2 = [[null], [1], ['']]; >arr2 : (string[] | number[])[] >[[null], [1], ['']] : (string[] | number[])[] >[null] : null[] +>null : null >[1] : number[] +>1 : number >[''] : string[] +>'' : string // Array literal with elements of only EveryType E has type E[] @@ -21,19 +26,31 @@ var stringArrArr = [[''], [""]]; >stringArrArr : string[][] >[[''], [""]] : string[][] >[''] : string[] +>'' : string >[""] : string[] +>"" : string var stringArr = ['', ""]; >stringArr : string[] >['', ""] : string[] +>'' : string +>"" : string var numberArr = [0, 0.0, 0x00, 1e1]; >numberArr : number[] >[0, 0.0, 0x00, 1e1] : number[] +>0 : number +>0.0 : number +>0x00 : number +>1e1 : number var boolArr = [false, true, false, true]; >boolArr : boolean[] >[false, true, false, true] : boolean[] +>false : boolean +>true : boolean +>false : boolean +>true : boolean class C { private p; } >C : C @@ -68,24 +85,36 @@ var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: ' >[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] >{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } >a : string +>'' : string >b : number +>0 : number >c : string +>'' : string >{ a: "", b: 3, c: 0 } : { a: string; b: number; c: number; } >a : string +>"" : string >b : number +>3 : number >c : number +>0 : number var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; >context2 : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] >[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] >{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } >a : string +>'' : string >b : number +>0 : number >c : string +>'' : string >{ a: "", b: 3, c: 0 } : { a: string; b: number; c: number; } >a : string +>"" : string >b : number +>3 : number >c : number +>0 : number // Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] class Base { private p; } diff --git a/tests/baselines/reference/arrayLiterals.types.pull b/tests/baselines/reference/arrayLiterals.types.pull deleted file mode 100644 index bd06540aca3..00000000000 --- a/tests/baselines/reference/arrayLiterals.types.pull +++ /dev/null @@ -1,124 +0,0 @@ -=== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals.ts === -// Empty array literal with no contextual type has type Undefined[] - -var arr1= [[], [1], ['']]; ->arr1 : (number[] | string[])[] ->[[], [1], ['']] : (number[] | string[])[] ->[] : undefined[] ->[1] : number[] ->[''] : string[] - -var arr2 = [[null], [1], ['']]; ->arr2 : (number[] | string[])[] ->[[null], [1], ['']] : (number[] | string[])[] ->[null] : null[] ->[1] : number[] ->[''] : string[] - - -// Array literal with elements of only EveryType E has type E[] -var stringArrArr = [[''], [""]]; ->stringArrArr : string[][] ->[[''], [""]] : string[][] ->[''] : string[] ->[""] : string[] - -var stringArr = ['', ""]; ->stringArr : string[] ->['', ""] : string[] - -var numberArr = [0, 0.0, 0x00, 1e1]; ->numberArr : number[] ->[0, 0.0, 0x00, 1e1] : number[] - -var boolArr = [false, true, false, true]; ->boolArr : boolean[] ->[false, true, false, true] : boolean[] - -class C { private p; } ->C : C ->p : any - -var classArr = [new C(), new C()]; ->classArr : C[] ->[new C(), new C()] : C[] ->new C() : C ->C : typeof C ->new C() : C ->C : typeof C - -var classTypeArray = [C, C, C]; ->classTypeArray : typeof C[] ->[C, C, C] : typeof C[] ->C : typeof C ->C : typeof C ->C : typeof C - -var classTypeArray: Array; // Should OK, not be a parse error ->classTypeArray : typeof C[] ->Array : T[] ->C : typeof C - -// Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] -var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; ->context1 : { [n: number]: { a: string; b: number; }; } ->n : number ->a : string ->b : number ->[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] ->{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } ->a : string ->b : number ->c : string ->{ a: "", b: 3, c: 0 } : { a: string; b: number; c: number; } ->a : string ->b : number ->c : number - -var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; ->context2 : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] ->[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] ->{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } ->a : string ->b : number ->c : string ->{ a: "", b: 3, c: 0 } : { a: string; b: number; c: number; } ->a : string ->b : number ->c : number - -// Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] -class Base { private p; } ->Base : Base ->p : any - -class Derived1 extends Base { private m }; ->Derived1 : Derived1 ->Base : Base ->m : any - -class Derived2 extends Base { private n }; ->Derived2 : Derived2 ->Base : Base ->n : any - -var context3: Base[] = [new Derived1(), new Derived2()]; ->context3 : Base[] ->Base : Base ->[new Derived1(), new Derived2()] : (Derived1 | Derived2)[] ->new Derived1() : Derived1 ->Derived1 : typeof Derived1 ->new Derived2() : Derived2 ->Derived2 : typeof Derived2 - -// Contextual type C with numeric index signature of type Base makes array literal of Derived1 and Derived2 have type Base[] -var context4: Base[] = [new Derived1(), new Derived1()]; ->context4 : Base[] ->Base : Base ->[new Derived1(), new Derived1()] : Derived1[] ->new Derived1() : Derived1 ->Derived1 : typeof Derived1 ->new Derived1() : Derived1 ->Derived1 : typeof Derived1 - - diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.symbols b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.symbols new file mode 100644 index 00000000000..cd597dc2b4e --- /dev/null +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.symbols @@ -0,0 +1,79 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/arrayLiteralsWithRecursiveGenerics.ts === +class List { +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 11)) + + data: T; +>data : Symbol(data, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 15)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 11)) + + next: List>; +>next : Symbol(next, Decl(arrayLiteralsWithRecursiveGenerics.ts, 1, 12)) +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 11)) +} + +class DerivedList extends List { +>DerivedList : Symbol(DerivedList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 3, 1)) +>U : Symbol(U, Decl(arrayLiteralsWithRecursiveGenerics.ts, 5, 18)) +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) +>U : Symbol(U, Decl(arrayLiteralsWithRecursiveGenerics.ts, 5, 18)) + + foo: U; +>foo : Symbol(foo, Decl(arrayLiteralsWithRecursiveGenerics.ts, 5, 38)) +>U : Symbol(U, Decl(arrayLiteralsWithRecursiveGenerics.ts, 5, 18)) + + // next: List> +} + +class MyList { +>MyList : Symbol(MyList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 8, 1)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 10, 13)) + + data: T; +>data : Symbol(data, Decl(arrayLiteralsWithRecursiveGenerics.ts, 10, 17)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 10, 13)) + + next: MyList>; +>next : Symbol(next, Decl(arrayLiteralsWithRecursiveGenerics.ts, 11, 12)) +>MyList : Symbol(MyList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 8, 1)) +>MyList : Symbol(MyList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 8, 1)) +>T : Symbol(T, Decl(arrayLiteralsWithRecursiveGenerics.ts, 10, 13)) +} + +var list: List; +>list : Symbol(list, Decl(arrayLiteralsWithRecursiveGenerics.ts, 15, 3)) +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) + +var list2: List; +>list2 : Symbol(list2, Decl(arrayLiteralsWithRecursiveGenerics.ts, 16, 3)) +>List : Symbol(List, Decl(arrayLiteralsWithRecursiveGenerics.ts, 0, 0)) + +var myList: MyList; +>myList : Symbol(myList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 17, 3)) +>MyList : Symbol(MyList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 8, 1)) + +var xs = [list, myList]; // {}[] +>xs : Symbol(xs, Decl(arrayLiteralsWithRecursiveGenerics.ts, 19, 3)) +>list : Symbol(list, Decl(arrayLiteralsWithRecursiveGenerics.ts, 15, 3)) +>myList : Symbol(myList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 17, 3)) + +var ys = [list, list2]; // {}[] +>ys : Symbol(ys, Decl(arrayLiteralsWithRecursiveGenerics.ts, 20, 3)) +>list : Symbol(list, Decl(arrayLiteralsWithRecursiveGenerics.ts, 15, 3)) +>list2 : Symbol(list2, Decl(arrayLiteralsWithRecursiveGenerics.ts, 16, 3)) + +var zs = [list, null]; // List[] +>zs : Symbol(zs, Decl(arrayLiteralsWithRecursiveGenerics.ts, 21, 3)) +>list : Symbol(list, Decl(arrayLiteralsWithRecursiveGenerics.ts, 15, 3)) + +var myDerivedList: DerivedList; +>myDerivedList : Symbol(myDerivedList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 23, 3)) +>DerivedList : Symbol(DerivedList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 3, 1)) + +var as = [list, myDerivedList]; // List[] +>as : Symbol(as, Decl(arrayLiteralsWithRecursiveGenerics.ts, 24, 3)) +>list : Symbol(list, Decl(arrayLiteralsWithRecursiveGenerics.ts, 15, 3)) +>myDerivedList : Symbol(myDerivedList, Decl(arrayLiteralsWithRecursiveGenerics.ts, 23, 3)) + diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types index 1496e99adca..9b2abf25c2d 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types @@ -70,6 +70,7 @@ var zs = [list, null]; // List[] >zs : List[] >[list, null] : List[] >list : List +>null : null var myDerivedList: DerivedList; >myDerivedList : DerivedList diff --git a/tests/baselines/reference/arrayOfExportedClass.symbols b/tests/baselines/reference/arrayOfExportedClass.symbols new file mode 100644 index 00000000000..3d0905a1e2d --- /dev/null +++ b/tests/baselines/reference/arrayOfExportedClass.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/arrayOfExportedClass_1.ts === +/// +import Car = require('arrayOfExportedClass_0'); +>Car : Symbol(Car, Decl(arrayOfExportedClass_1.ts, 0, 0)) + +class Road { +>Road : Symbol(Road, Decl(arrayOfExportedClass_1.ts, 1, 47)) + + public cars: Car[]; +>cars : Symbol(cars, Decl(arrayOfExportedClass_1.ts, 3, 12)) +>Car : Symbol(Car, Decl(arrayOfExportedClass_1.ts, 0, 0)) + + public AddCars(cars: Car[]) { +>AddCars : Symbol(AddCars, Decl(arrayOfExportedClass_1.ts, 5, 23)) +>cars : Symbol(cars, Decl(arrayOfExportedClass_1.ts, 7, 19)) +>Car : Symbol(Car, Decl(arrayOfExportedClass_1.ts, 0, 0)) + + this.cars = cars; +>this.cars : Symbol(cars, Decl(arrayOfExportedClass_1.ts, 3, 12)) +>this : Symbol(Road, Decl(arrayOfExportedClass_1.ts, 1, 47)) +>cars : Symbol(cars, Decl(arrayOfExportedClass_1.ts, 3, 12)) +>cars : Symbol(cars, Decl(arrayOfExportedClass_1.ts, 7, 19)) + } +} + +export = Road; +>Road : Symbol(Road, Decl(arrayOfExportedClass_1.ts, 1, 47)) + +=== tests/cases/compiler/arrayOfExportedClass_0.ts === +class Car { +>Car : Symbol(Car, Decl(arrayOfExportedClass_0.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(arrayOfExportedClass_0.ts, 0, 11)) +} + +export = Car; +>Car : Symbol(Car, Decl(arrayOfExportedClass_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.symbols b/tests/baselines/reference/arrayOfFunctionTypes3.symbols new file mode 100644 index 00000000000..d26effeb5b7 --- /dev/null +++ b/tests/baselines/reference/arrayOfFunctionTypes3.symbols @@ -0,0 +1,93 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayOfFunctionTypes3.ts === +// valid uses of arrays of function types + +var x = [() => 1, () => { }]; +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 2, 3)) + +var r2 = x[0](); +>r2 : Symbol(r2, Decl(arrayOfFunctionTypes3.ts, 3, 3)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16)) + + foo: string; +>foo : Symbol(foo, Decl(arrayOfFunctionTypes3.ts, 5, 9)) +} +var y = [C, C]; +>y : Symbol(y, Decl(arrayOfFunctionTypes3.ts, 8, 3)) +>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16)) +>C : Symbol(C, Decl(arrayOfFunctionTypes3.ts, 3, 16)) + +var r3 = new y[0](); +>r3 : Symbol(r3, Decl(arrayOfFunctionTypes3.ts, 9, 3)) +>y : Symbol(y, Decl(arrayOfFunctionTypes3.ts, 8, 3)) + +var a: { (x: number): number; (x: string): string; }; +>a : Symbol(a, Decl(arrayOfFunctionTypes3.ts, 11, 3)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 11, 10)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 11, 31)) + +var b: { (x: number): number; (x: string): string; }; +>b : Symbol(b, Decl(arrayOfFunctionTypes3.ts, 12, 3)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 12, 10)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 12, 31)) + +var c: { (x: number): number; (x: any): any; }; +>c : Symbol(c, Decl(arrayOfFunctionTypes3.ts, 13, 3)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 13, 10)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 13, 31)) + +var z = [a, b, c]; +>z : Symbol(z, Decl(arrayOfFunctionTypes3.ts, 14, 3)) +>a : Symbol(a, Decl(arrayOfFunctionTypes3.ts, 11, 3)) +>b : Symbol(b, Decl(arrayOfFunctionTypes3.ts, 12, 3)) +>c : Symbol(c, Decl(arrayOfFunctionTypes3.ts, 13, 3)) + +var r4 = z[0]; +>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3)) +>z : Symbol(z, Decl(arrayOfFunctionTypes3.ts, 14, 3)) + +var r5 = r4(''); // any not string +>r5 : Symbol(r5, Decl(arrayOfFunctionTypes3.ts, 16, 3)) +>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3)) + +var r5b = r4(1); +>r5b : Symbol(r5b, Decl(arrayOfFunctionTypes3.ts, 17, 3)) +>r4 : Symbol(r4, Decl(arrayOfFunctionTypes3.ts, 15, 3)) + +var a2: { (x: T): number; (x: string): string;}; +>a2 : Symbol(a2, Decl(arrayOfFunctionTypes3.ts, 19, 3)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 19, 11)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 19, 14)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 19, 11)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 19, 30)) + +var b2: { (x: T): number; (x: string): string; }; +>b2 : Symbol(b2, Decl(arrayOfFunctionTypes3.ts, 20, 3)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 20, 11)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 20, 14)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 20, 11)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 20, 30)) + +var c2: { (x: number): number; (x: T): any; }; +>c2 : Symbol(c2, Decl(arrayOfFunctionTypes3.ts, 21, 3)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 21, 11)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 21, 32)) +>x : Symbol(x, Decl(arrayOfFunctionTypes3.ts, 21, 35)) +>T : Symbol(T, Decl(arrayOfFunctionTypes3.ts, 21, 32)) + +var z2 = [a2, b2, c2]; +>z2 : Symbol(z2, Decl(arrayOfFunctionTypes3.ts, 23, 3)) +>a2 : Symbol(a2, Decl(arrayOfFunctionTypes3.ts, 19, 3)) +>b2 : Symbol(b2, Decl(arrayOfFunctionTypes3.ts, 20, 3)) +>c2 : Symbol(c2, Decl(arrayOfFunctionTypes3.ts, 21, 3)) + +var r6 = z2[0]; +>r6 : Symbol(r6, Decl(arrayOfFunctionTypes3.ts, 24, 3)) +>z2 : Symbol(z2, Decl(arrayOfFunctionTypes3.ts, 23, 3)) + +var r7 = r6(''); // any not string +>r7 : Symbol(r7, Decl(arrayOfFunctionTypes3.ts, 25, 3)) +>r6 : Symbol(r6, Decl(arrayOfFunctionTypes3.ts, 24, 3)) + diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.types b/tests/baselines/reference/arrayOfFunctionTypes3.types index 3ef5334382c..0ed92991ed0 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.types +++ b/tests/baselines/reference/arrayOfFunctionTypes3.types @@ -5,6 +5,7 @@ var x = [() => 1, () => { }]; >x : (() => void)[] >[() => 1, () => { }] : (() => void)[] >() => 1 : () => number +>1 : number >() => { } : () => void var r2 = x[0](); @@ -12,6 +13,7 @@ var r2 = x[0](); >x[0]() : void >x[0] : () => void >x : (() => void)[] +>0 : number class C { >C : C @@ -30,6 +32,7 @@ var r3 = new y[0](); >new y[0]() : C >y[0] : typeof C >y : typeof C[] +>0 : number var a: { (x: number): number; (x: string): string; }; >a : { (x: number): number; (x: string): string; } @@ -57,16 +60,19 @@ var r4 = z[0]; >r4 : { (x: number): number; (x: any): any; } >z[0] : { (x: number): number; (x: any): any; } >z : { (x: number): number; (x: any): any; }[] +>0 : number var r5 = r4(''); // any not string >r5 : any >r4('') : any >r4 : { (x: number): number; (x: any): any; } +>'' : string var r5b = r4(1); >r5b : number >r4(1) : number >r4 : { (x: number): number; (x: any): any; } +>1 : number var a2: { (x: T): number; (x: string): string;}; >a2 : { (x: T): number; (x: string): string; } @@ -100,9 +106,11 @@ var r6 = z2[0]; >r6 : { (x: number): number; (x: T): any; } >z2[0] : { (x: number): number; (x: T): any; } >z2 : { (x: number): number; (x: T): any; }[] +>0 : number var r7 = r6(''); // any not string >r7 : any >r6('') : any >r6 : { (x: number): number; (x: T): any; } +>'' : string diff --git a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.symbols b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.symbols new file mode 100644 index 00000000000..d9665e98eb5 --- /dev/null +++ b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.symbols @@ -0,0 +1,89 @@ +=== tests/cases/compiler/arrayTypeInSignatureOfInterfaceAndClass.ts === +declare module WinJS { +>WinJS : Symbol(WinJS, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 0)) + + class Promise { +>Promise : Symbol(Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 1, 18)) + + then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; +>then : Symbol(then, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 1, 22)) +>U : Symbol(U, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 13)) +>success : Symbol(success, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 16)) +>value : Symbol(value, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 27)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 1, 18)) +>Promise : Symbol(Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>U : Symbol(U, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 13)) +>error : Symbol(error, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 51)) +>error : Symbol(error, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 61)) +>Promise : Symbol(Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>U : Symbol(U, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 13)) +>progress : Symbol(progress, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 87)) +>progress : Symbol(progress, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 100)) +>Promise : Symbol(Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>U : Symbol(U, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 2, 13)) + } +} +declare module Data { +>Data : Symbol(Data, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 4, 1)) + + export interface IListItem { +>IListItem : Symbol(IListItem, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 5, 21)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 6, 31)) + + itemIndex: number; +>itemIndex : Symbol(itemIndex, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 6, 35)) + + key: any; +>key : Symbol(key, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 7, 26)) + + data: T; +>data : Symbol(data, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 8, 17)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 6, 31)) + + group: any; +>group : Symbol(group, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 9, 16)) + + isHeader: boolean; +>isHeader : Symbol(isHeader, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 10, 19)) + + cached: boolean; +>cached : Symbol(cached, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 11, 26)) + + isNonSourceData: boolean; +>isNonSourceData : Symbol(isNonSourceData, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 12, 24)) + + preventAugmentation: boolean; +>preventAugmentation : Symbol(preventAugmentation, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 13, 33)) + } + export interface IVirtualList { +>IVirtualList : Symbol(IVirtualList, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 15, 5)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 16, 34)) + + //removeIndices: WinJS.Promise[]>; + removeIndices(indices: number[], options?: any): WinJS.Promise[]>; +>removeIndices : Symbol(removeIndices, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 16, 38)) +>indices : Symbol(indices, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 18, 22)) +>options : Symbol(options, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 18, 40)) +>WinJS : Symbol(WinJS, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 0)) +>Promise : Symbol(WinJS.Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>IListItem : Symbol(IListItem, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 5, 21)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 16, 34)) + } + export class VirtualList implements IVirtualList { +>VirtualList : Symbol(VirtualList, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 19, 5)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 20, 29)) +>IVirtualList : Symbol(IVirtualList, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 15, 5)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 20, 29)) + + //removeIndices: WinJS.Promise[]>; + public removeIndices(indices: number[], options?: any): WinJS.Promise[]>; +>removeIndices : Symbol(removeIndices, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 20, 60)) +>indices : Symbol(indices, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 22, 29)) +>options : Symbol(options, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 22, 47)) +>WinJS : Symbol(WinJS, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 0)) +>Promise : Symbol(WinJS.Promise, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 0, 22)) +>IListItem : Symbol(IListItem, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 5, 21)) +>T : Symbol(T, Decl(arrayTypeInSignatureOfInterfaceAndClass.ts, 20, 29)) + } +} diff --git a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types index 419db571c05..57a8c73e5e6 100644 --- a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types +++ b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types @@ -65,7 +65,7 @@ declare module Data { >removeIndices : (indices: number[], options?: any) => WinJS.Promise[]> >indices : number[] >options : any ->WinJS : unknown +>WinJS : any >Promise : WinJS.Promise >IListItem : IListItem >T : T @@ -81,7 +81,7 @@ declare module Data { >removeIndices : (indices: number[], options?: any) => WinJS.Promise[]> >indices : number[] >options : any ->WinJS : unknown +>WinJS : any >Promise : WinJS.Promise >IListItem : IListItem >T : T diff --git a/tests/baselines/reference/arrayconcat.symbols b/tests/baselines/reference/arrayconcat.symbols new file mode 100644 index 00000000000..64e63d7c2ec --- /dev/null +++ b/tests/baselines/reference/arrayconcat.symbols @@ -0,0 +1,81 @@ +=== tests/cases/compiler/arrayconcat.ts === +interface IOptions { +>IOptions : Symbol(IOptions, Decl(arrayconcat.ts, 0, 0)) + + name?: string; +>name : Symbol(name, Decl(arrayconcat.ts, 0, 20)) + + flag?: boolean; +>flag : Symbol(flag, Decl(arrayconcat.ts, 1, 18)) + + short?: string; +>short : Symbol(short, Decl(arrayconcat.ts, 2, 19)) + + usage?: string; +>usage : Symbol(usage, Decl(arrayconcat.ts, 3, 19)) + + set?: (s: string) => void; +>set : Symbol(set, Decl(arrayconcat.ts, 4, 19)) +>s : Symbol(s, Decl(arrayconcat.ts, 5, 11)) + + type?: string; +>type : Symbol(type, Decl(arrayconcat.ts, 5, 30)) + + experimental?: boolean; +>experimental : Symbol(experimental, Decl(arrayconcat.ts, 6, 18)) +} + +class parser { +>parser : Symbol(parser, Decl(arrayconcat.ts, 8, 1)) + + public options: IOptions[]; +>options : Symbol(options, Decl(arrayconcat.ts, 10, 14)) +>IOptions : Symbol(IOptions, Decl(arrayconcat.ts, 0, 0)) + + public m() { +>m : Symbol(m, Decl(arrayconcat.ts, 11, 28)) + + this.options = this.options.sort(function(a, b) { +>this.options : Symbol(options, Decl(arrayconcat.ts, 10, 14)) +>this : Symbol(parser, Decl(arrayconcat.ts, 8, 1)) +>options : Symbol(options, Decl(arrayconcat.ts, 10, 14)) +>this.options.sort : Symbol(Array.sort, Decl(lib.d.ts, 1054, 45)) +>this.options : Symbol(options, Decl(arrayconcat.ts, 10, 14)) +>this : Symbol(parser, Decl(arrayconcat.ts, 8, 1)) +>options : Symbol(options, Decl(arrayconcat.ts, 10, 14)) +>sort : Symbol(Array.sort, Decl(lib.d.ts, 1054, 45)) +>a : Symbol(a, Decl(arrayconcat.ts, 14, 44)) +>b : Symbol(b, Decl(arrayconcat.ts, 14, 46)) + + var aName = a.name.toLowerCase(); +>aName : Symbol(aName, Decl(arrayconcat.ts, 15, 15)) +>a.name.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>a.name : Symbol(IOptions.name, Decl(arrayconcat.ts, 0, 20)) +>a : Symbol(a, Decl(arrayconcat.ts, 14, 44)) +>name : Symbol(IOptions.name, Decl(arrayconcat.ts, 0, 20)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) + + var bName = b.name.toLowerCase(); +>bName : Symbol(bName, Decl(arrayconcat.ts, 16, 15)) +>b.name.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>b.name : Symbol(IOptions.name, Decl(arrayconcat.ts, 0, 20)) +>b : Symbol(b, Decl(arrayconcat.ts, 14, 46)) +>name : Symbol(IOptions.name, Decl(arrayconcat.ts, 0, 20)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) + + if (aName > bName) { +>aName : Symbol(aName, Decl(arrayconcat.ts, 15, 15)) +>bName : Symbol(bName, Decl(arrayconcat.ts, 16, 15)) + + return 1; + } else if (aName < bName) { +>aName : Symbol(aName, Decl(arrayconcat.ts, 15, 15)) +>bName : Symbol(bName, Decl(arrayconcat.ts, 16, 15)) + + return -1; + } else { + return 0; + } + }); + } +} diff --git a/tests/baselines/reference/arrayconcat.types b/tests/baselines/reference/arrayconcat.types index 37e7308aad9..3560272a363 100644 --- a/tests/baselines/reference/arrayconcat.types +++ b/tests/baselines/reference/arrayconcat.types @@ -74,6 +74,8 @@ class parser { >bName : string return 1; +>1 : number + } else if (aName < bName) { >aName < bName : boolean >aName : string @@ -81,9 +83,11 @@ class parser { return -1; >-1 : number +>1 : number } else { return 0; +>0 : number } }); } diff --git a/tests/baselines/reference/arrowFunctionExpressions.symbols b/tests/baselines/reference/arrowFunctionExpressions.symbols new file mode 100644 index 00000000000..28945e1179f --- /dev/null +++ b/tests/baselines/reference/arrowFunctionExpressions.symbols @@ -0,0 +1,262 @@ +=== tests/cases/conformance/expressions/functions/arrowFunctionExpressions.ts === +// ArrowFormalParameters => AssignmentExpression is equivalent to ArrowFormalParameters => { return AssignmentExpression; } +var a = (p: string) => p.length; +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 1, 3), Decl(arrowFunctionExpressions.ts, 2, 3)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 1, 9)) +>p.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 1, 9)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + +var a = (p: string) => { return p.length; } +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 1, 3), Decl(arrowFunctionExpressions.ts, 2, 3)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 2, 9)) +>p.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 2, 9)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + +// Identifier => Block is equivalent to(Identifier) => Block +var b = j => { return 0; } +>b : Symbol(b, Decl(arrowFunctionExpressions.ts, 5, 3), Decl(arrowFunctionExpressions.ts, 6, 3)) +>j : Symbol(j, Decl(arrowFunctionExpressions.ts, 5, 7)) + +var b = (j) => { return 0; } +>b : Symbol(b, Decl(arrowFunctionExpressions.ts, 5, 3), Decl(arrowFunctionExpressions.ts, 6, 3)) +>j : Symbol(j, Decl(arrowFunctionExpressions.ts, 6, 9)) + +// Identifier => AssignmentExpression is equivalent to(Identifier) => AssignmentExpression +var c: number; +>c : Symbol(c, Decl(arrowFunctionExpressions.ts, 9, 3)) + +var d = n => c = n; +>d : Symbol(d, Decl(arrowFunctionExpressions.ts, 10, 3), Decl(arrowFunctionExpressions.ts, 11, 3), Decl(arrowFunctionExpressions.ts, 12, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 10, 7)) +>c : Symbol(c, Decl(arrowFunctionExpressions.ts, 9, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 10, 7)) + +var d = (n) => c = n; +>d : Symbol(d, Decl(arrowFunctionExpressions.ts, 10, 3), Decl(arrowFunctionExpressions.ts, 11, 3), Decl(arrowFunctionExpressions.ts, 12, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 11, 9)) +>c : Symbol(c, Decl(arrowFunctionExpressions.ts, 9, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 11, 9)) + +var d: (n: any) => any; +>d : Symbol(d, Decl(arrowFunctionExpressions.ts, 10, 3), Decl(arrowFunctionExpressions.ts, 11, 3), Decl(arrowFunctionExpressions.ts, 12, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 12, 8)) + +// Binding patterns in arrow functions +var p1 = ([a]) => { }; +>p1 : Symbol(p1, Decl(arrowFunctionExpressions.ts, 15, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 15, 11)) + +var p2 = ([...a]) => { }; +>p2 : Symbol(p2, Decl(arrowFunctionExpressions.ts, 16, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 16, 11)) + +var p3 = ([, a]) => { }; +>p3 : Symbol(p3, Decl(arrowFunctionExpressions.ts, 17, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 17, 12)) + +var p4 = ([, ...a]) => { }; +>p4 : Symbol(p4, Decl(arrowFunctionExpressions.ts, 18, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 18, 12)) + +var p5 = ([a = 1]) => { }; +>p5 : Symbol(p5, Decl(arrowFunctionExpressions.ts, 19, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 19, 11)) + +var p6 = ({ a }) => { }; +>p6 : Symbol(p6, Decl(arrowFunctionExpressions.ts, 20, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 20, 11)) + +var p7 = ({ a: { b } }) => { }; +>p7 : Symbol(p7, Decl(arrowFunctionExpressions.ts, 21, 3)) +>b : Symbol(b, Decl(arrowFunctionExpressions.ts, 21, 16)) + +var p8 = ({ a = 1 }) => { }; +>p8 : Symbol(p8, Decl(arrowFunctionExpressions.ts, 22, 3)) +>a : Symbol(a, Decl(arrowFunctionExpressions.ts, 22, 11)) + +var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; +>p9 : Symbol(p9, Decl(arrowFunctionExpressions.ts, 23, 3)) +>b : Symbol(b, Decl(arrowFunctionExpressions.ts, 23, 16)) +>b : Symbol(b, Decl(arrowFunctionExpressions.ts, 23, 28)) + +var p10 = ([{ value, done }]) => { }; +>p10 : Symbol(p10, Decl(arrowFunctionExpressions.ts, 24, 3)) +>value : Symbol(value, Decl(arrowFunctionExpressions.ts, 24, 13)) +>done : Symbol(done, Decl(arrowFunctionExpressions.ts, 24, 20)) + +// Arrow function used in class member initializer +// Arrow function used in class member function +class MyClass { +>MyClass : Symbol(MyClass, Decl(arrowFunctionExpressions.ts, 24, 37)) + + m = (n) => n + 1; +>m : Symbol(m, Decl(arrowFunctionExpressions.ts, 28, 15)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 29, 9)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 29, 9)) + + p = (n) => n && this; +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 29, 21)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 30, 9)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 30, 9)) +>this : Symbol(MyClass, Decl(arrowFunctionExpressions.ts, 24, 37)) + + fn() { +>fn : Symbol(fn, Decl(arrowFunctionExpressions.ts, 30, 25)) + + var m = (n) => n + 1; +>m : Symbol(m, Decl(arrowFunctionExpressions.ts, 33, 11)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 33, 17)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 33, 17)) + + var p = (n) => n && this; +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 34, 11)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 34, 17)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 34, 17)) +>this : Symbol(MyClass, Decl(arrowFunctionExpressions.ts, 24, 37)) + } +} + +// Arrow function used in arrow function +var arrrr = () => (m: number) => () => (n: number) => m + n; +>arrrr : Symbol(arrrr, Decl(arrowFunctionExpressions.ts, 39, 3)) +>m : Symbol(m, Decl(arrowFunctionExpressions.ts, 39, 19)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 39, 40)) +>m : Symbol(m, Decl(arrowFunctionExpressions.ts, 39, 19)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 39, 40)) + +var e = arrrr()(3)()(4); +>e : Symbol(e, Decl(arrowFunctionExpressions.ts, 40, 3), Decl(arrowFunctionExpressions.ts, 41, 3)) +>arrrr : Symbol(arrrr, Decl(arrowFunctionExpressions.ts, 39, 3)) + +var e: number; +>e : Symbol(e, Decl(arrowFunctionExpressions.ts, 40, 3), Decl(arrowFunctionExpressions.ts, 41, 3)) + +// Arrow function used in arrow function used in function +function someFn() { +>someFn : Symbol(someFn, Decl(arrowFunctionExpressions.ts, 41, 14)) + + var arr = (n: number) => (p: number) => p * n; +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 45, 7)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 45, 15)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 45, 30)) +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 45, 30)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 45, 15)) + + arr(3)(4).toExponential(); +>arr(3)(4).toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 45, 7)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +} + +// Arrow function used in function +function someOtherFn() { +>someOtherFn : Symbol(someOtherFn, Decl(arrowFunctionExpressions.ts, 47, 1)) + + var arr = (n: number) => '' + n; +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 51, 7)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 51, 15)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 51, 15)) + + arr(4).charAt(0); +>arr(4).charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 51, 7)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +} + +// Arrow function used in nested function in function +function outerFn() { +>outerFn : Symbol(outerFn, Decl(arrowFunctionExpressions.ts, 53, 1)) + + function innerFn() { +>innerFn : Symbol(innerFn, Decl(arrowFunctionExpressions.ts, 56, 20)) + + var arrowFn = () => { }; +>arrowFn : Symbol(arrowFn, Decl(arrowFunctionExpressions.ts, 58, 11)) + + var p = arrowFn(); +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 59, 11), Decl(arrowFunctionExpressions.ts, 60, 11)) +>arrowFn : Symbol(arrowFn, Decl(arrowFunctionExpressions.ts, 58, 11)) + + var p: void; +>p : Symbol(p, Decl(arrowFunctionExpressions.ts, 59, 11), Decl(arrowFunctionExpressions.ts, 60, 11)) + } +} + +// Arrow function used in nested function in arrow function +var f = (n: string) => { +>f : Symbol(f, Decl(arrowFunctionExpressions.ts, 65, 3)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 65, 9)) + + function fn(x: number) { +>fn : Symbol(fn, Decl(arrowFunctionExpressions.ts, 65, 24)) +>x : Symbol(x, Decl(arrowFunctionExpressions.ts, 66, 16)) + + return () => n + x; +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 65, 9)) +>x : Symbol(x, Decl(arrowFunctionExpressions.ts, 66, 16)) + } + return fn(4); +>fn : Symbol(fn, Decl(arrowFunctionExpressions.ts, 65, 24)) +} +var g = f('')(); +>g : Symbol(g, Decl(arrowFunctionExpressions.ts, 71, 3), Decl(arrowFunctionExpressions.ts, 72, 3)) +>f : Symbol(f, Decl(arrowFunctionExpressions.ts, 65, 3)) + +var g: string; +>g : Symbol(g, Decl(arrowFunctionExpressions.ts, 71, 3), Decl(arrowFunctionExpressions.ts, 72, 3)) + + +// Arrow function used in nested function in arrow function in nested function +function someOuterFn() { +>someOuterFn : Symbol(someOuterFn, Decl(arrowFunctionExpressions.ts, 72, 14)) + + var arr = (n: string) => { +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 77, 7)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 77, 15)) + + function innerFn() { +>innerFn : Symbol(innerFn, Decl(arrowFunctionExpressions.ts, 77, 30)) + + return () => n.length; +>n.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>n : Symbol(n, Decl(arrowFunctionExpressions.ts, 77, 15)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + } + return innerFn; +>innerFn : Symbol(innerFn, Decl(arrowFunctionExpressions.ts, 77, 30)) + } + return arr; +>arr : Symbol(arr, Decl(arrowFunctionExpressions.ts, 77, 7)) +} +var h = someOuterFn()('')()(); +>h : Symbol(h, Decl(arrowFunctionExpressions.ts, 85, 3)) +>someOuterFn : Symbol(someOuterFn, Decl(arrowFunctionExpressions.ts, 72, 14)) + +h.toExponential(); +>h.toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>h : Symbol(h, Decl(arrowFunctionExpressions.ts, 85, 3)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) + +// Arrow function used in try/catch/finally in function +function tryCatchFn() { +>tryCatchFn : Symbol(tryCatchFn, Decl(arrowFunctionExpressions.ts, 86, 18)) + + try { + var x = () => this; +>x : Symbol(x, Decl(arrowFunctionExpressions.ts, 91, 11)) + + } catch (e) { +>e : Symbol(e, Decl(arrowFunctionExpressions.ts, 92, 13)) + + var t = () => e + this; +>t : Symbol(t, Decl(arrowFunctionExpressions.ts, 93, 11)) +>e : Symbol(e, Decl(arrowFunctionExpressions.ts, 92, 13)) + + } finally { + var m = () => this + ''; +>m : Symbol(m, Decl(arrowFunctionExpressions.ts, 95, 11)) + } +} + diff --git a/tests/baselines/reference/arrowFunctionExpressions.types b/tests/baselines/reference/arrowFunctionExpressions.types index c10ecdad353..fc9fdb8a3bd 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.types +++ b/tests/baselines/reference/arrowFunctionExpressions.types @@ -21,11 +21,13 @@ var b = j => { return 0; } >b : (j: any) => number >j => { return 0; } : (j: any) => number >j : any +>0 : number var b = (j) => { return 0; } >b : (j: any) => number >(j) => { return 0; } : (j: any) => number >j : any +>0 : number // Identifier => AssignmentExpression is equivalent to(Identifier) => AssignmentExpression var c: number; @@ -65,17 +67,20 @@ var p2 = ([...a]) => { }; var p3 = ([, a]) => { }; >p3 : ([, a]: [any, any]) => void >([, a]) => { } : ([, a]: [any, any]) => void +> : undefined >a : any var p4 = ([, ...a]) => { }; >p4 : ([, ...a]: any[]) => void >([, ...a]) => { } : ([, ...a]: any[]) => void +> : undefined >a : any[] var p5 = ([a = 1]) => { }; >p5 : ([a = 1]: [number]) => void >([a = 1]) => { } : ([a = 1]: [number]) => void >a : number +>1 : number var p6 = ({ a }) => { }; >p6 : ({ a }: { a: any; }) => void @@ -85,21 +90,24 @@ var p6 = ({ a }) => { }; var p7 = ({ a: { b } }) => { }; >p7 : ({ a: { b } }: { a: { b: any; }; }) => void >({ a: { b } }) => { } : ({ a: { b } }: { a: { b: any; }; }) => void ->a : unknown +>a : any >b : any var p8 = ({ a = 1 }) => { }; >p8 : ({ a = 1 }: { a?: number; }) => void >({ a = 1 }) => { } : ({ a = 1 }: { a?: number; }) => void >a : number +>1 : number var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; >p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void >({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void ->a : unknown +>a : any >b : number +>1 : number >{ b: 1 } : { b: number; } >b : number +>1 : number var p10 = ([{ value, done }]) => { }; >p10 : ([{ value, done }]: [{ value: any; done: any; }]) => void @@ -118,6 +126,7 @@ class MyClass { >n : any >n + 1 : any >n : any +>1 : number p = (n) => n && this; >p : (n: any) => MyClass @@ -136,6 +145,7 @@ class MyClass { >n : any >n + 1 : any >n : any +>1 : number var p = (n) => n && this; >p : (n: any) => MyClass @@ -167,6 +177,8 @@ var e = arrrr()(3)()(4); >arrrr()(3) : () => (n: number) => number >arrrr() : (m: number) => () => (n: number) => number >arrrr : () => (m: number) => () => (n: number) => number +>3 : number +>4 : number var e: number; >e : number @@ -191,6 +203,8 @@ function someFn() { >arr(3)(4) : number >arr(3) : (p: number) => number >arr : (n: number) => (p: number) => number +>3 : number +>4 : number >toExponential : (fractionDigits?: number) => string } @@ -203,6 +217,7 @@ function someOtherFn() { >(n: number) => '' + n : (n: number) => string >n : number >'' + n : string +>'' : string >n : number arr(4).charAt(0); @@ -210,7 +225,9 @@ function someOtherFn() { >arr(4).charAt : (pos: number) => string >arr(4) : string >arr : (n: number) => string +>4 : number >charAt : (pos: number) => string +>0 : number } // Arrow function used in nested function in function @@ -253,12 +270,14 @@ var f = (n: string) => { return fn(4); >fn(4) : () => string >fn : (x: number) => () => string +>4 : number } var g = f('')(); >g : string >f('')() : string >f('') : () => string >f : (n: string) => () => string +>'' : string var g: string; >g : string @@ -295,6 +314,7 @@ var h = someOuterFn()('')()(); >someOuterFn()('') : () => () => number >someOuterFn() : (n: string) => () => () => number >someOuterFn : () => (n: string) => () => () => number +>'' : string h.toExponential(); >h.toExponential() : string @@ -328,6 +348,7 @@ function tryCatchFn() { >() => this + '' : () => string >this + '' : string >this : any +>'' : string } } diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement1.symbols b/tests/baselines/reference/arrowFunctionInExpressionStatement1.symbols new file mode 100644 index 00000000000..690ff3500c8 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement1.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/arrowFunctionInExpressionStatement1.ts === +() => 0; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement1.types b/tests/baselines/reference/arrowFunctionInExpressionStatement1.types index a5360a18fc0..a38a868f85b 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement1.types +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement1.types @@ -1,4 +1,5 @@ === tests/cases/compiler/arrowFunctionInExpressionStatement1.ts === () => 0; >() => 0 : () => number +>0 : number diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement2.symbols b/tests/baselines/reference/arrowFunctionInExpressionStatement2.symbols new file mode 100644 index 00000000000..c9bbfde9974 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/arrowFunctionInExpressionStatement2.ts === +module M { +>M : Symbol(M, Decl(arrowFunctionInExpressionStatement2.ts, 0, 0)) + + () => 0; +} diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement2.types b/tests/baselines/reference/arrowFunctionInExpressionStatement2.types index d4bb431fa8d..bfbd11e8c08 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement2.types +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement2.types @@ -4,4 +4,5 @@ module M { () => 0; >() => 0 : () => number +>0 : number } diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.symbols new file mode 100644 index 00000000000..b4f68e045fe --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody1.ts === +var v = a => {} +>v : Symbol(v, Decl(arrowFunctionWithObjectLiteralBody1.ts, 0, 3)) +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody1.ts, 0, 7)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.symbols new file mode 100644 index 00000000000..1f8b83a23f1 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody2.ts === +var v = a => {} +>v : Symbol(v, Decl(arrowFunctionWithObjectLiteralBody2.ts, 0, 3)) +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody2.ts, 0, 7)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody3.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody3.symbols new file mode 100644 index 00000000000..92122d16fc9 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody3.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody3.ts === +var v = a => {} +>v : Symbol(v, Decl(arrowFunctionWithObjectLiteralBody3.ts, 0, 3)) +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody3.ts, 0, 7)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody4.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody4.symbols new file mode 100644 index 00000000000..74a6b6a2b9d --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody4.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody4.ts === +var v = a => {} +>v : Symbol(v, Decl(arrowFunctionWithObjectLiteralBody4.ts, 0, 3)) +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody4.ts, 0, 7)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.symbols new file mode 100644 index 00000000000..c1d1cf40d90 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody5.ts === +var a = () => { name: "foo", message: "bar" }; +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody5.ts, 0, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody5.ts, 0, 22)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody5.ts, 0, 35)) + +var b = () => ({ name: "foo", message: "bar" }); +>b : Symbol(b, Decl(arrowFunctionWithObjectLiteralBody5.ts, 2, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody5.ts, 2, 23)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody5.ts, 2, 36)) + +var c = () => ({ name: "foo", message: "bar" }); +>c : Symbol(c, Decl(arrowFunctionWithObjectLiteralBody5.ts, 4, 3)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody5.ts, 4, 16)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody5.ts, 4, 29)) + +var d = () => ((({ name: "foo", message: "bar" }))); +>d : Symbol(d, Decl(arrowFunctionWithObjectLiteralBody5.ts, 6, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody5.ts, 6, 25)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody5.ts, 6, 38)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types index 15b3697732a..0093ace2d9c 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types @@ -6,7 +6,9 @@ var a = () => { name: "foo", message: "bar" }; >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var b = () => ({ name: "foo", message: "bar" }); >b : () => Error @@ -16,7 +18,9 @@ var b = () => ({ name: "foo", message: "bar" }); >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var c = () => ({ name: "foo", message: "bar" }); >c : () => { name: string; message: string; } @@ -24,7 +28,9 @@ var c = () => ({ name: "foo", message: "bar" }); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var d = () => ((({ name: "foo", message: "bar" }))); >d : () => Error @@ -36,5 +42,7 @@ var d = () => ((({ name: "foo", message: "bar" }))); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.symbols new file mode 100644 index 00000000000..80530cde016 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody6.ts === +var a = () => { name: "foo", message: "bar" }; +>a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody6.ts, 0, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 0, 22)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 0, 35)) + +var b = () => ({ name: "foo", message: "bar" }); +>b : Symbol(b, Decl(arrowFunctionWithObjectLiteralBody6.ts, 2, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 2, 23)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 2, 36)) + +var c = () => ({ name: "foo", message: "bar" }); +>c : Symbol(c, Decl(arrowFunctionWithObjectLiteralBody6.ts, 4, 3)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 4, 16)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 4, 29)) + +var d = () => ((({ name: "foo", message: "bar" }))); +>d : Symbol(d, Decl(arrowFunctionWithObjectLiteralBody6.ts, 6, 3)) +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +>name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 6, 25)) +>message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 6, 38)) + diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types index 14a45dca213..31d2a63fec0 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types @@ -6,7 +6,9 @@ var a = () => { name: "foo", message: "bar" }; >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var b = () => ({ name: "foo", message: "bar" }); >b : () => Error @@ -16,7 +18,9 @@ var b = () => ({ name: "foo", message: "bar" }); >Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var c = () => ({ name: "foo", message: "bar" }); >c : () => { name: string; message: string; } @@ -24,7 +28,9 @@ var c = () => ({ name: "foo", message: "bar" }); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string var d = () => ((({ name: "foo", message: "bar" }))); >d : () => Error @@ -36,5 +42,7 @@ var d = () => ((({ name: "foo", message: "bar" }))); >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string +>"foo" : string >message : string +>"bar" : string diff --git a/tests/baselines/reference/asiAmbientFunctionDeclaration.symbols b/tests/baselines/reference/asiAmbientFunctionDeclaration.symbols new file mode 100644 index 00000000000..d32b9a67619 --- /dev/null +++ b/tests/baselines/reference/asiAmbientFunctionDeclaration.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/asiAmbientFunctionDeclaration.ts === +declare function foo() +>foo : Symbol(foo, Decl(asiAmbientFunctionDeclaration.ts, 0, 0)) + diff --git a/tests/baselines/reference/asiArith.symbols b/tests/baselines/reference/asiArith.symbols new file mode 100644 index 00000000000..40b15d0723e --- /dev/null +++ b/tests/baselines/reference/asiArith.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/asiArith.ts === +var x = 1; +>x : Symbol(x, Decl(asiArith.ts, 0, 3)) + +var y = 1; +>y : Symbol(y, Decl(asiArith.ts, 2, 3)) + +var z = +>z : Symbol(z, Decl(asiArith.ts, 4, 3)) + +x +>x : Symbol(x, Decl(asiArith.ts, 0, 3)) + ++ + ++ + ++ + +y +>y : Symbol(y, Decl(asiArith.ts, 2, 3)) + + +var a = 1; +>a : Symbol(a, Decl(asiArith.ts, 17, 3)) + +var b = 1; +>b : Symbol(b, Decl(asiArith.ts, 19, 3)) + +var c = +>c : Symbol(c, Decl(asiArith.ts, 21, 3)) + +x +>x : Symbol(x, Decl(asiArith.ts, 0, 3)) + +- + +- + +- + +y +>y : Symbol(y, Decl(asiArith.ts, 2, 3)) + + diff --git a/tests/baselines/reference/asiArith.types b/tests/baselines/reference/asiArith.types index d6c0c7abd71..13394d2f1c2 100644 --- a/tests/baselines/reference/asiArith.types +++ b/tests/baselines/reference/asiArith.types @@ -1,9 +1,11 @@ === tests/cases/compiler/asiArith.ts === var x = 1; >x : number +>1 : number var y = 1; >y : number +>1 : number var z = >z : number @@ -26,9 +28,11 @@ y var a = 1; >a : number +>1 : number var b = 1; >b : number +>1 : number var c = >c : number diff --git a/tests/baselines/reference/asiBreak.symbols b/tests/baselines/reference/asiBreak.symbols new file mode 100644 index 00000000000..355d27f2a43 --- /dev/null +++ b/tests/baselines/reference/asiBreak.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/asiBreak.ts === +while (true) break +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/asiBreak.types b/tests/baselines/reference/asiBreak.types index 355d27f2a43..af3d6a040d5 100644 --- a/tests/baselines/reference/asiBreak.types +++ b/tests/baselines/reference/asiBreak.types @@ -1,3 +1,4 @@ === tests/cases/compiler/asiBreak.ts === while (true) break -No type information for this code. \ No newline at end of file +>true : boolean + diff --git a/tests/baselines/reference/asiContinue.symbols b/tests/baselines/reference/asiContinue.symbols new file mode 100644 index 00000000000..5b3f0145377 --- /dev/null +++ b/tests/baselines/reference/asiContinue.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/asiContinue.ts === +while (true) continue +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/asiContinue.types b/tests/baselines/reference/asiContinue.types index 5b3f0145377..e2eb5ba107d 100644 --- a/tests/baselines/reference/asiContinue.types +++ b/tests/baselines/reference/asiContinue.types @@ -1,3 +1,4 @@ === tests/cases/compiler/asiContinue.ts === while (true) continue -No type information for this code. \ No newline at end of file +>true : boolean + diff --git a/tests/baselines/reference/asiInES6Classes.symbols b/tests/baselines/reference/asiInES6Classes.symbols new file mode 100644 index 00000000000..e6af356008d --- /dev/null +++ b/tests/baselines/reference/asiInES6Classes.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/asiInES6Classes.ts === +class Foo { +>Foo : Symbol(Foo, Decl(asiInES6Classes.ts, 0, 0)) + + + + defaults = { +>defaults : Symbol(defaults, Decl(asiInES6Classes.ts, 0, 11)) + + done: false +>done : Symbol(done, Decl(asiInES6Classes.ts, 4, 16)) + + } + + + + bar() { +>bar : Symbol(bar, Decl(asiInES6Classes.ts, 8, 5)) + + return 3; + + } + + + +} + diff --git a/tests/baselines/reference/asiInES6Classes.types b/tests/baselines/reference/asiInES6Classes.types index 90c7f71aba6..41940a0f477 100644 --- a/tests/baselines/reference/asiInES6Classes.types +++ b/tests/baselines/reference/asiInES6Classes.types @@ -10,6 +10,7 @@ class Foo { done: false >done : boolean +>false : boolean } @@ -19,6 +20,7 @@ class Foo { >bar : () => number return 3; +>3 : number } diff --git a/tests/baselines/reference/assign1.symbols b/tests/baselines/reference/assign1.symbols new file mode 100644 index 00000000000..f434da72670 --- /dev/null +++ b/tests/baselines/reference/assign1.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/assign1.ts === +module M { +>M : Symbol(M, Decl(assign1.ts, 0, 0)) + + interface I { +>I : Symbol(I, Decl(assign1.ts, 0, 10)) + + salt:number; +>salt : Symbol(salt, Decl(assign1.ts, 1, 17)) + + pepper:number; +>pepper : Symbol(pepper, Decl(assign1.ts, 2, 20)) + } + + var x:I={salt:2,pepper:0}; +>x : Symbol(x, Decl(assign1.ts, 6, 7)) +>I : Symbol(I, Decl(assign1.ts, 0, 10)) +>salt : Symbol(salt, Decl(assign1.ts, 6, 13)) +>pepper : Symbol(pepper, Decl(assign1.ts, 6, 20)) +} + diff --git a/tests/baselines/reference/assign1.types b/tests/baselines/reference/assign1.types index 32b93af647d..d600c4055af 100644 --- a/tests/baselines/reference/assign1.types +++ b/tests/baselines/reference/assign1.types @@ -17,6 +17,8 @@ module M { >I : I >{salt:2,pepper:0} : { salt: number; pepper: number; } >salt : number +>2 : number >pepper : number +>0 : number } diff --git a/tests/baselines/reference/assignEveryTypeToAny.symbols b/tests/baselines/reference/assignEveryTypeToAny.symbols new file mode 100644 index 00000000000..145e19664fd --- /dev/null +++ b/tests/baselines/reference/assignEveryTypeToAny.symbols @@ -0,0 +1,141 @@ +=== tests/cases/conformance/types/any/assignEveryTypeToAny.ts === +// all of these are valid + +var x: any; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) + +x = 1; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) + +var a = 2; +>a : Symbol(a, Decl(assignEveryTypeToAny.ts, 5, 3)) + +x = a; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>a : Symbol(a, Decl(assignEveryTypeToAny.ts, 5, 3)) + +x = true; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) + +var b = true; +>b : Symbol(b, Decl(assignEveryTypeToAny.ts, 9, 3)) + +x = b; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>b : Symbol(b, Decl(assignEveryTypeToAny.ts, 9, 3)) + +x = ""; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) + +var c = ""; +>c : Symbol(c, Decl(assignEveryTypeToAny.ts, 13, 3)) + +x = c; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>c : Symbol(c, Decl(assignEveryTypeToAny.ts, 13, 3)) + +var d: void; +>d : Symbol(d, Decl(assignEveryTypeToAny.ts, 16, 3)) + +x = d; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>d : Symbol(d, Decl(assignEveryTypeToAny.ts, 16, 3)) + +var e = undefined; +>e : Symbol(e, Decl(assignEveryTypeToAny.ts, 19, 3)) +>undefined : Symbol(undefined) + +x = e; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>e : Symbol(e, Decl(assignEveryTypeToAny.ts, 19, 3)) + +var e2: typeof undefined; +>e2 : Symbol(e2, Decl(assignEveryTypeToAny.ts, 22, 3)) +>undefined : Symbol(undefined) + +x = e2; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>e2 : Symbol(e2, Decl(assignEveryTypeToAny.ts, 22, 3)) + +enum E { +>E : Symbol(E, Decl(assignEveryTypeToAny.ts, 23, 7)) + + A +>A : Symbol(E.A, Decl(assignEveryTypeToAny.ts, 25, 8)) +} + +x = E.A; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>E.A : Symbol(E.A, Decl(assignEveryTypeToAny.ts, 25, 8)) +>E : Symbol(E, Decl(assignEveryTypeToAny.ts, 23, 7)) +>A : Symbol(E.A, Decl(assignEveryTypeToAny.ts, 25, 8)) + +var f = E.A; +>f : Symbol(f, Decl(assignEveryTypeToAny.ts, 30, 3)) +>E.A : Symbol(E.A, Decl(assignEveryTypeToAny.ts, 25, 8)) +>E : Symbol(E, Decl(assignEveryTypeToAny.ts, 23, 7)) +>A : Symbol(E.A, Decl(assignEveryTypeToAny.ts, 25, 8)) + +x = f; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>f : Symbol(f, Decl(assignEveryTypeToAny.ts, 30, 3)) + +interface I { +>I : Symbol(I, Decl(assignEveryTypeToAny.ts, 31, 6)) + + foo: string; +>foo : Symbol(foo, Decl(assignEveryTypeToAny.ts, 33, 13)) +} + +var g: I; +>g : Symbol(g, Decl(assignEveryTypeToAny.ts, 37, 3)) +>I : Symbol(I, Decl(assignEveryTypeToAny.ts, 31, 6)) + +x = g; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>g : Symbol(g, Decl(assignEveryTypeToAny.ts, 37, 3)) + +class C { +>C : Symbol(C, Decl(assignEveryTypeToAny.ts, 38, 6)) + + bar: string; +>bar : Symbol(bar, Decl(assignEveryTypeToAny.ts, 40, 9)) +} + +var h: C; +>h : Symbol(h, Decl(assignEveryTypeToAny.ts, 44, 3)) +>C : Symbol(C, Decl(assignEveryTypeToAny.ts, 38, 6)) + +x = h; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>h : Symbol(h, Decl(assignEveryTypeToAny.ts, 44, 3)) + +var i: { (): string }; +>i : Symbol(i, Decl(assignEveryTypeToAny.ts, 47, 3)) + +x = i; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>i : Symbol(i, Decl(assignEveryTypeToAny.ts, 47, 3)) + +x = { f() { return 1; } } +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>f : Symbol(f, Decl(assignEveryTypeToAny.ts, 49, 5)) + +x = { f(x: T) { return x; } } +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>f : Symbol(f, Decl(assignEveryTypeToAny.ts, 50, 5)) +>T : Symbol(T, Decl(assignEveryTypeToAny.ts, 50, 8)) +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 50, 11)) +>T : Symbol(T, Decl(assignEveryTypeToAny.ts, 50, 8)) +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 50, 11)) + +function j(a: T) { +>j : Symbol(j, Decl(assignEveryTypeToAny.ts, 50, 32)) +>T : Symbol(T, Decl(assignEveryTypeToAny.ts, 52, 11)) +>a : Symbol(a, Decl(assignEveryTypeToAny.ts, 52, 14)) +>T : Symbol(T, Decl(assignEveryTypeToAny.ts, 52, 11)) + + x = a; +>x : Symbol(x, Decl(assignEveryTypeToAny.ts, 2, 3)) +>a : Symbol(a, Decl(assignEveryTypeToAny.ts, 52, 14)) +} diff --git a/tests/baselines/reference/assignEveryTypeToAny.types b/tests/baselines/reference/assignEveryTypeToAny.types index 129440fa463..dfff671a875 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.types +++ b/tests/baselines/reference/assignEveryTypeToAny.types @@ -7,9 +7,11 @@ var x: any; x = 1; >x = 1 : number >x : any +>1 : number var a = 2; >a : number +>2 : number x = a; >x = a : number @@ -19,9 +21,11 @@ x = a; x = true; >x = true : boolean >x : any +>true : boolean var b = true; >b : boolean +>true : boolean x = b; >x = b : boolean @@ -31,9 +35,11 @@ x = b; x = ""; >x = "" : string >x : any +>"" : string var c = ""; >c : string +>"" : string x = c; >x = c : string @@ -136,6 +142,7 @@ x = { f() { return 1; } } >x : any >{ f() { return 1; } } : { f(): number; } >f : () => number +>1 : number x = { f(x: T) { return x; } } >x = { f(x: T) { return x; } } : { f(x: T): T; } diff --git a/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.symbols b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.symbols new file mode 100644 index 00000000000..730560d0d81 --- /dev/null +++ b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/assignToObjectTypeWithPrototypeProperty.ts === +class XEvent {} +>XEvent : Symbol(XEvent, Decl(assignToObjectTypeWithPrototypeProperty.ts, 0, 0)) + +var p: XEvent = XEvent.prototype; +>p : Symbol(p, Decl(assignToObjectTypeWithPrototypeProperty.ts, 1, 3)) +>XEvent : Symbol(XEvent, Decl(assignToObjectTypeWithPrototypeProperty.ts, 0, 0)) +>XEvent.prototype : Symbol(XEvent.prototype) +>XEvent : Symbol(XEvent, Decl(assignToObjectTypeWithPrototypeProperty.ts, 0, 0)) +>prototype : Symbol(XEvent.prototype) + +var x: {prototype: XEvent} = XEvent; +>x : Symbol(x, Decl(assignToObjectTypeWithPrototypeProperty.ts, 2, 3)) +>prototype : Symbol(prototype, Decl(assignToObjectTypeWithPrototypeProperty.ts, 2, 8)) +>XEvent : Symbol(XEvent, Decl(assignToObjectTypeWithPrototypeProperty.ts, 0, 0)) +>XEvent : Symbol(XEvent, Decl(assignToObjectTypeWithPrototypeProperty.ts, 0, 0)) + diff --git a/tests/baselines/reference/assignToPrototype1.symbols b/tests/baselines/reference/assignToPrototype1.symbols new file mode 100644 index 00000000000..ddb8e915043 --- /dev/null +++ b/tests/baselines/reference/assignToPrototype1.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/assignToPrototype1.ts === +declare class Point { +>Point : Symbol(Point, Decl(assignToPrototype1.ts, 0, 0)) + + add(dx: number, dy: number): void; +>add : Symbol(add, Decl(assignToPrototype1.ts, 0, 21)) +>dx : Symbol(dx, Decl(assignToPrototype1.ts, 1, 6)) +>dy : Symbol(dy, Decl(assignToPrototype1.ts, 1, 17)) +} + +Point.prototype.add = function(dx, dy) { +>Point.prototype.add : Symbol(Point.add, Decl(assignToPrototype1.ts, 0, 21)) +>Point.prototype : Symbol(Point.prototype) +>Point : Symbol(Point, Decl(assignToPrototype1.ts, 0, 0)) +>prototype : Symbol(Point.prototype) +>add : Symbol(Point.add, Decl(assignToPrototype1.ts, 0, 21)) +>dx : Symbol(dx, Decl(assignToPrototype1.ts, 4, 31)) +>dy : Symbol(dy, Decl(assignToPrototype1.ts, 4, 34)) + +}; diff --git a/tests/baselines/reference/assignmentCompatForEnums.symbols b/tests/baselines/reference/assignmentCompatForEnums.symbols new file mode 100644 index 00000000000..510c08e61f6 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatForEnums.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/assignmentCompatForEnums.ts === +enum TokenType { One, Two }; +>TokenType : Symbol(TokenType, Decl(assignmentCompatForEnums.ts, 0, 0)) +>One : Symbol(TokenType.One, Decl(assignmentCompatForEnums.ts, 0, 16)) +>Two : Symbol(TokenType.Two, Decl(assignmentCompatForEnums.ts, 0, 21)) + +var list = {}; +>list : Symbol(list, Decl(assignmentCompatForEnums.ts, 2, 3)) + + +function returnType(): TokenType { return null; } +>returnType : Symbol(returnType, Decl(assignmentCompatForEnums.ts, 2, 14)) +>TokenType : Symbol(TokenType, Decl(assignmentCompatForEnums.ts, 0, 0)) + +function foo() { +>foo : Symbol(foo, Decl(assignmentCompatForEnums.ts, 5, 49)) + + var x = returnType(); +>x : Symbol(x, Decl(assignmentCompatForEnums.ts, 8, 7), Decl(assignmentCompatForEnums.ts, 10, 7)) +>returnType : Symbol(returnType, Decl(assignmentCompatForEnums.ts, 2, 14)) + + var x: TokenType = list['one']; +>x : Symbol(x, Decl(assignmentCompatForEnums.ts, 8, 7), Decl(assignmentCompatForEnums.ts, 10, 7)) +>TokenType : Symbol(TokenType, Decl(assignmentCompatForEnums.ts, 0, 0)) +>list : Symbol(list, Decl(assignmentCompatForEnums.ts, 2, 3)) +} + + diff --git a/tests/baselines/reference/assignmentCompatForEnums.types b/tests/baselines/reference/assignmentCompatForEnums.types index 53e8caab638..e8b48bd02bd 100644 --- a/tests/baselines/reference/assignmentCompatForEnums.types +++ b/tests/baselines/reference/assignmentCompatForEnums.types @@ -12,6 +12,7 @@ var list = {}; function returnType(): TokenType { return null; } >returnType : () => TokenType >TokenType : TokenType +>null : null function foo() { >foo : () => void @@ -26,6 +27,7 @@ function foo() { >TokenType : TokenType >list['one'] : any >list : {} +>'one' : string } diff --git a/tests/baselines/reference/assignmentCompatOnNew.symbols b/tests/baselines/reference/assignmentCompatOnNew.symbols new file mode 100644 index 00000000000..524a22d2421 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatOnNew.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/assignmentCompatOnNew.ts === +class Foo{}; +>Foo : Symbol(Foo, Decl(assignmentCompatOnNew.ts, 0, 0)) + +function bar(x: {new(): Foo;}){} +>bar : Symbol(bar, Decl(assignmentCompatOnNew.ts, 0, 12)) +>x : Symbol(x, Decl(assignmentCompatOnNew.ts, 2, 13)) +>Foo : Symbol(Foo, Decl(assignmentCompatOnNew.ts, 0, 0)) + +bar(Foo); // Error, but should be allowed +>bar : Symbol(bar, Decl(assignmentCompatOnNew.ts, 0, 12)) +>Foo : Symbol(Foo, Decl(assignmentCompatOnNew.ts, 0, 0)) + diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.symbols b/tests/baselines/reference/assignmentCompatWithCallSignatures3.symbols new file mode 100644 index 00000000000..8218de9be79 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.symbols @@ -0,0 +1,529 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts === +// these are all permitted with the current rules, since we do not do contextual signature instantiation + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures3.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures3.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithCallSignatures3.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithCallSignatures3.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithCallSignatures3.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithCallSignatures3.ts, 5, 33)) + +var a: (x: number) => number[]; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 7, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 7, 8)) + +var a2: (x: number) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures3.ts, 8, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 8, 9)) + +var a3: (x: number) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures3.ts, 9, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 9, 9)) + +var a4: (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures3.ts, 10, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 10, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 10, 19)) + +var a5: (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures3.ts, 11, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 11, 9)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 11, 13)) + +var a6: (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures3.ts, 12, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 12, 9)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 12, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) + +var a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(assignmentCompatWithCallSignatures3.ts, 13, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 13, 9)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 13, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 13, 40)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(assignmentCompatWithCallSignatures3.ts, 14, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 14, 9)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 14, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 14, 35)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithCallSignatures3.ts, 14, 40)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 14, 68)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(assignmentCompatWithCallSignatures3.ts, 15, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 15, 9)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 15, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 15, 35)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithCallSignatures3.ts, 15, 40)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 15, 68)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a10: (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(assignmentCompatWithCallSignatures3.ts, 16, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 16, 10)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures3.ts, 17, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 17, 10)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures3.ts, 17, 14)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 17, 29)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures3.ts, 17, 34)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures3.ts, 17, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) + +var a12: (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(assignmentCompatWithCallSignatures3.ts, 18, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 18, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 18, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithCallSignatures3.ts, 3, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a13: (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(assignmentCompatWithCallSignatures3.ts, 19, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 19, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 19, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +var a14: (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(assignmentCompatWithCallSignatures3.ts, 20, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 20, 10)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 20, 14)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures3.ts, 20, 25)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var a15: { +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures3.ts, 21, 3)) + + (x: number): number[]; +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 22, 5)) + + (x: string): string[]; +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 23, 5)) +} +var a16: { +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures3.ts, 25, 3)) + + (x: T): number[]; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 26, 5)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 26, 24)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 26, 5)) + + (x: U): number[]; +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 27, 5)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 27, 21)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 27, 5)) +} +var a17: { +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures3.ts, 29, 3)) + + (x: (a: number) => number): number[]; +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 30, 5)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 30, 9)) + + (x: (a: string) => string): string[]; +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 31, 5)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 31, 9)) + +}; +var a18: { +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures3.ts, 33, 3)) + + (x: { +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 34, 5)) + + (a: number): number; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 35, 9)) + + (a: string): string; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 36, 9)) + + }): any[]; + (x: { +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 38, 5)) + + (a: boolean): boolean; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 39, 9)) + + (a: Date): Date; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 40, 9)) +>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)) + + }): any[]; +} + +var b: (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures3.ts, 44, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 44, 8)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 44, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 44, 8)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 44, 8)) + +a = b; // ok +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 7, 3)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures3.ts, 44, 3)) + +b = a; // ok +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures3.ts, 44, 3)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 7, 3)) + +var b2: (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures3.ts, 47, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 47, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 47, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 47, 9)) + +a2 = b2; // ok +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures3.ts, 8, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures3.ts, 47, 3)) + +b2 = a2; // ok +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures3.ts, 47, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures3.ts, 8, 3)) + +var b3: (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures3.ts, 50, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 50, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 50, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 50, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 50, 9)) + +a3 = b3; // ok +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures3.ts, 9, 3)) +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures3.ts, 50, 3)) + +b3 = a3; // ok +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures3.ts, 50, 3)) +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures3.ts, 9, 3)) + +var b4: (x: T, y: U) => T; +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures3.ts, 53, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 53, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 53, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 53, 15)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 53, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 53, 20)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 53, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 53, 9)) + +a4 = b4; // ok +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures3.ts, 10, 3)) +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures3.ts, 53, 3)) + +b4 = a4; // ok +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures3.ts, 53, 3)) +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures3.ts, 10, 3)) + +var b5: (x: (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures3.ts, 56, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 56, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 56, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 56, 15)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 56, 19)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 56, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 56, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 56, 9)) + +a5 = b5; // ok +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures3.ts, 11, 3)) +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures3.ts, 56, 3)) + +b5 = a5; // ok +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures3.ts, 56, 3)) +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures3.ts, 11, 3)) + +var b6: (x: (arg: T) => U) => T; +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures3.ts, 59, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 59, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 59, 24)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 59, 44)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 59, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 59, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 59, 24)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 59, 9)) + +a6 = b6; // ok +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures3.ts, 12, 3)) +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures3.ts, 59, 3)) + +b6 = a6; // ok +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures3.ts, 59, 3)) +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures3.ts, 12, 3)) + +var b7: (x: (arg: T) => U) => (r: T) => U; +>b7 : Symbol(b7, Decl(assignmentCompatWithCallSignatures3.ts, 62, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 62, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 62, 24)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 62, 44)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 62, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 62, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 62, 24)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 62, 66)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 62, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 62, 24)) + +a7 = b7; // ok +>a7 : Symbol(a7, Decl(assignmentCompatWithCallSignatures3.ts, 13, 3)) +>b7 : Symbol(b7, Decl(assignmentCompatWithCallSignatures3.ts, 62, 3)) + +b7 = a7; // ok +>b7 : Symbol(b7, Decl(assignmentCompatWithCallSignatures3.ts, 62, 3)) +>a7 : Symbol(a7, Decl(assignmentCompatWithCallSignatures3.ts, 13, 3)) + +var b8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; +>b8 : Symbol(b8, Decl(assignmentCompatWithCallSignatures3.ts, 65, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 65, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 65, 24)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 65, 44)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 65, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 65, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 65, 24)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 65, 61)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithCallSignatures3.ts, 65, 66)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 65, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 65, 24)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 65, 85)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 65, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 65, 24)) + +a8 = b8; // ok +>a8 : Symbol(a8, Decl(assignmentCompatWithCallSignatures3.ts, 14, 3)) +>b8 : Symbol(b8, Decl(assignmentCompatWithCallSignatures3.ts, 65, 3)) + +b8 = a8; // ok +>b8 : Symbol(b8, Decl(assignmentCompatWithCallSignatures3.ts, 65, 3)) +>a8 : Symbol(a8, Decl(assignmentCompatWithCallSignatures3.ts, 14, 3)) + +var b9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; +>b9 : Symbol(b9, Decl(assignmentCompatWithCallSignatures3.ts, 68, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 68, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 68, 24)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 68, 44)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures3.ts, 68, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 68, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 68, 24)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 68, 61)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithCallSignatures3.ts, 68, 66)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures3.ts, 68, 73)) +>bing : Symbol(bing, Decl(assignmentCompatWithCallSignatures3.ts, 68, 86)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 68, 24)) +>r : Symbol(r, Decl(assignmentCompatWithCallSignatures3.ts, 68, 113)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 68, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures3.ts, 68, 24)) + +a9 = b9; // ok +>a9 : Symbol(a9, Decl(assignmentCompatWithCallSignatures3.ts, 15, 3)) +>b9 : Symbol(b9, Decl(assignmentCompatWithCallSignatures3.ts, 68, 3)) + +b9 = a9; // ok +>b9 : Symbol(b9, Decl(assignmentCompatWithCallSignatures3.ts, 68, 3)) +>a9 : Symbol(a9, Decl(assignmentCompatWithCallSignatures3.ts, 15, 3)) + +var b10: (...x: T[]) => T; +>b10 : Symbol(b10, Decl(assignmentCompatWithCallSignatures3.ts, 71, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 71, 10)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 71, 29)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 71, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 71, 10)) + +a10 = b10; // ok +>a10 : Symbol(a10, Decl(assignmentCompatWithCallSignatures3.ts, 16, 3)) +>b10 : Symbol(b10, Decl(assignmentCompatWithCallSignatures3.ts, 71, 3)) + +b10 = a10; // ok +>b10 : Symbol(b10, Decl(assignmentCompatWithCallSignatures3.ts, 71, 3)) +>a10 : Symbol(a10, Decl(assignmentCompatWithCallSignatures3.ts, 16, 3)) + +var b11: (x: T, y: T) => T; +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures3.ts, 74, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 74, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 74, 26)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 74, 10)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 74, 31)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 74, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 74, 10)) + +a11 = b11; // ok +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures3.ts, 17, 3)) +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures3.ts, 74, 3)) + +b11 = a11; // ok +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures3.ts, 74, 3)) +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures3.ts, 17, 3)) + +var b12: >(x: Array, y: T) => Array; +>b12 : Symbol(b12, Decl(assignmentCompatWithCallSignatures3.ts, 77, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 77, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 77, 33)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 77, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 77, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) + +a12 = b12; // ok +>a12 : Symbol(a12, Decl(assignmentCompatWithCallSignatures3.ts, 18, 3)) +>b12 : Symbol(b12, Decl(assignmentCompatWithCallSignatures3.ts, 77, 3)) + +b12 = a12; // ok +>b12 : Symbol(b12, Decl(assignmentCompatWithCallSignatures3.ts, 77, 3)) +>a12 : Symbol(a12, Decl(assignmentCompatWithCallSignatures3.ts, 18, 3)) + +var b13: >(x: Array, y: T) => T; +>b13 : Symbol(b13, Decl(assignmentCompatWithCallSignatures3.ts, 80, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 80, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 80, 36)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures3.ts, 80, 51)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 80, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 80, 10)) + +a13 = b13; // ok +>a13 : Symbol(a13, Decl(assignmentCompatWithCallSignatures3.ts, 19, 3)) +>b13 : Symbol(b13, Decl(assignmentCompatWithCallSignatures3.ts, 80, 3)) + +b13 = a13; // ok +>b13 : Symbol(b13, Decl(assignmentCompatWithCallSignatures3.ts, 80, 3)) +>a13 : Symbol(a13, Decl(assignmentCompatWithCallSignatures3.ts, 19, 3)) + +var b14: (x: { a: T; b: T }) => T; +>b14 : Symbol(b14, Decl(assignmentCompatWithCallSignatures3.ts, 83, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 83, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 83, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 83, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 83, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures3.ts, 83, 23)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 83, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 83, 10)) + +a14 = b14; // ok +>a14 : Symbol(a14, Decl(assignmentCompatWithCallSignatures3.ts, 20, 3)) +>b14 : Symbol(b14, Decl(assignmentCompatWithCallSignatures3.ts, 83, 3)) + +b14 = a14; // ok +>b14 : Symbol(b14, Decl(assignmentCompatWithCallSignatures3.ts, 83, 3)) +>a14 : Symbol(a14, Decl(assignmentCompatWithCallSignatures3.ts, 20, 3)) + +var b15: (x: T) => T[]; +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures3.ts, 86, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 86, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 86, 13)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 86, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 86, 10)) + +a15 = b15; // ok +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures3.ts, 21, 3)) +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures3.ts, 86, 3)) + +b15 = a15; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures3.ts, 86, 3)) +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures3.ts, 21, 3)) + +var b16: (x: T) => number[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures3.ts, 89, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 89, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 89, 26)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 89, 10)) + +a16 = b16; // ok +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures3.ts, 25, 3)) +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures3.ts, 89, 3)) + +b16 = a16; // ok +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures3.ts, 89, 3)) +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures3.ts, 25, 3)) + +var b17: (x: (a: T) => T) => T[]; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures3.ts, 92, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 92, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 92, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 92, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 92, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 92, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 92, 10)) + +a17 = b17; // ok +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures3.ts, 29, 3)) +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures3.ts, 92, 3)) + +b17 = a17; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures3.ts, 92, 3)) +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures3.ts, 29, 3)) + +var b18: (x: (a: T) => T) => T[]; +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures3.ts, 95, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 95, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures3.ts, 95, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 95, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 95, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 95, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures3.ts, 95, 10)) + +a18 = b18; // ok +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures3.ts, 33, 3)) +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures3.ts, 95, 3)) + +b18 = a18; // ok +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures3.ts, 95, 3)) +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures3.ts, 33, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.symbols b/tests/baselines/reference/assignmentCompatWithCallSignatures5.symbols new file mode 100644 index 00000000000..e26e95b0c0c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.symbols @@ -0,0 +1,358 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures5.ts === +// checking assignment compat for function types. No errors in this file + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures5.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures5.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithCallSignatures5.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithCallSignatures5.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithCallSignatures5.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithCallSignatures5.ts, 5, 33)) + +var a: (x: T) => T[]; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 7, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 7, 8)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 7, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 7, 8)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 7, 8)) + +var a2: (x: T) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures5.ts, 8, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 8, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 8, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 8, 9)) + +var a3: (x: T) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures5.ts, 9, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 9, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 9, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 9, 9)) + +var a4: (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures5.ts, 10, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 10, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 10, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 10, 14)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 10, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures5.ts, 10, 19)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 10, 11)) + +var a5: (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures5.ts, 11, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 11, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 11, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 11, 14)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures5.ts, 11, 18)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 11, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 11, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 11, 9)) + +var a6: (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures5.ts, 12, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 12, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 12, 25)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures5.ts, 12, 29)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 12, 9)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 12, 9)) + +var a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures5.ts, 13, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 13, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 13, 13)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures5.ts, 13, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 13, 10)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures5.ts, 13, 27)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures5.ts, 13, 32)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 13, 10)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures5.ts, 13, 40)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 13, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) + +var a15: (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures5.ts, 14, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 14, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 14, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 14, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 14, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 14, 23)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 14, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 14, 10)) + +var a16: (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures5.ts, 15, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 15, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 15, 26)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 15, 30)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 15, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 15, 36)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 15, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 15, 10)) + +var a17: { +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures5.ts, 16, 3)) + + (x: (a: T) => T): T[]; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 17, 5)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 17, 24)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 17, 28)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 17, 5)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 17, 5)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 17, 5)) + + (x: (a: T) => T): T[]; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 18, 5)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 18, 21)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 18, 25)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 18, 5)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 18, 5)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 18, 5)) + +}; +var a18: { +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures5.ts, 20, 3)) + + (x: { +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 21, 5)) + + (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 22, 9)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 22, 28)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 22, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 22, 9)) + + (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 23, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 23, 25)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 23, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 23, 9)) + + }): any[]; + (x: { +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 25, 5)) + + (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 26, 9)) +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithCallSignatures5.ts, 3, 43)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 26, 29)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 26, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 26, 9)) + + (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 27, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 27, 25)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 27, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 27, 9)) + + }): any[]; +}; + +var b: (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 31, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 31, 8)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 31, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 31, 8)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 31, 8)) + +a = b; // ok +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 7, 3)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 31, 3)) + +b = a; // ok +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 31, 3)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 7, 3)) + +var b2: (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures5.ts, 34, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 34, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 34, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 34, 9)) + +a2 = b2; // ok +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures5.ts, 8, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures5.ts, 34, 3)) + +b2 = a2; // ok +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures5.ts, 34, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures5.ts, 8, 3)) + +var b3: (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures5.ts, 37, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 37, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 37, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 37, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 37, 9)) + +a3 = b3; // ok +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures5.ts, 9, 3)) +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures5.ts, 37, 3)) + +b3 = a3; // ok +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures5.ts, 37, 3)) +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures5.ts, 9, 3)) + +var b4: (x: T, y: U) => string; +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures5.ts, 40, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 40, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 40, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 40, 15)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 40, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures5.ts, 40, 20)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 40, 11)) + +a4 = b4; // ok +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures5.ts, 10, 3)) +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures5.ts, 40, 3)) + +b4 = a4; // ok +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures5.ts, 40, 3)) +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures5.ts, 10, 3)) + +var b5: (x: (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures5.ts, 43, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 43, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 43, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 43, 15)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures5.ts, 43, 19)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 43, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 43, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 43, 9)) + +a5 = b5; // ok +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures5.ts, 11, 3)) +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures5.ts, 43, 3)) + +b5 = a5; // ok +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures5.ts, 43, 3)) +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures5.ts, 11, 3)) + +var b6: (x: (arg: T) => U) => T; +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures5.ts, 46, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 46, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 46, 24)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures5.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 46, 44)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures5.ts, 46, 48)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 46, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 46, 24)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 46, 9)) + +a6 = b6; // ok +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures5.ts, 12, 3)) +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures5.ts, 46, 3)) + +b6 = a6; // ok +>b6 : Symbol(b6, Decl(assignmentCompatWithCallSignatures5.ts, 46, 3)) +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures5.ts, 12, 3)) + +var b11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures5.ts, 49, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 49, 10)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 49, 12)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 49, 16)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures5.ts, 49, 20)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 49, 10)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures5.ts, 49, 30)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures5.ts, 49, 35)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 49, 12)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures5.ts, 49, 43)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 49, 12)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures5.ts, 0, 0)) + +a11 = b11; // ok +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures5.ts, 13, 3)) +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures5.ts, 49, 3)) + +b11 = a11; // ok +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures5.ts, 49, 3)) +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures5.ts, 13, 3)) + +var b15: (x: { a: U; b: V; }) => U[]; +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures5.ts, 52, 3)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 52, 10)) +>V : Symbol(V, Decl(assignmentCompatWithCallSignatures5.ts, 52, 12)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 52, 16)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 52, 20)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 52, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 52, 26)) +>V : Symbol(V, Decl(assignmentCompatWithCallSignatures5.ts, 52, 12)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures5.ts, 52, 10)) + +a15 = b15; // ok, T = U, T = V +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures5.ts, 14, 3)) +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures5.ts, 52, 3)) + +b15 = a15; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures5.ts, 52, 3)) +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures5.ts, 14, 3)) + +var b16: (x: { a: T; b: T }) => T[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures5.ts, 55, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 55, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 55, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 55, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 55, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures5.ts, 55, 23)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 55, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 55, 10)) + +a15 = b16; // ok +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures5.ts, 14, 3)) +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures5.ts, 55, 3)) + +b15 = a16; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithCallSignatures5.ts, 52, 3)) +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures5.ts, 15, 3)) + +var b17: (x: (a: T) => T) => T[]; +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures5.ts, 58, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 58, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 58, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 58, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 58, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 58, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 58, 10)) + +a17 = b17; // ok +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures5.ts, 16, 3)) +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures5.ts, 58, 3)) + +b17 = a17; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithCallSignatures5.ts, 58, 3)) +>a17 : Symbol(a17, Decl(assignmentCompatWithCallSignatures5.ts, 16, 3)) + +var b18: (x: (a: T) => T) => any[]; +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures5.ts, 61, 3)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures5.ts, 61, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 61, 14)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures5.ts, 61, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 61, 14)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures5.ts, 61, 14)) + +a18 = b18; // ok +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures5.ts, 20, 3)) +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures5.ts, 61, 3)) + +b18 = a18; // ok +>b18 : Symbol(b18, Decl(assignmentCompatWithCallSignatures5.ts, 61, 3)) +>a18 : Symbol(a18, Decl(assignmentCompatWithCallSignatures5.ts, 20, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.symbols b/tests/baselines/reference/assignmentCompatWithCallSignatures6.symbols new file mode 100644 index 00000000000..b7e6956ef65 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.symbols @@ -0,0 +1,259 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures6.ts === +// checking assignment compatibility relations for function types. All valid + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures6.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures6.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures6.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithCallSignatures6.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures6.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithCallSignatures6.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithCallSignatures6.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithCallSignatures6.ts, 5, 33)) + +interface A { +>A : Symbol(A, Decl(assignmentCompatWithCallSignatures6.ts, 5, 49)) + + a: (x: T) => T[]; +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures6.ts, 7, 13)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 8, 8)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 8, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 8, 8)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 8, 8)) + + a2: (x: T) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithCallSignatures6.ts, 8, 24)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 9, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 9, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 9, 9)) + + a3: (x: T) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithCallSignatures6.ts, 9, 30)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 10, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 10, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 10, 9)) + + a4: (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithCallSignatures6.ts, 10, 26)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 11, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 11, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 11, 14)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 11, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures6.ts, 11, 19)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 11, 11)) + + a5: (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(assignmentCompatWithCallSignatures6.ts, 11, 36)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 12, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 12, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 12, 14)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures6.ts, 12, 18)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 12, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 12, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 12, 9)) + + a6: (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(assignmentCompatWithCallSignatures6.ts, 12, 37)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 13, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 13, 25)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures6.ts, 13, 29)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 13, 9)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithCallSignatures6.ts, 2, 27)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 13, 9)) + + a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithCallSignatures6.ts, 13, 54)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 14, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 14, 13)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures6.ts, 14, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 14, 10)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures6.ts, 14, 27)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures6.ts, 14, 32)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 14, 10)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures6.ts, 14, 40)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 14, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) + + a15: (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(assignmentCompatWithCallSignatures6.ts, 14, 59)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 15, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 15, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures6.ts, 15, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 15, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 15, 23)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 15, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 15, 10)) + + a16: (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(assignmentCompatWithCallSignatures6.ts, 15, 39)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 16, 10)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 16, 26)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures6.ts, 16, 30)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 16, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 16, 36)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 16, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 16, 10)) +} + +var x: A; +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>A : Symbol(A, Decl(assignmentCompatWithCallSignatures6.ts, 5, 49)) + +var b: (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 21, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 21, 8)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 21, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 21, 8)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 21, 8)) + +x.a = b; +>x.a : Symbol(A.a, Decl(assignmentCompatWithCallSignatures6.ts, 7, 13)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a : Symbol(A.a, Decl(assignmentCompatWithCallSignatures6.ts, 7, 13)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 21, 3)) + +b = x.a; +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 21, 3)) +>x.a : Symbol(A.a, Decl(assignmentCompatWithCallSignatures6.ts, 7, 13)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a : Symbol(A.a, Decl(assignmentCompatWithCallSignatures6.ts, 7, 13)) + +var b2: (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures6.ts, 24, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 24, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 24, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 24, 9)) + +x.a2 = b2; +>x.a2 : Symbol(A.a2, Decl(assignmentCompatWithCallSignatures6.ts, 8, 24)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a2 : Symbol(A.a2, Decl(assignmentCompatWithCallSignatures6.ts, 8, 24)) +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures6.ts, 24, 3)) + +b2 = x.a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithCallSignatures6.ts, 24, 3)) +>x.a2 : Symbol(A.a2, Decl(assignmentCompatWithCallSignatures6.ts, 8, 24)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a2 : Symbol(A.a2, Decl(assignmentCompatWithCallSignatures6.ts, 8, 24)) + +var b3: (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures6.ts, 27, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 27, 9)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 27, 12)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 27, 9)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 27, 9)) + +x.a3 = b3; +>x.a3 : Symbol(A.a3, Decl(assignmentCompatWithCallSignatures6.ts, 9, 30)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a3 : Symbol(A.a3, Decl(assignmentCompatWithCallSignatures6.ts, 9, 30)) +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures6.ts, 27, 3)) + +b3 = x.a3; +>b3 : Symbol(b3, Decl(assignmentCompatWithCallSignatures6.ts, 27, 3)) +>x.a3 : Symbol(A.a3, Decl(assignmentCompatWithCallSignatures6.ts, 9, 30)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a3 : Symbol(A.a3, Decl(assignmentCompatWithCallSignatures6.ts, 9, 30)) + +var b4: (x: T, y: U) => string; +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures6.ts, 30, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 30, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 30, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 30, 15)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 30, 9)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures6.ts, 30, 20)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 30, 11)) + +x.a4 = b4; +>x.a4 : Symbol(A.a4, Decl(assignmentCompatWithCallSignatures6.ts, 10, 26)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a4 : Symbol(A.a4, Decl(assignmentCompatWithCallSignatures6.ts, 10, 26)) +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures6.ts, 30, 3)) + +b4 = x.a4; +>b4 : Symbol(b4, Decl(assignmentCompatWithCallSignatures6.ts, 30, 3)) +>x.a4 : Symbol(A.a4, Decl(assignmentCompatWithCallSignatures6.ts, 10, 26)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a4 : Symbol(A.a4, Decl(assignmentCompatWithCallSignatures6.ts, 10, 26)) + +var b5: (x: (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures6.ts, 33, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 33, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 33, 11)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 33, 15)) +>arg : Symbol(arg, Decl(assignmentCompatWithCallSignatures6.ts, 33, 19)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 33, 9)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 33, 11)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 33, 9)) + +x.a5 = b5; +>x.a5 : Symbol(A.a5, Decl(assignmentCompatWithCallSignatures6.ts, 11, 36)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a5 : Symbol(A.a5, Decl(assignmentCompatWithCallSignatures6.ts, 11, 36)) +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures6.ts, 33, 3)) + +b5 = x.a5; +>b5 : Symbol(b5, Decl(assignmentCompatWithCallSignatures6.ts, 33, 3)) +>x.a5 : Symbol(A.a5, Decl(assignmentCompatWithCallSignatures6.ts, 11, 36)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a5 : Symbol(A.a5, Decl(assignmentCompatWithCallSignatures6.ts, 11, 36)) + +var b11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures6.ts, 36, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 36, 10)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 36, 12)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 36, 16)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures6.ts, 36, 20)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 36, 10)) +>y : Symbol(y, Decl(assignmentCompatWithCallSignatures6.ts, 36, 30)) +>foo : Symbol(foo, Decl(assignmentCompatWithCallSignatures6.ts, 36, 35)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 36, 12)) +>bar : Symbol(bar, Decl(assignmentCompatWithCallSignatures6.ts, 36, 43)) +>U : Symbol(U, Decl(assignmentCompatWithCallSignatures6.ts, 36, 12)) +>Base : Symbol(Base, Decl(assignmentCompatWithCallSignatures6.ts, 0, 0)) + +x.a11 = b11; +>x.a11 : Symbol(A.a11, Decl(assignmentCompatWithCallSignatures6.ts, 13, 54)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a11 : Symbol(A.a11, Decl(assignmentCompatWithCallSignatures6.ts, 13, 54)) +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures6.ts, 36, 3)) + +b11 = x.a11; +>b11 : Symbol(b11, Decl(assignmentCompatWithCallSignatures6.ts, 36, 3)) +>x.a11 : Symbol(A.a11, Decl(assignmentCompatWithCallSignatures6.ts, 13, 54)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a11 : Symbol(A.a11, Decl(assignmentCompatWithCallSignatures6.ts, 13, 54)) + +var b16: (x: { a: T; b: T }) => T[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures6.ts, 39, 3)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 39, 10)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 39, 13)) +>a : Symbol(a, Decl(assignmentCompatWithCallSignatures6.ts, 39, 17)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 39, 10)) +>b : Symbol(b, Decl(assignmentCompatWithCallSignatures6.ts, 39, 23)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 39, 10)) +>T : Symbol(T, Decl(assignmentCompatWithCallSignatures6.ts, 39, 10)) + +x.a16 = b16; +>x.a16 : Symbol(A.a16, Decl(assignmentCompatWithCallSignatures6.ts, 15, 39)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a16 : Symbol(A.a16, Decl(assignmentCompatWithCallSignatures6.ts, 15, 39)) +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures6.ts, 39, 3)) + +b16 = x.a16; +>b16 : Symbol(b16, Decl(assignmentCompatWithCallSignatures6.ts, 39, 3)) +>x.a16 : Symbol(A.a16, Decl(assignmentCompatWithCallSignatures6.ts, 15, 39)) +>x : Symbol(x, Decl(assignmentCompatWithCallSignatures6.ts, 19, 3)) +>a16 : Symbol(A.a16, Decl(assignmentCompatWithCallSignatures6.ts, 15, 39)) + diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.symbols b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.symbols new file mode 100644 index 00000000000..ef02b7a08d3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.symbols @@ -0,0 +1,529 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts === +// checking assignment compatibility relations for function types. All of these are valid. + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures3.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures3.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithConstructSignatures3.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithConstructSignatures3.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithConstructSignatures3.ts, 5, 33)) + +var a: new (x: number) => number[]; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 7, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 7, 12)) + +var a2: new (x: number) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures3.ts, 8, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 8, 13)) + +var a3: new (x: number) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures3.ts, 9, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 9, 13)) + +var a4: new (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures3.ts, 10, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 10, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 10, 23)) + +var a5: new (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures3.ts, 11, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 11, 13)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 11, 17)) + +var a6: new (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures3.ts, 12, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 12, 13)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 12, 17)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) + +var a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 13)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 17)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 44)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 13)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 17)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 39)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 44)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 72)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 13)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 17)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 39)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 44)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 72)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a10: new (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(assignmentCompatWithConstructSignatures3.ts, 16, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 16, 14)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 14)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 18)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 33)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 38)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 51)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) + +var a12: new (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(assignmentCompatWithConstructSignatures3.ts, 18, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 18, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 18, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures3.ts, 3, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a13: new (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(assignmentCompatWithConstructSignatures3.ts, 19, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 19, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 19, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +var a14: new (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 14)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 18)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 29)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var a15: { +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures3.ts, 21, 3)) + + new (x: number): number[]; +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 22, 9)) + + new (x: string): string[]; +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 23, 9)) +} +var a16: { +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures3.ts, 25, 3)) + + new (x: T): number[]; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 26, 9)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 26, 28)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 26, 9)) + + new (x: U): number[]; +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 27, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 27, 25)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 27, 9)) +} +var a17: { +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures3.ts, 29, 3)) + + new (x: new (a: number) => number): number[]; +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 30, 9)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 30, 17)) + + new (x: new (a: string) => string): string[]; +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 31, 9)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 31, 17)) + +}; +var a18: { +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures3.ts, 33, 3)) + + new (x: { +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 34, 9)) + + new (a: number): number; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 35, 13)) + + new (a: string): string; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 36, 13)) + + }): any[]; + new (x: { +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 38, 9)) + + new (a: boolean): boolean; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 39, 13)) + + new (a: Date): Date; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 40, 13)) +>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)) + + }): any[]; +} + +var b: new (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 12)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 12)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 12)) + +a = b; // ok +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 7, 3)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 3)) + +b = a; // ok +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures3.ts, 44, 3)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 7, 3)) + +var b2: new (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 13)) + +a2 = b2; // ok +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures3.ts, 8, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 3)) + +b2 = a2; // ok +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures3.ts, 47, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures3.ts, 8, 3)) + +var b3: new (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 13)) + +a3 = b3; // ok +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures3.ts, 9, 3)) +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 3)) + +b3 = a3; // ok +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures3.ts, 50, 3)) +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures3.ts, 9, 3)) + +var b4: new (x: T, y: U) => T; +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 19)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 13)) + +a4 = b4; // ok +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures3.ts, 10, 3)) +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 3)) + +b4 = a4; // ok +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures3.ts, 53, 3)) +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures3.ts, 10, 3)) + +var b5: new (x: (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 19)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 23)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 13)) + +a5 = b5; // ok +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures3.ts, 11, 3)) +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 3)) + +b5 = a5; // ok +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures3.ts, 56, 3)) +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures3.ts, 11, 3)) + +var b6: new (x: (arg: T) => U) => T; +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 28)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 48)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 52)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 28)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 13)) + +a6 = b6; // ok +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures3.ts, 12, 3)) +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 3)) + +b6 = a6; // ok +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures3.ts, 59, 3)) +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures3.ts, 12, 3)) + +var b7: new (x: (arg: T) => U) => (r: T) => U; +>b7 : Symbol(b7, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 28)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 48)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 52)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 28)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 70)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 28)) + +a7 = b7; // ok +>a7 : Symbol(a7, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 3)) +>b7 : Symbol(b7, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 3)) + +b7 = a7; // ok +>b7 : Symbol(b7, Decl(assignmentCompatWithConstructSignatures3.ts, 62, 3)) +>a7 : Symbol(a7, Decl(assignmentCompatWithConstructSignatures3.ts, 13, 3)) + +var b8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; +>b8 : Symbol(b8, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 28)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 48)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 52)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 28)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 65)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 70)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 28)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 89)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 28)) + +a8 = b8; // ok +>a8 : Symbol(a8, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 3)) +>b8 : Symbol(b8, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 3)) + +b8 = a8; // ok +>b8 : Symbol(b8, Decl(assignmentCompatWithConstructSignatures3.ts, 65, 3)) +>a8 : Symbol(a8, Decl(assignmentCompatWithConstructSignatures3.ts, 14, 3)) + +var b9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; +>b9 : Symbol(b9, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 28)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 48)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 52)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 28)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 65)) +>arg2 : Symbol(arg2, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 70)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 77)) +>bing : Symbol(bing, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 90)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 28)) +>r : Symbol(r, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 117)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 28)) + +a9 = b9; // ok +>a9 : Symbol(a9, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 3)) +>b9 : Symbol(b9, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 3)) + +b9 = a9; // ok +>b9 : Symbol(b9, Decl(assignmentCompatWithConstructSignatures3.ts, 68, 3)) +>a9 : Symbol(a9, Decl(assignmentCompatWithConstructSignatures3.ts, 15, 3)) + +var b10: new (...x: T[]) => T; +>b10 : Symbol(b10, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 14)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 33)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 14)) + +a10 = b10; // ok +>a10 : Symbol(a10, Decl(assignmentCompatWithConstructSignatures3.ts, 16, 3)) +>b10 : Symbol(b10, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 3)) + +b10 = a10; // ok +>b10 : Symbol(b10, Decl(assignmentCompatWithConstructSignatures3.ts, 71, 3)) +>a10 : Symbol(a10, Decl(assignmentCompatWithConstructSignatures3.ts, 16, 3)) + +var b11: new (x: T, y: T) => T; +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 30)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 14)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 35)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 14)) + +a11 = b11; // ok +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 3)) +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 3)) + +b11 = a11; // ok +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures3.ts, 74, 3)) +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures3.ts, 17, 3)) + +var b12: new >(x: Array, y: T) => Array; +>b12 : Symbol(b12, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 37)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 52)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) + +a12 = b12; // ok +>a12 : Symbol(a12, Decl(assignmentCompatWithConstructSignatures3.ts, 18, 3)) +>b12 : Symbol(b12, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 3)) + +b12 = a12; // ok +>b12 : Symbol(b12, Decl(assignmentCompatWithConstructSignatures3.ts, 77, 3)) +>a12 : Symbol(a12, Decl(assignmentCompatWithConstructSignatures3.ts, 18, 3)) + +var b13: new >(x: Array, y: T) => T; +>b13 : Symbol(b13, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures3.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 40)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 55)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 14)) + +a13 = b13; // ok +>a13 : Symbol(a13, Decl(assignmentCompatWithConstructSignatures3.ts, 19, 3)) +>b13 : Symbol(b13, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 3)) + +b13 = a13; // ok +>b13 : Symbol(b13, Decl(assignmentCompatWithConstructSignatures3.ts, 80, 3)) +>a13 : Symbol(a13, Decl(assignmentCompatWithConstructSignatures3.ts, 19, 3)) + +var b14: new (x: { a: T; b: T }) => T; +>b14 : Symbol(b14, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 14)) + +a14 = b14; // ok +>a14 : Symbol(a14, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 3)) +>b14 : Symbol(b14, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 3)) + +b14 = a14; // ok +>b14 : Symbol(b14, Decl(assignmentCompatWithConstructSignatures3.ts, 83, 3)) +>a14 : Symbol(a14, Decl(assignmentCompatWithConstructSignatures3.ts, 20, 3)) + +var b15: new (x: T) => T[]; +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 17)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 14)) + +a15 = b15; // ok +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures3.ts, 21, 3)) +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 3)) + +b15 = a15; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures3.ts, 86, 3)) +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures3.ts, 21, 3)) + +var b16: new (x: T) => number[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures3.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 30)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 14)) + +a16 = b16; // ok +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures3.ts, 25, 3)) +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 3)) + +b16 = a16; // ok +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures3.ts, 89, 3)) +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures3.ts, 25, 3)) + +var b17: new (x: new (a: T) => T) => T[]; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 25)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 14)) + +a17 = b17; // ok +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures3.ts, 29, 3)) +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 3)) + +b17 = a17; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures3.ts, 92, 3)) +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures3.ts, 29, 3)) + +var b18: new (x: new (a: T) => T) => T[]; +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 25)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 14)) + +a18 = b18; // ok +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures3.ts, 33, 3)) +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 3)) + +b18 = a18; // ok +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures3.ts, 95, 3)) +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures3.ts, 33, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.symbols b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.symbols new file mode 100644 index 00000000000..d2016b247b8 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.symbols @@ -0,0 +1,358 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures5.ts === +// checking assignment compat for function types. All valid + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures5.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures5.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithConstructSignatures5.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithConstructSignatures5.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithConstructSignatures5.ts, 5, 33)) + +var a: new (x: T) => T[]; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 12)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 12)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 12)) + +var a2: new (x: T) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 13)) + +var a3: new (x: T) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 13)) + +var a4: new (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 19)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 15)) + +var a5: new (x: new (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 19)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 13)) + +var a6: new (x: new (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 29)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 37)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 13)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 13)) + +var a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 17)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 14)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 31)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 36)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 14)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 44)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) + +var a15: new (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 14)) + +var a16: new (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 30)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 34)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 40)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 14)) + +var a17: { +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures5.ts, 16, 3)) + + new (x: new (a: T) => T): T[]; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 9)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 28)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 36)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 9)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 9)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 17, 9)) + + new (x: new (a: T) => T): T[]; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 9)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 25)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 33)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 9)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 9)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 18, 9)) + +}; +var a18: { +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures5.ts, 20, 3)) + + new (x: { +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 21, 9)) + + new (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 22, 13)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 22, 32)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 22, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 22, 13)) + + new (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 23, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 23, 29)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 23, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 23, 13)) + + }): any[]; + new (x: { +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 25, 9)) + + new (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 26, 13)) +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures5.ts, 3, 43)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 26, 33)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 26, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 26, 13)) + + new (a: T): T; +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 27, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 27, 29)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 27, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 27, 13)) + + }): any[]; +}; + +var b: new (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 12)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 12)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 12)) + +a = b; // ok +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 3)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 3)) + +b = a; // ok +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 31, 3)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 7, 3)) + +var b2: new (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 13)) + +a2 = b2; // ok +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 3)) + +b2 = a2; // ok +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures5.ts, 34, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures5.ts, 8, 3)) + +var b3: new (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 13)) + +a3 = b3; // ok +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 3)) +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 3)) + +b3 = a3; // ok +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures5.ts, 37, 3)) +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures5.ts, 9, 3)) + +var b4: new (x: T, y: U) => string; +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 19)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 15)) + +a4 = b4; // ok +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 3)) +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 3)) + +b4 = a4; // ok +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures5.ts, 40, 3)) +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures5.ts, 10, 3)) + +var b5: new (x: new (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 19)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 13)) + +a5 = b5; // ok +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 3)) +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 3)) + +b5 = a5; // ok +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures5.ts, 43, 3)) +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures5.ts, 11, 3)) + +var b6: new (x: new (arg: T) => U) => T; +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 28)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures5.ts, 2, 27)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 48)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 56)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 28)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 13)) + +a6 = b6; // ok +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 3)) +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 3)) + +b6 = a6; // ok +>b6 : Symbol(b6, Decl(assignmentCompatWithConstructSignatures5.ts, 46, 3)) +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures5.ts, 12, 3)) + +var b11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 14)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 16)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 20)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 24)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 14)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 34)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 39)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 16)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 47)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 16)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures5.ts, 0, 0)) + +a11 = b11; // ok +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 3)) +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 3)) + +b11 = a11; // ok +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures5.ts, 49, 3)) +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures5.ts, 13, 3)) + +var b15: new (x: { a: U; b: V; }) => U[]; +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 3)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 14)) +>V : Symbol(V, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 16)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 20)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 30)) +>V : Symbol(V, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 16)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 14)) + +a15 = b15; // ok +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 3)) +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 3)) + +b15 = a15; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 3)) +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 3)) + +var b16: new (x: { a: T; b: T }) => T[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 14)) + +a15 = b16; // ok +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures5.ts, 14, 3)) +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures5.ts, 55, 3)) + +b15 = a16; // ok +>b15 : Symbol(b15, Decl(assignmentCompatWithConstructSignatures5.ts, 52, 3)) +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures5.ts, 15, 3)) + +var b17: new (x: new (a: T) => T) => T[]; +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 25)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 14)) + +a17 = b17; // ok +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures5.ts, 16, 3)) +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 3)) + +b17 = a17; // ok +>b17 : Symbol(b17, Decl(assignmentCompatWithConstructSignatures5.ts, 58, 3)) +>a17 : Symbol(a17, Decl(assignmentCompatWithConstructSignatures5.ts, 16, 3)) + +var b18: new (x: new (a: T) => T) => any[]; +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 3)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 22)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 25)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 22)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 22)) + +a18 = b18; // ok +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures5.ts, 20, 3)) +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 3)) + +b18 = a18; // ok +>b18 : Symbol(b18, Decl(assignmentCompatWithConstructSignatures5.ts, 61, 3)) +>a18 : Symbol(a18, Decl(assignmentCompatWithConstructSignatures5.ts, 20, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.symbols b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.symbols new file mode 100644 index 00000000000..1850406bfa8 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.symbols @@ -0,0 +1,259 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures6.ts === +// checking assignment compatibility relations for function types. All valid. + +class Base { foo: string; } +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 27)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures6.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(assignmentCompatWithConstructSignatures6.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 27)) +>baz : Symbol(baz, Decl(assignmentCompatWithConstructSignatures6.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(assignmentCompatWithConstructSignatures6.ts, 4, 47)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) +>bing : Symbol(bing, Decl(assignmentCompatWithConstructSignatures6.ts, 5, 33)) + +interface A { +>A : Symbol(A, Decl(assignmentCompatWithConstructSignatures6.ts, 5, 49)) + + a: new (x: T) => T[]; +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 12)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 12)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 12)) + + a2: new (x: T) => string[]; +>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 13)) + + a3: new (x: T) => void; +>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 13)) + + a4: new (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 19)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 15)) + + a5: new (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 19)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 23)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 13)) + + a6: new (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(assignmentCompatWithConstructSignatures6.ts, 12, 42)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 13)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 29)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 33)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 13)) +>Derived : Symbol(Derived, Decl(assignmentCompatWithConstructSignatures6.ts, 2, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 13)) + + a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 17)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 31)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 36)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 44)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) + + a15: new (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(assignmentCompatWithConstructSignatures6.ts, 14, 63)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 14)) + + a16: new (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 30)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 34)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 40)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 16, 14)) +} + +var x: A; +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>A : Symbol(A, Decl(assignmentCompatWithConstructSignatures6.ts, 5, 49)) + +var b: new (x: T) => T[]; +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 12)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 12)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 12)) + +x.a = b; +>x.a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 3)) + +b = x.a; +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 21, 3)) +>x.a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a : Symbol(A.a, Decl(assignmentCompatWithConstructSignatures6.ts, 7, 13)) + +var b2: new (x: T) => string[]; +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 13)) + +x.a2 = b2; +>x.a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28)) +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 3)) + +b2 = x.a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithConstructSignatures6.ts, 24, 3)) +>x.a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a2 : Symbol(A.a2, Decl(assignmentCompatWithConstructSignatures6.ts, 8, 28)) + +var b3: new (x: T) => T; +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 13)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 16)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 13)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 13)) + +x.a3 = b3; +>x.a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34)) +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 3)) + +b3 = x.a3; +>b3 : Symbol(b3, Decl(assignmentCompatWithConstructSignatures6.ts, 27, 3)) +>x.a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a3 : Symbol(A.a3, Decl(assignmentCompatWithConstructSignatures6.ts, 9, 34)) + +var b4: new (x: T, y: U) => string; +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 19)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 13)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 24)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 15)) + +x.a4 = b4; +>x.a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30)) +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 3)) + +b4 = x.a4; +>b4 : Symbol(b4, Decl(assignmentCompatWithConstructSignatures6.ts, 30, 3)) +>x.a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a4 : Symbol(A.a4, Decl(assignmentCompatWithConstructSignatures6.ts, 10, 30)) + +var b5: new (x: (arg: T) => U) => T; +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 15)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 19)) +>arg : Symbol(arg, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 23)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 13)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 15)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 13)) + +x.a5 = b5; +>x.a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41)) +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 3)) + +b5 = x.a5; +>b5 : Symbol(b5, Decl(assignmentCompatWithConstructSignatures6.ts, 33, 3)) +>x.a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a5 : Symbol(A.a5, Decl(assignmentCompatWithConstructSignatures6.ts, 11, 41)) + +var b11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 14)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 16)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 20)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 24)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 14)) +>y : Symbol(y, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 34)) +>foo : Symbol(foo, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 39)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 16)) +>bar : Symbol(bar, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 47)) +>U : Symbol(U, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 16)) +>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignatures6.ts, 0, 0)) + +x.a11 = b11; +>x.a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58)) +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 3)) + +b11 = x.a11; +>b11 : Symbol(b11, Decl(assignmentCompatWithConstructSignatures6.ts, 36, 3)) +>x.a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a11 : Symbol(A.a11, Decl(assignmentCompatWithConstructSignatures6.ts, 13, 58)) + +var b16: new (x: { a: T; b: T }) => T[]; +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 3)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 17)) +>a : Symbol(a, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 21)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14)) +>b : Symbol(b, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 27)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14)) +>T : Symbol(T, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 14)) + +x.a16 = b16; +>x.a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43)) +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 3)) + +b16 = x.a16; +>b16 : Symbol(b16, Decl(assignmentCompatWithConstructSignatures6.ts, 39, 3)) +>x.a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43)) +>x : Symbol(x, Decl(assignmentCompatWithConstructSignatures6.ts, 19, 3)) +>a16 : Symbol(A.a16, Decl(assignmentCompatWithConstructSignatures6.ts, 15, 43)) + diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.symbols b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.symbols new file mode 100644 index 00000000000..727e7ed911a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures.ts === +// some complex cases of assignment compat of generic signatures that stress contextual signature instantiation + +var f: (x: S) => void +>f : Symbol(f, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 3)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 8)) +>p : Symbol(p, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 19)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 35)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 8)) + +var g: (x: T[]) => void +>g : Symbol(g, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 3)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 8)) +>p : Symbol(p, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 19)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 33)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 8)) + +f = g; // ok +>f : Symbol(f, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 3)) +>g : Symbol(g, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 3)) + +g = f; // ok +>g : Symbol(g, Decl(assignmentCompatWithGenericCallSignatures.ts, 3, 3)) +>f : Symbol(f, Decl(assignmentCompatWithGenericCallSignatures.ts, 2, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.symbols b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.symbols new file mode 100644 index 00000000000..73991a789a2 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures2.ts === +// some complex cases of assignment compat of generic signatures. No contextual signature instantiation + +interface A { +>A : Symbol(A, Decl(assignmentCompatWithGenericCallSignatures2.ts, 0, 0)) + + (x: T, ...y: T[][]): void +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures2.ts, 3, 5)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures2.ts, 3, 8)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures2.ts, 3, 5)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures2.ts, 3, 13)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures2.ts, 3, 5)) +} + +interface B { +>B : Symbol(B, Decl(assignmentCompatWithGenericCallSignatures2.ts, 4, 1)) + + (x: S, ...y: S[]): void +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures2.ts, 7, 5)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures2.ts, 7, 8)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures2.ts, 7, 5)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures2.ts, 7, 13)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures2.ts, 7, 5)) +} + +var a: A; +>a : Symbol(a, Decl(assignmentCompatWithGenericCallSignatures2.ts, 10, 3)) +>A : Symbol(A, Decl(assignmentCompatWithGenericCallSignatures2.ts, 0, 0)) + +var b: B; +>b : Symbol(b, Decl(assignmentCompatWithGenericCallSignatures2.ts, 11, 3)) +>B : Symbol(B, Decl(assignmentCompatWithGenericCallSignatures2.ts, 4, 1)) + +// Both ok +a = b; +>a : Symbol(a, Decl(assignmentCompatWithGenericCallSignatures2.ts, 10, 3)) +>b : Symbol(b, Decl(assignmentCompatWithGenericCallSignatures2.ts, 11, 3)) + +b = a; +>b : Symbol(b, Decl(assignmentCompatWithGenericCallSignatures2.ts, 11, 3)) +>a : Symbol(a, Decl(assignmentCompatWithGenericCallSignatures2.ts, 10, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.symbols b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.symbols new file mode 100644 index 00000000000..42a00f83df3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.symbols @@ -0,0 +1,52 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures3.ts === +// some complex cases of assignment compat of generic signatures that stress contextual signature instantiation + +interface I { +>I : Symbol(I, Decl(assignmentCompatWithGenericCallSignatures3.ts, 0, 0)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 2, 12)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 2, 14)) + + (f: (x: T) => (y: S) => U): U +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 5)) +>f : Symbol(f, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 8)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 12)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 2, 12)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 22)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 2, 14)) +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 5)) +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 3, 5)) +} + +var g: (x: T) => (y: S) => I +>g : Symbol(g, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 3)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 8)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 11)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 8)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 21)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 24)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 21)) +>I : Symbol(I, Decl(assignmentCompatWithGenericCallSignatures3.ts, 0, 0)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 8)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 21)) + +var h: (x: T) => (y: S) => { (f: (x: T) => (y: S) => U): U } +>h : Symbol(h, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 3)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 8)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 11)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 8)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 21)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 24)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 21)) +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 36)) +>f : Symbol(f, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 39)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 43)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 8)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 53)) +>S : Symbol(S, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 21)) +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 36)) +>U : Symbol(U, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 36)) + +g = h // ok +>g : Symbol(g, Decl(assignmentCompatWithGenericCallSignatures3.ts, 6, 3)) +>h : Symbol(h, Decl(assignmentCompatWithGenericCallSignatures3.ts, 7, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.symbols b/tests/baselines/reference/assignmentCompatWithObjectMembers.symbols new file mode 100644 index 00000000000..181c4db641a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.symbols @@ -0,0 +1,268 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.ts === +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// no errors expected + +module SimpleTypes { +>SimpleTypes : Symbol(SimpleTypes, Decl(assignmentCompatWithObjectMembers.ts, 0, 0)) + + class S { foo: string; } +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 3, 20)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 4, 13)) + + class T { foo: string; } +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 4, 28)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 5, 13)) + + var s: S; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 3, 20)) + + var t: T; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 4, 28)) + + interface S2 { foo: string; } +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 7, 13)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 9, 18)) + + interface T2 { foo: string; } +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 9, 33)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 10, 18)) + + var s2: S2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 7, 13)) + + var t2: T2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 9, 33)) + + var a: { foo: string; } +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 14, 12)) + + var b: { foo: string; } +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 15, 12)) + + var a2 = { foo: '' }; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 17, 14)) + + var b2 = { foo: '' }; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 18, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 18, 14)) + + s = t; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7)) + + t = s; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) + + s = s2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) + + s = a2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) + + s2 = t2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7)) + + t2 = s2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) + + s2 = t; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7)) + + s2 = b; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7)) + + s2 = a2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) + + a = b; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7)) + + b = a; +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) + + a = s; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 6, 7)) + + a = s2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 11, 7)) + + a = a2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 14, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) + + a2 = b2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 18, 7)) + + b2 = a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 18, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) + + a2 = b; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 15, 7)) + + a2 = t2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 12, 7)) + + a2 = t; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 17, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 7, 7)) +} + +module ObjectTypes { +>ObjectTypes : Symbol(ObjectTypes, Decl(assignmentCompatWithObjectMembers.ts, 42, 1)) + + class S { foo: S; } +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 44, 20)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 45, 13)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 44, 20)) + + class T { foo: T; } +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 45, 23)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 46, 13)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 45, 23)) + + var s: S; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers.ts, 44, 20)) + + var t: T; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers.ts, 45, 23)) + + interface S2 { foo: S2; } +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 48, 13)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 50, 18)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 48, 13)) + + interface T2 { foo: T2; } +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 50, 29)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 51, 18)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 50, 29)) + + var s2: S2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers.ts, 48, 13)) + + var t2: T2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers.ts, 50, 29)) + + var a: { foo: typeof a; } +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 55, 12)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) + + var b: { foo: typeof b; } +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 56, 12)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) + + var a2 = { foo: a2 }; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 58, 14)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) + + var b2 = { foo: b2 }; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers.ts, 59, 14)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7)) + + s = t; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7)) + + t = s; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) + + s = s2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) + + s = a2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) + + s2 = t2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7)) + + t2 = s2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) + + s2 = t; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7)) + + s2 = b; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) + + s2 = a2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) + + a = b; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) + + b = a; +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) + + a = s; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers.ts, 47, 7)) + + a = s2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers.ts, 52, 7)) + + a = a2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers.ts, 55, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) + + a2 = b2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7)) + + b2 = a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers.ts, 59, 7)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) + + a2 = b; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers.ts, 56, 7)) + + a2 = t2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers.ts, 53, 7)) + + a2 = t; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers.ts, 58, 7)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers.ts, 48, 7)) + +} diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.types b/tests/baselines/reference/assignmentCompatWithObjectMembers.types index 940b1d7071d..f56b0b1dc74 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.types @@ -49,11 +49,13 @@ module SimpleTypes { >a2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string var b2 = { foo: '' }; >b2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.symbols b/tests/baselines/reference/assignmentCompatWithObjectMembers2.symbols new file mode 100644 index 00000000000..ab3301c5e93 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.symbols @@ -0,0 +1,132 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers2.ts === +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// additional optional properties do not cause errors + +class S { foo: string; } +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers2.ts, 0, 0)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 3, 9)) + +class T { foo: string; } +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers2.ts, 3, 24)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 4, 9)) + +var s: S; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers2.ts, 0, 0)) + +var t: T; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers2.ts, 3, 24)) + +interface S2 { foo: string; bar?: string } +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers2.ts, 6, 9)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 8, 14)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembers2.ts, 8, 27)) + +interface T2 { foo: string; baz?: string } +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers2.ts, 8, 42)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 9, 14)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembers2.ts, 9, 27)) + +var s2: S2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers2.ts, 6, 9)) + +var t2: T2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers2.ts, 8, 42)) + +var a: { foo: string; bar?: string } +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 13, 8)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembers2.ts, 13, 21)) + +var b: { foo: string; baz?: string } +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 14, 8)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembers2.ts, 14, 21)) + +var a2 = { foo: '' }; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 16, 10)) + +var b2 = { foo: '' }; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers2.ts, 17, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers2.ts, 17, 10)) + +s = t; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3)) + +t = s; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) + +s = s2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) + +s = a2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) + +s2 = t2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3)) + +t2 = s2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) + +s2 = t; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3)) + +s2 = b; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3)) + +s2 = a2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) + +a = b; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3)) + +b = a; +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) + +a = s; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers2.ts, 5, 3)) + +a = s2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers2.ts, 10, 3)) + +a = a2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers2.ts, 13, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) + +a2 = b2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers2.ts, 17, 3)) + +b2 = a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers2.ts, 17, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) + +a2 = b; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers2.ts, 14, 3)) + +a2 = t2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers2.ts, 11, 3)) + +a2 = t; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers2.ts, 16, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers2.ts, 6, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.types b/tests/baselines/reference/assignmentCompatWithObjectMembers2.types index 962b29732a5..560644f860e 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers2.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.types @@ -50,11 +50,13 @@ var a2 = { foo: '' }; >a2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string var b2 = { foo: '' }; >b2 : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.symbols b/tests/baselines/reference/assignmentCompatWithObjectMembers3.symbols new file mode 100644 index 00000000000..861d38530bb --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.symbols @@ -0,0 +1,136 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers3.ts === +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// additional optional properties do not cause errors + +class S implements S2 { foo: string; } +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers3.ts, 0, 0)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers3.ts, 6, 9)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 3, 23)) + +class T implements T2 { foo: string; } +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers3.ts, 3, 38)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers3.ts, 8, 42)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 4, 23)) + +var s: S; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembers3.ts, 0, 0)) + +var t: T; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers3.ts, 6, 3)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembers3.ts, 3, 38)) + +interface S2 { foo: string; bar?: string } +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers3.ts, 6, 9)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 8, 14)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembers3.ts, 8, 27)) + +interface T2 { foo: string; baz?: string } +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers3.ts, 8, 42)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 9, 14)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembers3.ts, 9, 27)) + +var s2: S2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers3.ts, 6, 9)) + +var t2: T2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers3.ts, 11, 3)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers3.ts, 8, 42)) + +var a: { foo: string; bar?: string } +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 13, 8)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembers3.ts, 13, 21)) + +var b: { foo: string; baz?: string } +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers3.ts, 14, 3)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 14, 8)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembers3.ts, 14, 21)) + +var a2: S2 = { foo: '' }; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembers3.ts, 6, 9)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 16, 14)) + +var b2: T2 = { foo: '' }; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers3.ts, 17, 3)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembers3.ts, 8, 42)) +>foo : Symbol(foo, Decl(assignmentCompatWithObjectMembers3.ts, 17, 14)) + +s = t; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers3.ts, 6, 3)) + +t = s; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers3.ts, 6, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) + +s = s2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) + +s = a2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) + +s2 = t2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers3.ts, 11, 3)) + +t2 = s2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers3.ts, 11, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) + +s2 = t; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers3.ts, 6, 3)) + +s2 = b; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers3.ts, 14, 3)) + +s2 = a2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) + +a = b; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers3.ts, 14, 3)) + +b = a; +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers3.ts, 14, 3)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) + +a = s; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembers3.ts, 5, 3)) + +a = s2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembers3.ts, 10, 3)) + +a = a2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembers3.ts, 13, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) + +a2 = b2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers3.ts, 17, 3)) + +b2 = a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembers3.ts, 17, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) + +a2 = b; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembers3.ts, 14, 3)) + +a2 = t2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembers3.ts, 11, 3)) + +a2 = t; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembers3.ts, 16, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembers3.ts, 6, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types index 85a7e59ffbc..3046c2f609d 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types @@ -53,12 +53,14 @@ var a2: S2 = { foo: '' }; >S2 : S2 >{ foo: '' } : { foo: string; } >foo : string +>'' : string var b2: T2 = { foo: '' }; >b2 : T2 >T2 : T2 >{ foo: '' } : { foo: string; } >foo : string +>'' : string s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.symbols b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.symbols new file mode 100644 index 00000000000..e01bcee21c0 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.symbols @@ -0,0 +1,124 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersNumericNames.ts === +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// numeric named properties work correctly, no errors expected + +class S { 1: string; } +>S : Symbol(S, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 0, 0)) + +class T { 1.: string; } +>T : Symbol(T, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 3, 22)) + +var s: S; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) +>S : Symbol(S, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 0, 0)) + +var t: T; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 3)) +>T : Symbol(T, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 3, 22)) + +interface S2 { 1: string; bar?: string } +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 9)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 8, 25)) + +interface T2 { 1.0: string; baz?: string } +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 8, 40)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 9, 27)) + +var s2: S2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) +>S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 9)) + +var t2: T2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 11, 3)) +>T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 8, 40)) + +var a: { 1.: string; bar?: string } +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>bar : Symbol(bar, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 20)) + +var b: { 1.0: string; baz?: string } +>b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) +>baz : Symbol(baz, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 21)) + +var a2 = { 1.0: '' }; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) + +var b2 = { 1: '' }; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 17, 3)) + +s = t; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 3)) + +t = s; +>t : Symbol(t, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) + +s = s2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) + +s = a2; +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) + +s2 = t2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 11, 3)) + +t2 = s2; +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 11, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) + +s2 = t; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 3)) + +s2 = b; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) + +s2 = a2; +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) + +a = b; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) + +b = a; +>b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) + +a = s; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) + +a = s2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>s2 : Symbol(s2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 10, 3)) + +a = a2; +>a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) + +a2 = b2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 17, 3)) + +b2 = a2; +>b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 17, 3)) +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) + +a2 = b; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) +>b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) + +a2 = t2; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) +>t2 : Symbol(t2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 11, 3)) + +a2 = t; +>a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) +>t : Symbol(t, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types index 4c76ce1e88a..440ef006e0a 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types @@ -43,10 +43,12 @@ var b: { 1.0: string; baz?: string } var a2 = { 1.0: '' }; >a2 : { 1.0: string; } >{ 1.0: '' } : { 1.0: string; } +>'' : string var b2 = { 1: '' }; >b2 : { 1: string; } >{ 1: '' } : { 1: string; } +>'' : string s = t; >s = t : T diff --git a/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.symbols b/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.symbols new file mode 100644 index 00000000000..e6db879f441 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithWithGenericConstructSignatures.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability1.symbols b/tests/baselines/reference/assignmentCompatability1.symbols new file mode 100644 index 00000000000..07d3cf4c029 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability1.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/assignmentCompatability1.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability1.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability1.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability1.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability1.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability1.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability1.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability1.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability1.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability1.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability1.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability1.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability1.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability1.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability1.ts, 3, 1)) + + export var aa = {};; +>aa : Symbol(aa, Decl(assignmentCompatability1.ts, 5, 14)) + + export var __val__aa = aa; +>__val__aa : Symbol(__val__aa, Decl(assignmentCompatability1.ts, 6, 14)) +>aa : Symbol(aa, Decl(assignmentCompatability1.ts, 5, 14)) +} +__test2__.__val__aa = __test1__.__val__obj4 +>__test2__.__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability1.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability1.ts, 3, 1)) +>__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability1.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability1.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability1.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability1.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability1.types b/tests/baselines/reference/assignmentCompatability1.types index 9949fc14bf5..66174a4036e 100644 --- a/tests/baselines/reference/assignmentCompatability1.types +++ b/tests/baselines/reference/assignmentCompatability1.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability2.symbols b/tests/baselines/reference/assignmentCompatability2.symbols new file mode 100644 index 00000000000..1ed6dd3c639 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability2.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/assignmentCompatability2.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability2.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability2.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability2.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability2.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability2.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability2.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability2.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability2.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability2.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability2.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability2.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability2.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability2.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability2.ts, 3, 1)) + + export var aa:{};; +>aa : Symbol(aa, Decl(assignmentCompatability2.ts, 5, 14)) + + export var __val__aa = aa; +>__val__aa : Symbol(__val__aa, Decl(assignmentCompatability2.ts, 6, 14)) +>aa : Symbol(aa, Decl(assignmentCompatability2.ts, 5, 14)) +} +__test2__.__val__aa = __test1__.__val__obj4 +>__test2__.__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability2.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability2.ts, 3, 1)) +>__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability2.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability2.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability2.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability2.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability2.types b/tests/baselines/reference/assignmentCompatability2.types index 16da45c7e35..f46a81cf51f 100644 --- a/tests/baselines/reference/assignmentCompatability2.types +++ b/tests/baselines/reference/assignmentCompatability2.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability3.symbols b/tests/baselines/reference/assignmentCompatability3.symbols new file mode 100644 index 00000000000..c31d69e2f12 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability3.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/assignmentCompatability3.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability3.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability3.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability3.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability3.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability3.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability3.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability3.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability3.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability3.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability3.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability3.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability3.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability3.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability3.ts, 3, 1)) + + export var obj = {one: 1}; +>obj : Symbol(obj, Decl(assignmentCompatability3.ts, 5, 14)) +>one : Symbol(one, Decl(assignmentCompatability3.ts, 5, 22)) + + export var __val__obj = obj; +>__val__obj : Symbol(__val__obj, Decl(assignmentCompatability3.ts, 6, 14)) +>obj : Symbol(obj, Decl(assignmentCompatability3.ts, 5, 14)) +} +__test2__.__val__obj = __test1__.__val__obj4 +>__test2__.__val__obj : Symbol(__test2__.__val__obj, Decl(assignmentCompatability3.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability3.ts, 3, 1)) +>__val__obj : Symbol(__test2__.__val__obj, Decl(assignmentCompatability3.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability3.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability3.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability3.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability3.types b/tests/baselines/reference/assignmentCompatability3.types index 61279b9c7fa..67e553235ed 100644 --- a/tests/baselines/reference/assignmentCompatability3.types +++ b/tests/baselines/reference/assignmentCompatability3.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -26,6 +27,7 @@ module __test2__ { >obj : { one: number; } >{one: 1} : { one: number; } >one : number +>1 : number export var __val__obj = obj; >__val__obj : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability4.symbols b/tests/baselines/reference/assignmentCompatability4.symbols new file mode 100644 index 00000000000..fe5e4a32dee --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability4.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/assignmentCompatability4.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability4.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability4.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability4.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability4.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability4.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability4.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability4.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability4.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability4.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability4.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability4.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability4.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability4.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability4.ts, 3, 1)) + + export var aa:{one:number;};; +>aa : Symbol(aa, Decl(assignmentCompatability4.ts, 5, 14)) +>one : Symbol(one, Decl(assignmentCompatability4.ts, 5, 19)) + + export var __val__aa = aa; +>__val__aa : Symbol(__val__aa, Decl(assignmentCompatability4.ts, 6, 14)) +>aa : Symbol(aa, Decl(assignmentCompatability4.ts, 5, 14)) +} +__test2__.__val__aa = __test1__.__val__obj4 +>__test2__.__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability4.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability4.ts, 3, 1)) +>__val__aa : Symbol(__test2__.__val__aa, Decl(assignmentCompatability4.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability4.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability4.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability4.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability4.types b/tests/baselines/reference/assignmentCompatability4.types index f7e5801e9b3..0cafbaa4dd7 100644 --- a/tests/baselines/reference/assignmentCompatability4.types +++ b/tests/baselines/reference/assignmentCompatability4.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability5.symbols b/tests/baselines/reference/assignmentCompatability5.symbols new file mode 100644 index 00000000000..15885d07892 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability5.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/assignmentCompatability5.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability5.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability5.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability5.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability5.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability5.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability5.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability5.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability5.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability5.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability5.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability5.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability5.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability5.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability5.ts, 3, 1)) + + export interface interfaceOne { one: T; }; var obj1: interfaceOne = { one: 1 };; +>interfaceOne : Symbol(interfaceOne, Decl(assignmentCompatability5.ts, 4, 18)) +>T : Symbol(T, Decl(assignmentCompatability5.ts, 5, 52)) +>one : Symbol(one, Decl(assignmentCompatability5.ts, 5, 56)) +>T : Symbol(T, Decl(assignmentCompatability5.ts, 5, 52)) +>obj1 : Symbol(obj1, Decl(assignmentCompatability5.ts, 5, 86)) +>interfaceOne : Symbol(interfaceOne, Decl(assignmentCompatability5.ts, 4, 18)) +>one : Symbol(one, Decl(assignmentCompatability5.ts, 5, 117)) + + export var __val__obj1 = obj1; +>__val__obj1 : Symbol(__val__obj1, Decl(assignmentCompatability5.ts, 6, 14)) +>obj1 : Symbol(obj1, Decl(assignmentCompatability5.ts, 5, 86)) +} +__test2__.__val__obj1 = __test1__.__val__obj4 +>__test2__.__val__obj1 : Symbol(__test2__.__val__obj1, Decl(assignmentCompatability5.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability5.ts, 3, 1)) +>__val__obj1 : Symbol(__test2__.__val__obj1, Decl(assignmentCompatability5.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability5.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability5.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability5.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability5.types b/tests/baselines/reference/assignmentCompatability5.types index 80eda3e510b..8f8dbb0f649 100644 --- a/tests/baselines/reference/assignmentCompatability5.types +++ b/tests/baselines/reference/assignmentCompatability5.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -31,6 +32,7 @@ module __test2__ { >interfaceOne : interfaceOne >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj1 = obj1; >__val__obj1 : interfaceOne diff --git a/tests/baselines/reference/assignmentCompatability6.symbols b/tests/baselines/reference/assignmentCompatability6.symbols new file mode 100644 index 00000000000..4ddacd5cd8c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability6.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/assignmentCompatability6.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability6.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability6.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability6.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability6.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability6.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability6.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability6.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability6.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability6.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability6.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability6.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability6.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability6.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability6.ts, 3, 1)) + + export interface interfaceWithOptional { one?: T; }; var obj3: interfaceWithOptional = { };; +>interfaceWithOptional : Symbol(interfaceWithOptional, Decl(assignmentCompatability6.ts, 4, 18)) +>T : Symbol(T, Decl(assignmentCompatability6.ts, 5, 52)) +>one : Symbol(one, Decl(assignmentCompatability6.ts, 5, 56)) +>T : Symbol(T, Decl(assignmentCompatability6.ts, 5, 52)) +>obj3 : Symbol(obj3, Decl(assignmentCompatability6.ts, 5, 86)) +>interfaceWithOptional : Symbol(interfaceWithOptional, Decl(assignmentCompatability6.ts, 4, 18)) + + export var __val__obj3 = obj3; +>__val__obj3 : Symbol(__val__obj3, Decl(assignmentCompatability6.ts, 6, 14)) +>obj3 : Symbol(obj3, Decl(assignmentCompatability6.ts, 5, 86)) +} +__test2__.__val__obj3 = __test1__.__val__obj4 +>__test2__.__val__obj3 : Symbol(__test2__.__val__obj3, Decl(assignmentCompatability6.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability6.ts, 3, 1)) +>__val__obj3 : Symbol(__test2__.__val__obj3, Decl(assignmentCompatability6.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability6.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability6.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability6.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability6.types b/tests/baselines/reference/assignmentCompatability6.types index 5e9ae8c6a2f..1191ff8bc26 100644 --- a/tests/baselines/reference/assignmentCompatability6.types +++ b/tests/baselines/reference/assignmentCompatability6.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability7.symbols b/tests/baselines/reference/assignmentCompatability7.symbols new file mode 100644 index 00000000000..32a5be9f87f --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability7.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/assignmentCompatability7.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability7.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability7.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability7.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability7.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability7.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability7.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability7.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability7.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability7.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability7.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability7.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability7.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability7.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability7.ts, 3, 1)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability7.ts, 4, 18)) +>T : Symbol(T, Decl(assignmentCompatability7.ts, 5, 52)) +>U : Symbol(U, Decl(assignmentCompatability7.ts, 5, 54)) +>one : Symbol(one, Decl(assignmentCompatability7.ts, 5, 58)) +>T : Symbol(T, Decl(assignmentCompatability7.ts, 5, 52)) +>two : Symbol(two, Decl(assignmentCompatability7.ts, 5, 66)) +>U : Symbol(U, Decl(assignmentCompatability7.ts, 5, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability7.ts, 5, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability7.ts, 4, 18)) +>one : Symbol(one, Decl(assignmentCompatability7.ts, 5, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability7.ts, 6, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability7.ts, 5, 83)) +} +__test2__.__val__obj4 = __test1__.__val__obj4 +>__test2__.__val__obj4 : Symbol(__test2__.__val__obj4, Decl(assignmentCompatability7.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability7.ts, 3, 1)) +>__val__obj4 : Symbol(__test2__.__val__obj4, Decl(assignmentCompatability7.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability7.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability7.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability7.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability7.types b/tests/baselines/reference/assignmentCompatability7.types index b7b2ab70566..77b67514473 100644 --- a/tests/baselines/reference/assignmentCompatability7.types +++ b/tests/baselines/reference/assignmentCompatability7.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -34,6 +35,7 @@ module __test2__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability8.symbols b/tests/baselines/reference/assignmentCompatability8.symbols new file mode 100644 index 00000000000..ba30e4fee94 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability8.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/assignmentCompatability8.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability8.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability8.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability8.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability8.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability8.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability8.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability8.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability8.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability8.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability8.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability8.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability8.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability8.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability8.ts, 3, 1)) + + export class classWithPublic { constructor(public one: T) {} } var x1 = new classWithPublic(1);; +>classWithPublic : Symbol(classWithPublic, Decl(assignmentCompatability8.ts, 4, 18)) +>T : Symbol(T, Decl(assignmentCompatability8.ts, 5, 44)) +>one : Symbol(one, Decl(assignmentCompatability8.ts, 5, 61)) +>T : Symbol(T, Decl(assignmentCompatability8.ts, 5, 44)) +>x1 : Symbol(x1, Decl(assignmentCompatability8.ts, 5, 107)) +>classWithPublic : Symbol(classWithPublic, Decl(assignmentCompatability8.ts, 4, 18)) + + export var __val__x1 = x1; +>__val__x1 : Symbol(__val__x1, Decl(assignmentCompatability8.ts, 6, 14)) +>x1 : Symbol(x1, Decl(assignmentCompatability8.ts, 5, 107)) +} +__test2__.__val__x1 = __test1__.__val__obj4 +>__test2__.__val__x1 : Symbol(__test2__.__val__x1, Decl(assignmentCompatability8.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability8.ts, 3, 1)) +>__val__x1 : Symbol(__test2__.__val__x1, Decl(assignmentCompatability8.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability8.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability8.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability8.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability8.types b/tests/baselines/reference/assignmentCompatability8.types index 1c009eea482..554f9b3caed 100644 --- a/tests/baselines/reference/assignmentCompatability8.types +++ b/tests/baselines/reference/assignmentCompatability8.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional @@ -30,6 +31,7 @@ module __test2__ { >x1 : classWithPublic >new classWithPublic(1) : classWithPublic >classWithPublic : typeof classWithPublic +>1 : number export var __val__x1 = x1; >__val__x1 : classWithPublic diff --git a/tests/baselines/reference/assignmentCompatability9.symbols b/tests/baselines/reference/assignmentCompatability9.symbols new file mode 100644 index 00000000000..7c49da7fea2 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability9.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/assignmentCompatability9.ts === +module __test1__ { +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability9.ts, 0, 0)) + + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability9.ts, 0, 18)) +>T : Symbol(T, Decl(assignmentCompatability9.ts, 1, 52)) +>U : Symbol(U, Decl(assignmentCompatability9.ts, 1, 54)) +>one : Symbol(one, Decl(assignmentCompatability9.ts, 1, 58)) +>T : Symbol(T, Decl(assignmentCompatability9.ts, 1, 52)) +>two : Symbol(two, Decl(assignmentCompatability9.ts, 1, 66)) +>U : Symbol(U, Decl(assignmentCompatability9.ts, 1, 54)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability9.ts, 1, 83)) +>interfaceWithPublicAndOptional : Symbol(interfaceWithPublicAndOptional, Decl(assignmentCompatability9.ts, 0, 18)) +>one : Symbol(one, Decl(assignmentCompatability9.ts, 1, 139)) + + export var __val__obj4 = obj4; +>__val__obj4 : Symbol(__val__obj4, Decl(assignmentCompatability9.ts, 2, 14)) +>obj4 : Symbol(obj4, Decl(assignmentCompatability9.ts, 1, 83)) +} +module __test2__ { +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability9.ts, 3, 1)) + + export class classWithOptional { constructor(public one?: T) {} } var x3 = new classWithOptional();; +>classWithOptional : Symbol(classWithOptional, Decl(assignmentCompatability9.ts, 4, 18)) +>T : Symbol(T, Decl(assignmentCompatability9.ts, 5, 44)) +>one : Symbol(one, Decl(assignmentCompatability9.ts, 5, 61)) +>T : Symbol(T, Decl(assignmentCompatability9.ts, 5, 44)) +>x3 : Symbol(x3, Decl(assignmentCompatability9.ts, 5, 107)) +>classWithOptional : Symbol(classWithOptional, Decl(assignmentCompatability9.ts, 4, 18)) + + export var __val__x3 = x3; +>__val__x3 : Symbol(__val__x3, Decl(assignmentCompatability9.ts, 6, 14)) +>x3 : Symbol(x3, Decl(assignmentCompatability9.ts, 5, 107)) +} +__test2__.__val__x3 = __test1__.__val__obj4 +>__test2__.__val__x3 : Symbol(__test2__.__val__x3, Decl(assignmentCompatability9.ts, 6, 14)) +>__test2__ : Symbol(__test2__, Decl(assignmentCompatability9.ts, 3, 1)) +>__val__x3 : Symbol(__test2__.__val__x3, Decl(assignmentCompatability9.ts, 6, 14)) +>__test1__.__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability9.ts, 2, 14)) +>__test1__ : Symbol(__test1__, Decl(assignmentCompatability9.ts, 0, 0)) +>__val__obj4 : Symbol(__test1__.__val__obj4, Decl(assignmentCompatability9.ts, 2, 14)) + diff --git a/tests/baselines/reference/assignmentCompatability9.types b/tests/baselines/reference/assignmentCompatability9.types index a8235220bec..d8fe3a764a4 100644 --- a/tests/baselines/reference/assignmentCompatability9.types +++ b/tests/baselines/reference/assignmentCompatability9.types @@ -14,6 +14,7 @@ module __test1__ { >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number +>1 : number export var __val__obj4 = obj4; >__val__obj4 : interfaceWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.symbols b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.symbols new file mode 100644 index 00000000000..7ca09f2c77d --- /dev/null +++ b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/assignmentCompatibilityForConstrainedTypeParameters.ts === +function foo() { +>foo : Symbol(foo, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 0)) +>T : Symbol(T, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 13)) +>bar : Symbol(bar, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 24)) + + function bar() { +>bar : Symbol(bar, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 43)) +>S : Symbol(S, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 1, 15)) +>T : Symbol(T, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 13)) + + var x: S; +>x : Symbol(x, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 2, 7)) +>S : Symbol(S, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 1, 15)) + + var y: T; +>y : Symbol(y, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 3, 7)) +>T : Symbol(T, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 0, 13)) + + y = x; +>y : Symbol(y, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 3, 7)) +>x : Symbol(x, Decl(assignmentCompatibilityForConstrainedTypeParameters.ts, 2, 7)) + } +} diff --git a/tests/baselines/reference/assignmentLHSIsReference.symbols b/tests/baselines/reference/assignmentLHSIsReference.symbols new file mode 100644 index 00000000000..b551557708f --- /dev/null +++ b/tests/baselines/reference/assignmentLHSIsReference.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsReference.ts === +var value; +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +// identifiers: variable and parameter +var x1: number; +>x1 : Symbol(x1, Decl(assignmentLHSIsReference.ts, 3, 3)) + +x1 = value; +>x1 : Symbol(x1, Decl(assignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +function fn1(x2: number) { +>fn1 : Symbol(fn1, Decl(assignmentLHSIsReference.ts, 4, 11)) +>x2 : Symbol(x2, Decl(assignmentLHSIsReference.ts, 6, 13)) + + x2 = value; +>x2 : Symbol(x2, Decl(assignmentLHSIsReference.ts, 6, 13)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) +} + +// property accesses +var x3: { a: string }; +>x3 : Symbol(x3, Decl(assignmentLHSIsReference.ts, 11, 3)) +>a : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) + +x3.a = value; +>x3.a : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>x3 : Symbol(x3, Decl(assignmentLHSIsReference.ts, 11, 3)) +>a : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +x3['a'] = value; +>x3 : Symbol(x3, Decl(assignmentLHSIsReference.ts, 11, 3)) +>'a' : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +// parentheses, the contained expression is reference +(x1) = value; +>x1 : Symbol(x1, Decl(assignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +function fn2(x4: number) { +>fn2 : Symbol(fn2, Decl(assignmentLHSIsReference.ts, 16, 13)) +>x4 : Symbol(x4, Decl(assignmentLHSIsReference.ts, 18, 13)) + + (x4) = value; +>x4 : Symbol(x4, Decl(assignmentLHSIsReference.ts, 18, 13)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) +} + +(x3.a) = value; +>x3.a : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>x3 : Symbol(x3, Decl(assignmentLHSIsReference.ts, 11, 3)) +>a : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + +(x3['a']) = value; +>x3 : Symbol(x3, Decl(assignmentLHSIsReference.ts, 11, 3)) +>'a' : Symbol(a, Decl(assignmentLHSIsReference.ts, 11, 9)) +>value : Symbol(value, Decl(assignmentLHSIsReference.ts, 0, 3)) + diff --git a/tests/baselines/reference/assignmentLHSIsReference.types b/tests/baselines/reference/assignmentLHSIsReference.types index 0d7bfad3f06..47204740165 100644 --- a/tests/baselines/reference/assignmentLHSIsReference.types +++ b/tests/baselines/reference/assignmentLHSIsReference.types @@ -37,6 +37,7 @@ x3['a'] = value; >x3['a'] = value : any >x3['a'] : string >x3 : { a: string; } +>'a' : string >value : any // parentheses, the contained expression is reference @@ -70,5 +71,6 @@ function fn2(x4: number) { >(x3['a']) : string >x3['a'] : string >x3 : { a: string; } +>'a' : string >value : any diff --git a/tests/baselines/reference/assignmentRestElementWithErrorSourceType.errors.txt b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.errors.txt new file mode 100644 index 00000000000..080aca5a7ac --- /dev/null +++ b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/assignmentRestElementWithErrorSourceType.ts(2,5): error TS2304: Cannot find name 'c'. +tests/cases/compiler/assignmentRestElementWithErrorSourceType.ts(2,10): error TS2304: Cannot find name 'tupel'. + + +==== tests/cases/compiler/assignmentRestElementWithErrorSourceType.ts (2 errors) ==== + var tuple: [string, number]; + [...c] = tupel; // intentionally misspelled + ~ +!!! error TS2304: Cannot find name 'c'. + ~~~~~ +!!! error TS2304: Cannot find name 'tupel'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentRestElementWithErrorSourceType.js b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.js new file mode 100644 index 00000000000..0a1109a14f7 --- /dev/null +++ b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.js @@ -0,0 +1,7 @@ +//// [assignmentRestElementWithErrorSourceType.ts] +var tuple: [string, number]; +[...c] = tupel; // intentionally misspelled + +//// [assignmentRestElementWithErrorSourceType.js] +var tuple; +c = tupel.slice(0); // intentionally misspelled diff --git a/tests/baselines/reference/augmentArray.symbols b/tests/baselines/reference/augmentArray.symbols new file mode 100644 index 00000000000..8c52363d601 --- /dev/null +++ b/tests/baselines/reference/augmentArray.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/augmentArray.ts === +interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(augmentArray.ts, 0, 0)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(augmentArray.ts, 0, 16)) + + (): any[]; +} diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.symbols b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.symbols new file mode 100644 index 00000000000..81c8b13d207 --- /dev/null +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/types/members/augmentedTypeBracketAccessIndexSignature.ts === +interface Foo { a } +>Foo : Symbol(Foo, Decl(augmentedTypeBracketAccessIndexSignature.ts, 0, 0)) +>a : Symbol(a, Decl(augmentedTypeBracketAccessIndexSignature.ts, 0, 15)) + +interface Bar { b } +>Bar : Symbol(Bar, Decl(augmentedTypeBracketAccessIndexSignature.ts, 0, 19)) +>b : Symbol(b, Decl(augmentedTypeBracketAccessIndexSignature.ts, 1, 15)) + +interface Object { +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11), Decl(augmentedTypeBracketAccessIndexSignature.ts, 1, 19)) + + [n: number]: Foo; +>n : Symbol(n, Decl(augmentedTypeBracketAccessIndexSignature.ts, 4, 5)) +>Foo : Symbol(Foo, Decl(augmentedTypeBracketAccessIndexSignature.ts, 0, 0)) +} + +interface Function { +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(augmentedTypeBracketAccessIndexSignature.ts, 5, 1)) + + [n: number]: Bar; +>n : Symbol(n, Decl(augmentedTypeBracketAccessIndexSignature.ts, 8, 5)) +>Bar : Symbol(Bar, Decl(augmentedTypeBracketAccessIndexSignature.ts, 0, 19)) +} + +var a = {}[0]; // Should be Foo +>a : Symbol(a, Decl(augmentedTypeBracketAccessIndexSignature.ts, 11, 3)) + +var b = (() => { })[0]; // Should be Bar +>b : Symbol(b, Decl(augmentedTypeBracketAccessIndexSignature.ts, 12, 3)) + diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types index 4e6b51730da..898da985aad 100644 --- a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types @@ -27,10 +27,12 @@ var a = {}[0]; // Should be Foo >a : any >{}[0] : any >{} : {} +>0 : number var b = (() => { })[0]; // Should be Bar >b : any >(() => { })[0] : any >(() => { }) : () => void >() => { } : () => void +>0 : number diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.symbols b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.symbols new file mode 100644 index 00000000000..cc9c2ba62ef --- /dev/null +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/augmentedTypeBracketNamedPropertyAccess.ts === +interface Object { +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11), Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 0)) + + data: number; +>data : Symbol(data, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 18)) +} +interface Function { +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(augmentedTypeBracketNamedPropertyAccess.ts, 2, 1)) + + functionData: string; +>functionData : Symbol(functionData, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 3, 20)) +} +var o = {}; +>o : Symbol(o, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 6, 3)) + +var f = function () { }; +>f : Symbol(f, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 7, 3)) + +var r1 = o['data']; // Should be number +>r1 : Symbol(r1, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 9, 3)) +>o : Symbol(o, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 6, 3)) +>'data' : Symbol(Object.data, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 18)) + +var r2 = o['functionData']; // Should be any (no property found) +>r2 : Symbol(r2, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 10, 3)) +>o : Symbol(o, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 6, 3)) + +var r3 = f['functionData']; // Should be string +>r3 : Symbol(r3, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 11, 3)) +>f : Symbol(f, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 7, 3)) +>'functionData' : Symbol(Function.functionData, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 3, 20)) + +var r4 = f['data']; // Should be number +>r4 : Symbol(r4, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 12, 3)) +>f : Symbol(f, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 7, 3)) +>'data' : Symbol(Object.data, Decl(augmentedTypeBracketNamedPropertyAccess.ts, 0, 18)) + diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types index 142b08928e3..c47c98ebc9c 100644 --- a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types @@ -23,19 +23,23 @@ var r1 = o['data']; // Should be number >r1 : number >o['data'] : number >o : {} +>'data' : string var r2 = o['functionData']; // Should be any (no property found) >r2 : any >o['functionData'] : any >o : {} +>'functionData' : string var r3 = f['functionData']; // Should be string >r3 : string >f['functionData'] : string >f : () => void +>'functionData' : string var r4 = f['data']; // Should be number >r4 : number >f['data'] : number >f : () => void +>'data' : string diff --git a/tests/baselines/reference/augmentedTypesClass3.symbols b/tests/baselines/reference/augmentedTypesClass3.symbols new file mode 100644 index 00000000000..62504a56f25 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesClass3.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/augmentedTypesClass3.ts === +// class then module +class c5 { public foo() { } } +>c5 : Symbol(c5, Decl(augmentedTypesClass3.ts, 0, 0), Decl(augmentedTypesClass3.ts, 1, 29)) +>foo : Symbol(foo, Decl(augmentedTypesClass3.ts, 1, 10)) + +module c5 { } // should be ok +>c5 : Symbol(c5, Decl(augmentedTypesClass3.ts, 0, 0), Decl(augmentedTypesClass3.ts, 1, 29)) + +class c5a { public foo() { } } +>c5a : Symbol(c5a, Decl(augmentedTypesClass3.ts, 2, 13), Decl(augmentedTypesClass3.ts, 4, 30)) +>foo : Symbol(foo, Decl(augmentedTypesClass3.ts, 4, 11)) + +module c5a { var y = 2; } // should be ok +>c5a : Symbol(c5a, Decl(augmentedTypesClass3.ts, 2, 13), Decl(augmentedTypesClass3.ts, 4, 30)) +>y : Symbol(y, Decl(augmentedTypesClass3.ts, 5, 16)) + +class c5b { public foo() { } } +>c5b : Symbol(c5b, Decl(augmentedTypesClass3.ts, 5, 25), Decl(augmentedTypesClass3.ts, 7, 30)) +>foo : Symbol(foo, Decl(augmentedTypesClass3.ts, 7, 11)) + +module c5b { export var y = 2; } // should be ok +>c5b : Symbol(c5b, Decl(augmentedTypesClass3.ts, 5, 25), Decl(augmentedTypesClass3.ts, 7, 30)) +>y : Symbol(y, Decl(augmentedTypesClass3.ts, 8, 23)) + +//// class then import +class c5c { public foo() { } } +>c5c : Symbol(c5c, Decl(augmentedTypesClass3.ts, 8, 32)) +>foo : Symbol(foo, Decl(augmentedTypesClass3.ts, 11, 11)) + +//import c5c = require(''); diff --git a/tests/baselines/reference/augmentedTypesClass3.types b/tests/baselines/reference/augmentedTypesClass3.types index b22899b03cf..bed118b5978 100644 --- a/tests/baselines/reference/augmentedTypesClass3.types +++ b/tests/baselines/reference/augmentedTypesClass3.types @@ -14,6 +14,7 @@ class c5a { public foo() { } } module c5a { var y = 2; } // should be ok >c5a : typeof c5a >y : number +>2 : number class c5b { public foo() { } } >c5b : c5b @@ -22,6 +23,7 @@ class c5b { public foo() { } } module c5b { export var y = 2; } // should be ok >c5b : typeof c5b >y : number +>2 : number //// class then import class c5c { public foo() { } } diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.symbols b/tests/baselines/reference/augmentedTypesExternalModule1.symbols new file mode 100644 index 00000000000..3a909b91df5 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesExternalModule1.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/augmentedTypesExternalModule1.ts === +export var a = 1; +>a : Symbol(a, Decl(augmentedTypesExternalModule1.ts, 0, 10)) + +class c5 { public foo() { } } +>c5 : Symbol(c5, Decl(augmentedTypesExternalModule1.ts, 0, 17), Decl(augmentedTypesExternalModule1.ts, 1, 29)) +>foo : Symbol(foo, Decl(augmentedTypesExternalModule1.ts, 1, 10)) + +module c5 { } // should be ok everywhere +>c5 : Symbol(c5, Decl(augmentedTypesExternalModule1.ts, 0, 17), Decl(augmentedTypesExternalModule1.ts, 1, 29)) + diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.types b/tests/baselines/reference/augmentedTypesExternalModule1.types index ec7e9194df6..e652ecb08e1 100644 --- a/tests/baselines/reference/augmentedTypesExternalModule1.types +++ b/tests/baselines/reference/augmentedTypesExternalModule1.types @@ -1,6 +1,7 @@ === tests/cases/compiler/augmentedTypesExternalModule1.ts === export var a = 1; >a : number +>1 : number class c5 { public foo() { } } >c5 : c5 diff --git a/tests/baselines/reference/augmentedTypesModules3b.symbols b/tests/baselines/reference/augmentedTypesModules3b.symbols new file mode 100644 index 00000000000..dd5456e4cf2 --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules3b.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/augmentedTypesModules3b.ts === +class m3b { foo() { } } +>m3b : Symbol(m3b, Decl(augmentedTypesModules3b.ts, 0, 0), Decl(augmentedTypesModules3b.ts, 0, 23)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 0, 11)) + +module m3b { var y = 2; } +>m3b : Symbol(m3b, Decl(augmentedTypesModules3b.ts, 0, 0), Decl(augmentedTypesModules3b.ts, 0, 23)) +>y : Symbol(y, Decl(augmentedTypesModules3b.ts, 1, 16)) + +class m3c { foo() { } } +>m3c : Symbol(m3c, Decl(augmentedTypesModules3b.ts, 1, 25), Decl(augmentedTypesModules3b.ts, 3, 23)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 3, 11)) + +module m3c { export var y = 2; } +>m3c : Symbol(m3c, Decl(augmentedTypesModules3b.ts, 1, 25), Decl(augmentedTypesModules3b.ts, 3, 23)) +>y : Symbol(y, Decl(augmentedTypesModules3b.ts, 4, 23)) + +declare class m3d { foo(): void } +>m3d : Symbol(m3d, Decl(augmentedTypesModules3b.ts, 4, 32), Decl(augmentedTypesModules3b.ts, 6, 33)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 6, 19)) + +module m3d { export var y = 2; } +>m3d : Symbol(m3d, Decl(augmentedTypesModules3b.ts, 4, 32), Decl(augmentedTypesModules3b.ts, 6, 33)) +>y : Symbol(y, Decl(augmentedTypesModules3b.ts, 7, 23)) + +module m3e { export var y = 2; } +>m3e : Symbol(m3e, Decl(augmentedTypesModules3b.ts, 7, 32), Decl(augmentedTypesModules3b.ts, 9, 32)) +>y : Symbol(y, Decl(augmentedTypesModules3b.ts, 9, 23)) + +declare class m3e { foo(): void } +>m3e : Symbol(m3e, Decl(augmentedTypesModules3b.ts, 7, 32), Decl(augmentedTypesModules3b.ts, 9, 32)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 10, 19)) + +declare class m3f { foo(): void } +>m3f : Symbol(m3f, Decl(augmentedTypesModules3b.ts, 10, 33), Decl(augmentedTypesModules3b.ts, 12, 33)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 12, 19)) + +module m3f { export interface I { foo(): void } } +>m3f : Symbol(m3f, Decl(augmentedTypesModules3b.ts, 10, 33), Decl(augmentedTypesModules3b.ts, 12, 33)) +>I : Symbol(I, Decl(augmentedTypesModules3b.ts, 13, 12)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 13, 33)) + +declare class m3g { foo(): void } +>m3g : Symbol(m3g, Decl(augmentedTypesModules3b.ts, 13, 49), Decl(augmentedTypesModules3b.ts, 15, 33)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 15, 19)) + +module m3g { export class C { foo() { } } } +>m3g : Symbol(m3g, Decl(augmentedTypesModules3b.ts, 13, 49), Decl(augmentedTypesModules3b.ts, 15, 33)) +>C : Symbol(C, Decl(augmentedTypesModules3b.ts, 16, 12)) +>foo : Symbol(foo, Decl(augmentedTypesModules3b.ts, 16, 29)) + diff --git a/tests/baselines/reference/augmentedTypesModules3b.types b/tests/baselines/reference/augmentedTypesModules3b.types index af2c33c65da..38134c7c1c2 100644 --- a/tests/baselines/reference/augmentedTypesModules3b.types +++ b/tests/baselines/reference/augmentedTypesModules3b.types @@ -6,6 +6,7 @@ class m3b { foo() { } } module m3b { var y = 2; } >m3b : typeof m3b >y : number +>2 : number class m3c { foo() { } } >m3c : m3c @@ -14,6 +15,7 @@ class m3c { foo() { } } module m3c { export var y = 2; } >m3c : typeof m3c >y : number +>2 : number declare class m3d { foo(): void } >m3d : m3d @@ -22,10 +24,12 @@ declare class m3d { foo(): void } module m3d { export var y = 2; } >m3d : typeof m3d >y : number +>2 : number module m3e { export var y = 2; } >m3e : typeof m3e >y : number +>2 : number declare class m3e { foo(): void } >m3e : m3e diff --git a/tests/baselines/reference/augmentedTypesModules4.symbols b/tests/baselines/reference/augmentedTypesModules4.symbols new file mode 100644 index 00000000000..e0cee3e7c3a --- /dev/null +++ b/tests/baselines/reference/augmentedTypesModules4.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/augmentedTypesModules4.ts === +// module then enum +// should be errors +module m4 { } +>m4 : Symbol(m4, Decl(augmentedTypesModules4.ts, 0, 0), Decl(augmentedTypesModules4.ts, 2, 13)) + +enum m4 { } +>m4 : Symbol(m4, Decl(augmentedTypesModules4.ts, 0, 0), Decl(augmentedTypesModules4.ts, 2, 13)) + +module m4a { var y = 2; } +>m4a : Symbol(m4a, Decl(augmentedTypesModules4.ts, 3, 11), Decl(augmentedTypesModules4.ts, 5, 25)) +>y : Symbol(y, Decl(augmentedTypesModules4.ts, 5, 16)) + +enum m4a { One } +>m4a : Symbol(m4a, Decl(augmentedTypesModules4.ts, 3, 11), Decl(augmentedTypesModules4.ts, 5, 25)) +>One : Symbol(m4a.One, Decl(augmentedTypesModules4.ts, 6, 10)) + +module m4b { export var y = 2; } +>m4b : Symbol(m4b, Decl(augmentedTypesModules4.ts, 6, 16), Decl(augmentedTypesModules4.ts, 8, 32)) +>y : Symbol(y, Decl(augmentedTypesModules4.ts, 8, 23)) + +enum m4b { One } +>m4b : Symbol(m4b, Decl(augmentedTypesModules4.ts, 6, 16), Decl(augmentedTypesModules4.ts, 8, 32)) +>One : Symbol(m4b.One, Decl(augmentedTypesModules4.ts, 9, 10)) + +module m4c { interface I { foo(): void } } +>m4c : Symbol(m4c, Decl(augmentedTypesModules4.ts, 9, 16), Decl(augmentedTypesModules4.ts, 11, 42)) +>I : Symbol(I, Decl(augmentedTypesModules4.ts, 11, 12)) +>foo : Symbol(foo, Decl(augmentedTypesModules4.ts, 11, 26)) + +enum m4c { One } +>m4c : Symbol(m4c, Decl(augmentedTypesModules4.ts, 9, 16), Decl(augmentedTypesModules4.ts, 11, 42)) +>One : Symbol(m4c.One, Decl(augmentedTypesModules4.ts, 12, 10)) + +module m4d { class C { foo() { } } } +>m4d : Symbol(m4d, Decl(augmentedTypesModules4.ts, 12, 16), Decl(augmentedTypesModules4.ts, 14, 36)) +>C : Symbol(C, Decl(augmentedTypesModules4.ts, 14, 12)) +>foo : Symbol(foo, Decl(augmentedTypesModules4.ts, 14, 22)) + +enum m4d { One } +>m4d : Symbol(m4d, Decl(augmentedTypesModules4.ts, 12, 16), Decl(augmentedTypesModules4.ts, 14, 36)) +>One : Symbol(m4d.One, Decl(augmentedTypesModules4.ts, 15, 10)) + +//// module then module + +module m5 { export var y = 2; } +>m5 : Symbol(m5, Decl(augmentedTypesModules4.ts, 15, 16), Decl(augmentedTypesModules4.ts, 19, 31)) +>y : Symbol(y, Decl(augmentedTypesModules4.ts, 19, 22)) + +module m5 { export interface I { foo(): void } } // should already be reasonably well covered +>m5 : Symbol(m5, Decl(augmentedTypesModules4.ts, 15, 16), Decl(augmentedTypesModules4.ts, 19, 31)) +>I : Symbol(I, Decl(augmentedTypesModules4.ts, 20, 11)) +>foo : Symbol(foo, Decl(augmentedTypesModules4.ts, 20, 32)) + diff --git a/tests/baselines/reference/augmentedTypesModules4.types b/tests/baselines/reference/augmentedTypesModules4.types index bf8922a5761..15d7c28e1d6 100644 --- a/tests/baselines/reference/augmentedTypesModules4.types +++ b/tests/baselines/reference/augmentedTypesModules4.types @@ -10,6 +10,7 @@ enum m4 { } module m4a { var y = 2; } >m4a : typeof m4a >y : number +>2 : number enum m4a { One } >m4a : m4a @@ -18,6 +19,7 @@ enum m4a { One } module m4b { export var y = 2; } >m4b : typeof m4b >y : number +>2 : number enum m4b { One } >m4b : m4b @@ -46,6 +48,7 @@ enum m4d { One } module m5 { export var y = 2; } >m5 : typeof m5 >y : number +>2 : number module m5 { export interface I { foo(): void } } // should already be reasonably well covered >m5 : typeof m5 diff --git a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.symbols b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.symbols new file mode 100644 index 00000000000..199830dc191 --- /dev/null +++ b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/autoAsiForStaticsInClassDeclaration.ts === +class C { +>C : Symbol(C, Decl(autoAsiForStaticsInClassDeclaration.ts, 0, 0)) + + static x +>x : Symbol(C.x, Decl(autoAsiForStaticsInClassDeclaration.ts, 0, 9)) + + static y +>y : Symbol(C.y, Decl(autoAsiForStaticsInClassDeclaration.ts, 1, 12)) +} diff --git a/tests/baselines/reference/autonumberingInEnums.symbols b/tests/baselines/reference/autonumberingInEnums.symbols new file mode 100644 index 00000000000..8cfba4d1057 --- /dev/null +++ b/tests/baselines/reference/autonumberingInEnums.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/autonumberingInEnums.ts === +enum Foo { +>Foo : Symbol(Foo, Decl(autonumberingInEnums.ts, 0, 0), Decl(autonumberingInEnums.ts, 2, 1)) + + a = 1 +>a : Symbol(Foo.a, Decl(autonumberingInEnums.ts, 0, 10)) +} + +enum Foo { +>Foo : Symbol(Foo, Decl(autonumberingInEnums.ts, 0, 0), Decl(autonumberingInEnums.ts, 2, 1)) + + b // should work fine +>b : Symbol(Foo.b, Decl(autonumberingInEnums.ts, 4, 10)) +} diff --git a/tests/baselines/reference/autonumberingInEnums.types b/tests/baselines/reference/autonumberingInEnums.types index ce3366390e8..35d5a1505a5 100644 --- a/tests/baselines/reference/autonumberingInEnums.types +++ b/tests/baselines/reference/autonumberingInEnums.types @@ -4,6 +4,7 @@ enum Foo { a = 1 >a : Foo +>1 : number } enum Foo { diff --git a/tests/baselines/reference/avoid.symbols b/tests/baselines/reference/avoid.symbols new file mode 100644 index 00000000000..9b9440eea65 --- /dev/null +++ b/tests/baselines/reference/avoid.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/avoid.ts === +function f() { +>f : Symbol(f, Decl(avoid.ts, 0, 0)) + + var x=1; +>x : Symbol(x, Decl(avoid.ts, 1, 7)) +} + +var y=f(); // error void fn +>y : Symbol(y, Decl(avoid.ts, 4, 3)) +>f : Symbol(f, Decl(avoid.ts, 0, 0)) + +var why:any=f(); // error void fn +>why : Symbol(why, Decl(avoid.ts, 5, 3)) +>f : Symbol(f, Decl(avoid.ts, 0, 0)) + +var w:any; +>w : Symbol(w, Decl(avoid.ts, 6, 3)) + +w=f(); // error void fn +>w : Symbol(w, Decl(avoid.ts, 6, 3)) +>f : Symbol(f, Decl(avoid.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(avoid.ts, 7, 6)) + + g() { +>g : Symbol(g, Decl(avoid.ts, 9, 9)) + + } +} + +var z=new C().g(); // error void fn +>z : Symbol(z, Decl(avoid.ts, 15, 3)) +>new C().g : Symbol(C.g, Decl(avoid.ts, 9, 9)) +>C : Symbol(C, Decl(avoid.ts, 7, 6)) +>g : Symbol(C.g, Decl(avoid.ts, 9, 9)) + +var N=new f(); // ok with void fn +>N : Symbol(N, Decl(avoid.ts, 16, 3)) +>f : Symbol(f, Decl(avoid.ts, 0, 0)) + + diff --git a/tests/baselines/reference/avoid.types b/tests/baselines/reference/avoid.types index 853d93bdd79..25fe27a2ea0 100644 --- a/tests/baselines/reference/avoid.types +++ b/tests/baselines/reference/avoid.types @@ -4,6 +4,7 @@ function f() { var x=1; >x : number +>1 : number } var y=f(); // error void fn diff --git a/tests/baselines/reference/badOverloadError.symbols b/tests/baselines/reference/badOverloadError.symbols new file mode 100644 index 00000000000..86c0a332f8f --- /dev/null +++ b/tests/baselines/reference/badOverloadError.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/badOverloadError.ts === +function method() { +>method : Symbol(method, Decl(badOverloadError.ts, 0, 0)) + + var dictionary = <{ [index: string]: string; }>{}; +>dictionary : Symbol(dictionary, Decl(badOverloadError.ts, 1, 7)) +>index : Symbol(index, Decl(badOverloadError.ts, 1, 25)) +} + diff --git a/tests/baselines/reference/badThisBinding.symbols b/tests/baselines/reference/badThisBinding.symbols new file mode 100644 index 00000000000..c1ca8d1f481 --- /dev/null +++ b/tests/baselines/reference/badThisBinding.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/badThisBinding.ts === +declare function foo(a:any): any; +>foo : Symbol(foo, Decl(badThisBinding.ts, 0, 0)) +>a : Symbol(a, Decl(badThisBinding.ts, 0, 21)) + +declare function bar(a:any): any; +>bar : Symbol(bar, Decl(badThisBinding.ts, 0, 33)) +>a : Symbol(a, Decl(badThisBinding.ts, 1, 21)) + +class Greeter { +>Greeter : Symbol(Greeter, Decl(badThisBinding.ts, 1, 33)) + + constructor() { + foo(() => { +>foo : Symbol(foo, Decl(badThisBinding.ts, 0, 0)) + + bar(() => { +>bar : Symbol(bar, Decl(badThisBinding.ts, 0, 33)) + + var x = this; +>x : Symbol(x, Decl(badThisBinding.ts, 7, 19)) +>this : Symbol(Greeter, Decl(badThisBinding.ts, 1, 33)) + + }); + }); + } + +} diff --git a/tests/baselines/reference/baseIndexSignatureResolution.symbols b/tests/baselines/reference/baseIndexSignatureResolution.symbols new file mode 100644 index 00000000000..297f6b092f3 --- /dev/null +++ b/tests/baselines/reference/baseIndexSignatureResolution.symbols @@ -0,0 +1,49 @@ +=== tests/cases/compiler/baseIndexSignatureResolution.ts === +class Base { private a: string; } +>Base : Symbol(Base, Decl(baseIndexSignatureResolution.ts, 0, 0)) +>a : Symbol(a, Decl(baseIndexSignatureResolution.ts, 0, 12)) + +class Derived extends Base { private b: string; } +>Derived : Symbol(Derived, Decl(baseIndexSignatureResolution.ts, 0, 33)) +>Base : Symbol(Base, Decl(baseIndexSignatureResolution.ts, 0, 0)) +>b : Symbol(b, Decl(baseIndexSignatureResolution.ts, 1, 28)) + +// Note - commmenting "extends Foo" prevents the error +interface Foo { +>Foo : Symbol(Foo, Decl(baseIndexSignatureResolution.ts, 1, 49)) + + [i: number]: Base; +>i : Symbol(i, Decl(baseIndexSignatureResolution.ts, 5, 5)) +>Base : Symbol(Base, Decl(baseIndexSignatureResolution.ts, 0, 0)) +} +interface FooOf extends Foo { +>FooOf : Symbol(FooOf, Decl(baseIndexSignatureResolution.ts, 6, 1)) +>TBase : Symbol(TBase, Decl(baseIndexSignatureResolution.ts, 7, 16)) +>Base : Symbol(Base, Decl(baseIndexSignatureResolution.ts, 0, 0)) +>Foo : Symbol(Foo, Decl(baseIndexSignatureResolution.ts, 1, 49)) + + [i: number]: TBase; +>i : Symbol(i, Decl(baseIndexSignatureResolution.ts, 8, 5)) +>TBase : Symbol(TBase, Decl(baseIndexSignatureResolution.ts, 7, 16)) +} +var x: FooOf = null; +>x : Symbol(x, Decl(baseIndexSignatureResolution.ts, 10, 3)) +>FooOf : Symbol(FooOf, Decl(baseIndexSignatureResolution.ts, 6, 1)) +>Derived : Symbol(Derived, Decl(baseIndexSignatureResolution.ts, 0, 33)) + +var y: Derived = x[0]; +>y : Symbol(y, Decl(baseIndexSignatureResolution.ts, 11, 3)) +>Derived : Symbol(Derived, Decl(baseIndexSignatureResolution.ts, 0, 33)) +>x : Symbol(x, Decl(baseIndexSignatureResolution.ts, 10, 3)) + +/* +// Note - the equivalent for normal interface methods works fine: +interface A { + foo(): Base; +} +interface B extends A { + foo(): TBase; +} +var b: B = null; +var z: Derived = b.foo(); +*/ diff --git a/tests/baselines/reference/baseIndexSignatureResolution.types b/tests/baselines/reference/baseIndexSignatureResolution.types index 5a7ad14d2fa..90d143155fb 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.types +++ b/tests/baselines/reference/baseIndexSignatureResolution.types @@ -30,12 +30,14 @@ var x: FooOf = null; >x : FooOf >FooOf : FooOf >Derived : Derived +>null : null var y: Derived = x[0]; >y : Derived >Derived : Derived >x[0] : Derived >x : FooOf +>0 : number /* // Note - the equivalent for normal interface methods works fine: diff --git a/tests/baselines/reference/baseTypeAfterDerivedType.symbols b/tests/baselines/reference/baseTypeAfterDerivedType.symbols new file mode 100644 index 00000000000..b085e0a4152 --- /dev/null +++ b/tests/baselines/reference/baseTypeAfterDerivedType.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/baseTypeAfterDerivedType.ts === +interface Derived extends Base { +>Derived : Symbol(Derived, Decl(baseTypeAfterDerivedType.ts, 0, 0)) +>Base : Symbol(Base, Decl(baseTypeAfterDerivedType.ts, 2, 1)) + + method(...args: any[]): void; +>method : Symbol(method, Decl(baseTypeAfterDerivedType.ts, 0, 32)) +>args : Symbol(args, Decl(baseTypeAfterDerivedType.ts, 1, 11)) +} + +interface Base { +>Base : Symbol(Base, Decl(baseTypeAfterDerivedType.ts, 2, 1)) + + method(...args: any[]): void; +>method : Symbol(method, Decl(baseTypeAfterDerivedType.ts, 4, 16)) +>args : Symbol(args, Decl(baseTypeAfterDerivedType.ts, 5, 11)) +} + +class Derived2 implements Base2 { +>Derived2 : Symbol(Derived2, Decl(baseTypeAfterDerivedType.ts, 6, 1)) +>Base2 : Symbol(Base2, Decl(baseTypeAfterDerivedType.ts, 10, 1)) + + method(...args: any[]): void { } +>method : Symbol(method, Decl(baseTypeAfterDerivedType.ts, 8, 33)) +>args : Symbol(args, Decl(baseTypeAfterDerivedType.ts, 9, 11)) +} + +interface Base2 { +>Base2 : Symbol(Base2, Decl(baseTypeAfterDerivedType.ts, 10, 1)) + + method(...args: any[]): void; +>method : Symbol(method, Decl(baseTypeAfterDerivedType.ts, 12, 17)) +>args : Symbol(args, Decl(baseTypeAfterDerivedType.ts, 13, 11)) +} + diff --git a/tests/baselines/reference/baseTypeOrderChecking.symbols b/tests/baselines/reference/baseTypeOrderChecking.symbols new file mode 100644 index 00000000000..05d913f481e --- /dev/null +++ b/tests/baselines/reference/baseTypeOrderChecking.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/baseTypeOrderChecking.ts === +var someVariable: Class4; +>someVariable : Symbol(someVariable, Decl(baseTypeOrderChecking.ts, 0, 3)) +>Class4 : Symbol(Class4, Decl(baseTypeOrderChecking.ts, 26, 1)) +>Class2 : Symbol(Class2, Decl(baseTypeOrderChecking.ts, 8, 1)) + + + +class Class1 +>Class1 : Symbol(Class1, Decl(baseTypeOrderChecking.ts, 0, 33)) + +{ + +} + + + +class Class2 extends Class1 +>Class2 : Symbol(Class2, Decl(baseTypeOrderChecking.ts, 8, 1)) +>Class1 : Symbol(Class1, Decl(baseTypeOrderChecking.ts, 0, 33)) + +{ + +} + + + +class Class3 +>Class3 : Symbol(Class3, Decl(baseTypeOrderChecking.ts, 16, 1)) +>T : Symbol(T, Decl(baseTypeOrderChecking.ts, 20, 13)) + +{ + + public memberVariable: Class2; +>memberVariable : Symbol(memberVariable, Decl(baseTypeOrderChecking.ts, 22, 1)) +>Class2 : Symbol(Class2, Decl(baseTypeOrderChecking.ts, 8, 1)) + +} + + + +class Class4 extends Class3 +>Class4 : Symbol(Class4, Decl(baseTypeOrderChecking.ts, 26, 1)) +>T : Symbol(T, Decl(baseTypeOrderChecking.ts, 30, 13)) +>Class3 : Symbol(Class3, Decl(baseTypeOrderChecking.ts, 16, 1)) +>T : Symbol(T, Decl(baseTypeOrderChecking.ts, 30, 13)) + +{ + +} + diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.symbols b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.symbols new file mode 100644 index 00000000000..e6b6def0944 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.symbols @@ -0,0 +1,101 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions.ts === +// conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) +// no errors expected here + +var a: { x: number; y?: number }; +>a : Symbol(a, Decl(bestCommonTypeOfConditionalExpressions.ts, 3, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 3, 8)) +>y : Symbol(y, Decl(bestCommonTypeOfConditionalExpressions.ts, 3, 19)) + +var b: { x: number; z?: number }; +>b : Symbol(b, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 8)) +>z : Symbol(z, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 19)) + +class Base { foo: string; } +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 33)) +>foo : Symbol(foo, Decl(bestCommonTypeOfConditionalExpressions.ts, 6, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(bestCommonTypeOfConditionalExpressions.ts, 6, 27)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 33)) +>bar : Symbol(bar, Decl(bestCommonTypeOfConditionalExpressions.ts, 7, 28)) + +class Derived2 extends Base { baz: string; } +>Derived2 : Symbol(Derived2, Decl(bestCommonTypeOfConditionalExpressions.ts, 7, 43)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 33)) +>baz : Symbol(baz, Decl(bestCommonTypeOfConditionalExpressions.ts, 8, 29)) + +var base: Base; +>base : Symbol(base, Decl(bestCommonTypeOfConditionalExpressions.ts, 9, 3)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 33)) + +var derived: Derived; +>derived : Symbol(derived, Decl(bestCommonTypeOfConditionalExpressions.ts, 10, 3)) +>Derived : Symbol(Derived, Decl(bestCommonTypeOfConditionalExpressions.ts, 6, 27)) + +var derived2: Derived2; +>derived2 : Symbol(derived2, Decl(bestCommonTypeOfConditionalExpressions.ts, 11, 3)) +>Derived2 : Symbol(Derived2, Decl(bestCommonTypeOfConditionalExpressions.ts, 7, 43)) + +var r = true ? 1 : 2; +>r : Symbol(r, Decl(bestCommonTypeOfConditionalExpressions.ts, 13, 3)) + +var r3 = true ? 1 : {}; +>r3 : Symbol(r3, Decl(bestCommonTypeOfConditionalExpressions.ts, 14, 3)) + +var r4 = true ? a : b; // typeof a +>r4 : Symbol(r4, Decl(bestCommonTypeOfConditionalExpressions.ts, 15, 3)) +>a : Symbol(a, Decl(bestCommonTypeOfConditionalExpressions.ts, 3, 3)) +>b : Symbol(b, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 3)) + +var r5 = true ? b : a; // typeof b +>r5 : Symbol(r5, Decl(bestCommonTypeOfConditionalExpressions.ts, 16, 3)) +>b : Symbol(b, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 3)) +>a : Symbol(a, Decl(bestCommonTypeOfConditionalExpressions.ts, 3, 3)) + +var r6 = true ? (x: number) => { } : (x: Object) => { }; // returns number => void +>r6 : Symbol(r6, Decl(bestCommonTypeOfConditionalExpressions.ts, 17, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 17, 17)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 17, 38)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; +>r7 : Symbol(r7, Decl(bestCommonTypeOfConditionalExpressions.ts, 18, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 18, 9)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 18, 38)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 18, 59)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => void +>r8 : Symbol(r8, Decl(bestCommonTypeOfConditionalExpressions.ts, 19, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 19, 17)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>x : Symbol(x, Decl(bestCommonTypeOfConditionalExpressions.ts, 19, 38)) + +var r10: Base = true ? derived : derived2; // no error since we use the contextual type in BCT +>r10 : Symbol(r10, Decl(bestCommonTypeOfConditionalExpressions.ts, 20, 3)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions.ts, 4, 33)) +>derived : Symbol(derived, Decl(bestCommonTypeOfConditionalExpressions.ts, 10, 3)) +>derived2 : Symbol(derived2, Decl(bestCommonTypeOfConditionalExpressions.ts, 11, 3)) + +var r11 = true ? base : derived2; +>r11 : Symbol(r11, Decl(bestCommonTypeOfConditionalExpressions.ts, 21, 3)) +>base : Symbol(base, Decl(bestCommonTypeOfConditionalExpressions.ts, 9, 3)) +>derived2 : Symbol(derived2, Decl(bestCommonTypeOfConditionalExpressions.ts, 11, 3)) + +function foo5(t: T, u: U): Object { +>foo5 : Symbol(foo5, Decl(bestCommonTypeOfConditionalExpressions.ts, 21, 33)) +>T : Symbol(T, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 14)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 16)) +>t : Symbol(t, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 20)) +>T : Symbol(T, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 14)) +>u : Symbol(u, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 25)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 16)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + return true ? t : u; // BCT is Object +>t : Symbol(t, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 20)) +>u : Symbol(u, Decl(bestCommonTypeOfConditionalExpressions.ts, 23, 25)) +} diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types index eb94c140883..2a5ee6a2fe2 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types @@ -41,27 +41,35 @@ var derived2: Derived2; var r = true ? 1 : 2; >r : number >true ? 1 : 2 : number +>true : boolean +>1 : number +>2 : number var r3 = true ? 1 : {}; >r3 : {} >true ? 1 : {} : {} +>true : boolean +>1 : number >{} : {} var r4 = true ? a : b; // typeof a >r4 : { x: number; y?: number; } | { x: number; z?: number; } >true ? a : b : { x: number; y?: number; } | { x: number; z?: number; } +>true : boolean >a : { x: number; y?: number; } >b : { x: number; z?: number; } var r5 = true ? b : a; // typeof b >r5 : { x: number; y?: number; } | { x: number; z?: number; } >true ? b : a : { x: number; y?: number; } | { x: number; z?: number; } +>true : boolean >b : { x: number; z?: number; } >a : { x: number; y?: number; } var r6 = true ? (x: number) => { } : (x: Object) => { }; // returns number => void >r6 : (x: number) => void >true ? (x: number) => { } : (x: Object) => { } : (x: number) => void +>true : boolean >(x: number) => { } : (x: number) => void >x : number >(x: Object) => { } : (x: Object) => void @@ -73,6 +81,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; >x : Object >Object : Object >true ? (x: number) => { } : (x: Object) => { } : (x: number) => void +>true : boolean >(x: number) => { } : (x: number) => void >x : number >(x: Object) => { } : (x: Object) => void @@ -82,6 +91,7 @@ var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => void >r8 : (x: Object) => void >true ? (x: Object) => { } : (x: number) => { } : (x: Object) => void +>true : boolean >(x: Object) => { } : (x: Object) => void >x : Object >Object : Object @@ -92,12 +102,14 @@ var r10: Base = true ? derived : derived2; // no error since we use the contextu >r10 : Base >Base : Base >true ? derived : derived2 : Derived | Derived2 +>true : boolean >derived : Derived >derived2 : Derived2 var r11 = true ? base : derived2; >r11 : Base >true ? base : derived2 : Base +>true : boolean >base : Base >derived2 : Derived2 @@ -113,6 +125,7 @@ function foo5(t: T, u: U): Object { return true ? t : u; // BCT is Object >true ? t : u : T | U +>true : boolean >t : T >u : U } diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.symbols b/tests/baselines/reference/bestCommonTypeOfTuple.symbols new file mode 100644 index 00000000000..59549da0cac --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfTuple.symbols @@ -0,0 +1,84 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts === +function f1(x: number): string { return "foo"; } +>f1 : Symbol(f1, Decl(bestCommonTypeOfTuple.ts, 0, 0)) +>x : Symbol(x, Decl(bestCommonTypeOfTuple.ts, 0, 12)) + +function f2(x: number): number { return 10; } +>f2 : Symbol(f2, Decl(bestCommonTypeOfTuple.ts, 0, 48)) +>x : Symbol(x, Decl(bestCommonTypeOfTuple.ts, 2, 12)) + +function f3(x: number): boolean { return true; } +>f3 : Symbol(f3, Decl(bestCommonTypeOfTuple.ts, 2, 45)) +>x : Symbol(x, Decl(bestCommonTypeOfTuple.ts, 4, 12)) + +enum E1 { one } +>E1 : Symbol(E1, Decl(bestCommonTypeOfTuple.ts, 4, 48)) +>one : Symbol(E1.one, Decl(bestCommonTypeOfTuple.ts, 6, 9)) + +enum E2 { two } +>E2 : Symbol(E2, Decl(bestCommonTypeOfTuple.ts, 6, 15)) +>two : Symbol(E2.two, Decl(bestCommonTypeOfTuple.ts, 8, 9)) + + +var t1: [(x: number) => string, (x: number) => number]; +>t1 : Symbol(t1, Decl(bestCommonTypeOfTuple.ts, 11, 3)) +>x : Symbol(x, Decl(bestCommonTypeOfTuple.ts, 11, 10)) +>x : Symbol(x, Decl(bestCommonTypeOfTuple.ts, 11, 33)) + +var t2: [E1, E2]; +>t2 : Symbol(t2, Decl(bestCommonTypeOfTuple.ts, 12, 3)) +>E1 : Symbol(E1, Decl(bestCommonTypeOfTuple.ts, 4, 48)) +>E2 : Symbol(E2, Decl(bestCommonTypeOfTuple.ts, 6, 15)) + +var t3: [number, any]; +>t3 : Symbol(t3, Decl(bestCommonTypeOfTuple.ts, 13, 3)) + +var t4: [E1, E2, number]; +>t4 : Symbol(t4, Decl(bestCommonTypeOfTuple.ts, 14, 3)) +>E1 : Symbol(E1, Decl(bestCommonTypeOfTuple.ts, 4, 48)) +>E2 : Symbol(E2, Decl(bestCommonTypeOfTuple.ts, 6, 15)) + +// no error +t1 = [f1, f2]; +>t1 : Symbol(t1, Decl(bestCommonTypeOfTuple.ts, 11, 3)) +>f1 : Symbol(f1, Decl(bestCommonTypeOfTuple.ts, 0, 0)) +>f2 : Symbol(f2, Decl(bestCommonTypeOfTuple.ts, 0, 48)) + +t2 = [E1.one, E2.two]; +>t2 : Symbol(t2, Decl(bestCommonTypeOfTuple.ts, 12, 3)) +>E1.one : Symbol(E1.one, Decl(bestCommonTypeOfTuple.ts, 6, 9)) +>E1 : Symbol(E1, Decl(bestCommonTypeOfTuple.ts, 4, 48)) +>one : Symbol(E1.one, Decl(bestCommonTypeOfTuple.ts, 6, 9)) +>E2.two : Symbol(E2.two, Decl(bestCommonTypeOfTuple.ts, 8, 9)) +>E2 : Symbol(E2, Decl(bestCommonTypeOfTuple.ts, 6, 15)) +>two : Symbol(E2.two, Decl(bestCommonTypeOfTuple.ts, 8, 9)) + +t3 = [5, undefined]; +>t3 : Symbol(t3, Decl(bestCommonTypeOfTuple.ts, 13, 3)) +>undefined : Symbol(undefined) + +t4 = [E1.one, E2.two, 20]; +>t4 : Symbol(t4, Decl(bestCommonTypeOfTuple.ts, 14, 3)) +>E1.one : Symbol(E1.one, Decl(bestCommonTypeOfTuple.ts, 6, 9)) +>E1 : Symbol(E1, Decl(bestCommonTypeOfTuple.ts, 4, 48)) +>one : Symbol(E1.one, Decl(bestCommonTypeOfTuple.ts, 6, 9)) +>E2.two : Symbol(E2.two, Decl(bestCommonTypeOfTuple.ts, 8, 9)) +>E2 : Symbol(E2, Decl(bestCommonTypeOfTuple.ts, 6, 15)) +>two : Symbol(E2.two, Decl(bestCommonTypeOfTuple.ts, 8, 9)) + +var e1 = t1[2]; // {} +>e1 : Symbol(e1, Decl(bestCommonTypeOfTuple.ts, 21, 3)) +>t1 : Symbol(t1, Decl(bestCommonTypeOfTuple.ts, 11, 3)) + +var e2 = t2[2]; // {} +>e2 : Symbol(e2, Decl(bestCommonTypeOfTuple.ts, 22, 3)) +>t2 : Symbol(t2, Decl(bestCommonTypeOfTuple.ts, 12, 3)) + +var e3 = t3[2]; // any +>e3 : Symbol(e3, Decl(bestCommonTypeOfTuple.ts, 23, 3)) +>t3 : Symbol(t3, Decl(bestCommonTypeOfTuple.ts, 13, 3)) + +var e4 = t4[3]; // number +>e4 : Symbol(e4, Decl(bestCommonTypeOfTuple.ts, 24, 3)) +>t4 : Symbol(t4, Decl(bestCommonTypeOfTuple.ts, 14, 3)) + diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.types b/tests/baselines/reference/bestCommonTypeOfTuple.types index 0516fc4af2b..7b7302a9cc2 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple.types @@ -2,14 +2,17 @@ function f1(x: number): string { return "foo"; } >f1 : (x: number) => string >x : number +>"foo" : string function f2(x: number): number { return 10; } >f2 : (x: number) => number >x : number +>10 : number function f3(x: number): boolean { return true; } >f3 : (x: number) => boolean >x : number +>true : boolean enum E1 { one } >E1 : E1 @@ -61,6 +64,7 @@ t3 = [5, undefined]; >t3 = [5, undefined] : [number, undefined] >t3 : [number, any] >[5, undefined] : [number, undefined] +>5 : number >undefined : undefined t4 = [E1.one, E2.two, 20]; @@ -73,24 +77,29 @@ t4 = [E1.one, E2.two, 20]; >E2.two : E2 >E2 : typeof E2 >two : E2 +>20 : number var e1 = t1[2]; // {} >e1 : ((x: number) => string) | ((x: number) => number) >t1[2] : ((x: number) => string) | ((x: number) => number) >t1 : [(x: number) => string, (x: number) => number] +>2 : number var e2 = t2[2]; // {} >e2 : E1 | E2 >t2[2] : E1 | E2 >t2 : [E1, E2] +>2 : number var e3 = t3[2]; // any >e3 : any >t3[2] : any >t3 : [number, any] +>2 : number var e4 = t4[3]; // number >e4 : number >t4[3] : number >t4 : [E1, E2, number] +>3 : number diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.symbols b/tests/baselines/reference/bestCommonTypeOfTuple2.symbols new file mode 100644 index 00000000000..842d07c417c --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.symbols @@ -0,0 +1,85 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts === +interface base { } +>base : Symbol(base, Decl(bestCommonTypeOfTuple2.ts, 0, 0)) + +interface base1 { i } +>base1 : Symbol(base1, Decl(bestCommonTypeOfTuple2.ts, 0, 18)) +>i : Symbol(i, Decl(bestCommonTypeOfTuple2.ts, 1, 17)) + +class C implements base { c } +>C : Symbol(C, Decl(bestCommonTypeOfTuple2.ts, 1, 21)) +>base : Symbol(base, Decl(bestCommonTypeOfTuple2.ts, 0, 0)) +>c : Symbol(c, Decl(bestCommonTypeOfTuple2.ts, 2, 25)) + +class D implements base { d } +>D : Symbol(D, Decl(bestCommonTypeOfTuple2.ts, 2, 29)) +>base : Symbol(base, Decl(bestCommonTypeOfTuple2.ts, 0, 0)) +>d : Symbol(d, Decl(bestCommonTypeOfTuple2.ts, 3, 25)) + +class E implements base { e } +>E : Symbol(E, Decl(bestCommonTypeOfTuple2.ts, 3, 29)) +>base : Symbol(base, Decl(bestCommonTypeOfTuple2.ts, 0, 0)) +>e : Symbol(e, Decl(bestCommonTypeOfTuple2.ts, 4, 25)) + +class F extends C { f } +>F : Symbol(F, Decl(bestCommonTypeOfTuple2.ts, 4, 29)) +>C : Symbol(C, Decl(bestCommonTypeOfTuple2.ts, 1, 21)) +>f : Symbol(f, Decl(bestCommonTypeOfTuple2.ts, 5, 19)) + +class C1 implements base1 { i = "foo"; c } +>C1 : Symbol(C1, Decl(bestCommonTypeOfTuple2.ts, 5, 23)) +>base1 : Symbol(base1, Decl(bestCommonTypeOfTuple2.ts, 0, 18)) +>i : Symbol(i, Decl(bestCommonTypeOfTuple2.ts, 7, 27)) +>c : Symbol(c, Decl(bestCommonTypeOfTuple2.ts, 7, 38)) + +class D1 extends C1 { i = "bar"; d } +>D1 : Symbol(D1, Decl(bestCommonTypeOfTuple2.ts, 7, 42)) +>C1 : Symbol(C1, Decl(bestCommonTypeOfTuple2.ts, 5, 23)) +>i : Symbol(i, Decl(bestCommonTypeOfTuple2.ts, 8, 21)) +>d : Symbol(d, Decl(bestCommonTypeOfTuple2.ts, 8, 32)) + +var t1: [C, base]; +>t1 : Symbol(t1, Decl(bestCommonTypeOfTuple2.ts, 10, 3)) +>C : Symbol(C, Decl(bestCommonTypeOfTuple2.ts, 1, 21)) +>base : Symbol(base, Decl(bestCommonTypeOfTuple2.ts, 0, 0)) + +var t2: [C, D]; +>t2 : Symbol(t2, Decl(bestCommonTypeOfTuple2.ts, 11, 3)) +>C : Symbol(C, Decl(bestCommonTypeOfTuple2.ts, 1, 21)) +>D : Symbol(D, Decl(bestCommonTypeOfTuple2.ts, 2, 29)) + +var t3: [C1, D1]; +>t3 : Symbol(t3, Decl(bestCommonTypeOfTuple2.ts, 12, 3)) +>C1 : Symbol(C1, Decl(bestCommonTypeOfTuple2.ts, 5, 23)) +>D1 : Symbol(D1, Decl(bestCommonTypeOfTuple2.ts, 7, 42)) + +var t4: [base1, C1]; +>t4 : Symbol(t4, Decl(bestCommonTypeOfTuple2.ts, 13, 3)) +>base1 : Symbol(base1, Decl(bestCommonTypeOfTuple2.ts, 0, 18)) +>C1 : Symbol(C1, Decl(bestCommonTypeOfTuple2.ts, 5, 23)) + +var t5: [C1, F] +>t5 : Symbol(t5, Decl(bestCommonTypeOfTuple2.ts, 14, 3)) +>C1 : Symbol(C1, Decl(bestCommonTypeOfTuple2.ts, 5, 23)) +>F : Symbol(F, Decl(bestCommonTypeOfTuple2.ts, 4, 29)) + +var e11 = t1[4]; // base +>e11 : Symbol(e11, Decl(bestCommonTypeOfTuple2.ts, 16, 3)) +>t1 : Symbol(t1, Decl(bestCommonTypeOfTuple2.ts, 10, 3)) + +var e21 = t2[4]; // {} +>e21 : Symbol(e21, Decl(bestCommonTypeOfTuple2.ts, 17, 3)) +>t2 : Symbol(t2, Decl(bestCommonTypeOfTuple2.ts, 11, 3)) + +var e31 = t3[4]; // C1 +>e31 : Symbol(e31, Decl(bestCommonTypeOfTuple2.ts, 18, 3)) +>t3 : Symbol(t3, Decl(bestCommonTypeOfTuple2.ts, 12, 3)) + +var e41 = t4[2]; // base1 +>e41 : Symbol(e41, Decl(bestCommonTypeOfTuple2.ts, 19, 3)) +>t4 : Symbol(t4, Decl(bestCommonTypeOfTuple2.ts, 13, 3)) + +var e51 = t5[2]; // {} +>e51 : Symbol(e51, Decl(bestCommonTypeOfTuple2.ts, 20, 3)) +>t5 : Symbol(t5, Decl(bestCommonTypeOfTuple2.ts, 14, 3)) + diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.types b/tests/baselines/reference/bestCommonTypeOfTuple2.types index a87407e98fc..32196fdf668 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.types @@ -30,12 +30,14 @@ class C1 implements base1 { i = "foo"; c } >C1 : C1 >base1 : base1 >i : string +>"foo" : string >c : any class D1 extends C1 { i = "bar"; d } >D1 : D1 >C1 : C1 >i : string +>"bar" : string >d : any var t1: [C, base]; @@ -67,24 +69,29 @@ var e11 = t1[4]; // base >e11 : base >t1[4] : base >t1 : [C, base] +>4 : number var e21 = t2[4]; // {} >e21 : C | D >t2[4] : C | D >t2 : [C, D] +>4 : number var e31 = t3[4]; // C1 >e31 : C1 >t3[4] : C1 >t3 : [C1, D1] +>4 : number var e41 = t4[2]; // base1 >e41 : base1 >t4[2] : base1 >t4 : [base1, C1] +>2 : number var e51 = t5[2]; // {} >e51 : F | C1 >t5[2] : F | C1 >t5 : [C1, F] +>2 : number diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.symbols b/tests/baselines/reference/bestCommonTypeReturnStatement.symbols new file mode 100644 index 00000000000..43e04ef037d --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/bestCommonTypeReturnStatement.ts === +interface IPromise { +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) +>T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 0, 19)) + + then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; +>then : Symbol(then, Decl(bestCommonTypeReturnStatement.ts, 0, 23)) +>successCallback : Symbol(successCallback, Decl(bestCommonTypeReturnStatement.ts, 1, 9)) +>promiseValue : Symbol(promiseValue, Decl(bestCommonTypeReturnStatement.ts, 1, 27)) +>T : Symbol(T, Decl(bestCommonTypeReturnStatement.ts, 0, 19)) +>errorCallback : Symbol(errorCallback, Decl(bestCommonTypeReturnStatement.ts, 1, 51)) +>reason : Symbol(reason, Decl(bestCommonTypeReturnStatement.ts, 1, 69)) +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) +} + +function f() { +>f : Symbol(f, Decl(bestCommonTypeReturnStatement.ts, 2, 1)) + + if (true) return b(); +>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 7, 1)) + + return d(); +>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 10, 45)) +} + + +function b(): IPromise { return null; } +>b : Symbol(b, Decl(bestCommonTypeReturnStatement.ts, 7, 1)) +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) + +function d(): IPromise { return null; } +>d : Symbol(d, Decl(bestCommonTypeReturnStatement.ts, 10, 45)) +>IPromise : Symbol(IPromise, Decl(bestCommonTypeReturnStatement.ts, 0, 0)) + diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.types b/tests/baselines/reference/bestCommonTypeReturnStatement.types index 3c260ea709b..28974f064a5 100644 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.types +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.types @@ -17,6 +17,7 @@ function f() { >f : () => IPromise if (true) return b(); +>true : boolean >b() : IPromise >b : () => IPromise @@ -29,8 +30,10 @@ function f() { function b(): IPromise { return null; } >b : () => IPromise >IPromise : IPromise +>null : null function d(): IPromise { return null; } >d : () => IPromise >IPromise : IPromise +>null : null diff --git a/tests/baselines/reference/bestCommonTypeWithContextualTyping.symbols b/tests/baselines/reference/bestCommonTypeWithContextualTyping.symbols new file mode 100644 index 00000000000..cfa5310bd3c --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeWithContextualTyping.symbols @@ -0,0 +1,52 @@ +=== tests/cases/compiler/bestCommonTypeWithContextualTyping.ts === +interface Contextual { +>Contextual : Symbol(Contextual, Decl(bestCommonTypeWithContextualTyping.ts, 0, 0)) + + dummy; +>dummy : Symbol(dummy, Decl(bestCommonTypeWithContextualTyping.ts, 0, 22)) + + p?: number; +>p : Symbol(p, Decl(bestCommonTypeWithContextualTyping.ts, 1, 10)) +} + +interface Ellement { +>Ellement : Symbol(Ellement, Decl(bestCommonTypeWithContextualTyping.ts, 3, 1)) + + dummy; +>dummy : Symbol(dummy, Decl(bestCommonTypeWithContextualTyping.ts, 5, 20)) + + p: any; +>p : Symbol(p, Decl(bestCommonTypeWithContextualTyping.ts, 6, 10)) +} + +var e: Ellement; +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) +>Ellement : Symbol(Ellement, Decl(bestCommonTypeWithContextualTyping.ts, 3, 1)) + +// All of these should pass. Neither type is a supertype of the other, but the RHS should +// always use Ellement in these examples (not Contextual). Because Ellement is assignable +// to Contextual, no errors. +var arr: Contextual[] = [e]; // Ellement[] +>arr : Symbol(arr, Decl(bestCommonTypeWithContextualTyping.ts, 15, 3)) +>Contextual : Symbol(Contextual, Decl(bestCommonTypeWithContextualTyping.ts, 0, 0)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) + +var obj: { [s: string]: Contextual } = { s: e }; // { s: Ellement; [s: string]: Ellement } +>obj : Symbol(obj, Decl(bestCommonTypeWithContextualTyping.ts, 16, 3)) +>s : Symbol(s, Decl(bestCommonTypeWithContextualTyping.ts, 16, 12)) +>Contextual : Symbol(Contextual, Decl(bestCommonTypeWithContextualTyping.ts, 0, 0)) +>s : Symbol(s, Decl(bestCommonTypeWithContextualTyping.ts, 16, 40)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) + +var conditional: Contextual = null ? e : e; // Ellement +>conditional : Symbol(conditional, Decl(bestCommonTypeWithContextualTyping.ts, 18, 3)) +>Contextual : Symbol(Contextual, Decl(bestCommonTypeWithContextualTyping.ts, 0, 0)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) + +var contextualOr: Contextual = e || e; // Ellement +>contextualOr : Symbol(contextualOr, Decl(bestCommonTypeWithContextualTyping.ts, 19, 3)) +>Contextual : Symbol(Contextual, Decl(bestCommonTypeWithContextualTyping.ts, 0, 0)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) +>e : Symbol(e, Decl(bestCommonTypeWithContextualTyping.ts, 10, 3)) + diff --git a/tests/baselines/reference/bestCommonTypeWithContextualTyping.types b/tests/baselines/reference/bestCommonTypeWithContextualTyping.types index 606cbae9231..628fe82012a 100644 --- a/tests/baselines/reference/bestCommonTypeWithContextualTyping.types +++ b/tests/baselines/reference/bestCommonTypeWithContextualTyping.types @@ -44,6 +44,7 @@ var conditional: Contextual = null ? e : e; // Ellement >conditional : Contextual >Contextual : Contextual >null ? e : e : Ellement +>null : null >e : Ellement >e : Ellement diff --git a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.symbols b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.symbols new file mode 100644 index 00000000000..35e9534ddb5 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/bestCommonTypeWithOptionalProperties.ts === +interface X { foo: string } +>X : Symbol(X, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 0)) +>foo : Symbol(foo, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 13)) + +interface Y extends X { bar?: number } +>Y : Symbol(Y, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 27)) +>X : Symbol(X, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 0)) +>bar : Symbol(bar, Decl(bestCommonTypeWithOptionalProperties.ts, 1, 23)) + +interface Z extends X { bar: string } +>Z : Symbol(Z, Decl(bestCommonTypeWithOptionalProperties.ts, 1, 38)) +>X : Symbol(X, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 0)) +>bar : Symbol(bar, Decl(bestCommonTypeWithOptionalProperties.ts, 2, 23)) + +var x: X; +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) +>X : Symbol(X, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 0)) + +var y: Y; +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) +>Y : Symbol(Y, Decl(bestCommonTypeWithOptionalProperties.ts, 0, 27)) + +var z: Z; +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) +>Z : Symbol(Z, Decl(bestCommonTypeWithOptionalProperties.ts, 1, 38)) + +// All these arrays should be X[] +var b1 = [x, y, z]; +>b1 : Symbol(b1, Decl(bestCommonTypeWithOptionalProperties.ts, 9, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) + +var b2 = [x, z, y]; +>b2 : Symbol(b2, Decl(bestCommonTypeWithOptionalProperties.ts, 10, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) + +var b3 = [y, x, z]; +>b3 : Symbol(b3, Decl(bestCommonTypeWithOptionalProperties.ts, 11, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) + +var b4 = [y, z, x]; +>b4 : Symbol(b4, Decl(bestCommonTypeWithOptionalProperties.ts, 12, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) + +var b5 = [z, x, y]; +>b5 : Symbol(b5, Decl(bestCommonTypeWithOptionalProperties.ts, 13, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) + +var b6 = [z, y, x]; +>b6 : Symbol(b6, Decl(bestCommonTypeWithOptionalProperties.ts, 14, 3)) +>z : Symbol(z, Decl(bestCommonTypeWithOptionalProperties.ts, 6, 3)) +>y : Symbol(y, Decl(bestCommonTypeWithOptionalProperties.ts, 5, 3)) +>x : Symbol(x, Decl(bestCommonTypeWithOptionalProperties.ts, 4, 3)) + diff --git a/tests/baselines/reference/binaryArithmatic1.symbols b/tests/baselines/reference/binaryArithmatic1.symbols new file mode 100644 index 00000000000..380a2ce95c1 --- /dev/null +++ b/tests/baselines/reference/binaryArithmatic1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/binaryArithmatic1.ts === +var v = 4 | null; +>v : Symbol(v, Decl(binaryArithmatic1.ts, 0, 3)) + diff --git a/tests/baselines/reference/binaryArithmatic1.types b/tests/baselines/reference/binaryArithmatic1.types index 2aec9528116..43f4f26de60 100644 --- a/tests/baselines/reference/binaryArithmatic1.types +++ b/tests/baselines/reference/binaryArithmatic1.types @@ -2,4 +2,6 @@ var v = 4 | null; >v : number >4 | null : number +>4 : number +>null : null diff --git a/tests/baselines/reference/binaryArithmatic2.symbols b/tests/baselines/reference/binaryArithmatic2.symbols new file mode 100644 index 00000000000..7c2756f30f6 --- /dev/null +++ b/tests/baselines/reference/binaryArithmatic2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/binaryArithmatic2.ts === +var v = 4 | undefined; +>v : Symbol(v, Decl(binaryArithmatic2.ts, 0, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/binaryArithmatic2.types b/tests/baselines/reference/binaryArithmatic2.types index 9fe3350fc24..77cbce5b1e3 100644 --- a/tests/baselines/reference/binaryArithmatic2.types +++ b/tests/baselines/reference/binaryArithmatic2.types @@ -2,5 +2,6 @@ var v = 4 | undefined; >v : number >4 | undefined : number +>4 : number >undefined : undefined diff --git a/tests/baselines/reference/binaryIntegerLiteral.symbols b/tests/baselines/reference/binaryIntegerLiteral.symbols new file mode 100644 index 00000000000..31e28819657 --- /dev/null +++ b/tests/baselines/reference/binaryIntegerLiteral.symbols @@ -0,0 +1,117 @@ +=== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts === +var bin1 = 0b11010; +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteral.ts, 0, 3)) + +var bin2 = 0B11010; +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteral.ts, 1, 3)) + +var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; +>bin3 : Symbol(bin3, Decl(binaryIntegerLiteral.ts, 2, 3)) + +var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; +>bin4 : Symbol(bin4, Decl(binaryIntegerLiteral.ts, 3, 3)) + +var obj1 = { +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) + + 0b11010: "Hello", + a: bin1, +>a : Symbol(a, Decl(binaryIntegerLiteral.ts, 6, 21)) +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteral.ts, 0, 3)) + + bin1, +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteral.ts, 7, 12)) + + b: 0b11010, +>b : Symbol(b, Decl(binaryIntegerLiteral.ts, 8, 9)) + + 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) + + 0B11010: "World", + a: bin2, +>a : Symbol(a, Decl(binaryIntegerLiteral.ts, 14, 21)) +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteral.ts, 1, 3)) + + bin2, +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteral.ts, 15, 12)) + + b: 0B11010, +>b : Symbol(b, Decl(binaryIntegerLiteral.ts, 16, 9)) + + 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +} + +obj1[0b11010]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>0b11010 : Symbol(0b11010, Decl(binaryIntegerLiteral.ts, 5, 12)) + +obj1[26]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>26 : Symbol(0b11010, Decl(binaryIntegerLiteral.ts, 5, 12)) + +obj1["26"]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>"26" : Symbol(0b11010, Decl(binaryIntegerLiteral.ts, 5, 12)) + +obj1["0b11010"]; // any +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) + +obj1["a"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>"a" : Symbol(a, Decl(binaryIntegerLiteral.ts, 6, 21)) + +obj1["b"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>"b" : Symbol(b, Decl(binaryIntegerLiteral.ts, 8, 9)) + +obj1["bin1"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>"bin1" : Symbol(bin1, Decl(binaryIntegerLiteral.ts, 7, 12)) + +obj1["Infinity"]; // boolean +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) +>"Infinity" : Symbol(0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteral.ts, 9, 15)) + +obj2[0B11010]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>0B11010 : Symbol(0B11010, Decl(binaryIntegerLiteral.ts, 13, 12)) + +obj2[26]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>26 : Symbol(0B11010, Decl(binaryIntegerLiteral.ts, 13, 12)) + +obj2["26"]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>"26" : Symbol(0B11010, Decl(binaryIntegerLiteral.ts, 13, 12)) + +obj2["0B11010"]; // any +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) + +obj2["a"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>"a" : Symbol(a, Decl(binaryIntegerLiteral.ts, 14, 21)) + +obj2["b"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>"b" : Symbol(b, Decl(binaryIntegerLiteral.ts, 16, 9)) + +obj2["bin2"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>"bin2" : Symbol(bin2, Decl(binaryIntegerLiteral.ts, 15, 12)) + +obj2[9.671406556917009e+24]; // boolean +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>9.671406556917009e+24 : Symbol(0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteral.ts, 17, 15)) + +obj2["9.671406556917009e+24"]; // boolean +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) +>"9.671406556917009e+24" : Symbol(0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteral.ts, 17, 15)) + +obj2["Infinity"]; // any +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) + + diff --git a/tests/baselines/reference/binaryIntegerLiteral.types b/tests/baselines/reference/binaryIntegerLiteral.types index f884ecc3a73..4ff3c3c28a3 100644 --- a/tests/baselines/reference/binaryIntegerLiteral.types +++ b/tests/baselines/reference/binaryIntegerLiteral.types @@ -1,21 +1,27 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts === var bin1 = 0b11010; >bin1 : number +>0b11010 : number var bin2 = 0B11010; >bin2 : number +>0B11010 : number var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin3 : number +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin4 : number +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number var obj1 = { >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } >{ 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,} : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0b11010: "Hello", +>"Hello" : string + a: bin1, >a : number >bin1 : number @@ -25,8 +31,10 @@ var obj1 = { b: 0b11010, >b : number +>0b11010 : number 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +>true : boolean } var obj2 = { @@ -34,6 +42,8 @@ var obj2 = { >{ 0B11010: "World", a: bin2, bin2, b: 0B11010, 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,} : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0B11010: "World", +>"World" : string + a: bin2, >a : number >bin2 : number @@ -43,80 +53,100 @@ var obj2 = { b: 0B11010, >b : number +>0B11010 : number 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +>false : boolean } obj1[0b11010]; // string >obj1[0b11010] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>0b11010 : number obj1[26]; // string >obj1[26] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>26 : number obj1["26"]; // string >obj1["26"] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"26" : string obj1["0b11010"]; // any >obj1["0b11010"] : any >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"0b11010" : string obj1["a"]; // number >obj1["a"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"a" : string obj1["b"]; // number >obj1["b"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"b" : string obj1["bin1"]; // number >obj1["bin1"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"bin1" : string obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"Infinity" : string obj2[0B11010]; // string >obj2[0B11010] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>0B11010 : number obj2[26]; // string >obj2[26] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>26 : number obj2["26"]; // string >obj2["26"] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"26" : string obj2["0B11010"]; // any >obj2["0B11010"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"0B11010" : string obj2["a"]; // number >obj2["a"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"a" : string obj2["b"]; // number >obj2["b"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"b" : string obj2["bin2"]; // number >obj2["bin2"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"bin2" : string obj2[9.671406556917009e+24]; // boolean >obj2[9.671406556917009e+24] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>9.671406556917009e+24 : number obj2["9.671406556917009e+24"]; // boolean >obj2["9.671406556917009e+24"] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"9.671406556917009e+24" : string obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"Infinity" : string diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.symbols b/tests/baselines/reference/binaryIntegerLiteralES6.symbols new file mode 100644 index 00000000000..4fb7aaff82d --- /dev/null +++ b/tests/baselines/reference/binaryIntegerLiteralES6.symbols @@ -0,0 +1,118 @@ +=== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralES6.ts === +var bin1 = 0b11010; +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteralES6.ts, 0, 3)) + +var bin2 = 0B11010; +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteralES6.ts, 1, 3)) + +var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; +>bin3 : Symbol(bin3, Decl(binaryIntegerLiteralES6.ts, 2, 3)) + +var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; +>bin4 : Symbol(bin4, Decl(binaryIntegerLiteralES6.ts, 3, 3)) + +var obj1 = { +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) + + 0b11010: "Hello", + a: bin1, +>a : Symbol(a, Decl(binaryIntegerLiteralES6.ts, 6, 21)) +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteralES6.ts, 0, 3)) + + bin1, +>bin1 : Symbol(bin1, Decl(binaryIntegerLiteralES6.ts, 7, 12)) + + b: 0b11010, +>b : Symbol(b, Decl(binaryIntegerLiteralES6.ts, 8, 9)) + + 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) + + 0B11010: "World", + a: bin2, +>a : Symbol(a, Decl(binaryIntegerLiteralES6.ts, 14, 21)) +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteralES6.ts, 1, 3)) + + bin2, +>bin2 : Symbol(bin2, Decl(binaryIntegerLiteralES6.ts, 15, 12)) + + b: 0B11010, +>b : Symbol(b, Decl(binaryIntegerLiteralES6.ts, 16, 9)) + + 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +} + +obj1[0b11010]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>0b11010 : Symbol(0b11010, Decl(binaryIntegerLiteralES6.ts, 5, 12)) + +obj1[26]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>26 : Symbol(0b11010, Decl(binaryIntegerLiteralES6.ts, 5, 12)) + +obj1["26"]; // string +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>"26" : Symbol(0b11010, Decl(binaryIntegerLiteralES6.ts, 5, 12)) + +obj1["0b11010"]; // any +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) + +obj1["a"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>"a" : Symbol(a, Decl(binaryIntegerLiteralES6.ts, 6, 21)) + +obj1["b"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>"b" : Symbol(b, Decl(binaryIntegerLiteralES6.ts, 8, 9)) + +obj1["bin1"]; // number +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>"bin1" : Symbol(bin1, Decl(binaryIntegerLiteralES6.ts, 7, 12)) + +obj1["Infinity"]; // boolean +>obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) +>"Infinity" : Symbol(0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteralES6.ts, 9, 15)) + +obj2[0B11010]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>0B11010 : Symbol(0B11010, Decl(binaryIntegerLiteralES6.ts, 13, 12)) + +obj2[26]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>26 : Symbol(0B11010, Decl(binaryIntegerLiteralES6.ts, 13, 12)) + +obj2["26"]; // string +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>"26" : Symbol(0B11010, Decl(binaryIntegerLiteralES6.ts, 13, 12)) + +obj2["0B11010"]; // any +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) + +obj2["a"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>"a" : Symbol(a, Decl(binaryIntegerLiteralES6.ts, 14, 21)) + +obj2["b"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>"b" : Symbol(b, Decl(binaryIntegerLiteralES6.ts, 16, 9)) + +obj2["bin2"]; // number +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>"bin2" : Symbol(bin2, Decl(binaryIntegerLiteralES6.ts, 15, 12)) + +obj2[9.671406556917009e+24]; // boolean +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>9.671406556917009e+24 : Symbol(0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteralES6.ts, 17, 15)) + +obj2["9.671406556917009e+24"]; // boolean +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) +>"9.671406556917009e+24" : Symbol(0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteralES6.ts, 17, 15)) + +obj2["Infinity"]; // any +>obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) + + + diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.types b/tests/baselines/reference/binaryIntegerLiteralES6.types index 86036ecc42f..47bfe6f548d 100644 --- a/tests/baselines/reference/binaryIntegerLiteralES6.types +++ b/tests/baselines/reference/binaryIntegerLiteralES6.types @@ -1,21 +1,27 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralES6.ts === var bin1 = 0b11010; >bin1 : number +>0b11010 : number var bin2 = 0B11010; >bin2 : number +>0B11010 : number var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin3 : number +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; >bin4 : number +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : number var obj1 = { >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } >{ 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,} : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0b11010: "Hello", +>"Hello" : string + a: bin1, >a : number >bin1 : number @@ -25,8 +31,10 @@ var obj1 = { b: 0b11010, >b : number +>0b11010 : number 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +>true : boolean } var obj2 = { @@ -34,6 +42,8 @@ var obj2 = { >{ 0B11010: "World", a: bin2, bin2, b: 0B11010, 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,} : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0B11010: "World", +>"World" : string + a: bin2, >a : number >bin2 : number @@ -43,81 +53,101 @@ var obj2 = { b: 0B11010, >b : number +>0B11010 : number 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +>false : boolean } obj1[0b11010]; // string >obj1[0b11010] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>0b11010 : number obj1[26]; // string >obj1[26] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>26 : number obj1["26"]; // string >obj1["26"] : string >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"26" : string obj1["0b11010"]; // any >obj1["0b11010"] : any >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"0b11010" : string obj1["a"]; // number >obj1["a"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"a" : string obj1["b"]; // number >obj1["b"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"b" : string obj1["bin1"]; // number >obj1["bin1"] : number >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"bin1" : string obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"Infinity" : string obj2[0B11010]; // string >obj2[0B11010] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>0B11010 : number obj2[26]; // string >obj2[26] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>26 : number obj2["26"]; // string >obj2["26"] : string >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"26" : string obj2["0B11010"]; // any >obj2["0B11010"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"0B11010" : string obj2["a"]; // number >obj2["a"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"a" : string obj2["b"]; // number >obj2["b"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"b" : string obj2["bin2"]; // number >obj2["bin2"] : number >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"bin2" : string obj2[9.671406556917009e+24]; // boolean >obj2[9.671406556917009e+24] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>9.671406556917009e+24 : number obj2["9.671406556917009e+24"]; // boolean >obj2["9.671406556917009e+24"] : boolean >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"9.671406556917009e+24" : string obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } +>"Infinity" : string diff --git a/tests/baselines/reference/bind2.symbols b/tests/baselines/reference/bind2.symbols new file mode 100644 index 00000000000..f51d09abcdd --- /dev/null +++ b/tests/baselines/reference/bind2.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/bind2.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.symbols b/tests/baselines/reference/binopAssignmentShouldHaveType.symbols new file mode 100644 index 00000000000..d984647149e --- /dev/null +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/binopAssignmentShouldHaveType.ts === +declare var console; +>console : Symbol(console, Decl(binopAssignmentShouldHaveType.ts, 0, 11)) + +"use strict"; +module Test { +>Test : Symbol(Test, Decl(binopAssignmentShouldHaveType.ts, 1, 13)) + + export class Bug { +>Bug : Symbol(Bug, Decl(binopAssignmentShouldHaveType.ts, 2, 13)) + + getName():string { +>getName : Symbol(getName, Decl(binopAssignmentShouldHaveType.ts, 3, 19)) + + return "name"; + } + bug() { +>bug : Symbol(bug, Decl(binopAssignmentShouldHaveType.ts, 6, 3)) + + var name:string= null; +>name : Symbol(name, Decl(binopAssignmentShouldHaveType.ts, 8, 6)) + + if ((name= this.getName()).length > 0) { +>(name= this.getName()).length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>name : Symbol(name, Decl(binopAssignmentShouldHaveType.ts, 8, 6)) +>this.getName : Symbol(getName, Decl(binopAssignmentShouldHaveType.ts, 3, 19)) +>this : Symbol(Bug, Decl(binopAssignmentShouldHaveType.ts, 2, 13)) +>getName : Symbol(getName, Decl(binopAssignmentShouldHaveType.ts, 3, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + console.log(name); +>console : Symbol(console, Decl(binopAssignmentShouldHaveType.ts, 0, 11)) +>name : Symbol(name, Decl(binopAssignmentShouldHaveType.ts, 8, 6)) + } + } + } +} + + + + diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.types b/tests/baselines/reference/binopAssignmentShouldHaveType.types index cf6966147bc..fdef2fbcabd 100644 --- a/tests/baselines/reference/binopAssignmentShouldHaveType.types +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.types @@ -3,6 +3,8 @@ declare var console; >console : any "use strict"; +>"use strict" : string + module Test { >Test : typeof Test @@ -13,12 +15,14 @@ module Test { >getName : () => string return "name"; +>"name" : string } bug() { >bug : () => void var name:string= null; >name : string +>null : null if ((name= this.getName()).length > 0) { >(name= this.getName()).length > 0 : boolean @@ -31,6 +35,7 @@ module Test { >this : Bug >getName : () => string >length : number +>0 : number console.log(name); >console.log(name) : any diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols new file mode 100644 index 00000000000..d6a29a11980 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols @@ -0,0 +1,89 @@ +=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts === +// ~ operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) + +function foo(): boolean { return true; } +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21)) + +class A { +>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40)) + + public a: boolean; +>a : Symbol(a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) + + static foo() { return false; } +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22)) +} +module M { +>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1)) + + export var n: boolean; +>n : Symbol(n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40)) + +// boolean type var +var ResultIsNumber1 = ~BOOLEAN; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithBooleanType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) + +// boolean type literal +var ResultIsNumber2 = ~true; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithBooleanType.ts, 19, 3)) + +var ResultIsNumber3 = ~{ x: true, y: false }; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 33)) + +// boolean type expressions +var ResultIsNumber4 = ~objA.a; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithBooleanType.ts, 23, 3)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) + +var ResultIsNumber5 = ~M.n; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithBooleanType.ts, 24, 3)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) + +var ResultIsNumber6 = ~foo(); +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithBooleanType.ts, 25, 3)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21)) + +var ResultIsNumber7 = ~A.foo(); +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithBooleanType.ts, 26, 3)) +>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22)) + +// multiple ~ operators +var ResultIsNumber8 = ~~BOOLEAN; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithBooleanType.ts, 29, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) + +// miss assignment operators +~true; +~BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3)) + +~foo(); +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21)) + +~true, false; +~objA.a; +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9)) + +~M.n; +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14)) + diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types index ce870dbc818..234c01e2241 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types @@ -5,6 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean +>true : boolean class A { >A : A @@ -14,6 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean +>false : boolean } module M { >M : typeof M @@ -37,13 +39,16 @@ var ResultIsNumber1 = ~BOOLEAN; var ResultIsNumber2 = ~true; >ResultIsNumber2 : number >~true : number +>true : boolean var ResultIsNumber3 = ~{ x: true, y: false }; >ResultIsNumber3 : number >~{ x: true, y: false } : number >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean +>true : boolean >y : boolean +>false : boolean // boolean type expressions var ResultIsNumber4 = ~objA.a; @@ -84,6 +89,7 @@ var ResultIsNumber8 = ~~BOOLEAN; // miss assignment operators ~true; >~true : number +>true : boolean ~BOOLEAN; >~BOOLEAN : number @@ -97,6 +103,8 @@ var ResultIsNumber8 = ~~BOOLEAN; ~true, false; >~true, false : boolean >~true : number +>true : boolean +>false : boolean ~objA.a; >~objA.a : number diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols new file mode 100644 index 00000000000..24783a153ae --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols @@ -0,0 +1,51 @@ +=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts === +// ~ operator on enum type + +enum ENUM1 { A, B, "" }; +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) + +// enum type var +var ResultIsNumber1 = ~ENUM1; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithEnumType.ts, 5, 3)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) + +// enum type expressions +var ResultIsNumber2 = ~ENUM1["A"]; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithEnumType.ts, 8, 3)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) + +var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithEnumType.ts, 9, 3)) +>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) + +// multiple ~ operators +var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithEnumType.ts, 12, 3)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1.B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) + +// miss assignment operators +~ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) + +~ENUM1["A"]; +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) + +~ENUM1.A, ~ENUM1["B"]; +>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) +>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) +>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) + diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types index 71598c6f693..bb8be9b3f54 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types @@ -18,6 +18,7 @@ var ResultIsNumber2 = ~ENUM1["A"]; >~ENUM1["A"] : number >ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 +>"A" : string var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); >ResultIsNumber3 : number @@ -29,6 +30,7 @@ var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]); >A : ENUM1 >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string // multiple ~ operators var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); @@ -40,6 +42,7 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); >ENUM1["A"] + ENUM1.B : number >ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 +>"A" : string >ENUM1.B : ENUM1 >ENUM1 : typeof ENUM1 >B : ENUM1 @@ -53,6 +56,7 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); >~ENUM1["A"] : number >ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 +>"A" : string ~ENUM1.A, ~ENUM1["B"]; >~ENUM1.A, ~ENUM1["B"] : number @@ -63,4 +67,5 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); >~ENUM1["B"] : number >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols new file mode 100644 index 00000000000..2cb37660135 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols @@ -0,0 +1,126 @@ +=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts === +// ~ operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) + +function foo(): number { return 1; } +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31)) + +class A { +>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36)) + + public a: number; +>a : Symbol(a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) + + static foo() { return 1; } +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) + + export var n: number; +>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36)) + +// number type var +var ResultIsNumber1 = ~NUMBER; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithNumberType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +var ResultIsNumber2 = ~NUMBER1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithNumberType.ts, 18, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) + +// number type literal +var ResultIsNumber3 = ~1; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithNumberType.ts, 21, 3)) + +var ResultIsNumber4 = ~{ x: 1, y: 2}; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 30)) + +var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 30)) +>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 35)) +>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 35)) + +// number type expressions +var ResultIsNumber6 = ~objA.a; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithNumberType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) + +var ResultIsNumber7 = ~M.n; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithNumberType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) + +var ResultIsNumber8 = ~NUMBER1[0]; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithNumberType.ts, 28, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) + +var ResultIsNumber9 = ~foo(); +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithNumberType.ts, 29, 3)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31)) + +var ResultIsNumber10 = ~A.foo(); +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithNumberType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21)) + +var ResultIsNumber11 = ~(NUMBER + NUMBER); +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithNumberType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +// multiple ~ operators +var ResultIsNumber12 = ~~NUMBER; +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithNumberType.ts, 34, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +var ResultIsNumber13 = ~~~(NUMBER + NUMBER); +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithNumberType.ts, 35, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +// miss assignment operators +~NUMBER; +>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3)) + +~NUMBER1; +>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3)) + +~foo(); +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31)) + +~objA.a; +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) + +~M.n; +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) + +~objA.a, M.n; +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14)) + diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types index 94207a56343..228bd43e593 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types @@ -6,9 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number function foo(): number { return 1; } >foo : () => number +>1 : number class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return 1; } >foo : () => number +>1 : number } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsNumber2 = ~NUMBER1; var ResultIsNumber3 = ~1; >ResultIsNumber3 : number >~1 : number +>1 : number var ResultIsNumber4 = ~{ x: 1, y: 2}; >ResultIsNumber4 : number >~{ x: 1, y: 2} : number >{ x: 1, y: 2} : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; >ResultIsNumber5 : number >~{ x: 1, y: (n: number) => { return n; } } : number >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number +>1 : number >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -84,6 +92,7 @@ var ResultIsNumber8 = ~NUMBER1[0]; >~NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number var ResultIsNumber9 = ~foo(); >ResultIsNumber9 : number diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols new file mode 100644 index 00000000000..1e2d28f51c2 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols @@ -0,0 +1,122 @@ +=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts === +// ~ operator on string type +var STRING: string; +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +var STRING1: string[] = ["", "abc"]; +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) + +function foo(): string { return "abc"; } +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36)) + +class A { +>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40)) + + public a: string; +>a : Symbol(a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) + + static foo() { return ""; } +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1)) + + export var n: string; +>n : Symbol(n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40)) + +// string type var +var ResultIsNumber1 = ~STRING; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithStringType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsNumber2 = ~STRING1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithStringType.ts, 18, 3)) +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) + +// string type literal +var ResultIsNumber3 = ~""; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithStringType.ts, 21, 3)) + +var ResultIsNumber4 = ~{ x: "", y: "" }; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithStringType.ts, 22, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 22, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 22, 31)) + +var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithStringType.ts, 23, 3)) +>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 23, 24)) +>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 23, 31)) +>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36)) +>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36)) + +// string type expressions +var ResultIsNumber6 = ~objA.a; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithStringType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) + +var ResultIsNumber7 = ~M.n; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithStringType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) + +var ResultIsNumber8 = ~STRING1[0]; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithStringType.ts, 28, 3)) +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) + +var ResultIsNumber9 = ~foo(); +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithStringType.ts, 29, 3)) +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36)) + +var ResultIsNumber10 = ~A.foo(); +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithStringType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21)) +>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21)) + +var ResultIsNumber11 = ~(STRING + STRING); +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithStringType.ts, 31, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsNumber12 = ~STRING.charAt(0); +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithStringType.ts, 32, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +// multiple ~ operators +var ResultIsNumber13 = ~~STRING; +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithStringType.ts, 35, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsNumber14 = ~~~(STRING + STRING); +>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(bitwiseNotOperatorWithStringType.ts, 36, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +//miss assignment operators +~STRING; +>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3)) + +~STRING1; +>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3)) + +~foo(); +>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36)) + +~objA.a,M.n; +>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14)) + diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types index dbe2f29631e..4f1ca481a1f 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types @@ -6,9 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] +>"" : string +>"abc" : string function foo(): string { return "abc"; } >foo : () => string +>"abc" : string class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return ""; } >foo : () => string +>"" : string } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsNumber2 = ~STRING1; var ResultIsNumber3 = ~""; >ResultIsNumber3 : number >~"" : number +>"" : string var ResultIsNumber4 = ~{ x: "", y: "" }; >ResultIsNumber4 : number >~{ x: "", y: "" } : number >{ x: "", y: "" } : { x: string; y: string; } >x : string +>"" : string >y : string +>"" : string var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; >ResultIsNumber5 : number >~{ x: "", y: (s: string) => { return s; } } : number >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string +>"" : string >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -84,6 +92,7 @@ var ResultIsNumber8 = ~STRING1[0]; >~STRING1[0] : number >STRING1[0] : string >STRING1 : string[] +>0 : number var ResultIsNumber9 = ~foo(); >ResultIsNumber9 : number @@ -114,6 +123,7 @@ var ResultIsNumber12 = ~STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number // multiple ~ operators var ResultIsNumber13 = ~~STRING; diff --git a/tests/baselines/reference/bom-utf16be.symbols b/tests/baselines/reference/bom-utf16be.symbols new file mode 100644 index 00000000000..e2a1f4c4c76 --- /dev/null +++ b/tests/baselines/reference/bom-utf16be.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/bom-utf16be.ts === +var x=10; +>x : Symbol(x, Decl(bom-utf16be.ts, 0, 3)) + diff --git a/tests/baselines/reference/bom-utf16be.types b/tests/baselines/reference/bom-utf16be.types index 04c6a5a61bb..1787d102245 100644 --- a/tests/baselines/reference/bom-utf16be.types +++ b/tests/baselines/reference/bom-utf16be.types @@ -1,4 +1,5 @@ === tests/cases/compiler/bom-utf16be.ts === var x=10; >x : number +>10 : number diff --git a/tests/baselines/reference/bom-utf16le.symbols b/tests/baselines/reference/bom-utf16le.symbols new file mode 100644 index 00000000000..396e7ec0d5c --- /dev/null +++ b/tests/baselines/reference/bom-utf16le.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/bom-utf16le.ts === +var x=10; +>x : Symbol(x, Decl(bom-utf16le.ts, 0, 3)) + diff --git a/tests/baselines/reference/bom-utf16le.types b/tests/baselines/reference/bom-utf16le.types index 15970945942..865c94eb82d 100644 --- a/tests/baselines/reference/bom-utf16le.types +++ b/tests/baselines/reference/bom-utf16le.types @@ -1,4 +1,5 @@ === tests/cases/compiler/bom-utf16le.ts === var x=10; >x : number +>10 : number diff --git a/tests/baselines/reference/bom-utf8.symbols b/tests/baselines/reference/bom-utf8.symbols new file mode 100644 index 00000000000..e13277c8953 --- /dev/null +++ b/tests/baselines/reference/bom-utf8.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/bom-utf8.ts === +var x=10; +>x : Symbol(x, Decl(bom-utf8.ts, 0, 3)) + diff --git a/tests/baselines/reference/bom-utf8.types b/tests/baselines/reference/bom-utf8.types index b8398f7b6b6..d96d0132383 100644 --- a/tests/baselines/reference/bom-utf8.types +++ b/tests/baselines/reference/bom-utf8.types @@ -1,4 +1,5 @@ === tests/cases/compiler/bom-utf8.ts === var x=10; >x : number +>10 : number diff --git a/tests/baselines/reference/booleanPropertyAccess.symbols b/tests/baselines/reference/booleanPropertyAccess.symbols new file mode 100644 index 00000000000..c552f268d01 --- /dev/null +++ b/tests/baselines/reference/booleanPropertyAccess.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/types/primitives/boolean/booleanPropertyAccess.ts === +var x = true; +>x : Symbol(x, Decl(booleanPropertyAccess.ts, 0, 3)) + +var a = x.toString(); +>a : Symbol(a, Decl(booleanPropertyAccess.ts, 2, 3)) +>x.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>x : Symbol(x, Decl(booleanPropertyAccess.ts, 0, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var b = x['toString'](); +>b : Symbol(b, Decl(booleanPropertyAccess.ts, 3, 3)) +>x : Symbol(x, Decl(booleanPropertyAccess.ts, 0, 3)) +>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + diff --git a/tests/baselines/reference/booleanPropertyAccess.types b/tests/baselines/reference/booleanPropertyAccess.types index d273e3b8852..2795b36cee5 100644 --- a/tests/baselines/reference/booleanPropertyAccess.types +++ b/tests/baselines/reference/booleanPropertyAccess.types @@ -1,6 +1,7 @@ === tests/cases/conformance/types/primitives/boolean/booleanPropertyAccess.ts === var x = true; >x : boolean +>true : boolean var a = x.toString(); >a : string @@ -14,4 +15,5 @@ var b = x['toString'](); >x['toString']() : string >x['toString'] : () => string >x : boolean +>'toString' : string diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement1.symbols b/tests/baselines/reference/breakInIterationOrSwitchStatement1.symbols new file mode 100644 index 00000000000..6a2bae2c2c4 --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/breakInIterationOrSwitchStatement1.ts === +while (true) { +No type information for this code. break; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement1.types b/tests/baselines/reference/breakInIterationOrSwitchStatement1.types index 6a2bae2c2c4..545a20ecc55 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement1.types +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement1.types @@ -1,5 +1,6 @@ === tests/cases/compiler/breakInIterationOrSwitchStatement1.ts === while (true) { -No type information for this code. break; -No type information for this code.} -No type information for this code. \ No newline at end of file +>true : boolean + + break; +} diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement2.symbols b/tests/baselines/reference/breakInIterationOrSwitchStatement2.symbols new file mode 100644 index 00000000000..0f8928a664d --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/breakInIterationOrSwitchStatement2.ts === +do { +No type information for this code. break; +No type information for this code.} +No type information for this code.while (true); +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement2.types b/tests/baselines/reference/breakInIterationOrSwitchStatement2.types index 0f8928a664d..5736be6c923 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement2.types +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement2.types @@ -1,6 +1,7 @@ === tests/cases/compiler/breakInIterationOrSwitchStatement2.ts === do { -No type information for this code. break; -No type information for this code.} -No type information for this code.while (true); -No type information for this code. \ No newline at end of file + break; +} +while (true); +>true : boolean + diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement3.symbols b/tests/baselines/reference/breakInIterationOrSwitchStatement3.symbols new file mode 100644 index 00000000000..5676b2deccd --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement3.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/breakInIterationOrSwitchStatement3.ts === +for (;;) { +No type information for this code. break; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget1.symbols b/tests/baselines/reference/breakTarget1.symbols new file mode 100644 index 00000000000..eda3b1cac35 --- /dev/null +++ b/tests/baselines/reference/breakTarget1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/breakTarget1.ts === +target: +No type information for this code. break target; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget1.types b/tests/baselines/reference/breakTarget1.types index eda3b1cac35..85efb331e10 100644 --- a/tests/baselines/reference/breakTarget1.types +++ b/tests/baselines/reference/breakTarget1.types @@ -1,4 +1,7 @@ === tests/cases/compiler/breakTarget1.ts === target: -No type information for this code. break target; -No type information for this code. \ No newline at end of file +>target : any + + break target; +>target : any + diff --git a/tests/baselines/reference/breakTarget2.symbols b/tests/baselines/reference/breakTarget2.symbols new file mode 100644 index 00000000000..6357695785b --- /dev/null +++ b/tests/baselines/reference/breakTarget2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/breakTarget2.ts === +target: +No type information for this code.while (true) { +No type information for this code. break target; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget2.types b/tests/baselines/reference/breakTarget2.types index 6357695785b..412203accd1 100644 --- a/tests/baselines/reference/breakTarget2.types +++ b/tests/baselines/reference/breakTarget2.types @@ -1,6 +1,10 @@ === tests/cases/compiler/breakTarget2.ts === target: -No type information for this code.while (true) { -No type information for this code. break target; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target : any + +while (true) { +>true : boolean + + break target; +>target : any +} diff --git a/tests/baselines/reference/breakTarget3.symbols b/tests/baselines/reference/breakTarget3.symbols new file mode 100644 index 00000000000..580706bbd4a --- /dev/null +++ b/tests/baselines/reference/breakTarget3.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/breakTarget3.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget3.types b/tests/baselines/reference/breakTarget3.types index 580706bbd4a..785bf00ef6e 100644 --- a/tests/baselines/reference/breakTarget3.types +++ b/tests/baselines/reference/breakTarget3.types @@ -1,7 +1,13 @@ === tests/cases/compiler/breakTarget3.ts === target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. break target1; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + break target1; +>target1 : any +} diff --git a/tests/baselines/reference/breakTarget4.symbols b/tests/baselines/reference/breakTarget4.symbols new file mode 100644 index 00000000000..aba35ddcfdf --- /dev/null +++ b/tests/baselines/reference/breakTarget4.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/breakTarget4.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget4.types b/tests/baselines/reference/breakTarget4.types index aba35ddcfdf..eb4c14f6386 100644 --- a/tests/baselines/reference/breakTarget4.types +++ b/tests/baselines/reference/breakTarget4.types @@ -1,7 +1,13 @@ === tests/cases/compiler/breakTarget4.ts === target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. break target2; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + break target2; +>target2 : any +} diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols new file mode 100644 index 00000000000..f1e724f38db --- /dev/null +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts === +interface I { +>I : Symbol(I, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 12)) + + (u: U): U; +>U : Symbol(U, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 5)) +>T : Symbol(T, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 12)) +>u : Symbol(u, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 18)) +>U : Symbol(U, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 5)) +>U : Symbol(U, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 5)) +} +var i: I; +>i : Symbol(i, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 3, 3)) +>I : Symbol(I, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) + +var y = i(""); // y should be string +>y : Symbol(y, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 3)) +>i : Symbol(i, Decl(callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 3, 3)) + diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types index 6349114bffe..fe7d3a6ad08 100644 --- a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types @@ -18,4 +18,5 @@ var y = i(""); // y should be string >y : string >i("") : string >i : I +>"" : string diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.symbols b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.symbols new file mode 100644 index 00000000000..107650c530e --- /dev/null +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/callGenericFunctionWithZeroTypeArguments.ts === +// valid invocations of generic functions with no explicit type arguments provided + +function f(x: T): T { return null; } +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 0, 0)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 2, 11)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 2, 14)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 2, 11)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 2, 11)) + +var r = f(1); +>r : Symbol(r, Decl(callGenericFunctionWithZeroTypeArguments.ts, 3, 3)) +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 0, 0)) + +var f2 = (x: T): T => { return null; } +>f2 : Symbol(f2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 3)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 10)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 13)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 10)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 10)) + +var r2 = f2(1); +>r2 : Symbol(r2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 6, 3)) +>f2 : Symbol(f2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 5, 3)) + +var f3: { (x: T): T; } +>f3 : Symbol(f3, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 3)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 11)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 14)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 11)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 11)) + +var r3 = f3(1); +>r3 : Symbol(r3, Decl(callGenericFunctionWithZeroTypeArguments.ts, 9, 3)) +>f3 : Symbol(f3, Decl(callGenericFunctionWithZeroTypeArguments.ts, 8, 3)) + +class C { +>C : Symbol(C, Decl(callGenericFunctionWithZeroTypeArguments.ts, 9, 15)) + + f(x: T): T { +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 11, 9)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 12, 6)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 12, 9)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 12, 6)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 12, 6)) + + return null; + } +} +var r4 = (new C()).f(1); +>r4 : Symbol(r4, Decl(callGenericFunctionWithZeroTypeArguments.ts, 16, 3)) +>(new C()).f : Symbol(C.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 11, 9)) +>C : Symbol(C, Decl(callGenericFunctionWithZeroTypeArguments.ts, 9, 15)) +>f : Symbol(C.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 11, 9)) + +interface I { +>I : Symbol(I, Decl(callGenericFunctionWithZeroTypeArguments.ts, 16, 24)) + + f(x: T): T; +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 18, 13)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 19, 6)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 19, 9)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 19, 6)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 19, 6)) +} +var i: I; +>i : Symbol(i, Decl(callGenericFunctionWithZeroTypeArguments.ts, 21, 3)) +>I : Symbol(I, Decl(callGenericFunctionWithZeroTypeArguments.ts, 16, 24)) + +var r5 = i.f(1); +>r5 : Symbol(r5, Decl(callGenericFunctionWithZeroTypeArguments.ts, 22, 3)) +>i.f : Symbol(I.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 18, 13)) +>i : Symbol(i, Decl(callGenericFunctionWithZeroTypeArguments.ts, 21, 3)) +>f : Symbol(I.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 18, 13)) + +class C2 { +>C2 : Symbol(C2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 22, 16)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 9)) + + f(x: T): T { +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 13)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 25, 6)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 9)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 9)) + + return null; + } +} +var r6 = (new C2()).f(1); +>r6 : Symbol(r6, Decl(callGenericFunctionWithZeroTypeArguments.ts, 29, 3)) +>(new C2()).f : Symbol(C2.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 13)) +>C2 : Symbol(C2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 22, 16)) +>f : Symbol(C2.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 24, 13)) + +interface I2 { +>I2 : Symbol(I2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 29, 25)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 13)) + + f(x: T): T; +>f : Symbol(f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 17)) +>x : Symbol(x, Decl(callGenericFunctionWithZeroTypeArguments.ts, 32, 6)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 13)) +>T : Symbol(T, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 13)) +} +var i2: I2; +>i2 : Symbol(i2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 34, 3)) +>I2 : Symbol(I2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 29, 25)) + +var r7 = i2.f(1); +>r7 : Symbol(r7, Decl(callGenericFunctionWithZeroTypeArguments.ts, 35, 3)) +>i2.f : Symbol(I2.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 17)) +>i2 : Symbol(i2, Decl(callGenericFunctionWithZeroTypeArguments.ts, 34, 3)) +>f : Symbol(I2.f, Decl(callGenericFunctionWithZeroTypeArguments.ts, 31, 17)) + diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types index 34de901e3c0..e3bcb35805f 100644 --- a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types @@ -7,11 +7,13 @@ function f(x: T): T { return null; } >x : T >T : T >T : T +>null : null var r = f(1); >r : number >f(1) : number >f : (x: T) => T +>1 : number var f2 = (x: T): T => { return null; } >f2 : (x: T) => T @@ -20,11 +22,13 @@ var f2 = (x: T): T => { return null; } >x : T >T : T >T : T +>null : null var r2 = f2(1); >r2 : number >f2(1) : number >f2 : (x: T) => T +>1 : number var f3: { (x: T): T; } >f3 : (x: T) => T @@ -37,6 +41,7 @@ var r3 = f3(1); >r3 : number >f3(1) : number >f3 : (x: T) => T +>1 : number class C { >C : C @@ -49,6 +54,7 @@ class C { >T : T return null; +>null : null } } var r4 = (new C()).f(1); @@ -59,6 +65,7 @@ var r4 = (new C()).f(1); >new C() : C >C : typeof C >f : (x: T) => T +>1 : number interface I { >I : I @@ -80,6 +87,7 @@ var r5 = i.f(1); >i.f : (x: T) => T >i : I >f : (x: T) => T +>1 : number class C2 { >C2 : C2 @@ -92,6 +100,7 @@ class C2 { >T : T return null; +>null : null } } var r6 = (new C2()).f(1); @@ -102,6 +111,7 @@ var r6 = (new C2()).f(1); >new C2() : C2<{}> >C2 : typeof C2 >f : (x: {}) => {} +>1 : number interface I2 { >I2 : I2 @@ -123,4 +133,5 @@ var r7 = i2.f(1); >i2.f : (x: number) => number >i2 : I2 >f : (x: number) => number +>1 : number diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.symbols b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.symbols new file mode 100644 index 00000000000..d0fe78cb178 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.symbols @@ -0,0 +1,398 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance2.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance2.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance2.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>baz : Symbol(baz, Decl(callSignatureAssignabilityInInheritance2.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(callSignatureAssignabilityInInheritance2.ts, 4, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance2.ts, 5, 33)) + +interface A { // T +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance2.ts, 5, 49)) + + // M's + a: (x: number) => number[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 7, 13)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 9, 8)) + + a2: (x: number) => string[]; +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance2.ts, 9, 31)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 10, 9)) + + a3: (x: number) => void; +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance2.ts, 10, 32)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 11, 9)) + + a4: (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance2.ts, 11, 28)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 12, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 12, 19)) + + a5: (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance2.ts, 12, 41)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 13, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 13, 13)) + + a6: (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance2.ts, 13, 47)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 14, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 14, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) + + a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(callSignatureAssignabilityInInheritance2.ts, 14, 44)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 15, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 15, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 15, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(callSignatureAssignabilityInInheritance2.ts, 15, 60)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 35)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 68)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(callSignatureAssignabilityInInheritance2.ts, 16, 88)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 35)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 68)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a10: (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(callSignatureAssignabilityInInheritance2.ts, 17, 88)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 18, 10)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance2.ts, 18, 38)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 10)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 14)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 29)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 34)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) + + a12: (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(callSignatureAssignabilityInInheritance2.ts, 19, 71)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 20, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 20, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance2.ts, 3, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a13: (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(callSignatureAssignabilityInInheritance2.ts, 20, 64)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 21, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 21, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a14: (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(callSignatureAssignabilityInInheritance2.ts, 21, 63)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 22, 10)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 22, 14)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance2.ts, 22, 25)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + a15: { +>a15 : Symbol(a15, Decl(callSignatureAssignabilityInInheritance2.ts, 22, 49)) + + (x: number): number[]; +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 24, 9)) + + (x: string): string[]; +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 25, 9)) + + }; + a16: { +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance2.ts, 26, 6)) + + (x: T): number[]; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 28, 9)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 28, 28)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 28, 9)) + + (x: U): number[]; +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 29, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 29, 25)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 29, 9)) + + }; + a17: { +>a17 : Symbol(a17, Decl(callSignatureAssignabilityInInheritance2.ts, 30, 6)) + + (x: (a: number) => number): number[]; +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 32, 9)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 32, 13)) + + (x: (a: string) => string): string[]; +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 33, 9)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 33, 13)) + + }; + a18: { +>a18 : Symbol(a18, Decl(callSignatureAssignabilityInInheritance2.ts, 34, 6)) + + (x: { +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 36, 9)) + + (a: number): number; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 37, 13)) + + (a: string): string; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 38, 13)) + + }): any[]; + (x: { +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 40, 9)) + + (a: boolean): boolean; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 41, 13)) + + (a: Date): Date; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 42, 13)) +>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)) + + }): any[]; + }; +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(callSignatureAssignabilityInInheritance2.ts, 45, 1)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance2.ts, 5, 49)) + + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 48, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 50, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 50, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 50, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 50, 8)) + + a2: (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance2.ts, 50, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 51, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 51, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 51, 9)) + + a3: (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance2.ts, 51, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 52, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 52, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 52, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 52, 9)) + + a4: (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance2.ts, 52, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 15)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 20)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 9)) + + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance2.ts, 53, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 15)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 19)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 9)) + + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance2.ts, 54, 38)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 9)) + + a7: (x: (arg: T) => U) => (r: T) => U; // ok +>a7 : Symbol(a7, Decl(callSignatureAssignabilityInInheritance2.ts, 55, 67)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 66)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 24)) + + a8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok +>a8 : Symbol(a8, Decl(callSignatureAssignabilityInInheritance2.ts, 56, 77)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 24)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 61)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 66)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 85)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 24)) + + a9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal +>a9 : Symbol(a9, Decl(callSignatureAssignabilityInInheritance2.ts, 57, 96)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 24)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 61)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 66)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 73)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 86)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 113)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 24)) + + a10: (...x: T[]) => T; // ok +>a10 : Symbol(a10, Decl(callSignatureAssignabilityInInheritance2.ts, 58, 124)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 59, 10)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 59, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 59, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 59, 10)) + + a11: (x: T, y: T) => T; // ok +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance2.ts, 59, 45)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 10)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 31)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 10)) + + a12: >(x: Array, y: T) => Array; // ok, less specific parameter type +>a12 : Symbol(a12, Decl(callSignatureAssignabilityInInheritance2.ts, 60, 43)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 61, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 61, 33)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 61, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 61, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a13: >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds +>a13 : Symbol(a13, Decl(callSignatureAssignabilityInInheritance2.ts, 61, 73)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 36)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 51)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 10)) + + a14: (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature +>a14 : Symbol(a14, Decl(callSignatureAssignabilityInInheritance2.ts, 62, 63)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 10)) + + a15: (x: T) => T[]; // ok +>a15 : Symbol(a15, Decl(callSignatureAssignabilityInInheritance2.ts, 63, 37)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 64, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 64, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 64, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 64, 10)) + + a16: (x: T) => number[]; // ok +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance2.ts, 64, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 65, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 65, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 65, 10)) + + a17: (x: (a: T) => T) => T[]; // ok +>a17 : Symbol(a17, Decl(callSignatureAssignabilityInInheritance2.ts, 65, 44)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 10)) + + a18: (x: (a: T) => T) => T[]; // ok, no inferences for T but assignable to any +>a18 : Symbol(a18, Decl(callSignatureAssignabilityInInheritance2.ts, 66, 36)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance2.ts, 67, 10)) +} diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.symbols b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.symbols new file mode 100644 index 00000000000..f45d7f318d2 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.symbols @@ -0,0 +1,281 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance4.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance4.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance4.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>baz : Symbol(baz, Decl(callSignatureAssignabilityInInheritance4.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(callSignatureAssignabilityInInheritance4.ts, 4, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance4.ts, 5, 33)) + +interface A { // T +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance4.ts, 5, 49)) + + // M's + a: (x: T) => T[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 7, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 9, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 9, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 9, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 9, 8)) + + a2: (x: T) => string[]; +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance4.ts, 9, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 10, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 10, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 10, 9)) + + a3: (x: T) => void; +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance4.ts, 10, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 11, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 11, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 11, 9)) + + a4: (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance4.ts, 11, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 14)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 19)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 11)) + + a5: (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance4.ts, 12, 36)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 14)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 18)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 9)) + + a6: (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance4.ts, 13, 37)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 25)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 9)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 9)) + + a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance4.ts, 14, 54)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 13)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 10)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 27)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 10)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 40)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) + + a15: (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(callSignatureAssignabilityInInheritance4.ts, 15, 59)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 10)) + + a16: (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance4.ts, 16, 39)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 26)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 36)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 10)) + + a17: { +>a17 : Symbol(a17, Decl(callSignatureAssignabilityInInheritance4.ts, 17, 52)) + + (x: (a: T) => T): T[]; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 9)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 28)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 19, 9)) + + (x: (a: T) => T): T[]; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 25)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 20, 9)) + + }; + a18: { +>a18 : Symbol(a18, Decl(callSignatureAssignabilityInInheritance4.ts, 21, 6)) + + (x: { +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 23, 9)) + + (a: T): T; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 24, 13)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 24, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 24, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 24, 13)) + + (a: T): T; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 25, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 25, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 25, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 25, 13)) + + }): any[]; + (x: { +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 27, 9)) + + (a: T): T; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 28, 13)) +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance4.ts, 3, 43)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 28, 33)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 28, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 28, 13)) + + (a: T): T; +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 29, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 29, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 29, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 29, 13)) + + }): any[]; + }; +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(callSignatureAssignabilityInInheritance4.ts, 32, 1)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance4.ts, 5, 49)) + + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 35, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 37, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 37, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 37, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 37, 8)) + + a2: (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance4.ts, 37, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 38, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 38, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 38, 9)) + + a3: (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance4.ts, 38, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 39, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 39, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 39, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 39, 9)) + + a4: (x: T, y: U) => string; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance4.ts, 39, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 15)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 20)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 11)) + + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance4.ts, 40, 37)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 15)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 19)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 9)) + + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance4.ts, 41, 38)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 9)) + + a11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance4.ts, 42, 67)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 10)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 12)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 16)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 20)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 10)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 30)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 35)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 12)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 43)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 12)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance4.ts, 0, 0)) + + a15: (x: { a: U; b: V; }) => U[]; // ok, T = U, T = V +>a15 : Symbol(a15, Decl(callSignatureAssignabilityInInheritance4.ts, 43, 62)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 10)) +>V : Symbol(V, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 12)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 16)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 20)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 26)) +>V : Symbol(V, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 12)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 10)) + + a16: (x: { a: T; b: T }) => T[]; // ok, more general parameter type +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance4.ts, 44, 43)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 10)) + + a17: (x: (a: T) => T) => T[]; // ok +>a17 : Symbol(a17, Decl(callSignatureAssignabilityInInheritance4.ts, 45, 39)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 10)) + + a18: (x: (a: T) => T) => any[]; // ok +>a18 : Symbol(a18, Decl(callSignatureAssignabilityInInheritance4.ts, 46, 36)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance4.ts, 47, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 47, 14)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance4.ts, 47, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 47, 14)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance4.ts, 47, 14)) +} diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.symbols b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.symbols new file mode 100644 index 00000000000..d5a68430887 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.symbols @@ -0,0 +1,314 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance5.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithCallSignatures2 just with an extra level of indirection in the inheritance chain + +class Base { foo: string; } +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance5.ts, 4, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance5.ts, 4, 43)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>baz : Symbol(baz, Decl(callSignatureAssignabilityInInheritance5.ts, 5, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(callSignatureAssignabilityInInheritance5.ts, 5, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance5.ts, 6, 33)) + +interface A { // T +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance5.ts, 6, 49)) + + // M's + a: (x: number) => number[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance5.ts, 8, 13)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 10, 8)) + + a2: (x: number) => string[]; +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance5.ts, 10, 31)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 11, 9)) + + a3: (x: number) => void; +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance5.ts, 11, 32)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 12, 9)) + + a4: (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance5.ts, 12, 28)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 13, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 13, 19)) + + a5: (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance5.ts, 13, 41)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 14, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 14, 13)) + + a6: (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance5.ts, 14, 47)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 15, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 15, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) + + a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(callSignatureAssignabilityInInheritance5.ts, 15, 44)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 16, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 16, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 16, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(callSignatureAssignabilityInInheritance5.ts, 16, 60)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 35)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 68)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(callSignatureAssignabilityInInheritance5.ts, 17, 88)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 9)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 13)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 35)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 40)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 68)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a10: (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(callSignatureAssignabilityInInheritance5.ts, 18, 88)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 19, 10)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance5.ts, 19, 38)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 10)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 14)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 29)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 34)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) + + a12: (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(callSignatureAssignabilityInInheritance5.ts, 20, 71)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 21, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 21, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance5.ts, 4, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a13: (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(callSignatureAssignabilityInInheritance5.ts, 21, 64)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 22, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 22, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a14: (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(callSignatureAssignabilityInInheritance5.ts, 22, 63)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 23, 10)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance5.ts, 23, 14)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance5.ts, 23, 25)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +interface B extends A { +>B : Symbol(B, Decl(callSignatureAssignabilityInInheritance5.ts, 24, 1)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance5.ts, 6, 49)) + + a: (x: T) => T[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance5.ts, 26, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 27, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 27, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 27, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 27, 8)) +} + +// S's +interface I extends B { +>I : Symbol(I, Decl(callSignatureAssignabilityInInheritance5.ts, 28, 1)) +>B : Symbol(B, Decl(callSignatureAssignabilityInInheritance5.ts, 24, 1)) + + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance5.ts, 31, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 33, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 33, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 33, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 33, 8)) + + a2: (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance5.ts, 33, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 34, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 34, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 34, 9)) + + a3: (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance5.ts, 34, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 35, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 35, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 35, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 35, 9)) + + a4: (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance5.ts, 35, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 15)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 20)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 9)) + + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance5.ts, 36, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 15)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 19)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 9)) + + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance5.ts, 37, 38)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 9)) + + a7: (x: (arg: T) => U) => (r: T) => U; // ok +>a7 : Symbol(a7, Decl(callSignatureAssignabilityInInheritance5.ts, 38, 67)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 66)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 24)) + + a8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok +>a8 : Symbol(a8, Decl(callSignatureAssignabilityInInheritance5.ts, 39, 77)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 24)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 61)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 66)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 85)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 24)) + + a9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal +>a9 : Symbol(a9, Decl(callSignatureAssignabilityInInheritance5.ts, 40, 96)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 24)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 44)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 24)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 61)) +>arg2 : Symbol(arg2, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 66)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 73)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 86)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 24)) +>r : Symbol(r, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 113)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 24)) + + a10: (...x: T[]) => T; // ok +>a10 : Symbol(a10, Decl(callSignatureAssignabilityInInheritance5.ts, 41, 124)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 42, 10)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 42, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 42, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 42, 10)) + + a11: (x: T, y: T) => T; // ok +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance5.ts, 42, 45)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 10)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 31)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 10)) + + a12: >(x: Array, y: T) => Array; // ok, less specific parameter type +>a12 : Symbol(a12, Decl(callSignatureAssignabilityInInheritance5.ts, 43, 43)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 44, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 44, 33)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 44, 48)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 44, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a13: >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds +>a13 : Symbol(a13, Decl(callSignatureAssignabilityInInheritance5.ts, 44, 73)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 10)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 36)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 51)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 10)) + + a14: (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature +>a14 : Symbol(a14, Decl(callSignatureAssignabilityInInheritance5.ts, 45, 63)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance5.ts, 46, 10)) +} diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.symbols b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.symbols new file mode 100644 index 00000000000..1d4c99d89db --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.symbols @@ -0,0 +1,209 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance6.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithCallSignatures4 but using class type parameters instead of generic signatures +// all are errors + +class Base { foo: string; } +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance6.ts, 4, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance6.ts, 4, 27)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance6.ts, 5, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(callSignatureAssignabilityInInheritance6.ts, 5, 43)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance6.ts, 4, 27)) +>baz : Symbol(baz, Decl(callSignatureAssignabilityInInheritance6.ts, 6, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(callSignatureAssignabilityInInheritance6.ts, 6, 47)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +>bing : Symbol(bing, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 33)) + +interface A { // T +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + // M's + a: (x: T) => T[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance6.ts, 9, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 11, 8)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 11, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 11, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 11, 8)) + + a2: (x: T) => string[]; +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance6.ts, 11, 24)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 12, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 12, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 12, 9)) + + a3: (x: T) => void; +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance6.ts, 12, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 13, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 13, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 13, 9)) + + a4: (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance6.ts, 13, 26)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 14)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 9)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 19)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 11)) + + a5: (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance6.ts, 14, 36)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 11)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 14)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 18)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 9)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 11)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 9)) + + a6: (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(callSignatureAssignabilityInInheritance6.ts, 15, 37)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 9)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 25)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 29)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 9)) +>Derived : Symbol(Derived, Decl(callSignatureAssignabilityInInheritance6.ts, 4, 27)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 9)) + + a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance6.ts, 16, 54)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 13)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 10)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 27)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 32)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 10)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 40)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) + + a15: (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(callSignatureAssignabilityInInheritance6.ts, 17, 59)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 13)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 23)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 10)) + + a16: (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance6.ts, 18, 39)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 26)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 30)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 10)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 36)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 10)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 19, 10)) +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(callSignatureAssignabilityInInheritance6.ts, 20, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 23, 12)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a: (x: T) => T[]; +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance6.ts, 23, 26)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 24, 8)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 23, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 23, 12)) +} + +interface I2 extends A { +>I2 : Symbol(I2, Decl(callSignatureAssignabilityInInheritance6.ts, 25, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 27, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a2: (x: T) => string[]; +>a2 : Symbol(a2, Decl(callSignatureAssignabilityInInheritance6.ts, 27, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 28, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 27, 13)) +} + +interface I3 extends A { +>I3 : Symbol(I3, Decl(callSignatureAssignabilityInInheritance6.ts, 29, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 31, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a3: (x: T) => T; +>a3 : Symbol(a3, Decl(callSignatureAssignabilityInInheritance6.ts, 31, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 32, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 31, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 31, 13)) +} + +interface I4 extends A { +>I4 : Symbol(I4, Decl(callSignatureAssignabilityInInheritance6.ts, 33, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 35, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a4: (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(callSignatureAssignabilityInInheritance6.ts, 35, 27)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 36, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 36, 12)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 35, 13)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance6.ts, 36, 17)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 36, 9)) +} + +interface I5 extends A { +>I5 : Symbol(I5, Decl(callSignatureAssignabilityInInheritance6.ts, 37, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 39, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a5: (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(callSignatureAssignabilityInInheritance6.ts, 39, 27)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 40, 9)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 40, 12)) +>arg : Symbol(arg, Decl(callSignatureAssignabilityInInheritance6.ts, 40, 16)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 39, 13)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 40, 9)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 39, 13)) +} + +interface I7 extends A { +>I7 : Symbol(I7, Decl(callSignatureAssignabilityInInheritance6.ts, 41, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 43, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>a11 : Symbol(a11, Decl(callSignatureAssignabilityInInheritance6.ts, 43, 27)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 10)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 13)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 17)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 43, 13)) +>y : Symbol(y, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 27)) +>foo : Symbol(foo, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 32)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 10)) +>bar : Symbol(bar, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 40)) +>U : Symbol(U, Decl(callSignatureAssignabilityInInheritance6.ts, 44, 10)) +>Base : Symbol(Base, Decl(callSignatureAssignabilityInInheritance6.ts, 0, 0)) +} + +interface I9 extends A { +>I9 : Symbol(I9, Decl(callSignatureAssignabilityInInheritance6.ts, 45, 1)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 47, 13)) +>A : Symbol(A, Decl(callSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a16: (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(callSignatureAssignabilityInInheritance6.ts, 47, 27)) +>x : Symbol(x, Decl(callSignatureAssignabilityInInheritance6.ts, 48, 10)) +>a : Symbol(a, Decl(callSignatureAssignabilityInInheritance6.ts, 48, 14)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 47, 13)) +>b : Symbol(b, Decl(callSignatureAssignabilityInInheritance6.ts, 48, 20)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 47, 13)) +>T : Symbol(T, Decl(callSignatureAssignabilityInInheritance6.ts, 47, 13)) +} diff --git a/tests/baselines/reference/callSignatureFunctionOverload.symbols b/tests/baselines/reference/callSignatureFunctionOverload.symbols new file mode 100644 index 00000000000..f0318f1a77d --- /dev/null +++ b/tests/baselines/reference/callSignatureFunctionOverload.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/callSignatureFunctionOverload.ts === +var foo: { +>foo : Symbol(foo, Decl(callSignatureFunctionOverload.ts, 0, 3)) + + (name: string): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 1, 5)) + + (name: 'order'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 2, 5)) + + (name: 'content'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 3, 5)) + + (name: 'done'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 4, 5)) +} + +var foo2: { +>foo2 : Symbol(foo2, Decl(callSignatureFunctionOverload.ts, 7, 3)) + + (name: string): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 8, 5)) + + (name: 'order'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 9, 5)) + + (name: 'order'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 10, 5)) + + (name: 'done'): string; +>name : Symbol(name, Decl(callSignatureFunctionOverload.ts, 11, 5)) +} + diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.symbols b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.symbols new file mode 100644 index 00000000000..4b499ec2667 --- /dev/null +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.symbols @@ -0,0 +1,50 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutAnnotationsOrBody.ts === +// Call signatures without a return type annotation and function body return 'any' + +function foo(x) { } +>foo : Symbol(foo, Decl(callSignatureWithoutAnnotationsOrBody.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureWithoutAnnotationsOrBody.ts, 2, 13)) + +var r = foo(1); // void since there's a body +>r : Symbol(r, Decl(callSignatureWithoutAnnotationsOrBody.ts, 3, 3)) +>foo : Symbol(foo, Decl(callSignatureWithoutAnnotationsOrBody.ts, 0, 0)) + +interface I { +>I : Symbol(I, Decl(callSignatureWithoutAnnotationsOrBody.ts, 3, 15)) + + (); + f(); +>f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 6, 7)) +} +var i: I; +>i : Symbol(i, Decl(callSignatureWithoutAnnotationsOrBody.ts, 9, 3)) +>I : Symbol(I, Decl(callSignatureWithoutAnnotationsOrBody.ts, 3, 15)) + +var r2 = i(); +>r2 : Symbol(r2, Decl(callSignatureWithoutAnnotationsOrBody.ts, 10, 3)) +>i : Symbol(i, Decl(callSignatureWithoutAnnotationsOrBody.ts, 9, 3)) + +var r3 = i.f(); +>r3 : Symbol(r3, Decl(callSignatureWithoutAnnotationsOrBody.ts, 11, 3)) +>i.f : Symbol(I.f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 6, 7)) +>i : Symbol(i, Decl(callSignatureWithoutAnnotationsOrBody.ts, 9, 3)) +>f : Symbol(I.f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 6, 7)) + +var a: { +>a : Symbol(a, Decl(callSignatureWithoutAnnotationsOrBody.ts, 13, 3)) + + (); + f(); +>f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 14, 7)) + +}; +var r4 = a(); +>r4 : Symbol(r4, Decl(callSignatureWithoutAnnotationsOrBody.ts, 17, 3)) +>a : Symbol(a, Decl(callSignatureWithoutAnnotationsOrBody.ts, 13, 3)) + +var r5 = a.f(); +>r5 : Symbol(r5, Decl(callSignatureWithoutAnnotationsOrBody.ts, 18, 3)) +>a.f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 14, 7)) +>a : Symbol(a, Decl(callSignatureWithoutAnnotationsOrBody.ts, 13, 3)) +>f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 14, 7)) + diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types index b8b608762f5..062961ac093 100644 --- a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types @@ -9,6 +9,7 @@ var r = foo(1); // void since there's a body >r : void >foo(1) : void >foo : (x: any) => void +>1 : number interface I { >I : I diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols new file mode 100644 index 00000000000..1c5a6786ab7 --- /dev/null +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.symbols @@ -0,0 +1,255 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts === +// Call signatures without a return type should infer one from the function body (if present) + +// Simple types +function foo(x) { +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 3, 13)) + + return 1; +} +var r = foo(1); +>r : Symbol(r, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 3)) +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) + +function foo2(x) { +>foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 15)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 8, 14)) + + return foo(x); +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 0, 0)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 8, 14)) +} +var r2 = foo2(1); +>r2 : Symbol(r2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 3)) +>foo2 : Symbol(foo2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 6, 15)) + +function foo3() { +>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17)) + + return foo3(); +>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17)) +} +var r3 = foo3(); +>r3 : Symbol(r3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 3)) +>foo3 : Symbol(foo3, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 11, 17)) + +function foo4(x: T) { +>foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 16)) +>T : Symbol(T, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 14)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 17)) +>T : Symbol(T, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 14)) + + return x; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 18, 17)) +} +var r4 = foo4(1); +>r4 : Symbol(r4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 3)) +>foo4 : Symbol(foo4, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 16, 16)) + +function foo5(x) { +>foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 23, 14)) + + if (true) { + return 1; + } else { + return 2; + } +} +var r5 = foo5(1); +>r5 : Symbol(r5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 3)) +>foo5 : Symbol(foo5, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 21, 17)) + +function foo6(x) { +>foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 32, 14)) + + try { + } + catch (e) { +>e : Symbol(e, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 35, 11)) + + return []; + } + finally { + return []; + } +} +var r6 = foo6(1); +>r6 : Symbol(r6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 3)) +>foo6 : Symbol(foo6, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 30, 17)) + +function foo7(x) { +>foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 44, 14)) + + return typeof x; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 44, 14)) +} +var r7 = foo7(1); +>r7 : Symbol(r7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 3)) +>foo7 : Symbol(foo7, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 42, 17)) + +// object types +function foo8(x: number) { +>foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 17)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 50, 14)) + + return { x: x }; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 51, 12)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 50, 14)) +} +var r8 = foo8(1); +>r8 : Symbol(r8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 3)) +>foo8 : Symbol(foo8, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 47, 17)) + +interface I { +>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 17)) + + foo: string; +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 55, 13)) +} +function foo9(x: number) { +>foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 57, 1)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 58, 14)) + + var i: I; +>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 59, 7)) +>I : Symbol(I, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 53, 17)) + + return i; +>i : Symbol(i, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 59, 7)) +} +var r9 = foo9(1); +>r9 : Symbol(r9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 3)) +>foo9 : Symbol(foo9, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 57, 1)) + +class C { +>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 17)) + + foo: string; +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 64, 9)) +} +function foo10(x: number) { +>foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 66, 1)) +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 67, 15)) + + var c: C; +>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 68, 7)) +>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 62, 17)) + + return c; +>c : Symbol(c, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 68, 7)) +} +var r10 = foo10(1); +>r10 : Symbol(r10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 3)) +>foo10 : Symbol(foo10, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 66, 1)) + +module M { +>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 19)) + + export var x = 1; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 74, 14)) + + export class C { foo: string } +>C : Symbol(C, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 74, 21)) +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 75, 20)) +} +function foo11() { +>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 1)) + + return M; +>M : Symbol(M, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 71, 19)) +} +var r11 = foo11(); +>r11 : Symbol(r11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 3)) +>foo11 : Symbol(foo11, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 76, 1)) + +// merged declarations +interface I2 { +>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1)) + + x: number; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 83, 14)) +} +interface I2 { +>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1)) + + y: number; +>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 86, 14)) +} +function foo12() { +>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 88, 1)) + + var i2: I2; +>i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 90, 7)) +>I2 : Symbol(I2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 80, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 85, 1)) + + return i2; +>i2 : Symbol(i2, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 90, 7)) +} +var r12 = foo12(); +>r12 : Symbol(r12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 3)) +>foo12 : Symbol(foo12, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 88, 1)) + +function m1() { return 1; } +>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27)) + +module m1 { export var y = 2; } +>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27)) +>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 22)) + +function foo13() { +>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 31)) + + return m1; +>m1 : Symbol(m1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 93, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 95, 27)) +} +var r13 = foo13(); +>r13 : Symbol(r13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 3)) +>foo13 : Symbol(foo13, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 96, 31)) + +class c1 { +>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1)) + + foo: string; +>foo : Symbol(foo, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 102, 10)) + + constructor(x) { } +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 104, 16)) +} +module c1 { +>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1)) + + export var x = 1; +>x : Symbol(x, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 107, 14)) +} +function foo14() { +>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 1)) + + return c1; +>c1 : Symbol(c1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 100, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 105, 1)) +} +var r14 = foo14(); +>r14 : Symbol(r14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 3)) +>foo14 : Symbol(foo14, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 108, 1)) + +enum e1 { A } +>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13)) +>A : Symbol(e1.A, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 9)) + +module e1 { export var y = 1; } +>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13)) +>y : Symbol(y, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 22)) + +function foo15() { +>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 31)) + + return e1; +>e1 : Symbol(e1, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 112, 18), Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 114, 13)) +} +var r15 = foo15(); +>r15 : Symbol(r15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 119, 3)) +>foo15 : Symbol(foo15, Decl(callSignatureWithoutReturnTypeAnnotationInference.ts, 115, 31)) + diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types index dc6a72cf897..760451eb9c1 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types @@ -7,11 +7,13 @@ function foo(x) { >x : any return 1; +>1 : number } var r = foo(1); >r : number >foo(1) : number >foo : (x: any) => number +>1 : number function foo2(x) { >foo2 : (x: any) => number @@ -26,6 +28,7 @@ var r2 = foo2(1); >r2 : number >foo2(1) : number >foo2 : (x: any) => number +>1 : number function foo3() { >foo3 : () => any @@ -52,21 +55,28 @@ var r4 = foo4(1); >r4 : number >foo4(1) : number >foo4 : (x: T) => T +>1 : number function foo5(x) { >foo5 : (x: any) => number >x : any if (true) { +>true : boolean + return 1; +>1 : number + } else { return 2; +>2 : number } } var r5 = foo5(1); >r5 : number >foo5(1) : number >foo5 : (x: any) => number +>1 : number function foo6(x) { >foo6 : (x: any) => any[] @@ -89,6 +99,7 @@ var r6 = foo6(1); >r6 : any[] >foo6(1) : any[] >foo6 : (x: any) => any[] +>1 : number function foo7(x) { >foo7 : (x: any) => string @@ -102,6 +113,7 @@ var r7 = foo7(1); >r7 : string >foo7(1) : string >foo7 : (x: any) => string +>1 : number // object types function foo8(x: number) { @@ -117,6 +129,7 @@ var r8 = foo8(1); >r8 : { x: number; } >foo8(1) : { x: number; } >foo8 : (x: number) => { x: number; } +>1 : number interface I { >I : I @@ -139,6 +152,7 @@ var r9 = foo9(1); >r9 : I >foo9(1) : I >foo9 : (x: number) => I +>1 : number class C { >C : C @@ -161,12 +175,14 @@ var r10 = foo10(1); >r10 : C >foo10(1) : C >foo10 : (x: number) => C +>1 : number module M { >M : typeof M export var x = 1; >x : number +>1 : number export class C { foo: string } >C : C @@ -213,10 +229,12 @@ var r12 = foo12(); function m1() { return 1; } >m1 : typeof m1 +>1 : number module m1 { export var y = 2; } >m1 : typeof m1 >y : number +>2 : number function foo13() { >foo13 : () => typeof m1 @@ -243,6 +261,7 @@ module c1 { export var x = 1; >x : number +>1 : number } function foo14() { >foo14 : () => typeof c1 @@ -262,6 +281,7 @@ enum e1 { A } module e1 { export var y = 1; } >e1 : typeof e1 >y : number +>1 : number function foo15() { >foo15 : () => typeof e1 diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.symbols b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.symbols new file mode 100644 index 00000000000..f2b9de48425 --- /dev/null +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.symbols @@ -0,0 +1,76 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType.ts === +// Each pair of signatures in these types has a signature that should cause an error. +// Overloads, generic or not, that differ only by return type are an error. +interface I { +>I : Symbol(I, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 0, 0)) + + (x): number; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 3, 5)) + + (x): void; // error +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 4, 5)) + + (x: T): number; +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 5, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 5, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 5, 5)) + + (x: T): string; // error +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 6, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 6, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 6, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 7, 1)) + + (x: T): number; +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 10, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 10, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 10, 5)) + + (x: T): string; // error +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 11, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 11, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 11, 5)) +} + +interface I3 { +>I3 : Symbol(I3, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 12, 1)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 14, 13)) + + (x: T): number; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 15, 5)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 14, 13)) + + (x: T): string; // error +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 16, 5)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 14, 13)) +} + +var a: { +>a : Symbol(a, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 19, 3)) + + (x, y): Object; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 20, 5)) +>y : Symbol(y, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 20, 7)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + (x, y): any; // error +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 21, 5)) +>y : Symbol(y, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 21, 7)) +} + +var a2: { +>a2 : Symbol(a2, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 24, 3)) + + (x: T): number; +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 25, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 25, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 25, 5)) + + (x: T): string; // error +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 26, 5)) +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 26, 8)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType.ts, 26, 5)) +} diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.symbols b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.symbols new file mode 100644 index 00000000000..dab2717aa0a --- /dev/null +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType3.ts === +// Normally it is an error to have multiple overloads with identical signatures in a single type declaration. +// Here the multiple overloads come from multiple merged declarations. + +interface I { +>I : Symbol(I, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 0, 0), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 5, 1)) + + (x: string): string; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 4, 5)) +} + +interface I { +>I : Symbol(I, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 0, 0), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 5, 1)) + + (x: string): number; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 8, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 9, 1), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 13, 1)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 11, 13), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 15, 13)) + + (x: string): string; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 12, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 9, 1), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 13, 1)) +>T : Symbol(T, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 11, 13), Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 15, 13)) + + (x: string): number; +>x : Symbol(x, Decl(callSignaturesThatDifferOnlyByReturnType3.ts, 16, 5)) +} diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.symbols b/tests/baselines/reference/callSignaturesWithOptionalParameters.symbols new file mode 100644 index 00000000000..542bd425fb1 --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.symbols @@ -0,0 +1,164 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithOptionalParameters.ts === +// Optional parameters should be valid in all the below casts + +function foo(x?: number) { } +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 0, 0)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 2, 13)) + +var f = function foo(x?: number) { } +>f : Symbol(f, Decl(callSignaturesWithOptionalParameters.ts, 3, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 3, 7)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 3, 21)) + +var f2 = (x: number, y?: number) => { } +>f2 : Symbol(f2, Decl(callSignaturesWithOptionalParameters.ts, 4, 3)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 4, 10)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters.ts, 4, 20)) + +foo(1); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 0, 0)) + +foo(); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 0, 0)) + +f(1); +>f : Symbol(f, Decl(callSignaturesWithOptionalParameters.ts, 3, 3)) + +f(); +>f : Symbol(f, Decl(callSignaturesWithOptionalParameters.ts, 3, 3)) + +f2(1); +>f2 : Symbol(f2, Decl(callSignaturesWithOptionalParameters.ts, 4, 3)) + +f2(1, 2); +>f2 : Symbol(f2, Decl(callSignaturesWithOptionalParameters.ts, 4, 3)) + +class C { +>C : Symbol(C, Decl(callSignaturesWithOptionalParameters.ts, 11, 9)) + + foo(x?: number) { } +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 13, 9)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 14, 8)) +} + +var c: C; +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters.ts, 17, 3)) +>C : Symbol(C, Decl(callSignaturesWithOptionalParameters.ts, 11, 9)) + +c.foo(); +>c.foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters.ts, 13, 9)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters.ts, 17, 3)) +>foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters.ts, 13, 9)) + +c.foo(1); +>c.foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters.ts, 13, 9)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters.ts, 17, 3)) +>foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters.ts, 13, 9)) + +interface I { +>I : Symbol(I, Decl(callSignaturesWithOptionalParameters.ts, 19, 9)) + + (x?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 22, 5)) + + foo(x: number, y?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 22, 17)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 23, 8)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters.ts, 23, 18)) +} + +var i: I; +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters.ts, 26, 3)) +>I : Symbol(I, Decl(callSignaturesWithOptionalParameters.ts, 19, 9)) + +i(); +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters.ts, 26, 3)) + +i(1); +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters.ts, 26, 3)) + +i.foo(1); +>i.foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters.ts, 22, 17)) +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters.ts, 26, 3)) +>foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters.ts, 22, 17)) + +i.foo(1, 2); +>i.foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters.ts, 22, 17)) +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters.ts, 26, 3)) +>foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters.ts, 22, 17)) + +var a: { +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 32, 3)) + + (x?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 33, 5)) + + foo(x?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 33, 17)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 34, 8)) +} + +a(); +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 32, 3)) + +a(1); +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 32, 3)) + +a.foo(); +>a.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 33, 17)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 32, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 33, 17)) + +a.foo(1); +>a.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 33, 17)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 32, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 33, 17)) + +var b = { +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) + + foo(x?: number) { }, +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 42, 9)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 43, 8)) + + a: function foo(x: number, y?: number) { }, +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 43, 24)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 44, 6)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 44, 20)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters.ts, 44, 30)) + + b: (x?: number) => { } +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 44, 47)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters.ts, 45, 8)) +} + +b.foo(); +>b.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 42, 9)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 42, 9)) + +b.foo(1); +>b.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 42, 9)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters.ts, 42, 9)) + +b.a(1); +>b.a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 43, 24)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 43, 24)) + +b.a(1, 2); +>b.a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 43, 24)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters.ts, 43, 24)) + +b.b(); +>b.b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 44, 47)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 44, 47)) + +b.b(1); +>b.b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 44, 47)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 42, 3)) +>b : Symbol(b, Decl(callSignaturesWithOptionalParameters.ts, 44, 47)) + diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.types b/tests/baselines/reference/callSignaturesWithOptionalParameters.types index 818c52f79d0..4ade0e8afe4 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.types @@ -20,6 +20,7 @@ var f2 = (x: number, y?: number) => { } foo(1); >foo(1) : void >foo : (x?: number) => void +>1 : number foo(); >foo() : void @@ -28,6 +29,7 @@ foo(); f(1); >f(1) : void >f : (x?: number) => void +>1 : number f(); >f() : void @@ -36,10 +38,13 @@ f(); f2(1); >f2(1) : void >f2 : (x: number, y?: number) => void +>1 : number f2(1, 2); >f2(1, 2) : void >f2 : (x: number, y?: number) => void +>1 : number +>2 : number class C { >C : C @@ -64,6 +69,7 @@ c.foo(1); >c.foo : (x?: number) => void >c : C >foo : (x?: number) => void +>1 : number interface I { >I : I @@ -88,18 +94,22 @@ i(); i(1); >i(1) : any >i : I +>1 : number i.foo(1); >i.foo(1) : any >i.foo : (x: number, y?: number) => any >i : I >foo : (x: number, y?: number) => any +>1 : number i.foo(1, 2); >i.foo(1, 2) : any >i.foo : (x: number, y?: number) => any >i : I >foo : (x: number, y?: number) => any +>1 : number +>2 : number var a: { >a : { (x?: number): any; foo(x?: number): any; } @@ -119,6 +129,7 @@ a(); a(1); >a(1) : any >a : { (x?: number): any; foo(x?: number): any; } +>1 : number a.foo(); >a.foo() : any @@ -131,6 +142,7 @@ a.foo(1); >a.foo : (x?: number) => any >a : { (x?: number): any; foo(x?: number): any; } >foo : (x?: number) => any +>1 : number var b = { >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } @@ -164,18 +176,22 @@ b.foo(1); >b.foo : (x?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >foo : (x?: number) => void +>1 : number b.a(1); >b.a(1) : void >b.a : (x: number, y?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >a : (x: number, y?: number) => void +>1 : number b.a(1, 2); >b.a(1, 2) : void >b.a : (x: number, y?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >a : (x: number, y?: number) => void +>1 : number +>2 : number b.b(); >b.b() : void @@ -188,4 +204,5 @@ b.b(1); >b.b : (x?: number) => void >b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >b : (x?: number) => void +>1 : number diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.symbols b/tests/baselines/reference/callSignaturesWithOptionalParameters2.symbols new file mode 100644 index 00000000000..e8609d66236 --- /dev/null +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.symbols @@ -0,0 +1,183 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithOptionalParameters2.ts === +// Optional parameters should be valid in all the below casts + +function foo(x?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 0, 0), Decl(callSignaturesWithOptionalParameters2.ts, 2, 25)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 2, 13)) + +function foo(x?: number) { } +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 0, 0), Decl(callSignaturesWithOptionalParameters2.ts, 2, 25)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 3, 13)) + +foo(1); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 0, 0), Decl(callSignaturesWithOptionalParameters2.ts, 2, 25)) + +foo(); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 0, 0), Decl(callSignaturesWithOptionalParameters2.ts, 2, 25)) + +function foo2(x: number); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 6, 6), Decl(callSignaturesWithOptionalParameters2.ts, 8, 25), Decl(callSignaturesWithOptionalParameters2.ts, 9, 37)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 8, 14)) + +function foo2(x: number, y?: number); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 6, 6), Decl(callSignaturesWithOptionalParameters2.ts, 8, 25), Decl(callSignaturesWithOptionalParameters2.ts, 9, 37)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 9, 14)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 9, 24)) + +function foo2(x: number, y?: number) { } +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 6, 6), Decl(callSignaturesWithOptionalParameters2.ts, 8, 25), Decl(callSignaturesWithOptionalParameters2.ts, 9, 37)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 10, 14)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 10, 24)) + +foo2(1); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 6, 6), Decl(callSignaturesWithOptionalParameters2.ts, 8, 25), Decl(callSignaturesWithOptionalParameters2.ts, 9, 37)) + +foo2(1, 2); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 6, 6), Decl(callSignaturesWithOptionalParameters2.ts, 8, 25), Decl(callSignaturesWithOptionalParameters2.ts, 9, 37)) + +class C { +>C : Symbol(C, Decl(callSignaturesWithOptionalParameters2.ts, 13, 11)) + + foo(x?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 16, 8)) + + foo(x?: number) { } +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 17, 8)) + + foo2(x: number); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 19, 9)) + + foo2(x: number, y?: number); +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 20, 9)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 20, 19)) + + foo2(x: number, y?: number) { } +>foo2 : Symbol(foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 21, 9)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 21, 19)) +} + +var c: C; +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters2.ts, 24, 3)) +>C : Symbol(C, Decl(callSignaturesWithOptionalParameters2.ts, 13, 11)) + +c.foo(); +>c.foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters2.ts, 24, 3)) +>foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) + +c.foo(1); +>c.foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters2.ts, 24, 3)) +>foo : Symbol(C.foo, Decl(callSignaturesWithOptionalParameters2.ts, 15, 9), Decl(callSignaturesWithOptionalParameters2.ts, 16, 20)) + +c.foo2(1); +>c.foo2 : Symbol(C.foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters2.ts, 24, 3)) +>foo2 : Symbol(C.foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) + +c.foo2(1, 2); +>c.foo2 : Symbol(C.foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) +>c : Symbol(c, Decl(callSignaturesWithOptionalParameters2.ts, 24, 3)) +>foo2 : Symbol(C.foo2, Decl(callSignaturesWithOptionalParameters2.ts, 17, 23), Decl(callSignaturesWithOptionalParameters2.ts, 19, 20), Decl(callSignaturesWithOptionalParameters2.ts, 20, 32)) + +interface I { +>I : Symbol(I, Decl(callSignaturesWithOptionalParameters2.ts, 29, 13)) + + (x?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 32, 5)) + + (x?: number, y?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 33, 5)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 33, 16)) + + foo(x: number, y?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 34, 8)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 34, 18)) + + foo(x: number, y?: number, z?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 35, 8)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 35, 18)) +>z : Symbol(z, Decl(callSignaturesWithOptionalParameters2.ts, 35, 30)) +} + +var i: I; +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) +>I : Symbol(I, Decl(callSignaturesWithOptionalParameters2.ts, 29, 13)) + +i(); +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) + +i(1); +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) + +i(1, 2); +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) + +i.foo(1); +>i.foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) +>foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) + +i.foo(1, 2); +>i.foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) +>foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) + +i.foo(1, 2, 3); +>i.foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) +>i : Symbol(i, Decl(callSignaturesWithOptionalParameters2.ts, 38, 3)) +>foo : Symbol(I.foo, Decl(callSignaturesWithOptionalParameters2.ts, 33, 29), Decl(callSignaturesWithOptionalParameters2.ts, 34, 31)) + +var a: { +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) + + (x?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 47, 5)) + + (x?: number, y?: number); +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 48, 5)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 48, 16)) + + foo(x: number, y?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 49, 8)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 49, 18)) + + foo(x: number, y?: number, z?: number); +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) +>x : Symbol(x, Decl(callSignaturesWithOptionalParameters2.ts, 50, 8)) +>y : Symbol(y, Decl(callSignaturesWithOptionalParameters2.ts, 50, 18)) +>z : Symbol(z, Decl(callSignaturesWithOptionalParameters2.ts, 50, 30)) +} + +a(); +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) + +a(1); +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) + +a(1, 2); +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) + +a.foo(1); +>a.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) + +a.foo(1, 2); +>a.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) + +a.foo(1, 2, 3); +>a.foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) +>a : Symbol(a, Decl(callSignaturesWithOptionalParameters2.ts, 46, 3)) +>foo : Symbol(foo, Decl(callSignaturesWithOptionalParameters2.ts, 48, 29), Decl(callSignaturesWithOptionalParameters2.ts, 49, 31)) + diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types index 602edd911fe..f726840752e 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types @@ -12,6 +12,7 @@ function foo(x?: number) { } foo(1); >foo(1) : any >foo : (x?: number) => any +>1 : number foo(); >foo() : any @@ -34,10 +35,13 @@ function foo2(x: number, y?: number) { } foo2(1); >foo2(1) : any >foo2 : { (x: number): any; (x: number, y?: number): any; } +>1 : number foo2(1, 2); >foo2(1, 2) : any >foo2 : { (x: number): any; (x: number, y?: number): any; } +>1 : number +>2 : number class C { >C : C @@ -80,18 +84,22 @@ c.foo(1); >c.foo : (x?: number) => any >c : C >foo : (x?: number) => any +>1 : number c.foo2(1); >c.foo2(1) : any >c.foo2 : { (x: number): any; (x: number, y?: number): any; } >c : C >foo2 : { (x: number): any; (x: number, y?: number): any; } +>1 : number c.foo2(1, 2); >c.foo2(1, 2) : any >c.foo2 : { (x: number): any; (x: number, y?: number): any; } >c : C >foo2 : { (x: number): any; (x: number, y?: number): any; } +>1 : number +>2 : number interface I { >I : I @@ -126,28 +134,37 @@ i(); i(1); >i(1) : any >i : I +>1 : number i(1, 2); >i(1, 2) : any >i : I +>1 : number +>2 : number i.foo(1); >i.foo(1) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number i.foo(1, 2); >i.foo(1, 2) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number +>2 : number i.foo(1, 2, 3); >i.foo(1, 2, 3) : any >i.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >i : I >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number +>2 : number +>3 : number var a: { >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } @@ -178,26 +195,35 @@ a(); a(1); >a(1) : any >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } +>1 : number a(1, 2); >a(1, 2) : any >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } +>1 : number +>2 : number a.foo(1); >a.foo(1) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number a.foo(1, 2); >a.foo(1, 2) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number +>2 : number a.foo(1, 2, 3); >a.foo(1, 2, 3) : any >a.foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } >a : { (x?: number): any; (x?: number, y?: number): any; foo(x: number, y?: number): any; foo(x: number, y?: number, z?: number): any; } >foo : { (x: number, y?: number): any; (x: number, y?: number, z?: number): any; } +>1 : number +>2 : number +>3 : number diff --git a/tests/baselines/reference/callWithSpreadES6.symbols b/tests/baselines/reference/callWithSpreadES6.symbols new file mode 100644 index 00000000000..0dd186210b2 --- /dev/null +++ b/tests/baselines/reference/callWithSpreadES6.symbols @@ -0,0 +1,166 @@ +=== tests/cases/conformance/expressions/functionCalls/callWithSpreadES6.ts === + +interface X { +>X : Symbol(X, Decl(callWithSpreadES6.ts, 0, 0)) + + foo(x: number, y: number, ...z: string[]); +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 1, 13)) +>x : Symbol(x, Decl(callWithSpreadES6.ts, 2, 8)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 2, 18)) +>z : Symbol(z, Decl(callWithSpreadES6.ts, 2, 29)) +} + +function foo(x: number, y: number, ...z: string[]) { +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 3, 1)) +>x : Symbol(x, Decl(callWithSpreadES6.ts, 5, 13)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 5, 23)) +>z : Symbol(z, Decl(callWithSpreadES6.ts, 5, 34)) +} + +var a: string[]; +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +var z: number[]; +>z : Symbol(z, Decl(callWithSpreadES6.ts, 9, 3)) + +var obj: X; +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>X : Symbol(X, Decl(callWithSpreadES6.ts, 0, 0)) + +var xa: X[]; +>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) +>X : Symbol(X, Decl(callWithSpreadES6.ts, 0, 0)) + +foo(1, 2, "abc"); +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 3, 1)) + +foo(1, 2, ...a); +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 3, 1)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +foo(1, 2, ...a, "abc"); +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 3, 1)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +obj.foo(1, 2, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) + +obj.foo(1, 2, ...a); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +obj.foo(1, 2, ...a, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +(obj.foo)(1, 2, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) + +(obj.foo)(1, 2, ...a); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +(obj.foo)(1, 2, ...a, "abc"); +>obj.foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>obj : Symbol(obj, Decl(callWithSpreadES6.ts, 10, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +xa[1].foo(1, 2, "abc"); +>xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) + +xa[1].foo(1, 2, ...a); +>xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +xa[1].foo(1, 2, ...a, "abc"); +>xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + +(xa[1].foo)(...[1, 2, "abc"]); +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(lib.d.ts, 1325, 1)) +>xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) +>xa : Symbol(xa, Decl(callWithSpreadES6.ts, 11, 3)) +>foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 1, 13)) + +class C { +>C : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) + + constructor(x: number, y: number, ...z: string[]) { +>x : Symbol(x, Decl(callWithSpreadES6.ts, 32, 16)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 32, 26)) +>z : Symbol(z, Decl(callWithSpreadES6.ts, 32, 37)) + + this.foo(x, y); +>this.foo : Symbol(foo, Decl(callWithSpreadES6.ts, 35, 5)) +>this : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 35, 5)) +>x : Symbol(x, Decl(callWithSpreadES6.ts, 32, 16)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 32, 26)) + + this.foo(x, y, ...z); +>this.foo : Symbol(foo, Decl(callWithSpreadES6.ts, 35, 5)) +>this : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 35, 5)) +>x : Symbol(x, Decl(callWithSpreadES6.ts, 32, 16)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 32, 26)) +>z : Symbol(z, Decl(callWithSpreadES6.ts, 32, 37)) + } + foo(x: number, y: number, ...z: string[]) { +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 35, 5)) +>x : Symbol(x, Decl(callWithSpreadES6.ts, 36, 8)) +>y : Symbol(y, Decl(callWithSpreadES6.ts, 36, 18)) +>z : Symbol(z, Decl(callWithSpreadES6.ts, 36, 29)) + } +} + +class D extends C { +>D : Symbol(D, Decl(callWithSpreadES6.ts, 38, 1)) +>C : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) + + constructor() { + super(1, 2); +>super : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) + + super(1, 2, ...a); +>super : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + } + foo() { +>foo : Symbol(foo, Decl(callWithSpreadES6.ts, 44, 5)) + + super.foo(1, 2); +>super.foo : Symbol(C.foo, Decl(callWithSpreadES6.ts, 35, 5)) +>super : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>foo : Symbol(C.foo, Decl(callWithSpreadES6.ts, 35, 5)) + + super.foo(1, 2, ...a); +>super.foo : Symbol(C.foo, Decl(callWithSpreadES6.ts, 35, 5)) +>super : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>foo : Symbol(C.foo, Decl(callWithSpreadES6.ts, 35, 5)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + } +} + +// Only supported in when target is ES6 +var c = new C(1, 2, ...a); +>c : Symbol(c, Decl(callWithSpreadES6.ts, 52, 3)) +>C : Symbol(C, Decl(callWithSpreadES6.ts, 29, 40)) +>a : Symbol(a, Decl(callWithSpreadES6.ts, 8, 3)) + diff --git a/tests/baselines/reference/callWithSpreadES6.types b/tests/baselines/reference/callWithSpreadES6.types index 10dd611d213..71d3cf9b2df 100644 --- a/tests/baselines/reference/callWithSpreadES6.types +++ b/tests/baselines/reference/callWithSpreadES6.types @@ -34,30 +34,43 @@ var xa: X[]; foo(1, 2, "abc"); >foo(1, 2, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number +>"abc" : string foo(1, 2, ...a); >foo(1, 2, ...a) : void >foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number >...a : string >a : string[] foo(1, 2, ...a, "abc"); >foo(1, 2, ...a, "abc") : void >foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number >...a : string >a : string[] +>"abc" : string obj.foo(1, 2, "abc"); >obj.foo(1, 2, "abc") : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>"abc" : string obj.foo(1, 2, ...a); >obj.foo(1, 2, ...a) : any >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] @@ -66,8 +79,11 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] +>"abc" : string (obj.foo)(1, 2, "abc"); >(obj.foo)(1, 2, "abc") : any @@ -75,6 +91,9 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>"abc" : string (obj.foo)(1, 2, ...a); >(obj.foo)(1, 2, ...a) : any @@ -82,6 +101,8 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] @@ -91,22 +112,32 @@ obj.foo(1, 2, ...a, "abc"); >obj.foo : (x: number, y: number, ...z: string[]) => any >obj : X >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] +>"abc" : string xa[1].foo(1, 2, "abc"); >xa[1].foo(1, 2, "abc") : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] +>1 : number >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number +>"abc" : string xa[1].foo(1, 2, ...a); >xa[1].foo(1, 2, ...a) : any >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] +>1 : number >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] @@ -115,9 +146,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] +>1 : number >foo : (x: number, y: number, ...z: string[]) => any +>1 : number +>2 : number >...a : string >a : string[] +>"abc" : string (xa[1].foo)(...[1, 2, "abc"]); >(xa[1].foo)(...[1, 2, "abc"]) : any @@ -127,9 +162,13 @@ xa[1].foo(1, 2, ...a, "abc"); >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] +>1 : number >foo : (x: number, y: number, ...z: string[]) => any >...[1, 2, "abc"] : string | number >[1, 2, "abc"] : (string | number)[] +>1 : number +>2 : number +>"abc" : string class C { >C : C @@ -173,10 +212,14 @@ class D extends C { super(1, 2); >super(1, 2) : void >super : typeof C +>1 : number +>2 : number super(1, 2, ...a); >super(1, 2, ...a) : void >super : typeof C +>1 : number +>2 : number >...a : string >a : string[] } @@ -188,12 +231,16 @@ class D extends C { >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number super.foo(1, 2, ...a); >super.foo(1, 2, ...a) : void >super.foo : (x: number, y: number, ...z: string[]) => void >super : C >foo : (x: number, y: number, ...z: string[]) => void +>1 : number +>2 : number >...a : string >a : string[] } @@ -204,6 +251,8 @@ var c = new C(1, 2, ...a); >c : C >new C(1, 2, ...a) : C >C : typeof C +>1 : number +>2 : number >...a : string >a : string[] diff --git a/tests/baselines/reference/callbacksDontShareTypes.symbols b/tests/baselines/reference/callbacksDontShareTypes.symbols new file mode 100644 index 00000000000..80a5f234d38 --- /dev/null +++ b/tests/baselines/reference/callbacksDontShareTypes.symbols @@ -0,0 +1,100 @@ +=== tests/cases/compiler/callbacksDontShareTypes.ts === +interface Collection { +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 0, 21)) + + length: number; +>length : Symbol(length, Decl(callbacksDontShareTypes.ts, 0, 25)) + + add(x: T): void; +>add : Symbol(add, Decl(callbacksDontShareTypes.ts, 1, 19)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 2, 8)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 0, 21)) + + remove(x: T): boolean; +>remove : Symbol(remove, Decl(callbacksDontShareTypes.ts, 2, 20)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 3, 11)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 0, 21)) +} +interface Combinators { +>Combinators : Symbol(Combinators, Decl(callbacksDontShareTypes.ts, 4, 1)) + + map(c: Collection, f: (x: T) => U): Collection; +>map : Symbol(map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 6, 8)) +>U : Symbol(U, Decl(callbacksDontShareTypes.ts, 6, 10)) +>c : Symbol(c, Decl(callbacksDontShareTypes.ts, 6, 14)) +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 6, 8)) +>f : Symbol(f, Decl(callbacksDontShareTypes.ts, 6, 31)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 6, 36)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 6, 8)) +>U : Symbol(U, Decl(callbacksDontShareTypes.ts, 6, 10)) +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) +>U : Symbol(U, Decl(callbacksDontShareTypes.ts, 6, 10)) + + map(c: Collection, f: (x: T) => any): Collection; +>map : Symbol(map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 7, 8)) +>c : Symbol(c, Decl(callbacksDontShareTypes.ts, 7, 11)) +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 7, 8)) +>f : Symbol(f, Decl(callbacksDontShareTypes.ts, 7, 28)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 7, 33)) +>T : Symbol(T, Decl(callbacksDontShareTypes.ts, 7, 8)) +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) +} + +var _: Combinators; +>_ : Symbol(_, Decl(callbacksDontShareTypes.ts, 10, 3)) +>Combinators : Symbol(Combinators, Decl(callbacksDontShareTypes.ts, 4, 1)) + +var c2: Collection; +>c2 : Symbol(c2, Decl(callbacksDontShareTypes.ts, 11, 3)) +>Collection : Symbol(Collection, Decl(callbacksDontShareTypes.ts, 0, 0)) + +var rf1 = (x: number) => { return x.toFixed() }; +>rf1 : Symbol(rf1, Decl(callbacksDontShareTypes.ts, 13, 3)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 13, 11)) +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 13, 11)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + +var r1a = _.map(c2, (x) => { return x.toFixed() }); +>r1a : Symbol(r1a, Decl(callbacksDontShareTypes.ts, 14, 3)) +>_.map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>_ : Symbol(_, Decl(callbacksDontShareTypes.ts, 10, 3)) +>map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>c2 : Symbol(c2, Decl(callbacksDontShareTypes.ts, 11, 3)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 14, 21)) +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 14, 21)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + +var r1b = _.map(c2, rf1); // this line should not cause the following 2 to have errors +>r1b : Symbol(r1b, Decl(callbacksDontShareTypes.ts, 15, 3)) +>_.map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>_ : Symbol(_, Decl(callbacksDontShareTypes.ts, 10, 3)) +>map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>c2 : Symbol(c2, Decl(callbacksDontShareTypes.ts, 11, 3)) +>rf1 : Symbol(rf1, Decl(callbacksDontShareTypes.ts, 13, 3)) + +var r5a = _.map(c2, (x) => { return x.toFixed() }); +>r5a : Symbol(r5a, Decl(callbacksDontShareTypes.ts, 16, 3)) +>_.map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>_ : Symbol(_, Decl(callbacksDontShareTypes.ts, 10, 3)) +>map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>c2 : Symbol(c2, Decl(callbacksDontShareTypes.ts, 11, 3)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 16, 37)) +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(callbacksDontShareTypes.ts, 16, 37)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + +var r5b = _.map(c2, rf1); +>r5b : Symbol(r5b, Decl(callbacksDontShareTypes.ts, 17, 3)) +>_.map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>_ : Symbol(_, Decl(callbacksDontShareTypes.ts, 10, 3)) +>map : Symbol(Combinators.map, Decl(callbacksDontShareTypes.ts, 5, 23), Decl(callbacksDontShareTypes.ts, 6, 63)) +>c2 : Symbol(c2, Decl(callbacksDontShareTypes.ts, 11, 3)) +>rf1 : Symbol(rf1, Decl(callbacksDontShareTypes.ts, 13, 3)) + diff --git a/tests/baselines/reference/captureThisInSuperCall.symbols b/tests/baselines/reference/captureThisInSuperCall.symbols new file mode 100644 index 00000000000..bf1fd151b3c --- /dev/null +++ b/tests/baselines/reference/captureThisInSuperCall.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/captureThisInSuperCall.ts === +class A { +>A : Symbol(A, Decl(captureThisInSuperCall.ts, 0, 0)) + + constructor(p:any) {} +>p : Symbol(p, Decl(captureThisInSuperCall.ts, 1, 16)) +} + +class B extends A { +>B : Symbol(B, Decl(captureThisInSuperCall.ts, 2, 1)) +>A : Symbol(A, Decl(captureThisInSuperCall.ts, 0, 0)) + + constructor() { super({ test: () => this.someMethod()}); } +>super : Symbol(A, Decl(captureThisInSuperCall.ts, 0, 0)) +>test : Symbol(test, Decl(captureThisInSuperCall.ts, 5, 27)) +>this.someMethod : Symbol(someMethod, Decl(captureThisInSuperCall.ts, 5, 62)) +>this : Symbol(B, Decl(captureThisInSuperCall.ts, 2, 1)) +>someMethod : Symbol(someMethod, Decl(captureThisInSuperCall.ts, 5, 62)) + + someMethod() {} +>someMethod : Symbol(someMethod, Decl(captureThisInSuperCall.ts, 5, 62)) +} diff --git a/tests/baselines/reference/castExpressionParentheses.symbols b/tests/baselines/reference/castExpressionParentheses.symbols new file mode 100644 index 00000000000..7bc8169e40f --- /dev/null +++ b/tests/baselines/reference/castExpressionParentheses.symbols @@ -0,0 +1,68 @@ +=== tests/cases/compiler/castExpressionParentheses.ts === +declare var a; +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +// parentheses should be omitted +// literals +({a:0}); +>a : Symbol(a, Decl(castExpressionParentheses.ts, 4, 7)) + +([1,3,]); +("string"); +(23.0); +(/regexp/g); +(false); +(true); +(null); +// names and dotted names +(this); +(this.x); +((a).x); +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +(a); +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +(a[0]); +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +(a.b["0"]); +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +(a()).x; +>a : Symbol(a, Decl(castExpressionParentheses.ts, 0, 11)) + +declare var A; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +// should keep the parentheses in emit +(new A).foo; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +(typeof A).x; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +(-A).x; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +new (A()); +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +(()=> {})(); +>Tany : Symbol(Tany, Decl(castExpressionParentheses.ts, 28, 2)) + +(function foo() { })(); +>foo : Symbol(foo, Decl(castExpressionParentheses.ts, 29, 6)) + +(-A).x; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +// nested cast, should keep one pair of parenthese +((-A)).x; +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + +// nested parenthesized expression, should keep one pair of parenthese +((A)) +>A : Symbol(A, Decl(castExpressionParentheses.ts, 21, 11)) + + diff --git a/tests/baselines/reference/castExpressionParentheses.types b/tests/baselines/reference/castExpressionParentheses.types index 7004aef9c95..ab563a4e8b7 100644 --- a/tests/baselines/reference/castExpressionParentheses.types +++ b/tests/baselines/reference/castExpressionParentheses.types @@ -9,35 +9,44 @@ declare var a; >{a:0} : any >{a:0} : { a: number; } >a : number +>0 : number ([1,3,]); >([1,3,]) : any >[1,3,] : any >[1,3,] : number[] +>1 : number +>3 : number ("string"); >("string") : any >"string" : any +>"string" : string (23.0); >(23.0) : any >23.0 : any +>23.0 : number (/regexp/g); >(/regexp/g) : any >/regexp/g : any +>/regexp/g : RegExp (false); >(false) : any >false : any +>false : boolean (true); >(true) : any >true : any +>true : boolean (null); >(null) : any >null : any +>null : null // names and dotted names (this); @@ -72,6 +81,7 @@ declare var a; >a[0] : any >a[0] : any >a : any +>0 : number (a.b["0"]); >(a.b["0"]) : any @@ -80,6 +90,7 @@ declare var a; >a.b : any >a : any >b : any +>"0" : string (a()).x; >(a()).x : any diff --git a/tests/baselines/reference/castNewObjectBug.symbols b/tests/baselines/reference/castNewObjectBug.symbols new file mode 100644 index 00000000000..3db7f7e065a --- /dev/null +++ b/tests/baselines/reference/castNewObjectBug.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/castNewObjectBug.ts === +interface Foo { } +>Foo : Symbol(Foo, Decl(castNewObjectBug.ts, 0, 0)) + +var xx = new Object(); +>xx : Symbol(xx, Decl(castNewObjectBug.ts, 1, 3)) +>Foo : Symbol(Foo, Decl(castNewObjectBug.ts, 0, 0)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + diff --git a/tests/baselines/reference/castParentheses.symbols b/tests/baselines/reference/castParentheses.symbols new file mode 100644 index 00000000000..6447c8721e2 --- /dev/null +++ b/tests/baselines/reference/castParentheses.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/castParentheses.ts === +class a { +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) + + static b: any; +>b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) +} + +var b = (a); +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) + +var b = (a).b; +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) + +var b = (a.b).c; +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a.b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) +>b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) + +var b = (a.b()).c; +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a.b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) +>b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) + +var b = (new a); +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) + +var b = (new a.b); +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a.b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) +>b : Symbol(a.b, Decl(castParentheses.ts, 0, 9)) + +var b = (new a).b +>b : Symbol(b, Decl(castParentheses.ts, 4, 3), Decl(castParentheses.ts, 5, 3), Decl(castParentheses.ts, 6, 3), Decl(castParentheses.ts, 7, 3), Decl(castParentheses.ts, 8, 3), Decl(castParentheses.ts, 9, 3), Decl(castParentheses.ts, 10, 3)) +>a : Symbol(a, Decl(castParentheses.ts, 0, 0)) + diff --git a/tests/baselines/reference/castTest.symbols b/tests/baselines/reference/castTest.symbols new file mode 100644 index 00000000000..e0bf154820e --- /dev/null +++ b/tests/baselines/reference/castTest.symbols @@ -0,0 +1,85 @@ +=== tests/cases/compiler/castTest.ts === + +var x : any = 0; +>x : Symbol(x, Decl(castTest.ts, 1, 3)) + +var z = x; +>z : Symbol(z, Decl(castTest.ts, 2, 3)) +>x : Symbol(x, Decl(castTest.ts, 1, 3)) + +var y = x + z; +>y : Symbol(y, Decl(castTest.ts, 3, 3)) +>x : Symbol(x, Decl(castTest.ts, 1, 3)) +>z : Symbol(z, Decl(castTest.ts, 2, 3)) + +var a = 0; +>a : Symbol(a, Decl(castTest.ts, 5, 3)) + +var b = true; +>b : Symbol(b, Decl(castTest.ts, 6, 3)) + +var s = ""; +>s : Symbol(s, Decl(castTest.ts, 7, 3)) + +var ar = null; +>ar : Symbol(ar, Decl(castTest.ts, 9, 3)) + +var f = <(res : number) => void>null; +>f : Symbol(f, Decl(castTest.ts, 11, 3)) +>res : Symbol(res, Decl(castTest.ts, 11, 10)) + +declare class Point +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) +{ + x: number; +>x : Symbol(x, Decl(castTest.ts, 14, 1)) + + y: number; +>y : Symbol(y, Decl(castTest.ts, 15, 14)) + + add(dx: number, dy: number): Point; +>add : Symbol(add, Decl(castTest.ts, 16, 14)) +>dx : Symbol(dx, Decl(castTest.ts, 17, 8)) +>dy : Symbol(dy, Decl(castTest.ts, 17, 19)) +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) + + mult(p: Point): Point; +>mult : Symbol(mult, Decl(castTest.ts, 17, 39)) +>p : Symbol(p, Decl(castTest.ts, 18, 9)) +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) + + constructor(x: number, y: number); +>x : Symbol(x, Decl(castTest.ts, 19, 16)) +>y : Symbol(y, Decl(castTest.ts, 19, 26)) +} + +var p_cast = ({ +>p_cast : Symbol(p_cast, Decl(castTest.ts, 22, 3)) +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) + + x: 0, +>x : Symbol(x, Decl(castTest.ts, 22, 23)) + + y: 0, +>y : Symbol(y, Decl(castTest.ts, 23, 9)) + + add: function(dx, dy) { +>add : Symbol(add, Decl(castTest.ts, 24, 9)) +>dx : Symbol(dx, Decl(castTest.ts, 25, 18)) +>dy : Symbol(dy, Decl(castTest.ts, 25, 21)) + + return new Point(this.x + dx, this.y + dy); +>Point : Symbol(Point, Decl(castTest.ts, 11, 37)) +>dx : Symbol(dx, Decl(castTest.ts, 25, 18)) +>dy : Symbol(dy, Decl(castTest.ts, 25, 21)) + + }, + mult: function(p) { return p; } +>mult : Symbol(mult, Decl(castTest.ts, 27, 6)) +>p : Symbol(p, Decl(castTest.ts, 28, 19)) +>p : Symbol(p, Decl(castTest.ts, 28, 19)) + +}) + + diff --git a/tests/baselines/reference/castTest.types b/tests/baselines/reference/castTest.types index 8250bec362d..35698219fd4 100644 --- a/tests/baselines/reference/castTest.types +++ b/tests/baselines/reference/castTest.types @@ -2,6 +2,7 @@ var x : any = 0; >x : any +>0 : number var z = x; >z : number @@ -17,23 +18,28 @@ var y = x + z; var a = 0; >a : any >0 : any +>0 : number var b = true; >b : boolean >true : boolean +>true : boolean var s = ""; >s : string >"" : string +>"" : string var ar = null; >ar : any[] >null : any[] +>null : null var f = <(res : number) => void>null; >f : (res: number) => void ><(res : number) => void>null : (res: number) => void >res : number +>null : null declare class Point >Point : Point @@ -70,9 +76,11 @@ var p_cast = ({ x: 0, >x : number +>0 : number y: 0, >y : number +>0 : number add: function(dx, dy) { >add : (dx: number, dy: number) => Point diff --git a/tests/baselines/reference/catch.symbols b/tests/baselines/reference/catch.symbols new file mode 100644 index 00000000000..155d262af58 --- /dev/null +++ b/tests/baselines/reference/catch.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/catch.ts === +function f() { +>f : Symbol(f, Decl(catch.ts, 0, 0)) + + try {} catch(e) { } +>e : Symbol(e, Decl(catch.ts, 1, 17)) + + try {} catch(e) { } +>e : Symbol(e, Decl(catch.ts, 2, 17)) +} + diff --git a/tests/baselines/reference/cf.symbols b/tests/baselines/reference/cf.symbols new file mode 100644 index 00000000000..9c2d73f5134 --- /dev/null +++ b/tests/baselines/reference/cf.symbols @@ -0,0 +1,111 @@ +=== tests/cases/compiler/cf.ts === +function f() { +>f : Symbol(f, Decl(cf.ts, 0, 0)) + + var z; +>z : Symbol(z, Decl(cf.ts, 1, 7)) + + var x=10; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + + var y=3; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + L1: for (var i=0;i<19;i++) { +>i : Symbol(i, Decl(cf.ts, 5, 16)) +>i : Symbol(i, Decl(cf.ts, 5, 16)) +>i : Symbol(i, Decl(cf.ts, 5, 16)) + + if (y==7) { +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + continue L1; + x=11; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + if (y==3) { +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + y++; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + } + else { + y--; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + } + do { + y+=2; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + if (y==20) { +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + break; + x=12; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + } while (y<41); +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + y++; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + } + while (y>2) { +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + y=y>>1; +>y : Symbol(y, Decl(cf.ts, 3, 7)) +>y : Symbol(y, Decl(cf.ts, 3, 7)) + } + L2: try { + L3: if (xx : Symbol(x, Decl(cf.ts, 2, 7)) +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + break L2; + x=13; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + else { + break L3; + x=14; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + } + catch (e) { +>e : Symbol(e, Decl(cf.ts, 38, 11)) + + x++; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + finally { + x+=3; +>x : Symbol(x, Decl(cf.ts, 2, 7)) + } + y++; +>y : Symbol(y, Decl(cf.ts, 3, 7)) + + for (var k=0;k<10;k++) { +>k : Symbol(k, Decl(cf.ts, 45, 12)) +>k : Symbol(k, Decl(cf.ts, 45, 12)) +>k : Symbol(k, Decl(cf.ts, 45, 12)) + + z; +>z : Symbol(z, Decl(cf.ts, 1, 7)) + + break; + } + for (k=0;k<10;k++) { +>k : Symbol(k, Decl(cf.ts, 45, 12)) +>k : Symbol(k, Decl(cf.ts, 45, 12)) +>k : Symbol(k, Decl(cf.ts, 45, 12)) + + if (k==6) { +>k : Symbol(k, Decl(cf.ts, 45, 12)) + + continue; + } + break; + } +} + diff --git a/tests/baselines/reference/cf.types b/tests/baselines/reference/cf.types index 62dcba0ba9a..397e3469ece 100644 --- a/tests/baselines/reference/cf.types +++ b/tests/baselines/reference/cf.types @@ -7,29 +7,39 @@ function f() { var x=10; >x : number +>10 : number var y=3; >y : number +>3 : number L1: for (var i=0;i<19;i++) { +>L1 : any >i : number +>0 : number >i<19 : boolean >i : number +>19 : number >i++ : number >i : number if (y==7) { >y==7 : boolean >y : number +>7 : number continue L1; +>L1 : any + x=11; >x=11 : number >x : number +>11 : number } if (y==3) { >y==3 : boolean >y : number +>3 : number y++; >y++ : number @@ -44,19 +54,23 @@ function f() { y+=2; >y+=2 : number >y : number +>2 : number if (y==20) { >y==20 : boolean >y : number +>20 : number break; x=12; >x=12 : number >x : number +>12 : number } } while (y<41); >y<41 : boolean >y : number +>41 : number y++; >y++ : number @@ -65,29 +79,40 @@ function f() { while (y>2) { >y>2 : boolean >y : number +>2 : number y=y>>1; >y=y>>1 : number >y : number >y>>1 : number >y : number +>1 : number } L2: try { +>L2 : any + L3: if (xL3 : any >xx : number >y : number break L2; +>L2 : any + x=13; >x=13 : number >x : number +>13 : number } else { break L3; +>L3 : any + x=14; >x=14 : number >x : number +>14 : number } } catch (e) { @@ -101,6 +126,7 @@ function f() { x+=3; >x+=3 : number >x : number +>3 : number } y++; >y++ : number @@ -108,8 +134,10 @@ function f() { for (var k=0;k<10;k++) { >k : number +>0 : number >k<10 : boolean >k : number +>10 : number >k++ : number >k : number @@ -121,14 +149,17 @@ function f() { for (k=0;k<10;k++) { >k=0 : number >k : number +>0 : number >k<10 : boolean >k : number +>10 : number >k++ : number >k : number if (k==6) { >k==6 : boolean >k : number +>6 : number continue; } diff --git a/tests/baselines/reference/chainedAssignment2.symbols b/tests/baselines/reference/chainedAssignment2.symbols new file mode 100644 index 00000000000..84eb8428a64 --- /dev/null +++ b/tests/baselines/reference/chainedAssignment2.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/chainedAssignment2.ts === +var a: string; +>a : Symbol(a, Decl(chainedAssignment2.ts, 0, 3)) + +var b: number; +>b : Symbol(b, Decl(chainedAssignment2.ts, 1, 3)) + +var c: boolean; +>c : Symbol(c, Decl(chainedAssignment2.ts, 2, 3)) + +var d: Date; +>d : Symbol(d, Decl(chainedAssignment2.ts, 3, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var e: RegExp; +>e : Symbol(e, Decl(chainedAssignment2.ts, 4, 3)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +a = b = c = d = e = null; +>a : Symbol(a, Decl(chainedAssignment2.ts, 0, 3)) +>b : Symbol(b, Decl(chainedAssignment2.ts, 1, 3)) +>c : Symbol(c, Decl(chainedAssignment2.ts, 2, 3)) +>d : Symbol(d, Decl(chainedAssignment2.ts, 3, 3)) +>e : Symbol(e, Decl(chainedAssignment2.ts, 4, 3)) + + diff --git a/tests/baselines/reference/chainedAssignment2.types b/tests/baselines/reference/chainedAssignment2.types index 3ddd7412b9c..c53c64143d9 100644 --- a/tests/baselines/reference/chainedAssignment2.types +++ b/tests/baselines/reference/chainedAssignment2.types @@ -27,5 +27,6 @@ a = b = c = d = e = null; >d : Date >e = null : null >e : RegExp +>null : null diff --git a/tests/baselines/reference/chainedImportAlias.symbols b/tests/baselines/reference/chainedImportAlias.symbols new file mode 100644 index 00000000000..3aebb4502f8 --- /dev/null +++ b/tests/baselines/reference/chainedImportAlias.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/chainedImportAlias_file1.ts === +import x = require('chainedImportAlias_file0'); +>x : Symbol(x, Decl(chainedImportAlias_file1.ts, 0, 0)) + +import y = x; +>y : Symbol(y, Decl(chainedImportAlias_file1.ts, 0, 47)) +>x : Symbol(x, Decl(chainedImportAlias_file0.ts, 0, 0)) + +y.m.foo(); +>y.m.foo : Symbol(x.m.foo, Decl(chainedImportAlias_file0.ts, 0, 17)) +>y.m : Symbol(x.m, Decl(chainedImportAlias_file0.ts, 0, 0)) +>y : Symbol(y, Decl(chainedImportAlias_file1.ts, 0, 47)) +>m : Symbol(x.m, Decl(chainedImportAlias_file0.ts, 0, 0)) +>foo : Symbol(x.m.foo, Decl(chainedImportAlias_file0.ts, 0, 17)) + +=== tests/cases/compiler/chainedImportAlias_file0.ts === +export module m { +>m : Symbol(m, Decl(chainedImportAlias_file0.ts, 0, 0)) + + export function foo() { } +>foo : Symbol(foo, Decl(chainedImportAlias_file0.ts, 0, 17)) +} + diff --git a/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.symbols b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.symbols new file mode 100644 index 00000000000..5eb563d3ef6 --- /dev/null +++ b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.symbols @@ -0,0 +1,67 @@ +=== tests/cases/compiler/chainedSpecializationToObjectTypeLiteral.ts === +interface Sequence { +>Sequence : Symbol(Sequence, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 0)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) + + each(iterator: (value: T) => void): void; +>each : Symbol(each, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 23)) +>iterator : Symbol(iterator, Decl(chainedSpecializationToObjectTypeLiteral.ts, 1, 9)) +>value : Symbol(value, Decl(chainedSpecializationToObjectTypeLiteral.ts, 1, 20)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) + + map(iterator: (value: T) => U): Sequence; +>map : Symbol(map, Decl(chainedSpecializationToObjectTypeLiteral.ts, 1, 45)) +>U : Symbol(U, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 8)) +>iterator : Symbol(iterator, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 11)) +>value : Symbol(value, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 22)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) +>U : Symbol(U, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 8)) +>Sequence : Symbol(Sequence, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 0)) +>U : Symbol(U, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 8)) + + filter(iterator: (value: T) => boolean): Sequence; +>filter : Symbol(filter, Decl(chainedSpecializationToObjectTypeLiteral.ts, 2, 51)) +>iterator : Symbol(iterator, Decl(chainedSpecializationToObjectTypeLiteral.ts, 3, 11)) +>value : Symbol(value, Decl(chainedSpecializationToObjectTypeLiteral.ts, 3, 22)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) +>Sequence : Symbol(Sequence, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 0)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) + + groupBy(keySelector: (value: T) => K): Sequence<{ key: K; items: T[]; }>; +>groupBy : Symbol(groupBy, Decl(chainedSpecializationToObjectTypeLiteral.ts, 3, 57)) +>K : Symbol(K, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 12)) +>keySelector : Symbol(keySelector, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 15)) +>value : Symbol(value, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 29)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) +>K : Symbol(K, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 12)) +>Sequence : Symbol(Sequence, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 0)) +>key : Symbol(key, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 56)) +>K : Symbol(K, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 12)) +>items : Symbol(items, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 64)) +>T : Symbol(T, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 19)) +} + +var s: Sequence; +>s : Symbol(s, Decl(chainedSpecializationToObjectTypeLiteral.ts, 7, 3)) +>Sequence : Symbol(Sequence, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 0)) + +var s2 = s.groupBy(s => s.length); +>s2 : Symbol(s2, Decl(chainedSpecializationToObjectTypeLiteral.ts, 8, 3)) +>s.groupBy : Symbol(Sequence.groupBy, Decl(chainedSpecializationToObjectTypeLiteral.ts, 3, 57)) +>s : Symbol(s, Decl(chainedSpecializationToObjectTypeLiteral.ts, 7, 3)) +>groupBy : Symbol(Sequence.groupBy, Decl(chainedSpecializationToObjectTypeLiteral.ts, 3, 57)) +>s : Symbol(s, Decl(chainedSpecializationToObjectTypeLiteral.ts, 8, 19)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(chainedSpecializationToObjectTypeLiteral.ts, 8, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + +var s3 = s2.each(x => { x.key /* Type is K, should be number */ }); +>s3 : Symbol(s3, Decl(chainedSpecializationToObjectTypeLiteral.ts, 9, 3)) +>s2.each : Symbol(Sequence.each, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 23)) +>s2 : Symbol(s2, Decl(chainedSpecializationToObjectTypeLiteral.ts, 8, 3)) +>each : Symbol(Sequence.each, Decl(chainedSpecializationToObjectTypeLiteral.ts, 0, 23)) +>x : Symbol(x, Decl(chainedSpecializationToObjectTypeLiteral.ts, 9, 17)) +>x.key : Symbol(key, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 56)) +>x : Symbol(x, Decl(chainedSpecializationToObjectTypeLiteral.ts, 9, 17)) +>key : Symbol(key, Decl(chainedSpecializationToObjectTypeLiteral.ts, 4, 56)) + diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination.symbols b/tests/baselines/reference/checkInfiniteExpansionTermination.symbols new file mode 100644 index 00000000000..52ba8ad698e --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/checkInfiniteExpansionTermination.ts === +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination.ts, 3, 22)) + + n: IObservable; // Needed, must be T[] +>n : Symbol(n, Decl(checkInfiniteExpansionTermination.ts, 3, 26)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination.ts, 3, 22)) +} + +// Needed +interface ISubject extends IObservable { } +>ISubject : Symbol(ISubject, Decl(checkInfiniteExpansionTermination.ts, 5, 1)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination.ts, 8, 19)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination.ts, 8, 19)) + +interface Foo { x } +>Foo : Symbol(Foo, Decl(checkInfiniteExpansionTermination.ts, 8, 48)) +>x : Symbol(x, Decl(checkInfiniteExpansionTermination.ts, 10, 15)) + +interface Bar { y } +>Bar : Symbol(Bar, Decl(checkInfiniteExpansionTermination.ts, 10, 19)) +>y : Symbol(y, Decl(checkInfiniteExpansionTermination.ts, 11, 15)) + +var values: IObservable; +>values : Symbol(values, Decl(checkInfiniteExpansionTermination.ts, 13, 3)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination.ts, 0, 0)) +>Foo : Symbol(Foo, Decl(checkInfiniteExpansionTermination.ts, 8, 48)) + +var values2: ISubject; +>values2 : Symbol(values2, Decl(checkInfiniteExpansionTermination.ts, 14, 3)) +>ISubject : Symbol(ISubject, Decl(checkInfiniteExpansionTermination.ts, 5, 1)) +>Bar : Symbol(Bar, Decl(checkInfiniteExpansionTermination.ts, 10, 19)) + +values = values2; +>values : Symbol(values, Decl(checkInfiniteExpansionTermination.ts, 13, 3)) +>values2 : Symbol(values2, Decl(checkInfiniteExpansionTermination.ts, 14, 3)) + diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination2.symbols b/tests/baselines/reference/checkInfiniteExpansionTermination2.symbols new file mode 100644 index 00000000000..c4fe17a09a6 --- /dev/null +++ b/tests/baselines/reference/checkInfiniteExpansionTermination2.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/checkInfiniteExpansionTermination2.ts === +// Regression test for #1002 +// Before fix this code would cause infinite loop + +interface IObservable { +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 3, 22)) + + n: IObservable; +>n : Symbol(n, Decl(checkInfiniteExpansionTermination2.ts, 3, 26)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 3, 22)) +} +interface ISubject extends IObservable { } +>ISubject : Symbol(ISubject, Decl(checkInfiniteExpansionTermination2.ts, 5, 1)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 6, 19)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 6, 19)) + +declare function combineLatest(x: IObservable[]): void; +>combineLatest : Symbol(combineLatest, Decl(checkInfiniteExpansionTermination2.ts, 6, 48), Decl(checkInfiniteExpansionTermination2.ts, 8, 71)) +>TOther : Symbol(TOther, Decl(checkInfiniteExpansionTermination2.ts, 8, 31)) +>x : Symbol(x, Decl(checkInfiniteExpansionTermination2.ts, 8, 39)) +>IObservable : Symbol(IObservable, Decl(checkInfiniteExpansionTermination2.ts, 0, 0)) +>TOther : Symbol(TOther, Decl(checkInfiniteExpansionTermination2.ts, 8, 31)) + +declare function combineLatest(): void; +>combineLatest : Symbol(combineLatest, Decl(checkInfiniteExpansionTermination2.ts, 6, 48), Decl(checkInfiniteExpansionTermination2.ts, 8, 71)) + +function fn() { +>fn : Symbol(fn, Decl(checkInfiniteExpansionTermination2.ts, 9, 39)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 11, 12)) + + var values: ISubject[] = []; +>values : Symbol(values, Decl(checkInfiniteExpansionTermination2.ts, 12, 7)) +>ISubject : Symbol(ISubject, Decl(checkInfiniteExpansionTermination2.ts, 5, 1)) + + // Hang when using , but not + combineLatest(values); +>combineLatest : Symbol(combineLatest, Decl(checkInfiniteExpansionTermination2.ts, 6, 48), Decl(checkInfiniteExpansionTermination2.ts, 8, 71)) +>T : Symbol(T, Decl(checkInfiniteExpansionTermination2.ts, 11, 12)) +>values : Symbol(values, Decl(checkInfiniteExpansionTermination2.ts, 12, 7)) +} + diff --git a/tests/baselines/reference/checkInterfaceBases.symbols b/tests/baselines/reference/checkInterfaceBases.symbols new file mode 100644 index 00000000000..6b5f987b0bc --- /dev/null +++ b/tests/baselines/reference/checkInterfaceBases.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/app.ts === +/// +interface SecondEvent { +>SecondEvent : Symbol(SecondEvent, Decl(app.ts, 0, 0)) + + data: any; +>data : Symbol(data, Decl(app.ts, 1, 23)) +} +interface Third extends JQueryEventObjectTest, SecondEvent {} +>Third : Symbol(Third, Decl(app.ts, 3, 1)) +>JQueryEventObjectTest : Symbol(JQueryEventObjectTest, Decl(jquery.d.ts, 0, 0)) +>SecondEvent : Symbol(SecondEvent, Decl(app.ts, 0, 0)) + +=== tests/cases/compiler/jquery.d.ts === +interface JQueryEventObjectTest { +>JQueryEventObjectTest : Symbol(JQueryEventObjectTest, Decl(jquery.d.ts, 0, 0)) + + data: any; +>data : Symbol(data, Decl(jquery.d.ts, 0, 33)) + + which: number; +>which : Symbol(which, Decl(jquery.d.ts, 1, 14)) + + metaKey: any; +>metaKey : Symbol(metaKey, Decl(jquery.d.ts, 2, 18)) +} + diff --git a/tests/baselines/reference/circularImportAlias.symbols b/tests/baselines/reference/circularImportAlias.symbols new file mode 100644 index 00000000000..6eaa4a7467e --- /dev/null +++ b/tests/baselines/reference/circularImportAlias.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/internalModules/importDeclarations/circularImportAlias.ts === +// expected no error + +module B { +>B : Symbol(a.b, Decl(circularImportAlias.ts, 0, 0)) + + export import a = A; +>a : Symbol(a, Decl(circularImportAlias.ts, 2, 10)) +>A : Symbol(a, Decl(circularImportAlias.ts, 7, 1)) + + export class D extends a.C { +>D : Symbol(D, Decl(circularImportAlias.ts, 3, 24)) +>a.C : Symbol(a.C, Decl(circularImportAlias.ts, 9, 10)) +>a : Symbol(a, Decl(circularImportAlias.ts, 2, 10)) +>C : Symbol(a.C, Decl(circularImportAlias.ts, 9, 10)) + + id: number; +>id : Symbol(id, Decl(circularImportAlias.ts, 4, 32)) + } +} + +module A { +>A : Symbol(b.a, Decl(circularImportAlias.ts, 7, 1)) + + export class C { name: string } +>C : Symbol(C, Decl(circularImportAlias.ts, 9, 10)) +>name : Symbol(name, Decl(circularImportAlias.ts, 10, 20)) + + export import b = B; +>b : Symbol(b, Decl(circularImportAlias.ts, 10, 35)) +>B : Symbol(b, Decl(circularImportAlias.ts, 0, 0)) +} + +var c: { name: string }; +>c : Symbol(c, Decl(circularImportAlias.ts, 14, 3), Decl(circularImportAlias.ts, 15, 3)) +>name : Symbol(name, Decl(circularImportAlias.ts, 14, 8)) + +var c = new B.a.C(); +>c : Symbol(c, Decl(circularImportAlias.ts, 14, 3), Decl(circularImportAlias.ts, 15, 3)) +>B.a.C : Symbol(A.C, Decl(circularImportAlias.ts, 9, 10)) +>B.a : Symbol(B.a, Decl(circularImportAlias.ts, 2, 10)) +>B : Symbol(B, Decl(circularImportAlias.ts, 0, 0)) +>a : Symbol(B.a, Decl(circularImportAlias.ts, 2, 10)) +>C : Symbol(A.C, Decl(circularImportAlias.ts, 9, 10)) + + + diff --git a/tests/baselines/reference/circularImportAlias.types b/tests/baselines/reference/circularImportAlias.types index b61f91d460e..3ab41f6187b 100644 --- a/tests/baselines/reference/circularImportAlias.types +++ b/tests/baselines/reference/circularImportAlias.types @@ -10,6 +10,7 @@ module B { export class D extends a.C { >D : D +>a.C : any >a : typeof a >C : a.C diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.symbols b/tests/baselines/reference/classAppearsToHaveMembersOfObject.symbols new file mode 100644 index 00000000000..c035b17bcc6 --- /dev/null +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classAppearsToHaveMembersOfObject.ts === +class C { foo: string; } +>C : Symbol(C, Decl(classAppearsToHaveMembersOfObject.ts, 0, 0)) +>foo : Symbol(foo, Decl(classAppearsToHaveMembersOfObject.ts, 0, 9)) + +var c: C; +>c : Symbol(c, Decl(classAppearsToHaveMembersOfObject.ts, 2, 3)) +>C : Symbol(C, Decl(classAppearsToHaveMembersOfObject.ts, 0, 0)) + +var r = c.toString(); +>r : Symbol(r, Decl(classAppearsToHaveMembersOfObject.ts, 3, 3)) +>c.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>c : Symbol(c, Decl(classAppearsToHaveMembersOfObject.ts, 2, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r2 = c.hasOwnProperty(''); +>r2 : Symbol(r2, Decl(classAppearsToHaveMembersOfObject.ts, 4, 3)) +>c.hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) +>c : Symbol(c, Decl(classAppearsToHaveMembersOfObject.ts, 2, 3)) +>hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) + +var o: Object = c; +>o : Symbol(o, Decl(classAppearsToHaveMembersOfObject.ts, 5, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>c : Symbol(c, Decl(classAppearsToHaveMembersOfObject.ts, 2, 3)) + +var o2: {} = c; +>o2 : Symbol(o2, Decl(classAppearsToHaveMembersOfObject.ts, 6, 3)) +>c : Symbol(c, Decl(classAppearsToHaveMembersOfObject.ts, 2, 3)) + diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.types b/tests/baselines/reference/classAppearsToHaveMembersOfObject.types index fe4079bbfcf..65c37e7dfeb 100644 --- a/tests/baselines/reference/classAppearsToHaveMembersOfObject.types +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.types @@ -20,6 +20,7 @@ var r2 = c.hasOwnProperty(''); >c.hasOwnProperty : (v: string) => boolean >c : C >hasOwnProperty : (v: string) => boolean +>'' : string var o: Object = c; >o : Object diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.symbols b/tests/baselines/reference/classConstructorParametersAccessibility3.symbols new file mode 100644 index 00000000000..b2888528e7e --- /dev/null +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.symbols @@ -0,0 +1,35 @@ +=== tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility3.ts === +class Base { +>Base : Symbol(Base, Decl(classConstructorParametersAccessibility3.ts, 0, 0)) + + constructor(protected p: number) { } +>p : Symbol(p, Decl(classConstructorParametersAccessibility3.ts, 1, 16)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(classConstructorParametersAccessibility3.ts, 2, 1)) +>Base : Symbol(Base, Decl(classConstructorParametersAccessibility3.ts, 0, 0)) + + constructor(public p: number) { +>p : Symbol(p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) + + super(p); +>super : Symbol(Base, Decl(classConstructorParametersAccessibility3.ts, 0, 0)) +>p : Symbol(p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) + + this.p; // OK +>this.p : Symbol(p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) +>this : Symbol(Derived, Decl(classConstructorParametersAccessibility3.ts, 2, 1)) +>p : Symbol(p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) + } +} + +var d: Derived; +>d : Symbol(d, Decl(classConstructorParametersAccessibility3.ts, 11, 3)) +>Derived : Symbol(Derived, Decl(classConstructorParametersAccessibility3.ts, 2, 1)) + +d.p; // public, OK +>d.p : Symbol(Derived.p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) +>d : Symbol(d, Decl(classConstructorParametersAccessibility3.ts, 11, 3)) +>p : Symbol(Derived.p, Decl(classConstructorParametersAccessibility3.ts, 5, 16)) + diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.symbols b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.symbols new file mode 100644 index 00000000000..c30ed9c674d --- /dev/null +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/classDeclarationMergedInModuleWithContinuation.ts === +module M { +>M : Symbol(M, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 0), Decl(classDeclarationMergedInModuleWithContinuation.ts, 5, 1)) + + export class N { } +>N : Symbol(N, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 10), Decl(classDeclarationMergedInModuleWithContinuation.ts, 1, 22)) + + export module N { +>N : Symbol(N, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 10), Decl(classDeclarationMergedInModuleWithContinuation.ts, 1, 22)) + + export var v = 0; +>v : Symbol(v, Decl(classDeclarationMergedInModuleWithContinuation.ts, 3, 18)) + } +} + +module M { +>M : Symbol(M, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 0), Decl(classDeclarationMergedInModuleWithContinuation.ts, 5, 1)) + + export class O extends M.N { +>O : Symbol(O, Decl(classDeclarationMergedInModuleWithContinuation.ts, 7, 10)) +>M.N : Symbol(N, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 10), Decl(classDeclarationMergedInModuleWithContinuation.ts, 1, 22)) +>M : Symbol(M, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 0), Decl(classDeclarationMergedInModuleWithContinuation.ts, 5, 1)) +>N : Symbol(N, Decl(classDeclarationMergedInModuleWithContinuation.ts, 0, 10), Decl(classDeclarationMergedInModuleWithContinuation.ts, 1, 22)) + } +} diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types index 623515a7ec0..f1be8e6d268 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.types @@ -10,6 +10,7 @@ module M { export var v = 0; >v : number +>0 : number } } @@ -18,6 +19,7 @@ module M { export class O extends M.N { >O : O +>M.N : any >M : typeof M >N : N } diff --git a/tests/baselines/reference/classDoesNotDependOnPrivateMember.symbols b/tests/baselines/reference/classDoesNotDependOnPrivateMember.symbols new file mode 100644 index 00000000000..ca042499c05 --- /dev/null +++ b/tests/baselines/reference/classDoesNotDependOnPrivateMember.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/declarationEmit/classDoesNotDependOnPrivateMember.ts === +module M { +>M : Symbol(M, Decl(classDoesNotDependOnPrivateMember.ts, 0, 0)) + + interface I { } +>I : Symbol(I, Decl(classDoesNotDependOnPrivateMember.ts, 0, 10)) + + export class C { +>C : Symbol(C, Decl(classDoesNotDependOnPrivateMember.ts, 1, 19)) + + private x: I; +>x : Symbol(x, Decl(classDoesNotDependOnPrivateMember.ts, 2, 20)) +>I : Symbol(I, Decl(classDoesNotDependOnPrivateMember.ts, 0, 10)) + } +} diff --git a/tests/baselines/reference/classExtendingClass.symbols b/tests/baselines/reference/classExtendingClass.symbols new file mode 100644 index 00000000000..3c79887d163 --- /dev/null +++ b/tests/baselines/reference/classExtendingClass.symbols @@ -0,0 +1,108 @@ +=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingClass.ts === +class C { +>C : Symbol(C, Decl(classExtendingClass.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(classExtendingClass.ts, 0, 9)) + + thing() { } +>thing : Symbol(thing, Decl(classExtendingClass.ts, 1, 16)) + + static other() { } +>other : Symbol(C.other, Decl(classExtendingClass.ts, 2, 15)) +} + +class D extends C { +>D : Symbol(D, Decl(classExtendingClass.ts, 4, 1)) +>C : Symbol(C, Decl(classExtendingClass.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(classExtendingClass.ts, 6, 19)) +} + +var d: D; +>d : Symbol(d, Decl(classExtendingClass.ts, 10, 3)) +>D : Symbol(D, Decl(classExtendingClass.ts, 4, 1)) + +var r = d.foo; +>r : Symbol(r, Decl(classExtendingClass.ts, 11, 3)) +>d.foo : Symbol(C.foo, Decl(classExtendingClass.ts, 0, 9)) +>d : Symbol(d, Decl(classExtendingClass.ts, 10, 3)) +>foo : Symbol(C.foo, Decl(classExtendingClass.ts, 0, 9)) + +var r2 = d.bar; +>r2 : Symbol(r2, Decl(classExtendingClass.ts, 12, 3)) +>d.bar : Symbol(D.bar, Decl(classExtendingClass.ts, 6, 19)) +>d : Symbol(d, Decl(classExtendingClass.ts, 10, 3)) +>bar : Symbol(D.bar, Decl(classExtendingClass.ts, 6, 19)) + +var r3 = d.thing(); +>r3 : Symbol(r3, Decl(classExtendingClass.ts, 13, 3)) +>d.thing : Symbol(C.thing, Decl(classExtendingClass.ts, 1, 16)) +>d : Symbol(d, Decl(classExtendingClass.ts, 10, 3)) +>thing : Symbol(C.thing, Decl(classExtendingClass.ts, 1, 16)) + +var r4 = D.other(); +>r4 : Symbol(r4, Decl(classExtendingClass.ts, 14, 3)) +>D.other : Symbol(C.other, Decl(classExtendingClass.ts, 2, 15)) +>D : Symbol(D, Decl(classExtendingClass.ts, 4, 1)) +>other : Symbol(C.other, Decl(classExtendingClass.ts, 2, 15)) + +class C2 { +>C2 : Symbol(C2, Decl(classExtendingClass.ts, 14, 19)) +>T : Symbol(T, Decl(classExtendingClass.ts, 16, 9)) + + foo: T; +>foo : Symbol(foo, Decl(classExtendingClass.ts, 16, 13)) +>T : Symbol(T, Decl(classExtendingClass.ts, 16, 9)) + + thing(x: T) { } +>thing : Symbol(thing, Decl(classExtendingClass.ts, 17, 11)) +>x : Symbol(x, Decl(classExtendingClass.ts, 18, 10)) +>T : Symbol(T, Decl(classExtendingClass.ts, 16, 9)) + + static other(x: T) { } +>other : Symbol(C2.other, Decl(classExtendingClass.ts, 18, 19)) +>T : Symbol(T, Decl(classExtendingClass.ts, 19, 17)) +>x : Symbol(x, Decl(classExtendingClass.ts, 19, 20)) +>T : Symbol(T, Decl(classExtendingClass.ts, 19, 17)) +} + +class D2 extends C2 { +>D2 : Symbol(D2, Decl(classExtendingClass.ts, 20, 1)) +>T : Symbol(T, Decl(classExtendingClass.ts, 22, 9)) +>C2 : Symbol(C2, Decl(classExtendingClass.ts, 14, 19)) +>T : Symbol(T, Decl(classExtendingClass.ts, 22, 9)) + + bar: string; +>bar : Symbol(bar, Decl(classExtendingClass.ts, 22, 27)) +} + +var d2: D2; +>d2 : Symbol(d2, Decl(classExtendingClass.ts, 26, 3)) +>D2 : Symbol(D2, Decl(classExtendingClass.ts, 20, 1)) + +var r5 = d2.foo; +>r5 : Symbol(r5, Decl(classExtendingClass.ts, 27, 3)) +>d2.foo : Symbol(C2.foo, Decl(classExtendingClass.ts, 16, 13)) +>d2 : Symbol(d2, Decl(classExtendingClass.ts, 26, 3)) +>foo : Symbol(C2.foo, Decl(classExtendingClass.ts, 16, 13)) + +var r6 = d2.bar; +>r6 : Symbol(r6, Decl(classExtendingClass.ts, 28, 3)) +>d2.bar : Symbol(D2.bar, Decl(classExtendingClass.ts, 22, 27)) +>d2 : Symbol(d2, Decl(classExtendingClass.ts, 26, 3)) +>bar : Symbol(D2.bar, Decl(classExtendingClass.ts, 22, 27)) + +var r7 = d2.thing(''); +>r7 : Symbol(r7, Decl(classExtendingClass.ts, 29, 3)) +>d2.thing : Symbol(C2.thing, Decl(classExtendingClass.ts, 17, 11)) +>d2 : Symbol(d2, Decl(classExtendingClass.ts, 26, 3)) +>thing : Symbol(C2.thing, Decl(classExtendingClass.ts, 17, 11)) + +var r8 = D2.other(1); +>r8 : Symbol(r8, Decl(classExtendingClass.ts, 30, 3)) +>D2.other : Symbol(C2.other, Decl(classExtendingClass.ts, 18, 19)) +>D2 : Symbol(D2, Decl(classExtendingClass.ts, 20, 1)) +>other : Symbol(C2.other, Decl(classExtendingClass.ts, 18, 19)) + diff --git a/tests/baselines/reference/classExtendingClass.types b/tests/baselines/reference/classExtendingClass.types index 7eaaaecf17f..f91493e97fd 100644 --- a/tests/baselines/reference/classExtendingClass.types +++ b/tests/baselines/reference/classExtendingClass.types @@ -102,6 +102,7 @@ var r7 = d2.thing(''); >d2.thing : (x: string) => void >d2 : D2 >thing : (x: string) => void +>'' : string var r8 = D2.other(1); >r8 : void @@ -109,4 +110,5 @@ var r8 = D2.other(1); >D2.other : (x: T) => void >D2 : typeof D2 >other : (x: T) => void +>1 : number diff --git a/tests/baselines/reference/classExtendingQualifiedName2.symbols b/tests/baselines/reference/classExtendingQualifiedName2.symbols new file mode 100644 index 00000000000..a4c33530817 --- /dev/null +++ b/tests/baselines/reference/classExtendingQualifiedName2.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/classExtendingQualifiedName2.ts === +module M { +>M : Symbol(M, Decl(classExtendingQualifiedName2.ts, 0, 0)) + + export class C { +>C : Symbol(C, Decl(classExtendingQualifiedName2.ts, 0, 10)) + } + + class D extends M.C { +>D : Symbol(D, Decl(classExtendingQualifiedName2.ts, 2, 5)) +>M.C : Symbol(C, Decl(classExtendingQualifiedName2.ts, 0, 10)) +>M : Symbol(M, Decl(classExtendingQualifiedName2.ts, 0, 0)) +>C : Symbol(C, Decl(classExtendingQualifiedName2.ts, 0, 10)) + } +} diff --git a/tests/baselines/reference/classExtendingQualifiedName2.types b/tests/baselines/reference/classExtendingQualifiedName2.types index ba96058d9b2..9f0c03db17d 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.types +++ b/tests/baselines/reference/classExtendingQualifiedName2.types @@ -8,6 +8,7 @@ module M { class D extends M.C { >D : D +>M.C : any >M : typeof M >C : C } diff --git a/tests/baselines/reference/classImplementingInterfaceIndexer.symbols b/tests/baselines/reference/classImplementingInterfaceIndexer.symbols new file mode 100644 index 00000000000..17fb9f9734b --- /dev/null +++ b/tests/baselines/reference/classImplementingInterfaceIndexer.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/classImplementingInterfaceIndexer.ts === +interface I { +>I : Symbol(I, Decl(classImplementingInterfaceIndexer.ts, 0, 0)) + + [index: string]: { prop } +>index : Symbol(index, Decl(classImplementingInterfaceIndexer.ts, 1, 5)) +>prop : Symbol(prop, Decl(classImplementingInterfaceIndexer.ts, 1, 22)) +} +class A implements I { +>A : Symbol(A, Decl(classImplementingInterfaceIndexer.ts, 2, 1)) +>I : Symbol(I, Decl(classImplementingInterfaceIndexer.ts, 0, 0)) + + [index: string]: { prop } +>index : Symbol(index, Decl(classImplementingInterfaceIndexer.ts, 4, 5)) +>prop : Symbol(prop, Decl(classImplementingInterfaceIndexer.ts, 4, 22)) +} diff --git a/tests/baselines/reference/classImplementsClass1.symbols b/tests/baselines/reference/classImplementsClass1.symbols new file mode 100644 index 00000000000..007f8b1741e --- /dev/null +++ b/tests/baselines/reference/classImplementsClass1.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/classImplementsClass1.ts === +class A { } +>A : Symbol(A, Decl(classImplementsClass1.ts, 0, 0)) + +class C implements A { } +>C : Symbol(C, Decl(classImplementsClass1.ts, 0, 11)) +>A : Symbol(A, Decl(classImplementsClass1.ts, 0, 0)) + diff --git a/tests/baselines/reference/classImplementsClass3.symbols b/tests/baselines/reference/classImplementsClass3.symbols new file mode 100644 index 00000000000..a1c565c8d53 --- /dev/null +++ b/tests/baselines/reference/classImplementsClass3.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/classImplementsClass3.ts === +class A { foo(): number { return 1; } } +>A : Symbol(A, Decl(classImplementsClass3.ts, 0, 0)) +>foo : Symbol(foo, Decl(classImplementsClass3.ts, 0, 9)) + +class C implements A { +>C : Symbol(C, Decl(classImplementsClass3.ts, 0, 39)) +>A : Symbol(A, Decl(classImplementsClass3.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(classImplementsClass3.ts, 1, 22)) + + return 1; + } +} + +class C2 extends A {} +>C2 : Symbol(C2, Decl(classImplementsClass3.ts, 5, 1)) +>A : Symbol(A, Decl(classImplementsClass3.ts, 0, 0)) + +// no errors +var c: C; +>c : Symbol(c, Decl(classImplementsClass3.ts, 10, 3)) +>C : Symbol(C, Decl(classImplementsClass3.ts, 0, 39)) + +var c2: C2; +>c2 : Symbol(c2, Decl(classImplementsClass3.ts, 11, 3)) +>C2 : Symbol(C2, Decl(classImplementsClass3.ts, 5, 1)) + +c = c2; +>c : Symbol(c, Decl(classImplementsClass3.ts, 10, 3)) +>c2 : Symbol(c2, Decl(classImplementsClass3.ts, 11, 3)) + +c2 = c; +>c2 : Symbol(c2, Decl(classImplementsClass3.ts, 11, 3)) +>c : Symbol(c, Decl(classImplementsClass3.ts, 10, 3)) + diff --git a/tests/baselines/reference/classImplementsClass3.types b/tests/baselines/reference/classImplementsClass3.types index 182ac535966..6f97a96a56e 100644 --- a/tests/baselines/reference/classImplementsClass3.types +++ b/tests/baselines/reference/classImplementsClass3.types @@ -2,6 +2,7 @@ class A { foo(): number { return 1; } } >A : A >foo : () => number +>1 : number class C implements A { >C : C @@ -11,6 +12,7 @@ class C implements A { >foo : () => number return 1; +>1 : number } } diff --git a/tests/baselines/reference/classImplementsImportedInterface.symbols b/tests/baselines/reference/classImplementsImportedInterface.symbols new file mode 100644 index 00000000000..a629d3c005d --- /dev/null +++ b/tests/baselines/reference/classImplementsImportedInterface.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/classImplementsImportedInterface.ts === +module M1 { +>M1 : Symbol(M1, Decl(classImplementsImportedInterface.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(classImplementsImportedInterface.ts, 0, 11)) + + foo(); +>foo : Symbol(foo, Decl(classImplementsImportedInterface.ts, 1, 24)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(classImplementsImportedInterface.ts, 4, 1)) + + import T = M1.I; +>T : Symbol(T, Decl(classImplementsImportedInterface.ts, 6, 11)) +>M1 : Symbol(M1, Decl(classImplementsImportedInterface.ts, 0, 0)) +>I : Symbol(T, Decl(classImplementsImportedInterface.ts, 0, 11)) + + class C implements T { +>C : Symbol(C, Decl(classImplementsImportedInterface.ts, 7, 20)) +>T : Symbol(T, Decl(classImplementsImportedInterface.ts, 6, 11)) + + foo() {} +>foo : Symbol(foo, Decl(classImplementsImportedInterface.ts, 8, 26)) + } +} diff --git a/tests/baselines/reference/classImplementsImportedInterface.types b/tests/baselines/reference/classImplementsImportedInterface.types index 74b0e81eb60..ce1c4e96e18 100644 --- a/tests/baselines/reference/classImplementsImportedInterface.types +++ b/tests/baselines/reference/classImplementsImportedInterface.types @@ -1,6 +1,6 @@ === tests/cases/compiler/classImplementsImportedInterface.ts === module M1 { ->M1 : unknown +>M1 : any export interface I { >I : I @@ -14,8 +14,8 @@ module M2 { >M2 : typeof M2 import T = M1.I; ->T : unknown ->M1 : unknown +>T : any +>M1 : any >I : T class C implements T { diff --git a/tests/baselines/reference/classIndexer.symbols b/tests/baselines/reference/classIndexer.symbols new file mode 100644 index 00000000000..8274beda930 --- /dev/null +++ b/tests/baselines/reference/classIndexer.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/classIndexer.ts === +class C123 { +>C123 : Symbol(C123, Decl(classIndexer.ts, 0, 0)) + + [s: string]: number; +>s : Symbol(s, Decl(classIndexer.ts, 1, 5)) + + constructor() { + } +} diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.symbols b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.symbols new file mode 100644 index 00000000000..585bae5b3c3 --- /dev/null +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/classMemberInitializerWithLamdaScoping5.ts === +declare var console: { +>console : Symbol(console, Decl(classMemberInitializerWithLamdaScoping5.ts, 0, 11)) + + log(message?: any, ...optionalParams: any[]): void; +>log : Symbol(log, Decl(classMemberInitializerWithLamdaScoping5.ts, 0, 22)) +>message : Symbol(message, Decl(classMemberInitializerWithLamdaScoping5.ts, 1, 8)) +>optionalParams : Symbol(optionalParams, Decl(classMemberInitializerWithLamdaScoping5.ts, 1, 22)) + +}; +class Greeter { +>Greeter : Symbol(Greeter, Decl(classMemberInitializerWithLamdaScoping5.ts, 2, 2)) + + constructor(message: string) { +>message : Symbol(message, Decl(classMemberInitializerWithLamdaScoping5.ts, 4, 16)) + } + + messageHandler = (message: string) => { +>messageHandler : Symbol(messageHandler, Decl(classMemberInitializerWithLamdaScoping5.ts, 5, 5)) +>message : Symbol(message, Decl(classMemberInitializerWithLamdaScoping5.ts, 7, 22)) + + console.log(message); // This shouldnt be error +>console.log : Symbol(log, Decl(classMemberInitializerWithLamdaScoping5.ts, 0, 22)) +>console : Symbol(console, Decl(classMemberInitializerWithLamdaScoping5.ts, 0, 11)) +>log : Symbol(log, Decl(classMemberInitializerWithLamdaScoping5.ts, 0, 22)) +>message : Symbol(message, Decl(classMemberInitializerWithLamdaScoping5.ts, 7, 22)) + } +} diff --git a/tests/baselines/reference/classMethodWithKeywordName1.symbols b/tests/baselines/reference/classMethodWithKeywordName1.symbols new file mode 100644 index 00000000000..af280f41036 --- /dev/null +++ b/tests/baselines/reference/classMethodWithKeywordName1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/classMethodWithKeywordName1.ts === +class C { +>C : Symbol(C, Decl(classMethodWithKeywordName1.ts, 0, 0)) + + static try() {} +>try : Symbol(C.try, Decl(classMethodWithKeywordName1.ts, 0, 9)) +} diff --git a/tests/baselines/reference/classOrder1.symbols b/tests/baselines/reference/classOrder1.symbols new file mode 100644 index 00000000000..4f1541ba9cd --- /dev/null +++ b/tests/baselines/reference/classOrder1.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/classOrder1.ts === +class A { +>A : Symbol(A, Decl(classOrder1.ts, 0, 0)) + + public foo() { +>foo : Symbol(foo, Decl(classOrder1.ts, 0, 9)) + + /*WScript.Echo("Here!");*/ + } +} + +var a = new A(); +>a : Symbol(a, Decl(classOrder1.ts, 6, 3)) +>A : Symbol(A, Decl(classOrder1.ts, 0, 0)) + +a.foo(); +>a.foo : Symbol(A.foo, Decl(classOrder1.ts, 0, 9)) +>a : Symbol(a, Decl(classOrder1.ts, 6, 3)) +>foo : Symbol(A.foo, Decl(classOrder1.ts, 0, 9)) + + + diff --git a/tests/baselines/reference/classOrder2.symbols b/tests/baselines/reference/classOrder2.symbols new file mode 100644 index 00000000000..4ee49d269a9 --- /dev/null +++ b/tests/baselines/reference/classOrder2.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/classOrder2.ts === + +class A extends B { +>A : Symbol(A, Decl(classOrder2.ts, 0, 0)) +>B : Symbol(B, Decl(classOrder2.ts, 5, 1)) + + foo() { this.bar(); } +>foo : Symbol(foo, Decl(classOrder2.ts, 1, 19)) +>this.bar : Symbol(B.bar, Decl(classOrder2.ts, 7, 9)) +>this : Symbol(A, Decl(classOrder2.ts, 0, 0)) +>bar : Symbol(B.bar, Decl(classOrder2.ts, 7, 9)) + +} + +class B { +>B : Symbol(B, Decl(classOrder2.ts, 5, 1)) + + bar() { } +>bar : Symbol(bar, Decl(classOrder2.ts, 7, 9)) + +} + + +var a = new A(); +>a : Symbol(a, Decl(classOrder2.ts, 14, 3)) +>A : Symbol(A, Decl(classOrder2.ts, 0, 0)) + +a.foo(); +>a.foo : Symbol(A.foo, Decl(classOrder2.ts, 1, 19)) +>a : Symbol(a, Decl(classOrder2.ts, 14, 3)) +>foo : Symbol(A.foo, Decl(classOrder2.ts, 1, 19)) + + diff --git a/tests/baselines/reference/classOrderBug.symbols b/tests/baselines/reference/classOrderBug.symbols new file mode 100644 index 00000000000..9065909180b --- /dev/null +++ b/tests/baselines/reference/classOrderBug.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/classOrderBug.ts === +class bar { +>bar : Symbol(bar, Decl(classOrderBug.ts, 0, 0)) + + public baz: foo; +>baz : Symbol(baz, Decl(classOrderBug.ts, 0, 11)) +>foo : Symbol(foo, Decl(classOrderBug.ts, 10, 12)) + + constructor() { + + this.baz = new foo(); +>this.baz : Symbol(baz, Decl(classOrderBug.ts, 0, 11)) +>this : Symbol(bar, Decl(classOrderBug.ts, 0, 0)) +>baz : Symbol(baz, Decl(classOrderBug.ts, 0, 11)) +>foo : Symbol(foo, Decl(classOrderBug.ts, 10, 12)) + + } + +} + +class baz {} +>baz : Symbol(baz, Decl(classOrderBug.ts, 8, 1)) + +class foo extends baz {} +>foo : Symbol(foo, Decl(classOrderBug.ts, 10, 12)) +>baz : Symbol(baz, Decl(classOrderBug.ts, 8, 1)) + + + diff --git a/tests/baselines/reference/classSideInheritance2.symbols b/tests/baselines/reference/classSideInheritance2.symbols new file mode 100644 index 00000000000..697aba99832 --- /dev/null +++ b/tests/baselines/reference/classSideInheritance2.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/classSideInheritance2.ts === +interface IText { +>IText : Symbol(IText, Decl(classSideInheritance2.ts, 0, 0)) + + foo: number; +>foo : Symbol(foo, Decl(classSideInheritance2.ts, 0, 17)) +} + +interface TextSpan {} +>TextSpan : Symbol(TextSpan, Decl(classSideInheritance2.ts, 2, 1)) + +class SubText extends TextBase { +>SubText : Symbol(SubText, Decl(classSideInheritance2.ts, 4, 21)) +>TextBase : Symbol(TextBase, Decl(classSideInheritance2.ts, 11, 1)) + + constructor(text: IText, span: TextSpan) { +>text : Symbol(text, Decl(classSideInheritance2.ts, 8, 20)) +>IText : Symbol(IText, Decl(classSideInheritance2.ts, 0, 0)) +>span : Symbol(span, Decl(classSideInheritance2.ts, 8, 32)) +>TextSpan : Symbol(TextSpan, Decl(classSideInheritance2.ts, 2, 1)) + + super(); +>super : Symbol(TextBase, Decl(classSideInheritance2.ts, 11, 1)) + } +} + +class TextBase implements IText { +>TextBase : Symbol(TextBase, Decl(classSideInheritance2.ts, 11, 1)) +>IText : Symbol(IText, Decl(classSideInheritance2.ts, 0, 0)) + + public foo: number; +>foo : Symbol(foo, Decl(classSideInheritance2.ts, 13, 33)) + + public subText(span: TextSpan): IText { +>subText : Symbol(subText, Decl(classSideInheritance2.ts, 14, 27)) +>span : Symbol(span, Decl(classSideInheritance2.ts, 15, 23)) +>TextSpan : Symbol(TextSpan, Decl(classSideInheritance2.ts, 2, 1)) +>IText : Symbol(IText, Decl(classSideInheritance2.ts, 0, 0)) + + return new SubText(this, span); +>SubText : Symbol(SubText, Decl(classSideInheritance2.ts, 4, 21)) +>this : Symbol(TextBase, Decl(classSideInheritance2.ts, 11, 1)) +>span : Symbol(span, Decl(classSideInheritance2.ts, 15, 23)) + } +} diff --git a/tests/baselines/reference/classWithEmptyBody.symbols b/tests/baselines/reference/classWithEmptyBody.symbols new file mode 100644 index 00000000000..e08b0fe03af --- /dev/null +++ b/tests/baselines/reference/classWithEmptyBody.symbols @@ -0,0 +1,49 @@ +=== tests/cases/conformance/classes/classDeclarations/classBody/classWithEmptyBody.ts === +class C { +>C : Symbol(C, Decl(classWithEmptyBody.ts, 0, 0)) +} + +var c: C; +>c : Symbol(c, Decl(classWithEmptyBody.ts, 3, 3)) +>C : Symbol(C, Decl(classWithEmptyBody.ts, 0, 0)) + +var o: {} = c; +>o : Symbol(o, Decl(classWithEmptyBody.ts, 4, 3), Decl(classWithEmptyBody.ts, 16, 3)) +>c : Symbol(c, Decl(classWithEmptyBody.ts, 3, 3)) + +c = 1; +>c : Symbol(c, Decl(classWithEmptyBody.ts, 3, 3)) + +c = { foo: '' } +>c : Symbol(c, Decl(classWithEmptyBody.ts, 3, 3)) +>foo : Symbol(foo, Decl(classWithEmptyBody.ts, 6, 5)) + +c = () => { } +>c : Symbol(c, Decl(classWithEmptyBody.ts, 3, 3)) + +class D { +>D : Symbol(D, Decl(classWithEmptyBody.ts, 7, 13)) + + constructor() { + return 1; + } +} + +var d: D; +>d : Symbol(d, Decl(classWithEmptyBody.ts, 15, 3)) +>D : Symbol(D, Decl(classWithEmptyBody.ts, 7, 13)) + +var o: {} = d; +>o : Symbol(o, Decl(classWithEmptyBody.ts, 4, 3), Decl(classWithEmptyBody.ts, 16, 3)) +>d : Symbol(d, Decl(classWithEmptyBody.ts, 15, 3)) + +d = 1; +>d : Symbol(d, Decl(classWithEmptyBody.ts, 15, 3)) + +d = { foo: '' } +>d : Symbol(d, Decl(classWithEmptyBody.ts, 15, 3)) +>foo : Symbol(foo, Decl(classWithEmptyBody.ts, 18, 5)) + +d = () => { } +>d : Symbol(d, Decl(classWithEmptyBody.ts, 15, 3)) + diff --git a/tests/baselines/reference/classWithEmptyBody.types b/tests/baselines/reference/classWithEmptyBody.types index ccf3c8556e0..1ac111796e8 100644 --- a/tests/baselines/reference/classWithEmptyBody.types +++ b/tests/baselines/reference/classWithEmptyBody.types @@ -14,12 +14,14 @@ var o: {} = c; c = 1; >c = 1 : number >c : C +>1 : number c = { foo: '' } >c = { foo: '' } : { foo: string; } >c : C >{ foo: '' } : { foo: string; } >foo : string +>'' : string c = () => { } >c = () => { } : () => void @@ -31,6 +33,7 @@ class D { constructor() { return 1; +>1 : number } } @@ -45,12 +48,14 @@ var o: {} = d; d = 1; >d = 1 : number >d : D +>1 : number d = { foo: '' } >d = { foo: '' } : { foo: string; } >d : D >{ foo: '' } : { foo: string; } >foo : string +>'' : string d = () => { } >d = () => { } : () => void diff --git a/tests/baselines/reference/classWithNoConstructorOrBaseClass.symbols b/tests/baselines/reference/classWithNoConstructorOrBaseClass.symbols new file mode 100644 index 00000000000..0d26f892dec --- /dev/null +++ b/tests/baselines/reference/classWithNoConstructorOrBaseClass.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/classes/members/constructorFunctionTypes/classWithNoConstructorOrBaseClass.ts === +class C { +>C : Symbol(C, Decl(classWithNoConstructorOrBaseClass.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(classWithNoConstructorOrBaseClass.ts, 0, 9)) +} + +var c = new C(); +>c : Symbol(c, Decl(classWithNoConstructorOrBaseClass.ts, 4, 3)) +>C : Symbol(C, Decl(classWithNoConstructorOrBaseClass.ts, 0, 0)) + +var r = C; +>r : Symbol(r, Decl(classWithNoConstructorOrBaseClass.ts, 5, 3)) +>C : Symbol(C, Decl(classWithNoConstructorOrBaseClass.ts, 0, 0)) + +class D { +>D : Symbol(D, Decl(classWithNoConstructorOrBaseClass.ts, 5, 10)) +>T : Symbol(T, Decl(classWithNoConstructorOrBaseClass.ts, 7, 8)) +>U : Symbol(U, Decl(classWithNoConstructorOrBaseClass.ts, 7, 10)) + + x: T; +>x : Symbol(x, Decl(classWithNoConstructorOrBaseClass.ts, 7, 14)) +>T : Symbol(T, Decl(classWithNoConstructorOrBaseClass.ts, 7, 8)) + + y: U; +>y : Symbol(y, Decl(classWithNoConstructorOrBaseClass.ts, 8, 9)) +>U : Symbol(U, Decl(classWithNoConstructorOrBaseClass.ts, 7, 10)) +} + +var d = new D(); +>d : Symbol(d, Decl(classWithNoConstructorOrBaseClass.ts, 12, 3)) +>D : Symbol(D, Decl(classWithNoConstructorOrBaseClass.ts, 5, 10)) + +var d2 = new D(); +>d2 : Symbol(d2, Decl(classWithNoConstructorOrBaseClass.ts, 13, 3)) +>D : Symbol(D, Decl(classWithNoConstructorOrBaseClass.ts, 5, 10)) + +var r2 = D; +>r2 : Symbol(r2, Decl(classWithNoConstructorOrBaseClass.ts, 14, 3)) +>D : Symbol(D, Decl(classWithNoConstructorOrBaseClass.ts, 5, 10)) + diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.symbols b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.symbols new file mode 100644 index 00000000000..7239eac77e6 --- /dev/null +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.symbols @@ -0,0 +1,71 @@ +=== tests/cases/conformance/types/namedTypes/classWithOnlyPublicMembersEquivalentToInterface.ts === +// no errors expected + +class C { +>C : Symbol(C, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 0, 0)) + + public x: string; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 2, 9)) + + public y(a: number): number { return null; } +>y : Symbol(y, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 3, 21)) +>a : Symbol(a, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 4, 13)) + + public get z() { return 1; } +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 4, 48), Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 5, 32)) + + public set z(v) { } +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 4, 48), Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 5, 32)) +>v : Symbol(v, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 6, 17)) + + [x: string]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 7, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 8, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + 0: number; +} + +interface I { +>I : Symbol(I, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 10, 1)) + + x: string; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 12, 13)) + + y(b: number): number; +>y : Symbol(y, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 13, 14)) +>b : Symbol(b, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 14, 6)) + + z: number; +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 14, 25)) + + [x: string]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 16, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 17, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + 0: number; +} + +var c: C; +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 21, 3)) +>C : Symbol(C, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 0, 0)) + +var i: I; +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 22, 3)) +>I : Symbol(I, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 10, 1)) + +c = i; +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 21, 3)) +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 22, 3)) + +i = c; +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 22, 3)) +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 21, 3)) + diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types index 9f6d031bf20..94460dfdeaf 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types @@ -10,9 +10,11 @@ class C { public y(a: number): number { return null; } >y : (a: number) => number >a : number +>null : null public get z() { return 1; } >z : number +>1 : number public set z(v) { } >z : number diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.symbols b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.symbols new file mode 100644 index 00000000000..48bcbfa5149 --- /dev/null +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.symbols @@ -0,0 +1,74 @@ +=== tests/cases/conformance/types/namedTypes/classWithOnlyPublicMembersEquivalentToInterface2.ts === +// no errors expected + +class C { +>C : Symbol(C, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 0, 0)) + + public x: string; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 2, 9)) + + public y(a: number): number { return null; } +>y : Symbol(y, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 3, 21)) +>a : Symbol(a, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 4, 13)) + + public get z() { return 1; } +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 4, 48), Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 5, 32)) + + public set z(v) { } +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 4, 48), Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 5, 32)) +>v : Symbol(v, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 6, 17)) + + [x: string]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 7, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 8, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + 0: number; + + public static foo: string; // doesn't effect equivalence +>foo : Symbol(C.foo, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 9, 14)) +} + +interface I { +>I : Symbol(I, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 12, 1)) + + x: string; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 14, 13)) + + y(b: number): number; +>y : Symbol(y, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 15, 14)) +>b : Symbol(b, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 16, 6)) + + z: number; +>z : Symbol(z, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 16, 25)) + + [x: string]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 18, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: Object; +>x : Symbol(x, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 19, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + 0: number; +} + +var c: C; +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 23, 3)) +>C : Symbol(C, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 0, 0)) + +var i: I; +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 24, 3)) +>I : Symbol(I, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 12, 1)) + +c = i; +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 23, 3)) +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 24, 3)) + +i = c; +>i : Symbol(i, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 24, 3)) +>c : Symbol(c, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 23, 3)) + diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types index be504f895fd..b359713f292 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types @@ -10,9 +10,11 @@ class C { public y(a: number): number { return null; } >y : (a: number) => number >a : number +>null : null public get z() { return 1; } >z : number +>1 : number public set z(v) { } >z : number diff --git a/tests/baselines/reference/classWithProtectedProperty.symbols b/tests/baselines/reference/classWithProtectedProperty.symbols new file mode 100644 index 00000000000..017233081b2 --- /dev/null +++ b/tests/baselines/reference/classWithProtectedProperty.symbols @@ -0,0 +1,92 @@ +=== tests/cases/conformance/types/members/classWithProtectedProperty.ts === +// accessing any protected outside the class is an error + +class C { +>C : Symbol(C, Decl(classWithProtectedProperty.ts, 0, 0)) + + protected x; +>x : Symbol(x, Decl(classWithProtectedProperty.ts, 2, 9)) + + protected a = ''; +>a : Symbol(a, Decl(classWithProtectedProperty.ts, 3, 16)) + + protected b: string = ''; +>b : Symbol(b, Decl(classWithProtectedProperty.ts, 4, 21)) + + protected c() { return '' } +>c : Symbol(c, Decl(classWithProtectedProperty.ts, 5, 29)) + + protected d = () => ''; +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 6, 31)) + + protected static e; +>e : Symbol(C.e, Decl(classWithProtectedProperty.ts, 7, 27)) + + protected static f() { return '' } +>f : Symbol(C.f, Decl(classWithProtectedProperty.ts, 8, 23)) + + protected static g = () => ''; +>g : Symbol(C.g, Decl(classWithProtectedProperty.ts, 9, 38)) +} + +class D extends C { +>D : Symbol(D, Decl(classWithProtectedProperty.ts, 11, 1)) +>C : Symbol(C, Decl(classWithProtectedProperty.ts, 0, 0)) + + method() { +>method : Symbol(method, Decl(classWithProtectedProperty.ts, 13, 19)) + + // No errors + var d = new D(); +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>D : Symbol(D, Decl(classWithProtectedProperty.ts, 11, 1)) + + var r1: string = d.x; +>r1 : Symbol(r1, Decl(classWithProtectedProperty.ts, 17, 11)) +>d.x : Symbol(C.x, Decl(classWithProtectedProperty.ts, 2, 9)) +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>x : Symbol(C.x, Decl(classWithProtectedProperty.ts, 2, 9)) + + var r2: string = d.a; +>r2 : Symbol(r2, Decl(classWithProtectedProperty.ts, 18, 11)) +>d.a : Symbol(C.a, Decl(classWithProtectedProperty.ts, 3, 16)) +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>a : Symbol(C.a, Decl(classWithProtectedProperty.ts, 3, 16)) + + var r3: string = d.b; +>r3 : Symbol(r3, Decl(classWithProtectedProperty.ts, 19, 11)) +>d.b : Symbol(C.b, Decl(classWithProtectedProperty.ts, 4, 21)) +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>b : Symbol(C.b, Decl(classWithProtectedProperty.ts, 4, 21)) + + var r4: string = d.c(); +>r4 : Symbol(r4, Decl(classWithProtectedProperty.ts, 20, 11)) +>d.c : Symbol(C.c, Decl(classWithProtectedProperty.ts, 5, 29)) +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>c : Symbol(C.c, Decl(classWithProtectedProperty.ts, 5, 29)) + + var r5: string = d.d(); +>r5 : Symbol(r5, Decl(classWithProtectedProperty.ts, 21, 11)) +>d.d : Symbol(C.d, Decl(classWithProtectedProperty.ts, 6, 31)) +>d : Symbol(d, Decl(classWithProtectedProperty.ts, 16, 11)) +>d : Symbol(C.d, Decl(classWithProtectedProperty.ts, 6, 31)) + + var r6: string = C.e; +>r6 : Symbol(r6, Decl(classWithProtectedProperty.ts, 22, 11)) +>C.e : Symbol(C.e, Decl(classWithProtectedProperty.ts, 7, 27)) +>C : Symbol(C, Decl(classWithProtectedProperty.ts, 0, 0)) +>e : Symbol(C.e, Decl(classWithProtectedProperty.ts, 7, 27)) + + var r7: string = C.f(); +>r7 : Symbol(r7, Decl(classWithProtectedProperty.ts, 23, 11)) +>C.f : Symbol(C.f, Decl(classWithProtectedProperty.ts, 8, 23)) +>C : Symbol(C, Decl(classWithProtectedProperty.ts, 0, 0)) +>f : Symbol(C.f, Decl(classWithProtectedProperty.ts, 8, 23)) + + var r8: string = C.g(); +>r8 : Symbol(r8, Decl(classWithProtectedProperty.ts, 24, 11)) +>C.g : Symbol(C.g, Decl(classWithProtectedProperty.ts, 9, 38)) +>C : Symbol(C, Decl(classWithProtectedProperty.ts, 0, 0)) +>g : Symbol(C.g, Decl(classWithProtectedProperty.ts, 9, 38)) + } +} diff --git a/tests/baselines/reference/classWithProtectedProperty.types b/tests/baselines/reference/classWithProtectedProperty.types index a091206cde0..1f53ea2aad9 100644 --- a/tests/baselines/reference/classWithProtectedProperty.types +++ b/tests/baselines/reference/classWithProtectedProperty.types @@ -9,26 +9,32 @@ class C { protected a = ''; >a : string +>'' : string protected b: string = ''; >b : string +>'' : string protected c() { return '' } >c : () => string +>'' : string protected d = () => ''; >d : () => string >() => '' : () => string +>'' : string protected static e; >e : any protected static f() { return '' } >f : () => string +>'' : string protected static g = () => ''; >g : () => string >() => '' : () => string +>'' : string } class D extends C { diff --git a/tests/baselines/reference/classWithPublicProperty.symbols b/tests/baselines/reference/classWithPublicProperty.symbols new file mode 100644 index 00000000000..0e3aa272e5d --- /dev/null +++ b/tests/baselines/reference/classWithPublicProperty.symbols @@ -0,0 +1,82 @@ +=== tests/cases/conformance/types/members/classWithPublicProperty.ts === +class C { +>C : Symbol(C, Decl(classWithPublicProperty.ts, 0, 0)) + + public x; +>x : Symbol(x, Decl(classWithPublicProperty.ts, 0, 9)) + + public a = ''; +>a : Symbol(a, Decl(classWithPublicProperty.ts, 1, 13)) + + public b: string = ''; +>b : Symbol(b, Decl(classWithPublicProperty.ts, 2, 18)) + + public c() { return '' } +>c : Symbol(c, Decl(classWithPublicProperty.ts, 3, 26)) + + public d = () => ''; +>d : Symbol(d, Decl(classWithPublicProperty.ts, 4, 28)) + + public static e; +>e : Symbol(C.e, Decl(classWithPublicProperty.ts, 5, 24)) + + public static f() { return '' } +>f : Symbol(C.f, Decl(classWithPublicProperty.ts, 6, 20)) + + public static g = () => ''; +>g : Symbol(C.g, Decl(classWithPublicProperty.ts, 7, 35)) +} + +// all of these are valid +var c = new C(); +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>C : Symbol(C, Decl(classWithPublicProperty.ts, 0, 0)) + +var r1: string = c.x; +>r1 : Symbol(r1, Decl(classWithPublicProperty.ts, 13, 3)) +>c.x : Symbol(C.x, Decl(classWithPublicProperty.ts, 0, 9)) +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>x : Symbol(C.x, Decl(classWithPublicProperty.ts, 0, 9)) + +var r2: string = c.a; +>r2 : Symbol(r2, Decl(classWithPublicProperty.ts, 14, 3)) +>c.a : Symbol(C.a, Decl(classWithPublicProperty.ts, 1, 13)) +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>a : Symbol(C.a, Decl(classWithPublicProperty.ts, 1, 13)) + +var r3: string = c.b; +>r3 : Symbol(r3, Decl(classWithPublicProperty.ts, 15, 3)) +>c.b : Symbol(C.b, Decl(classWithPublicProperty.ts, 2, 18)) +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>b : Symbol(C.b, Decl(classWithPublicProperty.ts, 2, 18)) + +var r4: string = c.c(); +>r4 : Symbol(r4, Decl(classWithPublicProperty.ts, 16, 3)) +>c.c : Symbol(C.c, Decl(classWithPublicProperty.ts, 3, 26)) +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>c : Symbol(C.c, Decl(classWithPublicProperty.ts, 3, 26)) + +var r5: string = c.d(); +>r5 : Symbol(r5, Decl(classWithPublicProperty.ts, 17, 3)) +>c.d : Symbol(C.d, Decl(classWithPublicProperty.ts, 4, 28)) +>c : Symbol(c, Decl(classWithPublicProperty.ts, 12, 3)) +>d : Symbol(C.d, Decl(classWithPublicProperty.ts, 4, 28)) + +var r6: string = C.e; +>r6 : Symbol(r6, Decl(classWithPublicProperty.ts, 18, 3)) +>C.e : Symbol(C.e, Decl(classWithPublicProperty.ts, 5, 24)) +>C : Symbol(C, Decl(classWithPublicProperty.ts, 0, 0)) +>e : Symbol(C.e, Decl(classWithPublicProperty.ts, 5, 24)) + +var r7: string = C.f(); +>r7 : Symbol(r7, Decl(classWithPublicProperty.ts, 19, 3)) +>C.f : Symbol(C.f, Decl(classWithPublicProperty.ts, 6, 20)) +>C : Symbol(C, Decl(classWithPublicProperty.ts, 0, 0)) +>f : Symbol(C.f, Decl(classWithPublicProperty.ts, 6, 20)) + +var r8: string = C.g(); +>r8 : Symbol(r8, Decl(classWithPublicProperty.ts, 20, 3)) +>C.g : Symbol(C.g, Decl(classWithPublicProperty.ts, 7, 35)) +>C : Symbol(C, Decl(classWithPublicProperty.ts, 0, 0)) +>g : Symbol(C.g, Decl(classWithPublicProperty.ts, 7, 35)) + diff --git a/tests/baselines/reference/classWithPublicProperty.types b/tests/baselines/reference/classWithPublicProperty.types index a5bdeb95f1a..09d3c0668d1 100644 --- a/tests/baselines/reference/classWithPublicProperty.types +++ b/tests/baselines/reference/classWithPublicProperty.types @@ -7,26 +7,32 @@ class C { public a = ''; >a : string +>'' : string public b: string = ''; >b : string +>'' : string public c() { return '' } >c : () => string +>'' : string public d = () => ''; >d : () => string >() => '' : () => string +>'' : string public static e; >e : any public static f() { return '' } >f : () => string +>'' : string public static g = () => ''; >g : () => string >() => '' : () => string +>'' : string } // all of these are valid diff --git a/tests/baselines/reference/classWithSemicolonClassElement1.symbols b/tests/baselines/reference/classWithSemicolonClassElement1.symbols new file mode 100644 index 00000000000..6925382630a --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement1.ts === +class C { +>C : Symbol(C, Decl(classWithSemicolonClassElement1.ts, 0, 0)) + + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElement2.symbols b/tests/baselines/reference/classWithSemicolonClassElement2.symbols new file mode 100644 index 00000000000..50b79a45164 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElement2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/classes/classDeclarations/classWithSemicolonClassElement2.ts === +class C { +>C : Symbol(C, Decl(classWithSemicolonClassElement2.ts, 0, 0)) + + ; + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES61.symbols b/tests/baselines/reference/classWithSemicolonClassElementES61.symbols new file mode 100644 index 00000000000..eb8e4345098 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES61.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES61.ts === +class C { +>C : Symbol(C, Decl(classWithSemicolonClassElementES61.ts, 0, 0)) + + ; +} diff --git a/tests/baselines/reference/classWithSemicolonClassElementES62.symbols b/tests/baselines/reference/classWithSemicolonClassElementES62.symbols new file mode 100644 index 00000000000..a1c69b61b77 --- /dev/null +++ b/tests/baselines/reference/classWithSemicolonClassElementES62.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/classDeclaration/classWithSemicolonClassElementES62.ts === +class C { +>C : Symbol(C, Decl(classWithSemicolonClassElementES62.ts, 0, 0)) + + ; + ; +} diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.symbols b/tests/baselines/reference/cloduleAcrossModuleDefinitions.symbols new file mode 100644 index 00000000000..7be8383355c --- /dev/null +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/cloduleAcrossModuleDefinitions.ts === +module A { +>A : Symbol(A, Decl(cloduleAcrossModuleDefinitions.ts, 0, 0), Decl(cloduleAcrossModuleDefinitions.ts, 5, 1)) + + export class B { +>B : Symbol(B, Decl(cloduleAcrossModuleDefinitions.ts, 0, 10), Decl(cloduleAcrossModuleDefinitions.ts, 7, 10)) + + foo() { } +>foo : Symbol(foo, Decl(cloduleAcrossModuleDefinitions.ts, 1, 20)) + + static bar() { } +>bar : Symbol(B.bar, Decl(cloduleAcrossModuleDefinitions.ts, 2, 17)) + } +} + +module A { +>A : Symbol(A, Decl(cloduleAcrossModuleDefinitions.ts, 0, 0), Decl(cloduleAcrossModuleDefinitions.ts, 5, 1)) + + export module B { +>B : Symbol(B, Decl(cloduleAcrossModuleDefinitions.ts, 0, 10), Decl(cloduleAcrossModuleDefinitions.ts, 7, 10)) + + export var x = 1; +>x : Symbol(x, Decl(cloduleAcrossModuleDefinitions.ts, 9, 18)) + } +} + +var b: A.B; // ok +>b : Symbol(b, Decl(cloduleAcrossModuleDefinitions.ts, 13, 3)) +>A : Symbol(A, Decl(cloduleAcrossModuleDefinitions.ts, 0, 0), Decl(cloduleAcrossModuleDefinitions.ts, 5, 1)) +>B : Symbol(A.B, Decl(cloduleAcrossModuleDefinitions.ts, 0, 10), Decl(cloduleAcrossModuleDefinitions.ts, 7, 10)) + diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.types b/tests/baselines/reference/cloduleAcrossModuleDefinitions.types index cda79f73734..53ef8392774 100644 --- a/tests/baselines/reference/cloduleAcrossModuleDefinitions.types +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.types @@ -21,11 +21,12 @@ module A { export var x = 1; >x : number +>1 : number } } var b: A.B; // ok >b : A.B ->A : unknown +>A : any >B : A.B diff --git a/tests/baselines/reference/cloduleAndTypeParameters.symbols b/tests/baselines/reference/cloduleAndTypeParameters.symbols new file mode 100644 index 00000000000..f2d96346495 --- /dev/null +++ b/tests/baselines/reference/cloduleAndTypeParameters.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/cloduleAndTypeParameters.ts === +class Foo { +>Foo : Symbol(Foo, Decl(cloduleAndTypeParameters.ts, 0, 0), Decl(cloduleAndTypeParameters.ts, 3, 1)) +>T : Symbol(T, Decl(cloduleAndTypeParameters.ts, 0, 10)) +>Foo : Symbol(Foo, Decl(cloduleAndTypeParameters.ts, 0, 0), Decl(cloduleAndTypeParameters.ts, 3, 1)) +>Bar : Symbol(Foo.Bar, Decl(cloduleAndTypeParameters.ts, 5, 12)) + + constructor() { + } +} + +module Foo { +>Foo : Symbol(Foo, Decl(cloduleAndTypeParameters.ts, 0, 0), Decl(cloduleAndTypeParameters.ts, 3, 1)) + + export interface Bar { +>Bar : Symbol(Bar, Decl(cloduleAndTypeParameters.ts, 5, 12)) + + bar(): void; +>bar : Symbol(bar, Decl(cloduleAndTypeParameters.ts, 6, 24)) + } + + export class Baz { +>Baz : Symbol(Baz, Decl(cloduleAndTypeParameters.ts, 8, 3)) + } +} diff --git a/tests/baselines/reference/cloduleAndTypeParameters.types b/tests/baselines/reference/cloduleAndTypeParameters.types index ad43bc90f2f..f7621b5d7f2 100644 --- a/tests/baselines/reference/cloduleAndTypeParameters.types +++ b/tests/baselines/reference/cloduleAndTypeParameters.types @@ -2,7 +2,7 @@ class Foo { >Foo : Foo >T : T ->Foo : unknown +>Foo : any >Bar : Foo.Bar constructor() { diff --git a/tests/baselines/reference/cloduleTest1.symbols b/tests/baselines/reference/cloduleTest1.symbols new file mode 100644 index 00000000000..01759cfa136 --- /dev/null +++ b/tests/baselines/reference/cloduleTest1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/cloduleTest1.ts === + declare function $(selector: string): $; +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) +>selector : Symbol(selector, Decl(cloduleTest1.ts, 0, 21)) +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) + + interface $ { +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) + + addClass(className: string): $; +>addClass : Symbol(addClass, Decl(cloduleTest1.ts, 1, 15)) +>className : Symbol(className, Decl(cloduleTest1.ts, 2, 15)) +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) + } + module $ { +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) + + export interface AjaxSettings { +>AjaxSettings : Symbol(AjaxSettings, Decl(cloduleTest1.ts, 4, 12)) + } + export function ajax(options: AjaxSettings) { } +>ajax : Symbol(ajax, Decl(cloduleTest1.ts, 6, 5)) +>options : Symbol(options, Decl(cloduleTest1.ts, 7, 25)) +>AjaxSettings : Symbol(AjaxSettings, Decl(cloduleTest1.ts, 4, 12)) + } + var it: $ = $('.foo').addClass('bar'); +>it : Symbol(it, Decl(cloduleTest1.ts, 9, 5)) +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) +>$('.foo').addClass : Symbol($.addClass, Decl(cloduleTest1.ts, 1, 15)) +>$ : Symbol($, Decl(cloduleTest1.ts, 0, 0), Decl(cloduleTest1.ts, 0, 42), Decl(cloduleTest1.ts, 3, 3)) +>addClass : Symbol($.addClass, Decl(cloduleTest1.ts, 1, 15)) + diff --git a/tests/baselines/reference/cloduleTest1.types b/tests/baselines/reference/cloduleTest1.types index a92355b483a..67c1fd6120f 100644 --- a/tests/baselines/reference/cloduleTest1.types +++ b/tests/baselines/reference/cloduleTest1.types @@ -30,5 +30,7 @@ >$('.foo').addClass : (className: string) => $ >$('.foo') : $ >$ : typeof $ +>'.foo' : string >addClass : (className: string) => $ +>'bar' : string diff --git a/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.symbols b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.symbols new file mode 100644 index 00000000000..7f93d361dd9 --- /dev/null +++ b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/cloduleWithPriorUninstantiatedModule.ts === +// Non-ambient & uninstantiated module. +module Moclodule { +>Moclodule : Symbol(Moclodule, Decl(cloduleWithPriorUninstantiatedModule.ts, 0, 0), Decl(cloduleWithPriorUninstantiatedModule.ts, 5, 1), Decl(cloduleWithPriorUninstantiatedModule.ts, 8, 1)) + + export interface Someinterface { +>Someinterface : Symbol(Someinterface, Decl(cloduleWithPriorUninstantiatedModule.ts, 1, 18)) + + foo(): void; +>foo : Symbol(foo, Decl(cloduleWithPriorUninstantiatedModule.ts, 2, 36)) + } +} + +class Moclodule { +>Moclodule : Symbol(Moclodule, Decl(cloduleWithPriorUninstantiatedModule.ts, 0, 0), Decl(cloduleWithPriorUninstantiatedModule.ts, 5, 1), Decl(cloduleWithPriorUninstantiatedModule.ts, 8, 1)) +} + +// Instantiated module. +module Moclodule { +>Moclodule : Symbol(Moclodule, Decl(cloduleWithPriorUninstantiatedModule.ts, 0, 0), Decl(cloduleWithPriorUninstantiatedModule.ts, 5, 1), Decl(cloduleWithPriorUninstantiatedModule.ts, 8, 1)) + + export class Manager { +>Manager : Symbol(Manager, Decl(cloduleWithPriorUninstantiatedModule.ts, 11, 18)) + } +} diff --git a/tests/baselines/reference/cloduleWithRecursiveReference.symbols b/tests/baselines/reference/cloduleWithRecursiveReference.symbols new file mode 100644 index 00000000000..22d5d64f72c --- /dev/null +++ b/tests/baselines/reference/cloduleWithRecursiveReference.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/cloduleWithRecursiveReference.ts === +module M +>M : Symbol(M, Decl(cloduleWithRecursiveReference.ts, 0, 0)) +{ + export class C { } +>C : Symbol(C, Decl(cloduleWithRecursiveReference.ts, 1, 1), Decl(cloduleWithRecursiveReference.ts, 2, 21)) + + export module C { +>C : Symbol(C, Decl(cloduleWithRecursiveReference.ts, 1, 1), Decl(cloduleWithRecursiveReference.ts, 2, 21)) + + export var C = M.C +>C : Symbol(C, Decl(cloduleWithRecursiveReference.ts, 4, 14)) +>M.C : Symbol(C, Decl(cloduleWithRecursiveReference.ts, 1, 1), Decl(cloduleWithRecursiveReference.ts, 2, 21)) +>M : Symbol(M, Decl(cloduleWithRecursiveReference.ts, 0, 0)) +>C : Symbol(C, Decl(cloduleWithRecursiveReference.ts, 1, 1), Decl(cloduleWithRecursiveReference.ts, 2, 21)) + } +} diff --git a/tests/baselines/reference/collisionArgumentsInType.symbols b/tests/baselines/reference/collisionArgumentsInType.symbols new file mode 100644 index 00000000000..94c9374c7cd --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsInType.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/collisionArgumentsInType.ts === +var v1: (i: number, ...arguments) => void; // no error - no code gen +>v1 : Symbol(v1, Decl(collisionArgumentsInType.ts, 0, 3)) +>i : Symbol(i, Decl(collisionArgumentsInType.ts, 0, 9)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 0, 19)) + +var v12: (arguments: number, ...restParameters) => void; // no error - no code gen +>v12 : Symbol(v12, Decl(collisionArgumentsInType.ts, 1, 3)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 1, 10)) +>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 1, 28)) + +var v2: { +>v2 : Symbol(v2, Decl(collisionArgumentsInType.ts, 2, 3)) + + (arguments: number, ...restParameters); // no error - no code gen +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 3, 5)) +>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 3, 23)) + + new (arguments: number, ...restParameters); // no error - no code gen +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 4, 9)) +>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 4, 27)) + + foo(arguments: number, ...restParameters); // no error - no code gen +>foo : Symbol(foo, Decl(collisionArgumentsInType.ts, 4, 47)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 5, 8)) +>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 5, 26)) + + prop: (arguments: number, ...restParameters) => void; // no error - no code gen +>prop : Symbol(prop, Decl(collisionArgumentsInType.ts, 5, 46)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 6, 11)) +>restParameters : Symbol(restParameters, Decl(collisionArgumentsInType.ts, 6, 29)) +} +var v21: { +>v21 : Symbol(v21, Decl(collisionArgumentsInType.ts, 8, 3)) + + (i: number, ...arguments); // no error - no code gen +>i : Symbol(i, Decl(collisionArgumentsInType.ts, 9, 5)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 9, 15)) + + new (i: number, ...arguments); // no error - no code gen +>i : Symbol(i, Decl(collisionArgumentsInType.ts, 10, 9)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 10, 19)) + + foo(i: number, ...arguments); // no error - no code gen +>foo : Symbol(foo, Decl(collisionArgumentsInType.ts, 10, 34)) +>i : Symbol(i, Decl(collisionArgumentsInType.ts, 11, 8)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 11, 18)) + + prop: (i: number, ...arguments) => void; // no error - no code gen +>prop : Symbol(prop, Decl(collisionArgumentsInType.ts, 11, 33)) +>i : Symbol(i, Decl(collisionArgumentsInType.ts, 12, 11)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInType.ts, 12, 21)) +} diff --git a/tests/baselines/reference/collisionArgumentsInterfaceMembers.symbols b/tests/baselines/reference/collisionArgumentsInterfaceMembers.symbols new file mode 100644 index 00000000000..a8856c37a4c --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsInterfaceMembers.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/collisionArgumentsInterfaceMembers.ts === +// call +interface i1 { +>i1 : Symbol(i1, Decl(collisionArgumentsInterfaceMembers.ts, 0, 0)) + + (i: number, ...arguments); // no error - no code gen +>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 2, 5)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 2, 15)) +} +interface i12 { +>i12 : Symbol(i12, Decl(collisionArgumentsInterfaceMembers.ts, 3, 1)) + + (arguments: number, ...rest); // no error - no code gen +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 5, 5)) +>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 5, 23)) +} +interface i1NoError { +>i1NoError : Symbol(i1NoError, Decl(collisionArgumentsInterfaceMembers.ts, 6, 1)) + + (arguments: number); // no error +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 8, 5)) +} + +// new +interface i2 { +>i2 : Symbol(i2, Decl(collisionArgumentsInterfaceMembers.ts, 9, 1)) + + new (i: number, ...arguments); // no error - no code gen +>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 13, 9)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 13, 19)) +} +interface i21 { +>i21 : Symbol(i21, Decl(collisionArgumentsInterfaceMembers.ts, 14, 1)) + + new (arguments: number, ...rest); // no error - no code gen +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 16, 9)) +>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 16, 27)) +} +interface i2NoError { +>i2NoError : Symbol(i2NoError, Decl(collisionArgumentsInterfaceMembers.ts, 17, 1)) + + new (arguments: number); // no error +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 19, 9)) +} + +// method +interface i3 { +>i3 : Symbol(i3, Decl(collisionArgumentsInterfaceMembers.ts, 20, 1)) + + foo(i: number, ...arguments); // no error - no code gen +>foo : Symbol(foo, Decl(collisionArgumentsInterfaceMembers.ts, 23, 14)) +>i : Symbol(i, Decl(collisionArgumentsInterfaceMembers.ts, 24, 8)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 24, 18)) + + foo1(arguments: number, ...rest); // no error - no code gen +>foo1 : Symbol(foo1, Decl(collisionArgumentsInterfaceMembers.ts, 24, 33)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 25, 9)) +>rest : Symbol(rest, Decl(collisionArgumentsInterfaceMembers.ts, 25, 27)) + + fooNoError(arguments: number); // no error +>fooNoError : Symbol(fooNoError, Decl(collisionArgumentsInterfaceMembers.ts, 25, 37)) +>arguments : Symbol(arguments, Decl(collisionArgumentsInterfaceMembers.ts, 26, 15)) +} diff --git a/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.symbols b/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.symbols new file mode 100644 index 00000000000..9f5bfa36485 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/collisionCodeGenEnumWithEnumMemberConflict.ts === +enum Color { +>Color : Symbol(Color, Decl(collisionCodeGenEnumWithEnumMemberConflict.ts, 0, 0)) + + Color, +>Color : Symbol(Color.Color, Decl(collisionCodeGenEnumWithEnumMemberConflict.ts, 0, 12)) + + Thing = Color +>Thing : Symbol(Color.Thing, Decl(collisionCodeGenEnumWithEnumMemberConflict.ts, 1, 10)) +>Color : Symbol(Color.Color, Decl(collisionCodeGenEnumWithEnumMemberConflict.ts, 0, 12)) +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.symbols b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.symbols new file mode 100644 index 00000000000..28665abd098 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithConstructorChildren.ts === +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 13, 1)) + + export var x = 3; +>x : Symbol(x, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 1, 14)) + + class c { +>c : Symbol(c, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 1, 21)) + + constructor(M, p = x) { +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 3, 20)) +>p : Symbol(p, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 3, 22)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 1, 14)) + } + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 13, 1)) + + class d { +>d : Symbol(d, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 8, 10)) + + constructor(private M, p = x) { +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 10, 20)) +>p : Symbol(p, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 10, 30)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 1, 14)) + } + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithConstructorChildren.ts, 13, 1)) + + class d2 { +>d2 : Symbol(d2, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 15, 10)) + + constructor() { + var M = 10; +>M : Symbol(M, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 18, 15)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 19, 15)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithConstructorChildren.ts, 1, 14)) + } + } +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types index f63f7eeb4f2..9c6fbac1539 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.types @@ -4,6 +4,7 @@ module M { export var x = 3; >x : number +>3 : number class c { >c : c @@ -39,6 +40,7 @@ module M { constructor() { var M = 10; >M : number +>10 : number var p = x; >p : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.symbols b/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.symbols new file mode 100644 index 00000000000..f44b0e5c11e --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithEnumMemberConflict.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithEnumMemberConflict.ts, 0, 0)) + + enum e { +>e : Symbol(e, Decl(collisionCodeGenModuleWithEnumMemberConflict.ts, 0, 11)) + + m1, +>m1 : Symbol(e.m1, Decl(collisionCodeGenModuleWithEnumMemberConflict.ts, 1, 12)) + + m2 = m1 +>m2 : Symbol(e.m2, Decl(collisionCodeGenModuleWithEnumMemberConflict.ts, 2, 11)) +>m1 : Symbol(e.m1, Decl(collisionCodeGenModuleWithEnumMemberConflict.ts, 1, 12)) + } +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.symbols b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.symbols new file mode 100644 index 00000000000..eeac7be0fdf --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithFunctionChildren.ts === +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 3, 1), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 10, 1)) + + export var x = 3; +>x : Symbol(x, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 1, 14)) + + function fn(M, p = x) { } +>fn : Symbol(fn, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 1, 21)) +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 2, 16)) +>p : Symbol(p, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 2, 18)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 1, 14)) +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 3, 1), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 10, 1)) + + function fn2() { +>fn2 : Symbol(fn2, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 5, 10)) + + var M; +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 7, 11)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 8, 11)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 1, 14)) + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 3, 1), Decl(collisionCodeGenModuleWithFunctionChildren.ts, 10, 1)) + + function fn3() { +>fn3 : Symbol(fn3, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 12, 10)) + + function M() { +>M : Symbol(M, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 13, 20)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 15, 15)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithFunctionChildren.ts, 1, 14)) + } + } +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types index 07ef123f642..5c99bc7b40b 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types @@ -4,6 +4,7 @@ module M { export var x = 3; >x : number +>3 : number function fn(M, p = x) { } >fn : (M: any, p?: number) => void diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.symbols b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.symbols new file mode 100644 index 00000000000..dba4163f16e --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithMemberClassConflict.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 0, 0)) + + export class m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 0, 11)) + } +} +var foo = new m1.m1(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 13, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 14, 3)) +>m1.m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 0, 11)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 0, 0)) +>m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 0, 11)) + +module m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 22)) + + export class m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 6, 11)) + } + + export class _m2 { +>_m2 : Symbol(_m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 8, 5)) + } +} +var foo = new m2.m2(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 13, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 14, 3)) +>m2.m2 : Symbol(m2.m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 6, 11)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 22)) +>m2 : Symbol(m2.m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 6, 11)) + +var foo = new m2._m2(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 13, 3), Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 14, 3)) +>m2._m2 : Symbol(m2._m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 8, 5)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 4, 22)) +>_m2 : Symbol(m2._m2, Decl(collisionCodeGenModuleWithMemberClassConflict.ts, 8, 5)) + diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.symbols b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.symbols new file mode 100644 index 00000000000..c9fc2e8175f --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithMemberInterfaceConflict.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 0, 0)) + + export interface m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 0, 11)) + } + export class m2 implements m1 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 2, 5)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 0, 11)) + } +} +var foo = new m1.m2(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 6, 3)) +>m1.m2 : Symbol(m1.m2, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 2, 5)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 0, 0)) +>m2 : Symbol(m1.m2, Decl(collisionCodeGenModuleWithMemberInterfaceConflict.ts, 2, 5)) + diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.symbols b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.symbols new file mode 100644 index 00000000000..b2b5cb2e455 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithMemberVariable.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 0, 0)) + + export var m1 = 10; +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 1, 14)) + + var b = m1; +>b : Symbol(b, Decl(collisionCodeGenModuleWithMemberVariable.ts, 2, 7)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 1, 14)) +} +var foo = m1.m1; +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithMemberVariable.ts, 4, 3)) +>m1.m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 1, 14)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 0, 0)) +>m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithMemberVariable.ts, 1, 14)) + diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types index 86f0767959d..651ba5344ad 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.types @@ -4,6 +4,7 @@ module m1 { export var m1 = 10; >m1 : number +>10 : number var b = m1; >b : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.symbols b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.symbols new file mode 100644 index 00000000000..02105ce42e6 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.symbols @@ -0,0 +1,68 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithMethodChildren.ts === +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithMethodChildren.ts, 5, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 14, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 24, 1)) + + export var x = 3; +>x : Symbol(x, Decl(collisionCodeGenModuleWithMethodChildren.ts, 1, 14)) + + class c { +>c : Symbol(c, Decl(collisionCodeGenModuleWithMethodChildren.ts, 1, 21)) + + fn(M, p = x) { } +>fn : Symbol(fn, Decl(collisionCodeGenModuleWithMethodChildren.ts, 2, 13)) +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 3, 11)) +>p : Symbol(p, Decl(collisionCodeGenModuleWithMethodChildren.ts, 3, 13)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithMethodChildren.ts, 1, 14)) + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithMethodChildren.ts, 5, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 14, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 24, 1)) + + class d { +>d : Symbol(d, Decl(collisionCodeGenModuleWithMethodChildren.ts, 7, 10)) + + fn2() { +>fn2 : Symbol(fn2, Decl(collisionCodeGenModuleWithMethodChildren.ts, 8, 13)) + + var M; +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 10, 15)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithMethodChildren.ts, 11, 15)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithMethodChildren.ts, 1, 14)) + } + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithMethodChildren.ts, 5, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 14, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 24, 1)) + + class e { +>e : Symbol(e, Decl(collisionCodeGenModuleWithMethodChildren.ts, 16, 10)) + + fn3() { +>fn3 : Symbol(fn3, Decl(collisionCodeGenModuleWithMethodChildren.ts, 17, 13)) + + function M() { +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 18, 15)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithMethodChildren.ts, 20, 19)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithMethodChildren.ts, 1, 14)) + } + } + } +} + +module M { // Shouldnt bn _M +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithMethodChildren.ts, 5, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 14, 1), Decl(collisionCodeGenModuleWithMethodChildren.ts, 24, 1)) + + class f { +>f : Symbol(f, Decl(collisionCodeGenModuleWithMethodChildren.ts, 26, 10)) + + M() { +>M : Symbol(M, Decl(collisionCodeGenModuleWithMethodChildren.ts, 27, 13)) + } + } +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types index 3632806e9b3..e7c6d9021eb 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.types @@ -4,6 +4,7 @@ module M { export var x = 3; >x : number +>3 : number class c { >c : c diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.symbols b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.symbols new file mode 100644 index 00000000000..42cc1d51007 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.symbols @@ -0,0 +1,91 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithModuleChildren.ts === +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 15, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 24, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 33, 1)) + + export var x = 3; +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + + module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 21)) + + var M = 10; +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 3, 11)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithModuleChildren.ts, 4, 11)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 15, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 24, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 33, 1)) + + module m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleChildren.ts, 8, 10)) + + class M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 9, 15)) + } + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithModuleChildren.ts, 12, 11)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + + var p2 = new M(); +>p2 : Symbol(p2, Decl(collisionCodeGenModuleWithModuleChildren.ts, 13, 11)) +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 9, 15)) + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 15, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 24, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 33, 1)) + + module m3 { +>m3 : Symbol(m3, Decl(collisionCodeGenModuleWithModuleChildren.ts, 17, 10)) + + function M() { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 18, 15)) + } + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithModuleChildren.ts, 21, 11)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + + var p2 = M(); +>p2 : Symbol(p2, Decl(collisionCodeGenModuleWithModuleChildren.ts, 22, 11)) +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 18, 15)) + } +} + +module M { // shouldnt be _M +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 15, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 24, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 33, 1)) + + module m3 { +>m3 : Symbol(m3, Decl(collisionCodeGenModuleWithModuleChildren.ts, 26, 10)) + + interface M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 27, 15)) + } + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithModuleChildren.ts, 30, 11)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + + var p2: M; +>p2 : Symbol(p2, Decl(collisionCodeGenModuleWithModuleChildren.ts, 31, 11)) +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 27, 15)) + } +} + +module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleChildren.ts, 6, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 15, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 24, 1), Decl(collisionCodeGenModuleWithModuleChildren.ts, 33, 1)) + + module m4 { +>m4 : Symbol(m4, Decl(collisionCodeGenModuleWithModuleChildren.ts, 35, 10)) + + module M { +>M : Symbol(M, Decl(collisionCodeGenModuleWithModuleChildren.ts, 36, 15)) + + var p = x; +>p : Symbol(p, Decl(collisionCodeGenModuleWithModuleChildren.ts, 38, 15)) +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleChildren.ts, 1, 14)) + } + } +} diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types index 7853bcbdb32..4ffaf6dad04 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types @@ -4,12 +4,14 @@ module M { export var x = 3; >x : number +>3 : number module m1 { >m1 : typeof m1 var M = 10; >M : number +>10 : number var p = x; >p : number diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.symbols b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.symbols new file mode 100644 index 00000000000..6dfd0727a1c --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.symbols @@ -0,0 +1,83 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithModuleReopening.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleReopening.ts, 4, 22)) + + export class m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 11)) + } +} +var foo = new m1.m1(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithModuleReopening.ts, 4, 3)) +>m1.m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 11)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleReopening.ts, 4, 22)) +>m1 : Symbol(m1.m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 11)) + +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleReopening.ts, 4, 22)) + + export class c1 { +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 5, 11)) + } + var b = new c1(); +>b : Symbol(b, Decl(collisionCodeGenModuleWithModuleReopening.ts, 8, 7)) +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 5, 11)) + + var c = new m1(); +>c : Symbol(c, Decl(collisionCodeGenModuleWithModuleReopening.ts, 9, 7)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 11)) +} +var foo2 = new m1.c1(); +>foo2 : Symbol(foo2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 3), Decl(collisionCodeGenModuleWithModuleReopening.ts, 28, 3)) +>m1.c1 : Symbol(m1.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 5, 11)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 0, 0), Decl(collisionCodeGenModuleWithModuleReopening.ts, 4, 22)) +>c1 : Symbol(m1.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 5, 11)) + +module m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 23), Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 23)) + + export class c1 { +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) + } + export var b10 = 10; +>b10 : Symbol(b10, Decl(collisionCodeGenModuleWithModuleReopening.ts, 16, 14)) + + var x = new c1(); +>x : Symbol(x, Decl(collisionCodeGenModuleWithModuleReopening.ts, 17, 7)) +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) +} +var foo3 = new m2.c1(); +>foo3 : Symbol(foo3, Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 3), Decl(collisionCodeGenModuleWithModuleReopening.ts, 27, 3)) +>m2.c1 : Symbol(m2.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 23), Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 23)) +>c1 : Symbol(m2.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) + +module m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 23), Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 23)) + + export class m2 { +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 20, 11)) + } + var b = new m2(); +>b : Symbol(b, Decl(collisionCodeGenModuleWithModuleReopening.ts, 23, 7)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 20, 11)) + + var d = b10; +>d : Symbol(d, Decl(collisionCodeGenModuleWithModuleReopening.ts, 24, 7)) +>b10 : Symbol(b10, Decl(collisionCodeGenModuleWithModuleReopening.ts, 16, 14)) + + var c = new c1(); +>c : Symbol(c, Decl(collisionCodeGenModuleWithModuleReopening.ts, 25, 7)) +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) +} +var foo3 = new m2.c1(); +>foo3 : Symbol(foo3, Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 3), Decl(collisionCodeGenModuleWithModuleReopening.ts, 27, 3)) +>m2.c1 : Symbol(m2.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 23), Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 23)) +>c1 : Symbol(m2.c1, Decl(collisionCodeGenModuleWithModuleReopening.ts, 13, 11)) + +var foo2 = new m2.m2(); +>foo2 : Symbol(foo2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 3), Decl(collisionCodeGenModuleWithModuleReopening.ts, 28, 3)) +>m2.m2 : Symbol(m2.m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 20, 11)) +>m2 : Symbol(m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 11, 23), Decl(collisionCodeGenModuleWithModuleReopening.ts, 19, 23)) +>m2 : Symbol(m2.m2, Decl(collisionCodeGenModuleWithModuleReopening.ts, 20, 11)) + diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types index 27520618366..b71eeb621d0 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.types @@ -44,6 +44,7 @@ module m2 { } export var b10 = 10; >b10 : number +>10 : number var x = new c1(); >x : c1 diff --git a/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.symbols b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.symbols new file mode 100644 index 00000000000..dd8c8d5de3e --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithPrivateMember.ts === +module m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 0, 0)) + + class m1 { +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 0, 11)) + } + var x = new m1(); +>x : Symbol(x, Decl(collisionCodeGenModuleWithPrivateMember.ts, 3, 7)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 0, 11)) + + export class c1 { +>c1 : Symbol(c1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 3, 21)) + } +} +var foo = new m1.c1(); +>foo : Symbol(foo, Decl(collisionCodeGenModuleWithPrivateMember.ts, 7, 3)) +>m1.c1 : Symbol(m1.c1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 3, 21)) +>m1 : Symbol(m1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 0, 0)) +>c1 : Symbol(m1.c1, Decl(collisionCodeGenModuleWithPrivateMember.ts, 3, 21)) + diff --git a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.symbols b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.symbols new file mode 100644 index 00000000000..d62860b50e6 --- /dev/null +++ b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/collisionCodeGenModuleWithUnicodeNames.ts === +module 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 { +>才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : Symbol(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 0)) + + export class 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 { +>才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : Symbol(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 82)) + } +} + +var x = new 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123(); +>x : Symbol(x, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 5, 3)) +>才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : Symbol(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 82)) +>才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : Symbol(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 0)) +>才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 : Symbol(才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123.才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123, Decl(collisionCodeGenModuleWithUnicodeNames.ts, 0, 82)) + + + diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.symbols new file mode 100644 index 00000000000..07aaf7d6c75 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientClass_externalmodule.ts === +export declare class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 0, 0)) +} +export declare class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 1, 1)) +} +declare module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 3, 1)) + + class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 4, 19)) + } + class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 6, 5)) + } +} +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 9, 1)) + + export declare class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 10, 11)) + } + export declare class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_externalmodule.ts, 12, 5)) + } +} + +=== tests/cases/compiler/collisionExportsRequireAndAmbientClass_globalFile.ts === +declare class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 0, 0)) +} +declare class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 1, 1)) +} +declare module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 3, 1)) + + class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 4, 19)) + } + class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 6, 5)) + } +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 9, 1)) + + export declare class require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 10, 11)) + } + export declare class exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 12, 5)) + } + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientClass_globalFile.ts, 15, 7)) +} diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types index 8212c6ffc61..0db9958d533 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.types @@ -54,4 +54,5 @@ module m4 { } var a = 10; >a : number +>10 : number } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.symbols new file mode 100644 index 00000000000..b90dd277bb3 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.symbols @@ -0,0 +1,127 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientEnum_externalmodule.ts === +export declare enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 0, 0)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 0, 29)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 1, 14)) +} +export declare enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 3, 1)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 4, 29)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 5, 14)) +} +declare module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 7, 1)) + + enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 8, 19)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 9, 18)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 10, 18)) + } + enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 12, 5)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 13, 18)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 14, 18)) + } +} +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 17, 1)) + + export declare enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 18, 11)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 19, 33)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 20, 18)) + } + export declare enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 22, 5)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 23, 33)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_externalmodule.ts, 24, 18)) + } +} + +=== tests/cases/compiler/collisionExportsRequireAndAmbientEnum_globalFile.ts === +declare enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 0, 0)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 0, 22)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 1, 14)) +} +declare enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 3, 1)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 4, 22)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 5, 14)) +} +declare module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 7, 1)) + + enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 8, 19)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 9, 18)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 10, 18)) + } + enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 12, 5)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 13, 18)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 14, 18)) + } +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 17, 1)) + + export declare enum require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 18, 11)) + + _thisVal1, +>_thisVal1 : Symbol(require._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 19, 33)) + + _thisVal2, +>_thisVal2 : Symbol(require._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 20, 18)) + } + export declare enum exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 22, 5)) + + _thisVal1, +>_thisVal1 : Symbol(exports._thisVal1, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 23, 33)) + + _thisVal2, +>_thisVal2 : Symbol(exports._thisVal2, Decl(collisionExportsRequireAndAmbientEnum_globalFile.ts, 24, 18)) + } +} diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.symbols new file mode 100644 index 00000000000..807b9e64553 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientFunction.ts === +export declare function exports(): number; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunction.ts, 0, 0)) + +export declare function require(): string[]; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunction.ts, 0, 42)) + +declare module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndAmbientFunction.ts, 2, 44)) + + function exports(): string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunction.ts, 4, 19)) + + function require(): number; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunction.ts, 5, 31)) +} +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndAmbientFunction.ts, 7, 1)) + + export declare function exports(): string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunction.ts, 8, 11)) + + export declare function require(): string[]; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunction.ts, 9, 46)) + + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientFunction.ts, 11, 7)) +} diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types index 024bdff8ea3..76210f7dda0 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunction.types @@ -25,4 +25,5 @@ module m2 { var a = 10; >a : number +>10 : number } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.symbols new file mode 100644 index 00000000000..d3d8ad2befe --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientFunctionInGlobalFile.ts === +declare function exports(): number; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 0, 0)) + +declare function require(): string; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 0, 35)) + +declare module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 1, 35)) + + function exports(): string[]; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 2, 19)) + + function require(): number[]; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 3, 33)) +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 5, 1)) + + export declare function exports(): string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 6, 11)) + + export declare function require(): string; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 7, 46)) + + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientFunctionInGlobalFile.ts, 9, 7)) +} diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types index 0ecde7f429f..9804380fd7a 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.types @@ -25,4 +25,5 @@ module m4 { var a = 10; >a : number +>10 : number } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.symbols new file mode 100644 index 00000000000..e888a419c42 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.symbols @@ -0,0 +1,159 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientModule_externalmodule.ts === +export declare module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 0, 31)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 2, 5)) + } +} +export function foo(): require.I { +>foo : Symbol(foo, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 5, 1)) +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 0, 0)) +>I : Symbol(require.I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 0, 31)) + + return null; +} +export declare module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 8, 1)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 9, 31)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 11, 5)) + } +} +export function foo2(): exports.I { +>foo2 : Symbol(foo2, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 14, 1)) +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 8, 1)) +>I : Symbol(exports.I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 9, 31)) + + return null; +} +declare module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 17, 1)) + + module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 18, 19)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 19, 20)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 21, 9)) + } + } + module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 24, 5)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 25, 20)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 27, 9)) + } + } +} +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 31, 1)) + + export declare module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 32, 11)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 33, 35)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 35, 9)) + } + } + export declare module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 38, 5)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 39, 35)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 41, 9)) + } + } + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientModule_externalmodule.ts, 45, 7)) +} + +=== tests/cases/compiler/collisionExportsRequireAndAmbientModule_globalFile.ts === +declare module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 0, 24)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 2, 5)) + } +} +declare module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 5, 1)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 6, 24)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 8, 5)) + } +} +declare module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 11, 1)) + + module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 12, 19)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 13, 20)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 15, 9)) + } + } + module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 18, 5)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 19, 20)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 21, 9)) + } + } +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 25, 1)) + + export declare module require { +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 26, 11)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 27, 35)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 29, 9)) + } + } + export declare module exports { +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 32, 5)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 33, 35)) + } + export class C { +>C : Symbol(C, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 35, 9)) + } + } + + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientModule_globalFile.ts, 40, 7)) +} + diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types index 7e41093daaa..1c4c56de99c 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.types @@ -11,10 +11,11 @@ export declare module require { } export function foo(): require.I { >foo : () => require.I ->require : unknown +>require : any >I : require.I return null; +>null : null } export declare module exports { >exports : typeof exports @@ -28,10 +29,11 @@ export declare module exports { } export function foo2(): exports.I { >foo2 : () => exports.I ->exports : unknown +>exports : any >I : exports.I return null; +>null : null } declare module m1 { >m1 : typeof m1 @@ -82,6 +84,7 @@ module m2 { } var a = 10; >a : number +>10 : number } === tests/cases/compiler/collisionExportsRequireAndAmbientModule_globalFile.ts === @@ -155,5 +158,6 @@ module m4 { var a = 10; >a : number +>10 : number } diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.symbols b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.symbols new file mode 100644 index 00000000000..518d9ee8b63 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/collisionExportsRequireAndAmbientVar_externalmodule.ts === +export declare var exports: number; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 0, 18)) + +export declare var require: string; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 1, 18)) + +declare module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 1, 35)) + + var exports: string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 3, 7)) + + var require: number; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 4, 7)) +} +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 5, 1)) + + export declare var exports: number; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 7, 22)) + + export declare var require: string; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 8, 22)) + + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientVar_externalmodule.ts, 9, 7)) +} + +=== tests/cases/compiler/collisionExportsRequireAndAmbientVar_globalFile.ts === +declare var exports: number; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 0, 11)) + +declare var require: string; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 1, 11)) + +declare module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 1, 28)) + + var exports: string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 3, 7)) + + var require: number; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 4, 7)) +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 5, 1)) + + export declare var exports: string; +>exports : Symbol(exports, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 7, 22)) + + export declare var require: number; +>require : Symbol(require, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 8, 22)) + + var a = 10; +>a : Symbol(a, Decl(collisionExportsRequireAndAmbientVar_globalFile.ts, 9, 7)) +} diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types index 1419df3504b..90a9b8968e5 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.types @@ -25,6 +25,7 @@ module m2 { var a = 10; >a : number +>10 : number } === tests/cases/compiler/collisionExportsRequireAndAmbientVar_globalFile.ts === @@ -54,4 +55,5 @@ module m4 { var a = 10; >a : number +>10 : number } diff --git a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.symbols b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.symbols new file mode 100644 index 00000000000..2fae606b76b --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/collisionExportsRequireAndFunctionInGlobalFile.ts === +function exports() { +>exports : Symbol(exports, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 0, 0)) + + return 1; +} +function require() { +>require : Symbol(require, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 2, 1)) + + return "require"; +} +module m3 { +>m3 : Symbol(m3, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 5, 1)) + + function exports() { +>exports : Symbol(exports, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 6, 11)) + + return 1; + } + function require() { +>require : Symbol(require, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 9, 5)) + + return "require"; + } +} +module m4 { +>m4 : Symbol(m4, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 13, 1)) + + export function exports() { +>exports : Symbol(exports, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 14, 11)) + + return 1; + } + export function require() { +>require : Symbol(require, Decl(collisionExportsRequireAndFunctionInGlobalFile.ts, 17, 5)) + + return "require"; + } +} diff --git a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types index ba804feb91a..3cc08359508 100644 --- a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types +++ b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.types @@ -3,11 +3,13 @@ function exports() { >exports : () => number return 1; +>1 : number } function require() { >require : () => string return "require"; +>"require" : string } module m3 { >m3 : typeof m3 @@ -16,11 +18,13 @@ module m3 { >exports : () => number return 1; +>1 : number } function require() { >require : () => string return "require"; +>"require" : string } } module m4 { @@ -30,10 +34,12 @@ module m4 { >exports : () => number return 1; +>1 : number } export function require() { >require : () => string return "require"; +>"require" : string } } diff --git a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.symbols b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.symbols new file mode 100644 index 00000000000..08b8cf9c6a8 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts === +module mOfGloalFile { +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + } +} +import exports = mOfGloalFile.c; +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 3, 1)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + +import require = mOfGloalFile.c; +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 4, 32)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + +new exports(); +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 3, 1)) + +new require(); +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 4, 32)) + +module m1 { +>m1 : Symbol(m1, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 7, 14)) + + import exports = mOfGloalFile.c; +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 9, 11)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + + import require = mOfGloalFile.c; +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 10, 36)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + + new exports(); +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 9, 11)) + + new require(); +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 10, 36)) +} + +module m2 { +>m2 : Symbol(m2, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 14, 1)) + + export import exports = mOfGloalFile.c; +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 16, 11)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + + export import require = mOfGloalFile.c; +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 17, 43)) +>mOfGloalFile : Symbol(mOfGloalFile, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 0)) +>c : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 0, 21)) + + new exports(); +>exports : Symbol(exports, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 16, 11)) + + new require(); +>require : Symbol(require, Decl(collisionExportsRequireAndInternalModuleAliasInGlobalFile.ts, 17, 43)) +} diff --git a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.symbols b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.symbols new file mode 100644 index 00000000000..409d1275677 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/collisionExportsRequireAndUninstantiatedModule.ts === +export module require { // no error +>require : Symbol(require, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 0, 23)) + } +} +export function foo(): require.I { +>foo : Symbol(foo, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 3, 1)) +>require : Symbol(require, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 0, 0)) +>I : Symbol(require.I, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 0, 23)) + + return null; +} +export module exports { // no error +>exports : Symbol(exports, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 6, 1)) + + export interface I { +>I : Symbol(I, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 7, 23)) + } +} +export function foo2(): exports.I { +>foo2 : Symbol(foo2, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 10, 1)) +>exports : Symbol(exports, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 6, 1)) +>I : Symbol(exports.I, Decl(collisionExportsRequireAndUninstantiatedModule.ts, 7, 23)) + + return null; +} diff --git a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types index 59d90feda46..4b313bcd849 100644 --- a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types +++ b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types @@ -1,6 +1,6 @@ === tests/cases/compiler/collisionExportsRequireAndUninstantiatedModule.ts === export module require { // no error ->require : unknown +>require : any export interface I { >I : I @@ -8,13 +8,14 @@ export module require { // no error } export function foo(): require.I { >foo : () => require.I ->require : unknown +>require : any >I : require.I return null; +>null : null } export module exports { // no error ->exports : unknown +>exports : any export interface I { >I : I @@ -22,8 +23,9 @@ export module exports { // no error } export function foo2(): exports.I { >foo2 : () => exports.I ->exports : unknown +>exports : any >I : exports.I return null; +>null : null } diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.symbols b/tests/baselines/reference/collisionRestParameterArrowFunctions.symbols new file mode 100644 index 00000000000..9a44f92b1f5 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/collisionRestParameterArrowFunctions.ts === +var f1 = (_i: number, ...restParameters) => { //_i is error +>f1 : Symbol(f1, Decl(collisionRestParameterArrowFunctions.ts, 0, 3)) +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 0, 10), Decl(collisionRestParameterArrowFunctions.ts, 1, 7)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterArrowFunctions.ts, 0, 21)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 0, 10), Decl(collisionRestParameterArrowFunctions.ts, 1, 7)) +} +var f1NoError = (_i: number) => { // no error +>f1NoError : Symbol(f1NoError, Decl(collisionRestParameterArrowFunctions.ts, 3, 3)) +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 3, 17), Decl(collisionRestParameterArrowFunctions.ts, 4, 7)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 3, 17), Decl(collisionRestParameterArrowFunctions.ts, 4, 7)) +} + +var f2 = (...restParameters) => { +>f2 : Symbol(f2, Decl(collisionRestParameterArrowFunctions.ts, 7, 3)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterArrowFunctions.ts, 7, 10)) + + var _i = 10; // No Error +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 8, 7)) +} +var f2NoError = () => { +>f2NoError : Symbol(f2NoError, Decl(collisionRestParameterArrowFunctions.ts, 10, 3)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterArrowFunctions.ts, 11, 7)) +} diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.types b/tests/baselines/reference/collisionRestParameterArrowFunctions.types index f2316c99583..dcd52e5f766 100644 --- a/tests/baselines/reference/collisionRestParameterArrowFunctions.types +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.types @@ -7,6 +7,7 @@ var f1 = (_i: number, ...restParameters) => { //_i is error var _i = 10; // no error >_i : number +>10 : number } var f1NoError = (_i: number) => { // no error >f1NoError : (_i: number) => void @@ -15,6 +16,7 @@ var f1NoError = (_i: number) => { // no error var _i = 10; // no error >_i : number +>10 : number } var f2 = (...restParameters) => { @@ -24,6 +26,7 @@ var f2 = (...restParameters) => { var _i = 10; // No Error >_i : number +>10 : number } var f2NoError = () => { >f2NoError : () => void @@ -31,4 +34,5 @@ var f2NoError = () => { var _i = 10; // no error >_i : number +>10 : number } diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.symbols b/tests/baselines/reference/collisionRestParameterClassConstructor.symbols new file mode 100644 index 00000000000..895cb0f8df4 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.symbols @@ -0,0 +1,137 @@ +=== tests/cases/compiler/collisionRestParameterClassConstructor.ts === +// Constructors +class c1 { +>c1 : Symbol(c1, Decl(collisionRestParameterClassConstructor.ts, 0, 0)) + + constructor(_i: number, ...restParameters) { //_i is error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 2, 16), Decl(collisionRestParameterClassConstructor.ts, 3, 11)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassConstructor.ts, 2, 27)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 2, 16), Decl(collisionRestParameterClassConstructor.ts, 3, 11)) + } +} +class c1NoError { +>c1NoError : Symbol(c1NoError, Decl(collisionRestParameterClassConstructor.ts, 5, 1)) + + constructor(_i: number) { // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 7, 16), Decl(collisionRestParameterClassConstructor.ts, 8, 11)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 7, 16), Decl(collisionRestParameterClassConstructor.ts, 8, 11)) + } +} + +class c2 { +>c2 : Symbol(c2, Decl(collisionRestParameterClassConstructor.ts, 10, 1)) + + constructor(...restParameters) { +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassConstructor.ts, 13, 16)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 14, 11)) + } +} +class c2NoError { +>c2NoError : Symbol(c2NoError, Decl(collisionRestParameterClassConstructor.ts, 16, 1)) + + constructor() { + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 19, 11)) + } +} + +class c3 { +>c3 : Symbol(c3, Decl(collisionRestParameterClassConstructor.ts, 21, 1)) + + constructor(public _i: number, ...restParameters) { //_i is error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 24, 16)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassConstructor.ts, 24, 34)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 24, 16), Decl(collisionRestParameterClassConstructor.ts, 25, 11)) + } +} +class c3NoError { +>c3NoError : Symbol(c3NoError, Decl(collisionRestParameterClassConstructor.ts, 27, 1)) + + constructor(public _i: number) { // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 29, 16)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 29, 16), Decl(collisionRestParameterClassConstructor.ts, 30, 11)) + } +} + +declare class c4 { +>c4 : Symbol(c4, Decl(collisionRestParameterClassConstructor.ts, 32, 1)) + + constructor(_i: number, ...restParameters); // No error - no code gen +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 35, 16)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassConstructor.ts, 35, 27)) +} +declare class c4NoError { +>c4NoError : Symbol(c4NoError, Decl(collisionRestParameterClassConstructor.ts, 36, 1)) + + constructor(_i: number); // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 38, 16)) +} + +class c5 { +>c5 : Symbol(c5, Decl(collisionRestParameterClassConstructor.ts, 39, 1)) + + constructor(_i: number, ...rest); // no codegen no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 42, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterClassConstructor.ts, 42, 27)) + + constructor(_i: string, ...rest); // no codegen no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 43, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterClassConstructor.ts, 43, 27)) + + constructor(_i: any, ...rest) { // error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 44, 16), Decl(collisionRestParameterClassConstructor.ts, 45, 11)) +>rest : Symbol(rest, Decl(collisionRestParameterClassConstructor.ts, 44, 24)) + + var _i: any; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 44, 16), Decl(collisionRestParameterClassConstructor.ts, 45, 11)) + } +} + +class c5NoError { +>c5NoError : Symbol(c5NoError, Decl(collisionRestParameterClassConstructor.ts, 47, 1)) + + constructor(_i: number); // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 50, 16)) + + constructor(_i: string); // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 51, 16)) + + constructor(_i: any) { // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 52, 16), Decl(collisionRestParameterClassConstructor.ts, 53, 11)) + + var _i: any; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 52, 16), Decl(collisionRestParameterClassConstructor.ts, 53, 11)) + } +} + +declare class c6 { +>c6 : Symbol(c6, Decl(collisionRestParameterClassConstructor.ts, 55, 1)) + + constructor(_i: number, ...rest); // no codegen no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 58, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterClassConstructor.ts, 58, 27)) + + constructor(_i: string, ...rest); // no codegen no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 59, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterClassConstructor.ts, 59, 27)) +} + +declare class c6NoError { +>c6NoError : Symbol(c6NoError, Decl(collisionRestParameterClassConstructor.ts, 60, 1)) + + constructor(_i: number); // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 63, 16)) + + constructor(_i: string); // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassConstructor.ts, 64, 16)) +} diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.types b/tests/baselines/reference/collisionRestParameterClassConstructor.types index d0ceb9e0749..f86d6d80d21 100644 --- a/tests/baselines/reference/collisionRestParameterClassConstructor.types +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.types @@ -9,6 +9,7 @@ class c1 { var _i = 10; // no error >_i : number +>10 : number } } class c1NoError { @@ -19,6 +20,7 @@ class c1NoError { var _i = 10; // no error >_i : number +>10 : number } } @@ -30,6 +32,7 @@ class c2 { var _i = 10; // no error >_i : number +>10 : number } } class c2NoError { @@ -38,6 +41,7 @@ class c2NoError { constructor() { var _i = 10; // no error >_i : number +>10 : number } } @@ -50,6 +54,7 @@ class c3 { var _i = 10; // no error >_i : number +>10 : number } } class c3NoError { @@ -60,6 +65,7 @@ class c3NoError { var _i = 10; // no error >_i : number +>10 : number } } diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.symbols b/tests/baselines/reference/collisionRestParameterClassMethod.symbols new file mode 100644 index 00000000000..838736e33ce --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterClassMethod.symbols @@ -0,0 +1,103 @@ +=== tests/cases/compiler/collisionRestParameterClassMethod.ts === +class c1 { +>c1 : Symbol(c1, Decl(collisionRestParameterClassMethod.ts, 0, 0)) + + public foo(_i: number, ...restParameters) { //_i is error +>foo : Symbol(foo, Decl(collisionRestParameterClassMethod.ts, 0, 10)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 1, 15), Decl(collisionRestParameterClassMethod.ts, 2, 11)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassMethod.ts, 1, 26)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 1, 15), Decl(collisionRestParameterClassMethod.ts, 2, 11)) + } + public fooNoError(_i: number) { // no error +>fooNoError : Symbol(fooNoError, Decl(collisionRestParameterClassMethod.ts, 3, 5)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 4, 22), Decl(collisionRestParameterClassMethod.ts, 5, 11)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 4, 22), Decl(collisionRestParameterClassMethod.ts, 5, 11)) + } + public f4(_i: number, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterClassMethod.ts, 6, 5), Decl(collisionRestParameterClassMethod.ts, 7, 35), Decl(collisionRestParameterClassMethod.ts, 8, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 7, 14)) +>rest : Symbol(rest, Decl(collisionRestParameterClassMethod.ts, 7, 25)) + + public f4(_i: string, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterClassMethod.ts, 6, 5), Decl(collisionRestParameterClassMethod.ts, 7, 35), Decl(collisionRestParameterClassMethod.ts, 8, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 8, 14)) +>rest : Symbol(rest, Decl(collisionRestParameterClassMethod.ts, 8, 25)) + + public f4(_i: any, ...rest) { // error +>f4 : Symbol(f4, Decl(collisionRestParameterClassMethod.ts, 6, 5), Decl(collisionRestParameterClassMethod.ts, 7, 35), Decl(collisionRestParameterClassMethod.ts, 8, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 9, 14), Decl(collisionRestParameterClassMethod.ts, 10, 11)) +>rest : Symbol(rest, Decl(collisionRestParameterClassMethod.ts, 9, 22)) + + var _i: any; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 9, 14), Decl(collisionRestParameterClassMethod.ts, 10, 11)) + } + + public f4NoError(_i: number); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterClassMethod.ts, 11, 5), Decl(collisionRestParameterClassMethod.ts, 13, 33), Decl(collisionRestParameterClassMethod.ts, 14, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 13, 21)) + + public f4NoError(_i: string); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterClassMethod.ts, 11, 5), Decl(collisionRestParameterClassMethod.ts, 13, 33), Decl(collisionRestParameterClassMethod.ts, 14, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 14, 21)) + + public f4NoError(_i: any) { // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterClassMethod.ts, 11, 5), Decl(collisionRestParameterClassMethod.ts, 13, 33), Decl(collisionRestParameterClassMethod.ts, 14, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 15, 21), Decl(collisionRestParameterClassMethod.ts, 16, 11)) + + var _i: any; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 15, 21), Decl(collisionRestParameterClassMethod.ts, 16, 11)) + } +} + +declare class c2 { +>c2 : Symbol(c2, Decl(collisionRestParameterClassMethod.ts, 18, 1)) + + public foo(_i: number, ...restParameters); // No error - no code gen +>foo : Symbol(foo, Decl(collisionRestParameterClassMethod.ts, 20, 18)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 21, 15)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassMethod.ts, 21, 26)) + + public fooNoError(_i: number); // no error +>fooNoError : Symbol(fooNoError, Decl(collisionRestParameterClassMethod.ts, 21, 46)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 22, 22)) + + public f4(_i: number, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterClassMethod.ts, 22, 34), Decl(collisionRestParameterClassMethod.ts, 24, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 24, 14)) +>rest : Symbol(rest, Decl(collisionRestParameterClassMethod.ts, 24, 25)) + + public f4(_i: string, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterClassMethod.ts, 22, 34), Decl(collisionRestParameterClassMethod.ts, 24, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 25, 14)) +>rest : Symbol(rest, Decl(collisionRestParameterClassMethod.ts, 25, 25)) + + public f4NoError(_i: number); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterClassMethod.ts, 25, 35), Decl(collisionRestParameterClassMethod.ts, 26, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 26, 21)) + + public f4NoError(_i: string); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterClassMethod.ts, 25, 35), Decl(collisionRestParameterClassMethod.ts, 26, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 27, 21)) +} + +class c3 { +>c3 : Symbol(c3, Decl(collisionRestParameterClassMethod.ts, 28, 1)) + + public foo(...restParameters) { +>foo : Symbol(foo, Decl(collisionRestParameterClassMethod.ts, 30, 10)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterClassMethod.ts, 31, 15)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 32, 11)) + } + public fooNoError() { +>fooNoError : Symbol(fooNoError, Decl(collisionRestParameterClassMethod.ts, 33, 5)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterClassMethod.ts, 35, 11)) + } +} diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.types b/tests/baselines/reference/collisionRestParameterClassMethod.types index 2a4c23ae5a9..bc6b09dd795 100644 --- a/tests/baselines/reference/collisionRestParameterClassMethod.types +++ b/tests/baselines/reference/collisionRestParameterClassMethod.types @@ -9,6 +9,7 @@ class c1 { var _i = 10; // no error >_i : number +>10 : number } public fooNoError(_i: number) { // no error >fooNoError : (_i: number) => void @@ -16,6 +17,7 @@ class c1 { var _i = 10; // no error >_i : number +>10 : number } public f4(_i: number, ...rest); // no codegen no error >f4 : { (_i: number, ...rest: any[]): any; (_i: string, ...rest: any[]): any; } @@ -93,11 +95,13 @@ class c3 { var _i = 10; // no error >_i : number +>10 : number } public fooNoError() { >fooNoError : () => void var _i = 10; // no error >_i : number +>10 : number } } diff --git a/tests/baselines/reference/collisionRestParameterFunction.symbols b/tests/baselines/reference/collisionRestParameterFunction.symbols new file mode 100644 index 00000000000..918cc7534dd --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterFunction.symbols @@ -0,0 +1,88 @@ +=== tests/cases/compiler/collisionRestParameterFunction.ts === +// Functions +function f1(_i: number, ...restParameters) { //_i is error +>f1 : Symbol(f1, Decl(collisionRestParameterFunction.ts, 0, 0)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 1, 12), Decl(collisionRestParameterFunction.ts, 2, 7)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterFunction.ts, 1, 23)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 1, 12), Decl(collisionRestParameterFunction.ts, 2, 7)) +} +function f1NoError(_i: number) { // no error +>f1NoError : Symbol(f1NoError, Decl(collisionRestParameterFunction.ts, 3, 1)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 4, 19), Decl(collisionRestParameterFunction.ts, 5, 7)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 4, 19), Decl(collisionRestParameterFunction.ts, 5, 7)) +} + +declare function f2(_i: number, ...restParameters); // no error - no code gen +>f2 : Symbol(f2, Decl(collisionRestParameterFunction.ts, 6, 1)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 8, 20)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterFunction.ts, 8, 31)) + +declare function f2NoError(_i: number); // no error +>f2NoError : Symbol(f2NoError, Decl(collisionRestParameterFunction.ts, 8, 51)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 9, 27)) + +function f3(...restParameters) { +>f3 : Symbol(f3, Decl(collisionRestParameterFunction.ts, 9, 39)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterFunction.ts, 11, 12)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 12, 7)) +} +function f3NoError() { +>f3NoError : Symbol(f3NoError, Decl(collisionRestParameterFunction.ts, 13, 1)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 15, 7)) +} + +function f4(_i: number, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterFunction.ts, 16, 1), Decl(collisionRestParameterFunction.ts, 18, 33), Decl(collisionRestParameterFunction.ts, 19, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 18, 12)) +>rest : Symbol(rest, Decl(collisionRestParameterFunction.ts, 18, 23)) + +function f4(_i: string, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterFunction.ts, 16, 1), Decl(collisionRestParameterFunction.ts, 18, 33), Decl(collisionRestParameterFunction.ts, 19, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 19, 12)) +>rest : Symbol(rest, Decl(collisionRestParameterFunction.ts, 19, 23)) + +function f4(_i: any, ...rest) { // error +>f4 : Symbol(f4, Decl(collisionRestParameterFunction.ts, 16, 1), Decl(collisionRestParameterFunction.ts, 18, 33), Decl(collisionRestParameterFunction.ts, 19, 33)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 20, 12)) +>rest : Symbol(rest, Decl(collisionRestParameterFunction.ts, 20, 20)) +} + +function f4NoError(_i: number); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunction.ts, 21, 1), Decl(collisionRestParameterFunction.ts, 23, 31), Decl(collisionRestParameterFunction.ts, 24, 31)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 23, 19)) + +function f4NoError(_i: string); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunction.ts, 21, 1), Decl(collisionRestParameterFunction.ts, 23, 31), Decl(collisionRestParameterFunction.ts, 24, 31)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 24, 19)) + +function f4NoError(_i: any) { // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunction.ts, 21, 1), Decl(collisionRestParameterFunction.ts, 23, 31), Decl(collisionRestParameterFunction.ts, 24, 31)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 25, 19)) +} + +declare function f5(_i: number, ...rest); // no codegen no error +>f5 : Symbol(f5, Decl(collisionRestParameterFunction.ts, 26, 1), Decl(collisionRestParameterFunction.ts, 28, 41)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 28, 20)) +>rest : Symbol(rest, Decl(collisionRestParameterFunction.ts, 28, 31)) + +declare function f5(_i: string, ...rest); // no codegen no error +>f5 : Symbol(f5, Decl(collisionRestParameterFunction.ts, 26, 1), Decl(collisionRestParameterFunction.ts, 28, 41)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 29, 20)) +>rest : Symbol(rest, Decl(collisionRestParameterFunction.ts, 29, 31)) + +declare function f6(_i: number); // no codegen no error +>f6 : Symbol(f6, Decl(collisionRestParameterFunction.ts, 29, 41), Decl(collisionRestParameterFunction.ts, 31, 32)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 31, 20)) + +declare function f6(_i: string); // no codegen no error +>f6 : Symbol(f6, Decl(collisionRestParameterFunction.ts, 29, 41), Decl(collisionRestParameterFunction.ts, 31, 32)) +>_i : Symbol(_i, Decl(collisionRestParameterFunction.ts, 32, 20)) + diff --git a/tests/baselines/reference/collisionRestParameterFunction.types b/tests/baselines/reference/collisionRestParameterFunction.types index f0d8abeac9d..d988f74c928 100644 --- a/tests/baselines/reference/collisionRestParameterFunction.types +++ b/tests/baselines/reference/collisionRestParameterFunction.types @@ -7,6 +7,7 @@ function f1(_i: number, ...restParameters) { //_i is error var _i = 10; // no error >_i : number +>10 : number } function f1NoError(_i: number) { // no error >f1NoError : (_i: number) => void @@ -14,6 +15,7 @@ function f1NoError(_i: number) { // no error var _i = 10; // no error >_i : number +>10 : number } declare function f2(_i: number, ...restParameters); // no error - no code gen @@ -31,12 +33,14 @@ function f3(...restParameters) { var _i = 10; // no error >_i : number +>10 : number } function f3NoError() { >f3NoError : () => void var _i = 10; // no error >_i : number +>10 : number } function f4(_i: number, ...rest); // no codegen no error diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.symbols b/tests/baselines/reference/collisionRestParameterFunctionExpressions.symbols new file mode 100644 index 00000000000..42339c0da95 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.symbols @@ -0,0 +1,62 @@ +=== tests/cases/compiler/collisionRestParameterFunctionExpressions.ts === +function foo() { +>foo : Symbol(foo, Decl(collisionRestParameterFunctionExpressions.ts, 0, 0)) + + function f1(_i: number, ...restParameters) { //_i is error +>f1 : Symbol(f1, Decl(collisionRestParameterFunctionExpressions.ts, 0, 16)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 1, 16), Decl(collisionRestParameterFunctionExpressions.ts, 2, 11)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterFunctionExpressions.ts, 1, 27)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 1, 16), Decl(collisionRestParameterFunctionExpressions.ts, 2, 11)) + } + function f1NoError(_i: number) { // no error +>f1NoError : Symbol(f1NoError, Decl(collisionRestParameterFunctionExpressions.ts, 3, 5)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 4, 23), Decl(collisionRestParameterFunctionExpressions.ts, 5, 11)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 4, 23), Decl(collisionRestParameterFunctionExpressions.ts, 5, 11)) + } + function f3(...restParameters) { +>f3 : Symbol(f3, Decl(collisionRestParameterFunctionExpressions.ts, 6, 5)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterFunctionExpressions.ts, 7, 16)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 8, 11)) + } + function f3NoError() { +>f3NoError : Symbol(f3NoError, Decl(collisionRestParameterFunctionExpressions.ts, 9, 5)) + + var _i = 10; // no error +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 11, 11)) + } + + function f4(_i: number, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterFunctionExpressions.ts, 12, 5), Decl(collisionRestParameterFunctionExpressions.ts, 14, 37), Decl(collisionRestParameterFunctionExpressions.ts, 15, 37)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 14, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterFunctionExpressions.ts, 14, 27)) + + function f4(_i: string, ...rest); // no codegen no error +>f4 : Symbol(f4, Decl(collisionRestParameterFunctionExpressions.ts, 12, 5), Decl(collisionRestParameterFunctionExpressions.ts, 14, 37), Decl(collisionRestParameterFunctionExpressions.ts, 15, 37)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 15, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterFunctionExpressions.ts, 15, 27)) + + function f4(_i: any, ...rest) { // error +>f4 : Symbol(f4, Decl(collisionRestParameterFunctionExpressions.ts, 12, 5), Decl(collisionRestParameterFunctionExpressions.ts, 14, 37), Decl(collisionRestParameterFunctionExpressions.ts, 15, 37)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 16, 16)) +>rest : Symbol(rest, Decl(collisionRestParameterFunctionExpressions.ts, 16, 24)) + } + + function f4NoError(_i: number); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunctionExpressions.ts, 17, 5), Decl(collisionRestParameterFunctionExpressions.ts, 19, 35), Decl(collisionRestParameterFunctionExpressions.ts, 20, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 19, 23)) + + function f4NoError(_i: string); // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunctionExpressions.ts, 17, 5), Decl(collisionRestParameterFunctionExpressions.ts, 19, 35), Decl(collisionRestParameterFunctionExpressions.ts, 20, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 20, 23)) + + function f4NoError(_i: any) { // no error +>f4NoError : Symbol(f4NoError, Decl(collisionRestParameterFunctionExpressions.ts, 17, 5), Decl(collisionRestParameterFunctionExpressions.ts, 19, 35), Decl(collisionRestParameterFunctionExpressions.ts, 20, 35)) +>_i : Symbol(_i, Decl(collisionRestParameterFunctionExpressions.ts, 21, 23)) + } +} diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.types b/tests/baselines/reference/collisionRestParameterFunctionExpressions.types index c6c52390894..f8ca0c18ed8 100644 --- a/tests/baselines/reference/collisionRestParameterFunctionExpressions.types +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.types @@ -9,6 +9,7 @@ function foo() { var _i = 10; // no error >_i : number +>10 : number } function f1NoError(_i: number) { // no error >f1NoError : (_i: number) => void @@ -16,6 +17,7 @@ function foo() { var _i = 10; // no error >_i : number +>10 : number } function f3(...restParameters) { >f3 : (...restParameters: any[]) => void @@ -23,12 +25,14 @@ function foo() { var _i = 10; // no error >_i : number +>10 : number } function f3NoError() { >f3NoError : () => void var _i = 10; // no error >_i : number +>10 : number } function f4(_i: number, ...rest); // no codegen no error diff --git a/tests/baselines/reference/collisionRestParameterInType.symbols b/tests/baselines/reference/collisionRestParameterInType.symbols new file mode 100644 index 00000000000..efe0e89ad42 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterInType.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/collisionRestParameterInType.ts === +var v1: (_i: number, ...restParameters) => void; // no error - no code gen +>v1 : Symbol(v1, Decl(collisionRestParameterInType.ts, 0, 3)) +>_i : Symbol(_i, Decl(collisionRestParameterInType.ts, 0, 9)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInType.ts, 0, 20)) + +var v2: { +>v2 : Symbol(v2, Decl(collisionRestParameterInType.ts, 1, 3)) + + (_i: number, ...restParameters); // no error - no code gen +>_i : Symbol(_i, Decl(collisionRestParameterInType.ts, 2, 5)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInType.ts, 2, 16)) + + new (_i: number, ...restParameters); // no error - no code gen +>_i : Symbol(_i, Decl(collisionRestParameterInType.ts, 3, 9)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInType.ts, 3, 20)) + + foo(_i: number, ...restParameters); // no error - no code gen +>foo : Symbol(foo, Decl(collisionRestParameterInType.ts, 3, 40)) +>_i : Symbol(_i, Decl(collisionRestParameterInType.ts, 4, 8)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInType.ts, 4, 19)) + + prop: (_i: number, ...restParameters) => void; // no error - no code gen +>prop : Symbol(prop, Decl(collisionRestParameterInType.ts, 4, 39)) +>_i : Symbol(_i, Decl(collisionRestParameterInType.ts, 5, 11)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInType.ts, 5, 22)) +} diff --git a/tests/baselines/reference/collisionRestParameterInterfaceMembers.symbols b/tests/baselines/reference/collisionRestParameterInterfaceMembers.symbols new file mode 100644 index 00000000000..448346c0838 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterInterfaceMembers.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/collisionRestParameterInterfaceMembers.ts === +// call +interface i1 { +>i1 : Symbol(i1, Decl(collisionRestParameterInterfaceMembers.ts, 0, 0)) + + (_i: number, ...restParameters); // no error - no code gen +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 2, 5)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInterfaceMembers.ts, 2, 16)) +} +interface i1NoError { +>i1NoError : Symbol(i1NoError, Decl(collisionRestParameterInterfaceMembers.ts, 3, 1)) + + (_i: number); // no error +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 5, 5)) +} + +// new +interface i2 { +>i2 : Symbol(i2, Decl(collisionRestParameterInterfaceMembers.ts, 6, 1)) + + new (_i: number, ...restParameters); // no error - no code gen +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 10, 9)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInterfaceMembers.ts, 10, 20)) +} +interface i2NoError { +>i2NoError : Symbol(i2NoError, Decl(collisionRestParameterInterfaceMembers.ts, 11, 1)) + + new (_i: number); // no error +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 13, 9)) +} + +// method +interface i3 { +>i3 : Symbol(i3, Decl(collisionRestParameterInterfaceMembers.ts, 14, 1)) + + foo (_i: number, ...restParameters); // no error - no code gen +>foo : Symbol(foo, Decl(collisionRestParameterInterfaceMembers.ts, 17, 14)) +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 18, 9)) +>restParameters : Symbol(restParameters, Decl(collisionRestParameterInterfaceMembers.ts, 18, 20)) + + fooNoError (_i: number); // no error +>fooNoError : Symbol(fooNoError, Decl(collisionRestParameterInterfaceMembers.ts, 18, 40)) +>_i : Symbol(_i, Decl(collisionRestParameterInterfaceMembers.ts, 19, 16)) +} diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.symbols b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.symbols new file mode 100644 index 00000000000..ef033d796e4 --- /dev/null +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/collisionRestParameterUnderscoreIUsage.ts === +declare var console: { log(msg?: string): void; }; +>console : Symbol(console, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 11)) +>log : Symbol(log, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 22)) +>msg : Symbol(msg, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 27)) + +var _i = "This is what I'd expect to see"; +>_i : Symbol(_i, Decl(collisionRestParameterUnderscoreIUsage.ts, 1, 3)) + +class Foo { +>Foo : Symbol(Foo, Decl(collisionRestParameterUnderscoreIUsage.ts, 1, 42)) + + constructor(...args: any[]) { +>args : Symbol(args, Decl(collisionRestParameterUnderscoreIUsage.ts, 3, 16)) + + console.log(_i); // This should result in error +>console.log : Symbol(log, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 22)) +>console : Symbol(console, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 11)) +>log : Symbol(log, Decl(collisionRestParameterUnderscoreIUsage.ts, 0, 22)) +>_i : Symbol(_i, Decl(collisionRestParameterUnderscoreIUsage.ts, 1, 3)) + } +} +new Foo(); +>Foo : Symbol(Foo, Decl(collisionRestParameterUnderscoreIUsage.ts, 1, 42)) + diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types index c700f50aca4..fadc27dfa6c 100644 --- a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types @@ -6,6 +6,7 @@ declare var console: { log(msg?: string): void; }; var _i = "This is what I'd expect to see"; >_i : string +>"This is what I'd expect to see" : string class Foo { >Foo : Foo diff --git a/tests/baselines/reference/commaOperator1.symbols b/tests/baselines/reference/commaOperator1.symbols new file mode 100644 index 00000000000..ec4a1f6ceab --- /dev/null +++ b/tests/baselines/reference/commaOperator1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/commaOperator1.ts === +var v1 = ((1, 2, 3), 4, 5, (6, 7)); +>v1 : Symbol(v1, Decl(commaOperator1.ts, 0, 3)) + +function f1() { +>f1 : Symbol(f1, Decl(commaOperator1.ts, 0, 35)) + + var a = 1; +>a : Symbol(a, Decl(commaOperator1.ts, 2, 7)) + + return a, v1, a; +>a : Symbol(a, Decl(commaOperator1.ts, 2, 7)) +>v1 : Symbol(v1, Decl(commaOperator1.ts, 0, 3)) +>a : Symbol(a, Decl(commaOperator1.ts, 2, 7)) +} + diff --git a/tests/baselines/reference/commaOperator1.types b/tests/baselines/reference/commaOperator1.types index 52a36e33024..8116fec8328 100644 --- a/tests/baselines/reference/commaOperator1.types +++ b/tests/baselines/reference/commaOperator1.types @@ -8,14 +8,22 @@ var v1 = ((1, 2, 3), 4, 5, (6, 7)); >(1, 2, 3) : number >1, 2, 3 : number >1, 2 : number +>1 : number +>2 : number +>3 : number +>4 : number +>5 : number >(6, 7) : number >6, 7 : number +>6 : number +>7 : number function f1() { >f1 : () => number var a = 1; >a : number +>1 : number return a, v1, a; >a, v1, a : number diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.symbols b/tests/baselines/reference/commaOperatorOtherValidOperation.symbols new file mode 100644 index 00000000000..da65d20fc30 --- /dev/null +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.symbols @@ -0,0 +1,50 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts === +//Comma operator in for loop +for (var i = 0, j = 10; i < j; i++, j--) +>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8)) +>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15)) +>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8)) +>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15)) +>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8)) +>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15)) +{ +} + +//Comma operator in fuction arguments and return +function foo(x: number, y: string) +>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1)) +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23)) +{ + return x, y; +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23)) +} +var resultIsString = foo(1, "123"); +>resultIsString : Symbol(resultIsString, Decl(commaOperatorOtherValidOperation.ts, 10, 3)) +>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1)) + +//TypeParameters +function foo1() +>foo1 : Symbol(foo1, Decl(commaOperatorOtherValidOperation.ts, 10, 35)) +>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14)) +>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17)) +{ + var x: T1; +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7)) +>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14)) + + var y: T2; +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) +>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17)) + + x, y; +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) + + var resultIsT1 = (y, x); +>resultIsT1 : Symbol(resultIsT1, Decl(commaOperatorOtherValidOperation.ts, 18, 7)) +>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7)) +>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7)) +} + diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.types b/tests/baselines/reference/commaOperatorOtherValidOperation.types index e42991e7b5a..bc7bdd81157 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.types +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.types @@ -2,7 +2,9 @@ //Comma operator in for loop for (var i = 0, j = 10; i < j; i++, j--) >i : number +>0 : number >j : number +>10 : number >i < j : boolean >i : number >j : number @@ -29,6 +31,8 @@ var resultIsString = foo(1, "123"); >resultIsString : string >foo(1, "123") : string >foo : (x: number, y: string) => string +>1 : number +>"123" : string //TypeParameters function foo1() diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols new file mode 100644 index 00000000000..4b7f24a9048 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//The second operand type is any +ANY, ANY; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +BOOLEAN, ANY; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +NUMBER, ANY; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +STRING, ANY; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +OBJECT, ANY; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +//Return type is any +var resultIsAny1 = (ANY, ANY); +>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorWithSecondOperandAnyType.ts, 14, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny2 = (BOOLEAN, ANY); +>resultIsAny2 : Symbol(resultIsAny2, Decl(commaOperatorWithSecondOperandAnyType.ts, 15, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny3 = (NUMBER, ANY); +>resultIsAny3 : Symbol(resultIsAny3, Decl(commaOperatorWithSecondOperandAnyType.ts, 16, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny4 = (STRING, ANY); +>resultIsAny4 : Symbol(resultIsAny4, Decl(commaOperatorWithSecondOperandAnyType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny5 = (OBJECT, ANY); +>resultIsAny5 : Symbol(resultIsAny5, Decl(commaOperatorWithSecondOperandAnyType.ts, 18, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +//Literal and expression +var x: any; +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) + +1, ANY; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +++NUMBER, ANY; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +"string", [null, 1]; +"string".charAt(0), [null, 1]; +>"string".charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +true, x("any"); +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) + +!BOOLEAN, x.doSomeThing(); +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) + +var resultIsAny6 = (1, ANY); +>resultIsAny6 : Symbol(resultIsAny6, Decl(commaOperatorWithSecondOperandAnyType.ts, 30, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny7 = (++NUMBER, ANY); +>resultIsAny7 : Symbol(resultIsAny7, Decl(commaOperatorWithSecondOperandAnyType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3)) + +var resultIsAny8 = ("string", null); +>resultIsAny8 : Symbol(resultIsAny8, Decl(commaOperatorWithSecondOperandAnyType.ts, 32, 3)) + +var resultIsAny9 = ("string".charAt(0), undefined); +>resultIsAny9 : Symbol(resultIsAny9, Decl(commaOperatorWithSecondOperandAnyType.ts, 33, 3)) +>"string".charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>undefined : Symbol(undefined) + +var resultIsAny10 = (true, x("any")); +>resultIsAny10 : Symbol(resultIsAny10, Decl(commaOperatorWithSecondOperandAnyType.ts, 34, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) + +var resultIsAny11 = (!BOOLEAN, x.doSomeThing()); +>resultIsAny11 : Symbol(resultIsAny11, Decl(commaOperatorWithSecondOperandAnyType.ts, 35, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3)) +>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3)) + diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types index a63e20cf673..a8217c2d248 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types @@ -83,6 +83,7 @@ var x: any; 1, ANY; >1, ANY : any +>1 : number >ANY : any ++NUMBER, ANY; @@ -93,19 +94,28 @@ var x: any; "string", [null, 1]; >"string", [null, 1] : number[] +>"string" : string >[null, 1] : number[] +>null : null +>1 : number "string".charAt(0), [null, 1]; >"string".charAt(0), [null, 1] : number[] >"string".charAt(0) : string >"string".charAt : (pos: number) => string +>"string" : string >charAt : (pos: number) => string +>0 : number >[null, 1] : number[] +>null : null +>1 : number true, x("any"); >true, x("any") : any +>true : boolean >x("any") : any >x : any +>"any" : string !BOOLEAN, x.doSomeThing(); >!BOOLEAN, x.doSomeThing() : any @@ -120,6 +130,7 @@ var resultIsAny6 = (1, ANY); >resultIsAny6 : any >(1, ANY) : any >1, ANY : any +>1 : number >ANY : any var resultIsAny7 = (++NUMBER, ANY); @@ -134,6 +145,8 @@ var resultIsAny8 = ("string", null); >resultIsAny8 : any >("string", null) : null >"string", null : null +>"string" : string +>null : null var resultIsAny9 = ("string".charAt(0), undefined); >resultIsAny9 : any @@ -141,15 +154,19 @@ var resultIsAny9 = ("string".charAt(0), undefined); >"string".charAt(0), undefined : undefined >"string".charAt(0) : string >"string".charAt : (pos: number) => string +>"string" : string >charAt : (pos: number) => string +>0 : number >undefined : undefined var resultIsAny10 = (true, x("any")); >resultIsAny10 : any >(true, x("any")) : any >true, x("any") : any +>true : boolean >x("any") : any >x : any +>"any" : string var resultIsAny11 = (!BOOLEAN, x.doSomeThing()); >resultIsAny11 : any diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols new file mode 100644 index 00000000000..bd520c1876d --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols @@ -0,0 +1,110 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//The second operand type is boolean +ANY, BOOLEAN; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +BOOLEAN, BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +NUMBER, BOOLEAN; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +STRING, BOOLEAN; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +OBJECT, BOOLEAN; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +//Return type is boolean +var resultIsBoolean1 = (ANY, BOOLEAN); +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorWithSecondOperandBooleanType.ts, 14, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean2 = (BOOLEAN, BOOLEAN); +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(commaOperatorWithSecondOperandBooleanType.ts, 15, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean3 = (NUMBER, BOOLEAN); +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(commaOperatorWithSecondOperandBooleanType.ts, 16, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean4 = (STRING, BOOLEAN); +>resultIsBoolean4 : Symbol(resultIsBoolean4, Decl(commaOperatorWithSecondOperandBooleanType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean5 = (OBJECT, BOOLEAN); +>resultIsBoolean5 : Symbol(resultIsBoolean5, Decl(commaOperatorWithSecondOperandBooleanType.ts, 18, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +//Literal and expression +null, BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +ANY = undefined, BOOLEAN; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>undefined : Symbol(undefined) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +1, true; +++NUMBER, true; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) + +[1, 2, 3], !BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +OBJECT = [1, 2, 3], BOOLEAN = false; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean6 = (null, BOOLEAN); +>resultIsBoolean6 : Symbol(resultIsBoolean6, Decl(commaOperatorWithSecondOperandBooleanType.ts, 28, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean7 = (ANY = undefined, BOOLEAN); +>resultIsBoolean7 : Symbol(resultIsBoolean7, Decl(commaOperatorWithSecondOperandBooleanType.ts, 29, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3)) +>undefined : Symbol(undefined) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean8 = (1, true); +>resultIsBoolean8 : Symbol(resultIsBoolean8, Decl(commaOperatorWithSecondOperandBooleanType.ts, 30, 3)) + +var resultIsBoolean9 = (++NUMBER, true); +>resultIsBoolean9 : Symbol(resultIsBoolean9, Decl(commaOperatorWithSecondOperandBooleanType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3)) + +var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); +>resultIsBoolean10 : Symbol(resultIsBoolean10, Decl(commaOperatorWithSecondOperandBooleanType.ts, 32, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + +var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); +>resultIsBoolean11 : Symbol(resultIsBoolean11, Decl(commaOperatorWithSecondOperandBooleanType.ts, 33, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3)) + diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types index 49a3fdc4cc5..dba5285d880 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types @@ -80,6 +80,7 @@ var resultIsBoolean5 = (OBJECT, BOOLEAN); //Literal and expression null, BOOLEAN; >null, BOOLEAN : boolean +>null : null >BOOLEAN : boolean ANY = undefined, BOOLEAN; @@ -91,15 +92,21 @@ ANY = undefined, BOOLEAN; 1, true; >1, true : boolean +>1 : number +>true : boolean ++NUMBER, true; >++NUMBER, true : boolean >++NUMBER : number >NUMBER : number +>true : boolean [1, 2, 3], !BOOLEAN; >[1, 2, 3], !BOOLEAN : boolean >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number >!BOOLEAN : boolean >BOOLEAN : boolean @@ -108,13 +115,18 @@ OBJECT = [1, 2, 3], BOOLEAN = false; >OBJECT = [1, 2, 3] : number[] >OBJECT : Object >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number >BOOLEAN = false : boolean >BOOLEAN : boolean +>false : boolean var resultIsBoolean6 = (null, BOOLEAN); >resultIsBoolean6 : boolean >(null, BOOLEAN) : boolean >null, BOOLEAN : boolean +>null : null >BOOLEAN : boolean var resultIsBoolean7 = (ANY = undefined, BOOLEAN); @@ -130,6 +142,8 @@ var resultIsBoolean8 = (1, true); >resultIsBoolean8 : boolean >(1, true) : boolean >1, true : boolean +>1 : number +>true : boolean var resultIsBoolean9 = (++NUMBER, true); >resultIsBoolean9 : boolean @@ -137,12 +151,16 @@ var resultIsBoolean9 = (++NUMBER, true); >++NUMBER, true : boolean >++NUMBER : number >NUMBER : number +>true : boolean var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); >resultIsBoolean10 : boolean >([1, 2, 3], !BOOLEAN) : boolean >[1, 2, 3], !BOOLEAN : boolean >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number >!BOOLEAN : boolean >BOOLEAN : boolean @@ -153,6 +171,10 @@ var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); >OBJECT = [1, 2, 3] : number[] >OBJECT : Object >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number >BOOLEAN = false : boolean >BOOLEAN : boolean +>false : boolean diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols new file mode 100644 index 00000000000..3da456eaa5f --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//The second operand type is number +ANY, NUMBER; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +BOOLEAN, NUMBER; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +NUMBER, NUMBER; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +STRING, NUMBER; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +OBJECT, NUMBER; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +//Return type is number +var resultIsNumber1 = (ANY, NUMBER); +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorWithSecondOperandNumberType.ts, 14, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber2 = (BOOLEAN, NUMBER); +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorWithSecondOperandNumberType.ts, 15, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber3 = (NUMBER, NUMBER); +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(commaOperatorWithSecondOperandNumberType.ts, 16, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber4 = (STRING, NUMBER); +>resultIsNumber4 : Symbol(resultIsNumber4, Decl(commaOperatorWithSecondOperandNumberType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber5 = (OBJECT, NUMBER); +>resultIsNumber5 : Symbol(resultIsNumber5, Decl(commaOperatorWithSecondOperandNumberType.ts, 18, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +//Literal and expression +null, NUMBER; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +ANY = undefined, NUMBER; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>undefined : Symbol(undefined) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +true, 1; +BOOLEAN = false, 1; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) + +"", NUMBER = 1; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +STRING.trim(), NUMBER = 1; +>STRING.trim : Symbol(String.trim, Decl(lib.d.ts, 411, 32)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>trim : Symbol(String.trim, Decl(lib.d.ts, 411, 32)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber6 = (null, NUMBER); +>resultIsNumber6 : Symbol(resultIsNumber6, Decl(commaOperatorWithSecondOperandNumberType.ts, 28, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber7 = (ANY = undefined, NUMBER); +>resultIsNumber7 : Symbol(resultIsNumber7, Decl(commaOperatorWithSecondOperandNumberType.ts, 29, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3)) +>undefined : Symbol(undefined) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber8 = (true, 1); +>resultIsNumber8 : Symbol(resultIsNumber8, Decl(commaOperatorWithSecondOperandNumberType.ts, 30, 3)) + +var resultIsNumber9 = (BOOLEAN = false, 1); +>resultIsNumber9 : Symbol(resultIsNumber9, Decl(commaOperatorWithSecondOperandNumberType.ts, 31, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3)) + +var resultIsNumber10 = ("", NUMBER = 1); +>resultIsNumber10 : Symbol(resultIsNumber10, Decl(commaOperatorWithSecondOperandNumberType.ts, 32, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + +var resultIsNumber11 = (STRING.trim(), NUMBER = 1); +>resultIsNumber11 : Symbol(resultIsNumber11, Decl(commaOperatorWithSecondOperandNumberType.ts, 33, 3)) +>STRING.trim : Symbol(String.trim, Decl(lib.d.ts, 411, 32)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3)) +>trim : Symbol(String.trim, Decl(lib.d.ts, 411, 32)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3)) + diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types index a144466d4c8..13aae51e0cb 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types @@ -80,6 +80,7 @@ var resultIsNumber5 = (OBJECT, NUMBER); //Literal and expression null, NUMBER; >null, NUMBER : number +>null : null >NUMBER : number ANY = undefined, NUMBER; @@ -91,16 +92,22 @@ ANY = undefined, NUMBER; true, 1; >true, 1 : number +>true : boolean +>1 : number BOOLEAN = false, 1; >BOOLEAN = false, 1 : number >BOOLEAN = false : boolean >BOOLEAN : boolean +>false : boolean +>1 : number "", NUMBER = 1; >"", NUMBER = 1 : number +>"" : string >NUMBER = 1 : number >NUMBER : number +>1 : number STRING.trim(), NUMBER = 1; >STRING.trim(), NUMBER = 1 : number @@ -110,11 +117,13 @@ STRING.trim(), NUMBER = 1; >trim : () => string >NUMBER = 1 : number >NUMBER : number +>1 : number var resultIsNumber6 = (null, NUMBER); >resultIsNumber6 : number >(null, NUMBER) : number >null, NUMBER : number +>null : null >NUMBER : number var resultIsNumber7 = (ANY = undefined, NUMBER); @@ -130,6 +139,8 @@ var resultIsNumber8 = (true, 1); >resultIsNumber8 : number >(true, 1) : number >true, 1 : number +>true : boolean +>1 : number var resultIsNumber9 = (BOOLEAN = false, 1); >resultIsNumber9 : number @@ -137,13 +148,17 @@ var resultIsNumber9 = (BOOLEAN = false, 1); >BOOLEAN = false, 1 : number >BOOLEAN = false : boolean >BOOLEAN : boolean +>false : boolean +>1 : number var resultIsNumber10 = ("", NUMBER = 1); >resultIsNumber10 : number >("", NUMBER = 1) : number >"", NUMBER = 1 : number +>"" : string >NUMBER = 1 : number >NUMBER : number +>1 : number var resultIsNumber11 = (STRING.trim(), NUMBER = 1); >resultIsNumber11 : number @@ -155,4 +170,5 @@ var resultIsNumber11 = (STRING.trim(), NUMBER = 1); >trim : () => string >NUMBER = 1 : number >NUMBER : number +>1 : number diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols new file mode 100644 index 00000000000..42f24f77d50 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols @@ -0,0 +1,121 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +class CLASS { +>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19)) + + num: number; +>num : Symbol(num, Decl(commaOperatorWithSecondOperandObjectType.ts, 6, 13)) +} + +//The second operand type is Object +ANY, OBJECT; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +BOOLEAN, OBJECT; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +NUMBER, OBJECT; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +STRING, OBJECT; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +OBJECT, OBJECT; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +//Return type is Object +var resultIsObject1 = (ANY, OBJECT); +>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorWithSecondOperandObjectType.ts, 18, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject2 = (BOOLEAN, OBJECT); +>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorWithSecondOperandObjectType.ts, 19, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject3 = (NUMBER, OBJECT); +>resultIsObject3 : Symbol(resultIsObject3, Decl(commaOperatorWithSecondOperandObjectType.ts, 20, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject4 = (STRING, OBJECT); +>resultIsObject4 : Symbol(resultIsObject4, Decl(commaOperatorWithSecondOperandObjectType.ts, 21, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject5 = (OBJECT, OBJECT); +>resultIsObject5 : Symbol(resultIsObject5, Decl(commaOperatorWithSecondOperandObjectType.ts, 22, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +//Literal and expression +null, OBJECT +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +ANY = null, OBJECT +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +true, {} +!BOOLEAN, [] +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) + +"string", new Date() +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +STRING.toLowerCase(), new CLASS() +>STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19)) + +var resultIsObject6 = (null, OBJECT); +>resultIsObject6 : Symbol(resultIsObject6, Decl(commaOperatorWithSecondOperandObjectType.ts, 32, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject7 = (ANY = null, OBJECT); +>resultIsObject7 : Symbol(resultIsObject7, Decl(commaOperatorWithSecondOperandObjectType.ts, 33, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3)) + +var resultIsObject8 = (true, {}); +>resultIsObject8 : Symbol(resultIsObject8, Decl(commaOperatorWithSecondOperandObjectType.ts, 34, 3)) + +var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); +>resultIsObject9 : Symbol(resultIsObject9, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) +>a : Symbol(a, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 34)) +>b : Symbol(b, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 40)) + +var resultIsObject10 = ("string", new Date()); +>resultIsObject10 : Symbol(resultIsObject10, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var resultIsObject11 = (STRING.toLowerCase(), new CLASS()); +>resultIsObject11 : Symbol(resultIsObject11, Decl(commaOperatorWithSecondOperandObjectType.ts, 37, 3)) +>STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19)) + diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types index ba2663dd271..9c948da9699 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types @@ -87,16 +87,19 @@ var resultIsObject5 = (OBJECT, OBJECT); //Literal and expression null, OBJECT >null, OBJECT : Object +>null : null >OBJECT : Object ANY = null, OBJECT >ANY = null, OBJECT : Object >ANY = null : null >ANY : any +>null : null >OBJECT : Object true, {} >true, {} : {} +>true : boolean >{} : {} !BOOLEAN, [] @@ -107,6 +110,7 @@ true, {} "string", new Date() >"string", new Date() : Date +>"string" : string >new Date() : Date >Date : DateConstructor @@ -123,6 +127,7 @@ var resultIsObject6 = (null, OBJECT); >resultIsObject6 : Object >(null, OBJECT) : Object >null, OBJECT : Object +>null : null >OBJECT : Object var resultIsObject7 = (ANY = null, OBJECT); @@ -131,12 +136,14 @@ var resultIsObject7 = (ANY = null, OBJECT); >ANY = null, OBJECT : Object >ANY = null : null >ANY : any +>null : null >OBJECT : Object var resultIsObject8 = (true, {}); >resultIsObject8 : {} >(true, {}) : {} >true, {} : {} +>true : boolean >{} : {} var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); @@ -147,12 +154,15 @@ var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); >BOOLEAN : boolean >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string var resultIsObject10 = ("string", new Date()); >resultIsObject10 : Date >("string", new Date()) : Date >"string", new Date() : Date +>"string" : string >new Date() : Date >Date : DateConstructor diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols new file mode 100644 index 00000000000..d0c800858f7 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var resultIsString: string; +>resultIsString : Symbol(resultIsString, Decl(commaOperatorWithSecondOperandStringType.ts, 6, 3)) + +//The second operand is string +ANY, STRING; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +BOOLEAN, STRING; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +NUMBER, STRING; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +STRING, STRING; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +OBJECT, STRING; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +//Return type is string +var resultIsString1 = (ANY, STRING); +>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorWithSecondOperandStringType.ts, 16, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString2 = (BOOLEAN, STRING); +>resultIsString2 : Symbol(resultIsString2, Decl(commaOperatorWithSecondOperandStringType.ts, 17, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString3 = (NUMBER, STRING); +>resultIsString3 : Symbol(resultIsString3, Decl(commaOperatorWithSecondOperandStringType.ts, 18, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString4 = (STRING, STRING); +>resultIsString4 : Symbol(resultIsString4, Decl(commaOperatorWithSecondOperandStringType.ts, 19, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString5 = (OBJECT, STRING); +>resultIsString5 : Symbol(resultIsString5, Decl(commaOperatorWithSecondOperandStringType.ts, 20, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +//Literal and expression +null, STRING; +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +ANY = new Date(), STRING; +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +true, ""; +BOOLEAN == undefined, ""; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>undefined : Symbol(undefined) + +["a", "b"], NUMBER.toString(); +>NUMBER.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +OBJECT = new Object, STRING + "string"; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString6 = (null, STRING); +>resultIsString6 : Symbol(resultIsString6, Decl(commaOperatorWithSecondOperandStringType.ts, 30, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString7 = (ANY = new Date(), STRING); +>resultIsString7 : Symbol(resultIsString7, Decl(commaOperatorWithSecondOperandStringType.ts, 31, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + +var resultIsString8 = (true, ""); +>resultIsString8 : Symbol(resultIsString8, Decl(commaOperatorWithSecondOperandStringType.ts, 32, 3)) + +var resultIsString9 = (BOOLEAN == undefined, ""); +>resultIsString9 : Symbol(resultIsString9, Decl(commaOperatorWithSecondOperandStringType.ts, 33, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3)) +>undefined : Symbol(undefined) + +var resultIsString10 = (["a", "b"], NUMBER.toString()); +>resultIsString10 : Symbol(resultIsString10, Decl(commaOperatorWithSecondOperandStringType.ts, 34, 3)) +>NUMBER.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +var resultIsString11 = (new Object, STRING + "string"); +>resultIsString11 : Symbol(resultIsString11, Decl(commaOperatorWithSecondOperandStringType.ts, 35, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) + diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types index d5b2f50ca33..a28202876d2 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types @@ -83,6 +83,7 @@ var resultIsString5 = (OBJECT, STRING); //Literal and expression null, STRING; >null, STRING : string +>null : null >STRING : string ANY = new Date(), STRING; @@ -95,16 +96,21 @@ ANY = new Date(), STRING; true, ""; >true, "" : string +>true : boolean +>"" : string BOOLEAN == undefined, ""; >BOOLEAN == undefined, "" : string >BOOLEAN == undefined : boolean >BOOLEAN : boolean >undefined : undefined +>"" : string ["a", "b"], NUMBER.toString(); >["a", "b"], NUMBER.toString() : string >["a", "b"] : string[] +>"a" : string +>"b" : string >NUMBER.toString() : string >NUMBER.toString : (radix?: number) => string >NUMBER : number @@ -118,11 +124,13 @@ OBJECT = new Object, STRING + "string"; >Object : ObjectConstructor >STRING + "string" : string >STRING : string +>"string" : string var resultIsString6 = (null, STRING); >resultIsString6 : string >(null, STRING) : string >null, STRING : string +>null : null >STRING : string var resultIsString7 = (ANY = new Date(), STRING); @@ -139,6 +147,8 @@ var resultIsString8 = (true, ""); >resultIsString8 : string >(true, "") : string >true, "" : string +>true : boolean +>"" : string var resultIsString9 = (BOOLEAN == undefined, ""); >resultIsString9 : string @@ -147,12 +157,15 @@ var resultIsString9 = (BOOLEAN == undefined, ""); >BOOLEAN == undefined : boolean >BOOLEAN : boolean >undefined : undefined +>"" : string var resultIsString10 = (["a", "b"], NUMBER.toString()); >resultIsString10 : string >(["a", "b"], NUMBER.toString()) : string >["a", "b"], NUMBER.toString() : string >["a", "b"] : string[] +>"a" : string +>"b" : string >NUMBER.toString() : string >NUMBER.toString : (radix?: number) => string >NUMBER : number @@ -166,4 +179,5 @@ var resultIsString11 = (new Object, STRING + "string"); >Object : ObjectConstructor >STRING + "string" : string >STRING : string +>"string" : string diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.symbols b/tests/baselines/reference/commaOperatorsMultipleOperators.symbols new file mode 100644 index 00000000000..bd39a21519f --- /dev/null +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.symbols @@ -0,0 +1,94 @@ +=== tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts === +var ANY: any; +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) + +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) + +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) + +var STRING: string; +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) + +var OBJECT: Object; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//Expected: work well +ANY, BOOLEAN, NUMBER; +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) + +BOOLEAN, NUMBER, STRING; +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) + +NUMBER, STRING, OBJECT; +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) + +STRING, OBJECT, ANY; +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) + +OBJECT, ANY, BOOLEAN; +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) + +//Results should have the same type as the third operand +var resultIsAny1 = (STRING, OBJECT, ANY); +>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorsMultipleOperators.ts, 14, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) + +var resultIsBoolean1 = (OBJECT, ANY, BOOLEAN); +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorsMultipleOperators.ts, 15, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) + +var resultIsNumber1 = (ANY, BOOLEAN, NUMBER); +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorsMultipleOperators.ts, 16, 3)) +>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) + +var resultIsString1 = (BOOLEAN, NUMBER, STRING); +>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorsMultipleOperators.ts, 17, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) + +var resultIsObject1 = (NUMBER, STRING, OBJECT); +>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorsMultipleOperators.ts, 18, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3)) + +//Literal and expression +null, true, 1; +++NUMBER, STRING.charAt(0), new Object(); +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var resultIsNumber2 = (null, true, 1); +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorsMultipleOperators.ts, 24, 3)) + +var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); +>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorsMultipleOperators.ts, 25, 3)) +>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.types b/tests/baselines/reference/commaOperatorsMultipleOperators.types index 12b90e8ec77..9a2c7c7e5c5 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.types +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.types @@ -101,6 +101,9 @@ var resultIsObject1 = (NUMBER, STRING, OBJECT); null, true, 1; >null, true, 1 : number >null, true : boolean +>null : null +>true : boolean +>1 : number ++NUMBER, STRING.charAt(0), new Object(); >++NUMBER, STRING.charAt(0), new Object() : Object @@ -111,6 +114,7 @@ null, true, 1; >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number >new Object() : Object >Object : ObjectConstructor @@ -119,6 +123,9 @@ var resultIsNumber2 = (null, true, 1); >(null, true, 1) : number >null, true, 1 : number >null, true : boolean +>null : null +>true : boolean +>1 : number var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); >resultIsObject2 : Object @@ -131,6 +138,7 @@ var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number >new Object() : Object >Object : ObjectConstructor diff --git a/tests/baselines/reference/commentBeforeStaticMethod1.symbols b/tests/baselines/reference/commentBeforeStaticMethod1.symbols new file mode 100644 index 00000000000..ef5bee04be6 --- /dev/null +++ b/tests/baselines/reference/commentBeforeStaticMethod1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/commentBeforeStaticMethod1.ts === +class C { +>C : Symbol(C, Decl(commentBeforeStaticMethod1.ts, 0, 0)) + + /** + * Returns bar + */ + public static foo(): string { +>foo : Symbol(C.foo, Decl(commentBeforeStaticMethod1.ts, 0, 9)) + + return "bar"; + } +} diff --git a/tests/baselines/reference/commentBeforeStaticMethod1.types b/tests/baselines/reference/commentBeforeStaticMethod1.types index db674324306..1b16709a701 100644 --- a/tests/baselines/reference/commentBeforeStaticMethod1.types +++ b/tests/baselines/reference/commentBeforeStaticMethod1.types @@ -9,5 +9,6 @@ class C { >foo : () => string return "bar"; +>"bar" : string } } diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.symbols b/tests/baselines/reference/commentEmitAtEndOfFile1.symbols new file mode 100644 index 00000000000..1fc0ad09553 --- /dev/null +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/commentEmitAtEndOfFile1.ts === +// test +var f = '' +>f : Symbol(f, Decl(commentEmitAtEndOfFile1.ts, 1, 3)) + +// test #2 +module foo { +>foo : Symbol(foo, Decl(commentEmitAtEndOfFile1.ts, 1, 10)) + + function bar() { } +>bar : Symbol(bar, Decl(commentEmitAtEndOfFile1.ts, 3, 12)) +} +// test #3 +module empty { +>empty : Symbol(empty, Decl(commentEmitAtEndOfFile1.ts, 5, 1)) +} +// test #4 diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.types b/tests/baselines/reference/commentEmitAtEndOfFile1.types index 76b5c868cb6..d88d7ffa5fc 100644 --- a/tests/baselines/reference/commentEmitAtEndOfFile1.types +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.types @@ -2,6 +2,7 @@ // test var f = '' >f : string +>'' : string // test #2 module foo { @@ -12,6 +13,6 @@ module foo { } // test #3 module empty { ->empty : unknown +>empty : any } // test #4 diff --git a/tests/baselines/reference/commentEmitWithCommentOnLastLine.symbols b/tests/baselines/reference/commentEmitWithCommentOnLastLine.symbols new file mode 100644 index 00000000000..47ee947a500 --- /dev/null +++ b/tests/baselines/reference/commentEmitWithCommentOnLastLine.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/commentEmitWithCommentOnLastLine.ts === +var x: any; +>x : Symbol(x, Decl(commentEmitWithCommentOnLastLine.ts, 0, 3)) + +/* +var bar; +*/ diff --git a/tests/baselines/reference/commentInEmptyParameterList1.symbols b/tests/baselines/reference/commentInEmptyParameterList1.symbols new file mode 100644 index 00000000000..b5566029948 --- /dev/null +++ b/tests/baselines/reference/commentInEmptyParameterList1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/commentInEmptyParameterList1.ts === +function foo(/** nothing */) { +>foo : Symbol(foo, Decl(commentInEmptyParameterList1.ts, 0, 0)) +} diff --git a/tests/baselines/reference/commentInMethodCall.symbols b/tests/baselines/reference/commentInMethodCall.symbols new file mode 100644 index 00000000000..ff286983e23 --- /dev/null +++ b/tests/baselines/reference/commentInMethodCall.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/commentInMethodCall.ts === +//commment here +var s: string[]; +>s : Symbol(s, Decl(commentInMethodCall.ts, 1, 3)) + +s.map(// do something +>s.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>s : Symbol(s, Decl(commentInMethodCall.ts, 1, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) + + function () { }); + diff --git a/tests/baselines/reference/commentOnAmbientClass1.symbols b/tests/baselines/reference/commentOnAmbientClass1.symbols new file mode 100644 index 00000000000..899c5f19a24 --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientClass1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/b.ts === +/// +declare class E extends C { +>E : Symbol(E, Decl(b.ts, 0, 0)) +>C : Symbol(C, Decl(a.ts, 0, 0)) +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +declare class C { +>C : Symbol(C, Decl(a.ts, 0, 0)) +} + +// Don't keep this comment. +declare class D { +>D : Symbol(D, Decl(a.ts, 2, 1)) +} + diff --git a/tests/baselines/reference/commentOnAmbientEnum.symbols b/tests/baselines/reference/commentOnAmbientEnum.symbols new file mode 100644 index 00000000000..d86d490113d --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientEnum.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/b.ts === +/// +declare enum E { +>E : Symbol(E, Decl(b.ts, 0, 0)) +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +declare enum C { +>C : Symbol(C, Decl(a.ts, 0, 0)) + + a, +>a : Symbol(C.a, Decl(a.ts, 1, 16)) + + b, +>b : Symbol(C.b, Decl(a.ts, 2, 6)) + + c +>c : Symbol(C.c, Decl(a.ts, 3, 6)) +} + +// Don't keep this comment. +declare enum D { +>D : Symbol(D, Decl(a.ts, 5, 1)) +} + diff --git a/tests/baselines/reference/commentOnAmbientModule.symbols b/tests/baselines/reference/commentOnAmbientModule.symbols new file mode 100644 index 00000000000..c1412c17880 --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientModule.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/b.ts === +/// +declare module E { +>E : Symbol(E, Decl(b.ts, 0, 0)) + + class foobar extends D.bar { +>foobar : Symbol(foobar, Decl(b.ts, 1, 18)) +>D.bar : Symbol(D.bar, Decl(a.ts, 6, 18)) +>D : Symbol(D, Decl(a.ts, 3, 1)) +>bar : Symbol(D.bar, Decl(a.ts, 6, 18)) + + foo(); +>foo : Symbol(foo, Decl(b.ts, 2, 32)) + } +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +declare module C { +>C : Symbol(C, Decl(a.ts, 0, 0)) + + function foo(); +>foo : Symbol(foo, Decl(a.ts, 1, 18)) +} + +// Don't keep this comment. +declare module D { +>D : Symbol(D, Decl(a.ts, 3, 1)) + + class bar { } +>bar : Symbol(bar, Decl(a.ts, 6, 18)) +} + diff --git a/tests/baselines/reference/commentOnAmbientModule.types b/tests/baselines/reference/commentOnAmbientModule.types index f0056decc29..13d35cddcea 100644 --- a/tests/baselines/reference/commentOnAmbientModule.types +++ b/tests/baselines/reference/commentOnAmbientModule.types @@ -5,6 +5,7 @@ declare module E { class foobar extends D.bar { >foobar : foobar +>D.bar : any >D : typeof D >bar : D.bar diff --git a/tests/baselines/reference/commentOnAmbientVariable1.symbols b/tests/baselines/reference/commentOnAmbientVariable1.symbols new file mode 100644 index 00000000000..153653e7827 --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientVariable1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/commentOnAmbientVariable1.ts === +/*! Keep this pinned comment */ +declare var v: number; +>v : Symbol(v, Decl(commentOnAmbientVariable1.ts, 1, 11)) + +// Don't keep this comment. +declare var y: number; +>y : Symbol(y, Decl(commentOnAmbientVariable1.ts, 4, 11)) + diff --git a/tests/baselines/reference/commentOnAmbientVariable2.symbols b/tests/baselines/reference/commentOnAmbientVariable2.symbols new file mode 100644 index 00000000000..94100ce7b5b --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientVariable2.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/commentOnAmbientVariable2_2.ts === +/// +declare var x: number; +>x : Symbol(x, Decl(commentOnAmbientVariable2_2.ts, 1, 11)) + +x = 2; +>x : Symbol(x, Decl(commentOnAmbientVariable2_2.ts, 1, 11)) + +=== tests/cases/compiler/commentOnAmbientVariable2_1.ts === +var y = 1; +>y : Symbol(y, Decl(commentOnAmbientVariable2_1.ts, 0, 3)) + diff --git a/tests/baselines/reference/commentOnAmbientVariable2.types b/tests/baselines/reference/commentOnAmbientVariable2.types index 68ca1459575..28760dca1ec 100644 --- a/tests/baselines/reference/commentOnAmbientVariable2.types +++ b/tests/baselines/reference/commentOnAmbientVariable2.types @@ -6,8 +6,10 @@ declare var x: number; x = 2; >x = 2 : number >x : number +>2 : number === tests/cases/compiler/commentOnAmbientVariable2_1.ts === var y = 1; >y : number +>1 : number diff --git a/tests/baselines/reference/commentOnAmbientfunction.symbols b/tests/baselines/reference/commentOnAmbientfunction.symbols new file mode 100644 index 00000000000..c6afb72eb9c --- /dev/null +++ b/tests/baselines/reference/commentOnAmbientfunction.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/b.ts === +/// +declare function foobar(a: typeof foo): typeof bar; +>foobar : Symbol(foobar, Decl(b.ts, 0, 0)) +>a : Symbol(a, Decl(b.ts, 1, 24)) +>foo : Symbol(foo, Decl(a.ts, 0, 0)) +>bar : Symbol(bar, Decl(a.ts, 1, 23)) + +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +declare function foo(); +>foo : Symbol(foo, Decl(a.ts, 0, 0)) + +// Don't keep this comment. +declare function bar(); +>bar : Symbol(bar, Decl(a.ts, 1, 23)) + diff --git a/tests/baselines/reference/commentOnBlock1.symbols b/tests/baselines/reference/commentOnBlock1.symbols new file mode 100644 index 00000000000..5bdae83d3eb --- /dev/null +++ b/tests/baselines/reference/commentOnBlock1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/commentOnBlock1.ts === +// asdf +function f() { +>f : Symbol(f, Decl(commentOnBlock1.ts, 0, 0)) + + /*asdf*/{} +} diff --git a/tests/baselines/reference/commentOnClassMethod1.symbols b/tests/baselines/reference/commentOnClassMethod1.symbols new file mode 100644 index 00000000000..18caefb744b --- /dev/null +++ b/tests/baselines/reference/commentOnClassMethod1.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/commentOnClassMethod1.ts === +class WebControls { +>WebControls : Symbol(WebControls, Decl(commentOnClassMethod1.ts, 0, 0)) + + /** + * Render a control + */ + createControl(): any { +>createControl : Symbol(createControl, Decl(commentOnClassMethod1.ts, 0, 19)) + } +} diff --git a/tests/baselines/reference/commentOnElidedModule1.symbols b/tests/baselines/reference/commentOnElidedModule1.symbols new file mode 100644 index 00000000000..63ce4dadf97 --- /dev/null +++ b/tests/baselines/reference/commentOnElidedModule1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/b.ts === +/// +module ElidedModule3 { +>ElidedModule3 : Symbol(ElidedModule3, Decl(b.ts, 0, 0)) +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +module ElidedModule { +>ElidedModule : Symbol(ElidedModule, Decl(a.ts, 0, 0)) +} + +// Don't keep this comment. +module ElidedModule2 { +>ElidedModule2 : Symbol(ElidedModule2, Decl(a.ts, 2, 1)) +} + diff --git a/tests/baselines/reference/commentOnElidedModule1.types b/tests/baselines/reference/commentOnElidedModule1.types index 785336dff3d..8e095b8102f 100644 --- a/tests/baselines/reference/commentOnElidedModule1.types +++ b/tests/baselines/reference/commentOnElidedModule1.types @@ -1,16 +1,16 @@ === tests/cases/compiler/b.ts === /// module ElidedModule3 { ->ElidedModule3 : unknown +>ElidedModule3 : any } === tests/cases/compiler/a.ts === /*! Keep this pinned comment */ module ElidedModule { ->ElidedModule : unknown +>ElidedModule : any } // Don't keep this comment. module ElidedModule2 { ->ElidedModule2 : unknown +>ElidedModule2 : any } diff --git a/tests/baselines/reference/commentOnExpressionStatement1.symbols b/tests/baselines/reference/commentOnExpressionStatement1.symbols new file mode 100644 index 00000000000..f78660f0344 --- /dev/null +++ b/tests/baselines/reference/commentOnExpressionStatement1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/commentOnExpressionStatement1.ts === + +No type information for this code.1 + 1; // Comment. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnExpressionStatement1.types b/tests/baselines/reference/commentOnExpressionStatement1.types index c39689ed381..11d5fe1c6b5 100644 --- a/tests/baselines/reference/commentOnExpressionStatement1.types +++ b/tests/baselines/reference/commentOnExpressionStatement1.types @@ -2,4 +2,6 @@ 1 + 1; // Comment. >1 + 1 : number +>1 : number +>1 : number diff --git a/tests/baselines/reference/commentOnIfStatement1.symbols b/tests/baselines/reference/commentOnIfStatement1.symbols new file mode 100644 index 00000000000..03f357c8ccf --- /dev/null +++ b/tests/baselines/reference/commentOnIfStatement1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/commentOnIfStatement1.ts === + +No type information for this code.// Test +No type information for this code.if (true) { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/commentOnIfStatement1.types b/tests/baselines/reference/commentOnIfStatement1.types index 03f357c8ccf..7b983156f4d 100644 --- a/tests/baselines/reference/commentOnIfStatement1.types +++ b/tests/baselines/reference/commentOnIfStatement1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/commentOnIfStatement1.ts === -No type information for this code.// Test -No type information for this code.if (true) { -No type information for this code.} -No type information for this code. \ No newline at end of file +// Test +if (true) { +>true : boolean +} diff --git a/tests/baselines/reference/commentOnInterface1.symbols b/tests/baselines/reference/commentOnInterface1.symbols new file mode 100644 index 00000000000..9564d9b4cfa --- /dev/null +++ b/tests/baselines/reference/commentOnInterface1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/b.ts === +/// +interface I3 { +>I3 : Symbol(I3, Decl(b.ts, 0, 0)) +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +interface I { +>I : Symbol(I, Decl(a.ts, 0, 0)) +} + +// Don't keep this comment. +interface I2 { +>I2 : Symbol(I2, Decl(a.ts, 2, 1)) +} + diff --git a/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.symbols b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.symbols new file mode 100644 index 00000000000..d3726f99af2 --- /dev/null +++ b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/commentOnParenthesizedExpressionOpenParen1.ts === +var j; +>j : Symbol(j, Decl(commentOnParenthesizedExpressionOpenParen1.ts, 0, 3)) + +var f: () => any; +>f : Symbol(f, Decl(commentOnParenthesizedExpressionOpenParen1.ts, 1, 3)) + +( /* Preserve */ j = f()); +>j : Symbol(j, Decl(commentOnParenthesizedExpressionOpenParen1.ts, 0, 3)) +>f : Symbol(f, Decl(commentOnParenthesizedExpressionOpenParen1.ts, 1, 3)) + diff --git a/tests/baselines/reference/commentOnSignature1.symbols b/tests/baselines/reference/commentOnSignature1.symbols new file mode 100644 index 00000000000..0d39565fb61 --- /dev/null +++ b/tests/baselines/reference/commentOnSignature1.symbols @@ -0,0 +1,62 @@ +=== tests/cases/compiler/b.ts === +/// +function foo2(n: number): void; +>foo2 : Symbol(foo2, Decl(b.ts, 0, 0), Decl(b.ts, 1, 31), Decl(b.ts, 3, 31)) +>n : Symbol(n, Decl(b.ts, 1, 14)) + +// Don't keep this comment. +function foo2(s: string): void; +>foo2 : Symbol(foo2, Decl(b.ts, 0, 0), Decl(b.ts, 1, 31), Decl(b.ts, 3, 31)) +>s : Symbol(s, Decl(b.ts, 3, 14)) + +function foo2(a: any): void { +>foo2 : Symbol(foo2, Decl(b.ts, 0, 0), Decl(b.ts, 1, 31), Decl(b.ts, 3, 31)) +>a : Symbol(a, Decl(b.ts, 4, 14)) +} +=== tests/cases/compiler/a.ts === +/*! Keep this pinned comment */ +function foo(n: number): void; +>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 1, 30), Decl(a.ts, 3, 30)) +>n : Symbol(n, Decl(a.ts, 1, 13)) + +// Don't keep this comment. +function foo(s: string): void; +>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 1, 30), Decl(a.ts, 3, 30)) +>s : Symbol(s, Decl(a.ts, 3, 13)) + +function foo(a: any): void { +>foo : Symbol(foo, Decl(a.ts, 0, 0), Decl(a.ts, 1, 30), Decl(a.ts, 3, 30)) +>a : Symbol(a, Decl(a.ts, 4, 13)) +} + +class c { +>c : Symbol(c, Decl(a.ts, 5, 1)) + + // dont keep this comment + constructor(a: string); +>a : Symbol(a, Decl(a.ts, 9, 16)) + + /*! keep this pinned comment */ + constructor(a: number); +>a : Symbol(a, Decl(a.ts, 11, 16)) + + constructor(a: any) { +>a : Symbol(a, Decl(a.ts, 12, 16)) + } + + // dont keep this comment + foo(a: string); +>foo : Symbol(foo, Decl(a.ts, 13, 5), Decl(a.ts, 16, 19), Decl(a.ts, 18, 19)) +>a : Symbol(a, Decl(a.ts, 16, 8)) + + /*! keep this pinned comment */ + foo(a: number); +>foo : Symbol(foo, Decl(a.ts, 13, 5), Decl(a.ts, 16, 19), Decl(a.ts, 18, 19)) +>a : Symbol(a, Decl(a.ts, 18, 8)) + + foo(a: any) { +>foo : Symbol(foo, Decl(a.ts, 13, 5), Decl(a.ts, 16, 19), Decl(a.ts, 18, 19)) +>a : Symbol(a, Decl(a.ts, 19, 8)) + } +} + diff --git a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.symbols b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.symbols new file mode 100644 index 00000000000..efbcb08496d --- /dev/null +++ b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/commentOnSimpleArrowFunctionBody1.ts === +function Foo(x: any) +>Foo : Symbol(Foo, Decl(commentOnSimpleArrowFunctionBody1.ts, 0, 0)) +>x : Symbol(x, Decl(commentOnSimpleArrowFunctionBody1.ts, 0, 13)) +{ +} + +Foo(() => +>Foo : Symbol(Foo, Decl(commentOnSimpleArrowFunctionBody1.ts, 0, 0)) + + // do something + 127); + diff --git a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types index 916a03eb65e..6dd530e438b 100644 --- a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types +++ b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types @@ -12,4 +12,5 @@ Foo(() => // do something 127); +>127 : number diff --git a/tests/baselines/reference/commentOnStaticMember1.symbols b/tests/baselines/reference/commentOnStaticMember1.symbols new file mode 100644 index 00000000000..4d575a17cb6 --- /dev/null +++ b/tests/baselines/reference/commentOnStaticMember1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/commentOnStaticMember1.ts === +class Greeter { +>Greeter : Symbol(Greeter, Decl(commentOnStaticMember1.ts, 0, 0)) + + //Hello World + static foo(){ +>foo : Symbol(Greeter.foo, Decl(commentOnStaticMember1.ts, 0, 15)) + } +} diff --git a/tests/baselines/reference/commentsAtEndOfFile1.symbols b/tests/baselines/reference/commentsAtEndOfFile1.symbols new file mode 100644 index 00000000000..c09a435f1a7 --- /dev/null +++ b/tests/baselines/reference/commentsAtEndOfFile1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/commentsAtEndOfFile1.ts === +Input: +No type information for this code.; +No type information for this code.//Testing two +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/commentsAtEndOfFile1.types b/tests/baselines/reference/commentsAtEndOfFile1.types index c09a435f1a7..6bac6757061 100644 --- a/tests/baselines/reference/commentsAtEndOfFile1.types +++ b/tests/baselines/reference/commentsAtEndOfFile1.types @@ -1,6 +1,7 @@ === tests/cases/compiler/commentsAtEndOfFile1.ts === Input: -No type information for this code.; -No type information for this code.//Testing two -No type information for this code. -No type information for this code. \ No newline at end of file +>Input : any + +; +//Testing two + diff --git a/tests/baselines/reference/commentsBeforeFunctionExpression1.symbols b/tests/baselines/reference/commentsBeforeFunctionExpression1.symbols new file mode 100644 index 00000000000..adeea60711e --- /dev/null +++ b/tests/baselines/reference/commentsBeforeFunctionExpression1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/commentsBeforeFunctionExpression1.ts === +var v = { +>v : Symbol(v, Decl(commentsBeforeFunctionExpression1.ts, 0, 3)) + + f: /**own f*/ (a) => 0 +>f : Symbol(f, Decl(commentsBeforeFunctionExpression1.ts, 0, 9)) +>a : Symbol(a, Decl(commentsBeforeFunctionExpression1.ts, 1, 19)) +} + diff --git a/tests/baselines/reference/commentsBeforeFunctionExpression1.types b/tests/baselines/reference/commentsBeforeFunctionExpression1.types index 4580ca9ceeb..a057918a74d 100644 --- a/tests/baselines/reference/commentsBeforeFunctionExpression1.types +++ b/tests/baselines/reference/commentsBeforeFunctionExpression1.types @@ -7,5 +7,6 @@ var v = { >f : (a: any) => number >(a) => 0 : (a: any) => number >a : any +>0 : number } diff --git a/tests/baselines/reference/commentsBeforeVariableStatement1.symbols b/tests/baselines/reference/commentsBeforeVariableStatement1.symbols new file mode 100644 index 00000000000..ddbac8e4653 --- /dev/null +++ b/tests/baselines/reference/commentsBeforeVariableStatement1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/commentsBeforeVariableStatement1.ts === +/** b's comment*/ +export var b: number; +>b : Symbol(b, Decl(commentsBeforeVariableStatement1.ts, 1, 10)) + diff --git a/tests/baselines/reference/commentsClass.symbols b/tests/baselines/reference/commentsClass.symbols new file mode 100644 index 00000000000..9364dc50b02 --- /dev/null +++ b/tests/baselines/reference/commentsClass.symbols @@ -0,0 +1,135 @@ +=== tests/cases/compiler/commentsClass.ts === + +/** This is class c2 without constuctor*/ +class c2 { +>c2 : Symbol(c2, Decl(commentsClass.ts, 0, 0)) + +} // trailing comment1 +var i2 = new c2(); +>i2 : Symbol(i2, Decl(commentsClass.ts, 4, 3)) +>c2 : Symbol(c2, Decl(commentsClass.ts, 0, 0)) + +var i2_c = c2; +>i2_c : Symbol(i2_c, Decl(commentsClass.ts, 5, 3)) +>c2 : Symbol(c2, Decl(commentsClass.ts, 0, 0)) + +class c3 { +>c3 : Symbol(c3, Decl(commentsClass.ts, 5, 14)) + + /** Constructor comment*/ + constructor() { + } // trailing comment of constructor +} /* trailing comment 2 */ +var i3 = new c3(); +>i3 : Symbol(i3, Decl(commentsClass.ts, 11, 3)) +>c3 : Symbol(c3, Decl(commentsClass.ts, 5, 14)) + +var i3_c = c3; +>i3_c : Symbol(i3_c, Decl(commentsClass.ts, 12, 3)) +>c3 : Symbol(c3, Decl(commentsClass.ts, 5, 14)) + +/** Class comment*/ +class c4 { +>c4 : Symbol(c4, Decl(commentsClass.ts, 12, 14)) + + /** Constructor comment*/ + constructor() { + } /* trailing comment of constructor 2*/ +} +var i4 = new c4(); +>i4 : Symbol(i4, Decl(commentsClass.ts, 19, 3)) +>c4 : Symbol(c4, Decl(commentsClass.ts, 12, 14)) + +var i4_c = c4; +>i4_c : Symbol(i4_c, Decl(commentsClass.ts, 20, 3)) +>c4 : Symbol(c4, Decl(commentsClass.ts, 12, 14)) + +/** Class with statics*/ +class c5 { +>c5 : Symbol(c5, Decl(commentsClass.ts, 20, 14)) + + static s1: number; +>s1 : Symbol(c5.s1, Decl(commentsClass.ts, 22, 10)) +} +var i5 = new c5(); +>i5 : Symbol(i5, Decl(commentsClass.ts, 25, 3)) +>c5 : Symbol(c5, Decl(commentsClass.ts, 20, 14)) + +var i5_c = c5; +>i5_c : Symbol(i5_c, Decl(commentsClass.ts, 26, 3)) +>c5 : Symbol(c5, Decl(commentsClass.ts, 20, 14)) + +/// class with statics and constructor +class c6 { /// class with statics and constructor2 +>c6 : Symbol(c6, Decl(commentsClass.ts, 26, 14)) + + /// s1 comment + static s1: number; /// s1 comment2 +>s1 : Symbol(c6.s1, Decl(commentsClass.ts, 29, 10)) + + /// constructor comment + constructor() { /// constructor comment2 + } +} +var i6 = new c6(); +>i6 : Symbol(i6, Decl(commentsClass.ts, 36, 3)) +>c6 : Symbol(c6, Decl(commentsClass.ts, 26, 14)) + +var i6_c = c6; +>i6_c : Symbol(i6_c, Decl(commentsClass.ts, 37, 3)) +>c6 : Symbol(c6, Decl(commentsClass.ts, 26, 14)) + +// class with statics and constructor +class c7 { +>c7 : Symbol(c7, Decl(commentsClass.ts, 37, 14)) + + // s1 comment + static s1: number; +>s1 : Symbol(c7.s1, Decl(commentsClass.ts, 40, 10)) + + // constructor comment + constructor() { + } +} +var i7 = new c7(); +>i7 : Symbol(i7, Decl(commentsClass.ts, 47, 3)) +>c7 : Symbol(c7, Decl(commentsClass.ts, 37, 14)) + +var i7_c = c7; +>i7_c : Symbol(i7_c, Decl(commentsClass.ts, 48, 3)) +>c7 : Symbol(c7, Decl(commentsClass.ts, 37, 14)) + +/** class with statics and constructor + */ +class c8 { +>c8 : Symbol(c8, Decl(commentsClass.ts, 48, 14)) + + /** s1 comment */ + static s1: number; /** s1 comment2 */ +>s1 : Symbol(c8.s1, Decl(commentsClass.ts, 52, 10)) + + /** constructor comment + */ + constructor() { + /** constructor comment2 + */ + } +} +var i8 = new c8(); +>i8 : Symbol(i8, Decl(commentsClass.ts, 62, 3)) +>c8 : Symbol(c8, Decl(commentsClass.ts, 48, 14)) + +var i8_c = c8; +>i8_c : Symbol(i8_c, Decl(commentsClass.ts, 63, 3)) +>c8 : Symbol(c8, Decl(commentsClass.ts, 48, 14)) + +class c9 { +>c9 : Symbol(c9, Decl(commentsClass.ts, 63, 14)) + + constructor() { + /// This is some detached comment + + // should emit this leading comment of } too + } +} + diff --git a/tests/baselines/reference/commentsClassMembers.symbols b/tests/baselines/reference/commentsClassMembers.symbols new file mode 100644 index 00000000000..dd014611df7 --- /dev/null +++ b/tests/baselines/reference/commentsClassMembers.symbols @@ -0,0 +1,706 @@ +=== tests/cases/compiler/commentsClassMembers.ts === + +/** This is comment for c1*/ +class c1 { +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) + + /** p1 is property of c1*/ + public p1: number; +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) + + /** sum with property*/ + public p2(/** number to add*/b: number) { +>p2 : Symbol(p2, Decl(commentsClassMembers.ts, 4, 22)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 6, 14)) + + return this.p1 + b; +>this.p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 6, 14)) + + } /* trailing comment of method*/ + /** getter property*/ + public get p3() { +>p3 : Symbol(p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) + + return this.p2(this.p1); +>this.p2 : Symbol(p2, Decl(commentsClassMembers.ts, 4, 22)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p2 : Symbol(p2, Decl(commentsClassMembers.ts, 4, 22)) +>this.p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) + + }// trailing comment Getter + /** setter property*/ + public set p3(/** this is value*/value: number) { +>p3 : Symbol(p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 14, 18)) + + this.p1 = this.p2(value); +>this.p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>this.p2 : Symbol(p2, Decl(commentsClassMembers.ts, 4, 22)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p2 : Symbol(p2, Decl(commentsClassMembers.ts, 4, 22)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 14, 18)) + + }// trailing comment Setter + /** pp1 is property of c1*/ + private pp1: number; +>pp1 : Symbol(pp1, Decl(commentsClassMembers.ts, 16, 5)) + + /** sum with property*/ + private pp2(/** number to add*/b: number) { +>pp2 : Symbol(pp2, Decl(commentsClassMembers.ts, 18, 24)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 20, 16)) + + return this.p1 + b; +>this.p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 2, 10)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 20, 16)) + + } // trailing comment of method + /** getter property*/ + private get pp3() { +>pp3 : Symbol(pp3, Decl(commentsClassMembers.ts, 22, 5), Decl(commentsClassMembers.ts, 26, 5)) + + return this.pp2(this.pp1); +>this.pp2 : Symbol(pp2, Decl(commentsClassMembers.ts, 18, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>pp2 : Symbol(pp2, Decl(commentsClassMembers.ts, 18, 24)) +>this.pp1 : Symbol(pp1, Decl(commentsClassMembers.ts, 16, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>pp1 : Symbol(pp1, Decl(commentsClassMembers.ts, 16, 5)) + } + /** setter property*/ + private set pp3( /** this is value*/value: number) { +>pp3 : Symbol(pp3, Decl(commentsClassMembers.ts, 22, 5), Decl(commentsClassMembers.ts, 26, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 28, 20)) + + this.pp1 = this.pp2(value); +>this.pp1 : Symbol(pp1, Decl(commentsClassMembers.ts, 16, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>pp1 : Symbol(pp1, Decl(commentsClassMembers.ts, 16, 5)) +>this.pp2 : Symbol(pp2, Decl(commentsClassMembers.ts, 18, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>pp2 : Symbol(pp2, Decl(commentsClassMembers.ts, 18, 24)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 28, 20)) + } + /** Constructor method*/ + constructor() { + } + /** s1 is static property of c1*/ + static s1: number; +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) + + /** static sum with property*/ + static s2(/** number to add*/b: number) { +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 37, 14)) + + return c1.s1 + b; +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 37, 14)) + } + /** static getter property*/ + static get s3() { +>s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) + + return c1.s2(c1.s1); +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) + + } /*trailing comment 1 getter*/ + /** setter property*/ + static set s3( /** this is value*/value: number) { +>s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 45, 18)) + + c1.s1 = c1.s2(value); +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 45, 18)) + + }/*trailing comment 2 */ /*setter*/ + public nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) + + public nc_p2(b: number) { +>nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 49, 17)) + + return this.nc_p1 + b; +>this.nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 49, 17)) + } + public get nc_p3() { +>nc_p3 : Symbol(nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) + + return this.nc_p2(this.nc_p1); +>this.nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>this.nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) + } + public set nc_p3(value: number) { +>nc_p3 : Symbol(nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 55, 21)) + + this.nc_p1 = this.nc_p2(value); +>this.nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>this.nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 55, 21)) + } + private nc_pp1: number; +>nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) + + private nc_pp2(b: number) { +>nc_pp2 : Symbol(nc_pp2, Decl(commentsClassMembers.ts, 58, 27)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 59, 19)) + + return this.nc_pp1 + b; +>this.nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 59, 19)) + } + private get nc_pp3() { +>nc_pp3 : Symbol(nc_pp3, Decl(commentsClassMembers.ts, 61, 5), Decl(commentsClassMembers.ts, 64, 5)) + + return this.nc_pp2(this.nc_pp1); +>this.nc_pp2 : Symbol(nc_pp2, Decl(commentsClassMembers.ts, 58, 27)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_pp2 : Symbol(nc_pp2, Decl(commentsClassMembers.ts, 58, 27)) +>this.nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) + } + private set nc_pp3(value: number) { +>nc_pp3 : Symbol(nc_pp3, Decl(commentsClassMembers.ts, 61, 5), Decl(commentsClassMembers.ts, 64, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 65, 23)) + + this.nc_pp1 = this.nc_pp2(value); +>this.nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_pp1 : Symbol(nc_pp1, Decl(commentsClassMembers.ts, 57, 5)) +>this.nc_pp2 : Symbol(nc_pp2, Decl(commentsClassMembers.ts, 58, 27)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_pp2 : Symbol(nc_pp2, Decl(commentsClassMembers.ts, 58, 27)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 65, 23)) + } + static nc_s1: number; +>nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) + + static nc_s2(b: number) { +>nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 69, 17)) + + return c1.nc_s1 + b; +>c1.nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 69, 17)) + } + static get nc_s3() { +>nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) + + return c1.nc_s2(c1.nc_s1); +>c1.nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>c1.nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) + } + static set nc_s3(value: number) { +>nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 75, 21)) + + c1.nc_s1 = c1.nc_s2(value); +>c1.nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>c1.nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 75, 21)) + } + + // p1 is property of c1 + public a_p1: number; +>a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) + + // sum with property + public a_p2(b: number) { +>a_p2 : Symbol(a_p2, Decl(commentsClassMembers.ts, 80, 24)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 82, 16)) + + return this.a_p1 + b; +>this.a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 82, 16)) + } + // getter property + public get a_p3() { +>a_p3 : Symbol(a_p3, Decl(commentsClassMembers.ts, 84, 5), Decl(commentsClassMembers.ts, 88, 5)) + + return this.a_p2(this.a_p1); +>this.a_p2 : Symbol(a_p2, Decl(commentsClassMembers.ts, 80, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p2 : Symbol(a_p2, Decl(commentsClassMembers.ts, 80, 24)) +>this.a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) + } + // setter property + public set a_p3(value: number) { +>a_p3 : Symbol(a_p3, Decl(commentsClassMembers.ts, 84, 5), Decl(commentsClassMembers.ts, 88, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 90, 20)) + + this.a_p1 = this.a_p2(value); +>this.a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>this.a_p2 : Symbol(a_p2, Decl(commentsClassMembers.ts, 80, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p2 : Symbol(a_p2, Decl(commentsClassMembers.ts, 80, 24)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 90, 20)) + } + // pp1 is property of c1 + private a_pp1: number; +>a_pp1 : Symbol(a_pp1, Decl(commentsClassMembers.ts, 92, 5)) + + // sum with property + private a_pp2(b: number) { +>a_pp2 : Symbol(a_pp2, Decl(commentsClassMembers.ts, 94, 26)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 96, 18)) + + return this.a_p1 + b; +>this.a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_p1 : Symbol(a_p1, Decl(commentsClassMembers.ts, 77, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 96, 18)) + } + // getter property + private get a_pp3() { +>a_pp3 : Symbol(a_pp3, Decl(commentsClassMembers.ts, 98, 5), Decl(commentsClassMembers.ts, 102, 5)) + + return this.a_pp2(this.a_pp1); +>this.a_pp2 : Symbol(a_pp2, Decl(commentsClassMembers.ts, 94, 26)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_pp2 : Symbol(a_pp2, Decl(commentsClassMembers.ts, 94, 26)) +>this.a_pp1 : Symbol(a_pp1, Decl(commentsClassMembers.ts, 92, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_pp1 : Symbol(a_pp1, Decl(commentsClassMembers.ts, 92, 5)) + } + // setter property + private set a_pp3(value: number) { +>a_pp3 : Symbol(a_pp3, Decl(commentsClassMembers.ts, 98, 5), Decl(commentsClassMembers.ts, 102, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 104, 22)) + + this.a_pp1 = this.a_pp2(value); +>this.a_pp1 : Symbol(a_pp1, Decl(commentsClassMembers.ts, 92, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_pp1 : Symbol(a_pp1, Decl(commentsClassMembers.ts, 92, 5)) +>this.a_pp2 : Symbol(a_pp2, Decl(commentsClassMembers.ts, 94, 26)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_pp2 : Symbol(a_pp2, Decl(commentsClassMembers.ts, 94, 26)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 104, 22)) + } + + // s1 is static property of c1 + static a_s1: number; +>a_s1 : Symbol(c1.a_s1, Decl(commentsClassMembers.ts, 106, 5)) + + // static sum with property + static a_s2(b: number) { +>a_s2 : Symbol(c1.a_s2, Decl(commentsClassMembers.ts, 109, 24)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 111, 16)) + + return c1.a_s1 + b; +>c1.a_s1 : Symbol(c1.a_s1, Decl(commentsClassMembers.ts, 106, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_s1 : Symbol(c1.a_s1, Decl(commentsClassMembers.ts, 106, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 111, 16)) + } + // static getter property + static get a_s3() { +>a_s3 : Symbol(c1.a_s3, Decl(commentsClassMembers.ts, 113, 5), Decl(commentsClassMembers.ts, 117, 5)) + + return c1.s2(c1.s1); +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) + } + + // setter property + static set a_s3(value: number) { +>a_s3 : Symbol(c1.a_s3, Decl(commentsClassMembers.ts, 113, 5), Decl(commentsClassMembers.ts, 117, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 120, 20)) + + c1.a_s1 = c1.a_s2(value); +>c1.a_s1 : Symbol(c1.a_s1, Decl(commentsClassMembers.ts, 106, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_s1 : Symbol(c1.a_s1, Decl(commentsClassMembers.ts, 106, 5)) +>c1.a_s2 : Symbol(c1.a_s2, Decl(commentsClassMembers.ts, 109, 24)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>a_s2 : Symbol(c1.a_s2, Decl(commentsClassMembers.ts, 109, 24)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 120, 20)) + } + + /** p1 is property of c1 */ + public b_p1: number; +>b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) + + /** sum with property */ + public b_p2(b: number) { +>b_p2 : Symbol(b_p2, Decl(commentsClassMembers.ts, 125, 24)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 127, 16)) + + return this.b_p1 + b; +>this.b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 127, 16)) + } + /** getter property */ + public get b_p3() { +>b_p3 : Symbol(b_p3, Decl(commentsClassMembers.ts, 129, 5), Decl(commentsClassMembers.ts, 133, 5)) + + return this.b_p2(this.b_p1); +>this.b_p2 : Symbol(b_p2, Decl(commentsClassMembers.ts, 125, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p2 : Symbol(b_p2, Decl(commentsClassMembers.ts, 125, 24)) +>this.b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) + } + /** setter property */ + public set b_p3(value: number) { +>b_p3 : Symbol(b_p3, Decl(commentsClassMembers.ts, 129, 5), Decl(commentsClassMembers.ts, 133, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 135, 20)) + + this.b_p1 = this.b_p2(value); +>this.b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>this.b_p2 : Symbol(b_p2, Decl(commentsClassMembers.ts, 125, 24)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p2 : Symbol(b_p2, Decl(commentsClassMembers.ts, 125, 24)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 135, 20)) + } + /** pp1 is property of c1 */ + private b_pp1: number; +>b_pp1 : Symbol(b_pp1, Decl(commentsClassMembers.ts, 137, 5)) + + /** sum with property */ + private b_pp2(b: number) { +>b_pp2 : Symbol(b_pp2, Decl(commentsClassMembers.ts, 139, 26)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 141, 18)) + + return this.b_p1 + b; +>this.b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_p1 : Symbol(b_p1, Decl(commentsClassMembers.ts, 122, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 141, 18)) + } + /** getter property */ + private get b_pp3() { +>b_pp3 : Symbol(b_pp3, Decl(commentsClassMembers.ts, 143, 5), Decl(commentsClassMembers.ts, 147, 5)) + + return this.b_pp2(this.b_pp1); +>this.b_pp2 : Symbol(b_pp2, Decl(commentsClassMembers.ts, 139, 26)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_pp2 : Symbol(b_pp2, Decl(commentsClassMembers.ts, 139, 26)) +>this.b_pp1 : Symbol(b_pp1, Decl(commentsClassMembers.ts, 137, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_pp1 : Symbol(b_pp1, Decl(commentsClassMembers.ts, 137, 5)) + } + /** setter property */ + private set b_pp3(value: number) { +>b_pp3 : Symbol(b_pp3, Decl(commentsClassMembers.ts, 143, 5), Decl(commentsClassMembers.ts, 147, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 149, 22)) + + this.b_pp1 = this.b_pp2(value); +>this.b_pp1 : Symbol(b_pp1, Decl(commentsClassMembers.ts, 137, 5)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_pp1 : Symbol(b_pp1, Decl(commentsClassMembers.ts, 137, 5)) +>this.b_pp2 : Symbol(b_pp2, Decl(commentsClassMembers.ts, 139, 26)) +>this : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_pp2 : Symbol(b_pp2, Decl(commentsClassMembers.ts, 139, 26)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 149, 22)) + } + + /** s1 is static property of c1 */ + static b_s1: number; +>b_s1 : Symbol(c1.b_s1, Decl(commentsClassMembers.ts, 151, 5)) + + /** static sum with property */ + static b_s2(b: number) { +>b_s2 : Symbol(c1.b_s2, Decl(commentsClassMembers.ts, 154, 24)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 156, 16)) + + return c1.b_s1 + b; +>c1.b_s1 : Symbol(c1.b_s1, Decl(commentsClassMembers.ts, 151, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_s1 : Symbol(c1.b_s1, Decl(commentsClassMembers.ts, 151, 5)) +>b : Symbol(b, Decl(commentsClassMembers.ts, 156, 16)) + } + /** static getter property + */ + static get b_s3() { +>b_s3 : Symbol(c1.b_s3, Decl(commentsClassMembers.ts, 158, 5), Decl(commentsClassMembers.ts, 163, 5)) + + return c1.s2(c1.s1); +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) + } + + /** setter property + */ + static set b_s3(value: number) { +>b_s3 : Symbol(c1.b_s3, Decl(commentsClassMembers.ts, 158, 5), Decl(commentsClassMembers.ts, 163, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 167, 20)) + + /** setter */ + c1.b_s1 = c1.b_s2(value); +>c1.b_s1 : Symbol(c1.b_s1, Decl(commentsClassMembers.ts, 151, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_s1 : Symbol(c1.b_s1, Decl(commentsClassMembers.ts, 151, 5)) +>c1.b_s2 : Symbol(c1.b_s2, Decl(commentsClassMembers.ts, 154, 24)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>b_s2 : Symbol(c1.b_s2, Decl(commentsClassMembers.ts, 154, 24)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 167, 20)) + } +} +var i1 = new c1(); +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) + +var i1_p = i1.p1; +>i1_p : Symbol(i1_p, Decl(commentsClassMembers.ts, 173, 3)) +>i1.p1 : Symbol(c1.p1, Decl(commentsClassMembers.ts, 2, 10)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>p1 : Symbol(c1.p1, Decl(commentsClassMembers.ts, 2, 10)) + +var i1_f = i1.p2; +>i1_f : Symbol(i1_f, Decl(commentsClassMembers.ts, 174, 3)) +>i1.p2 : Symbol(c1.p2, Decl(commentsClassMembers.ts, 4, 22)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>p2 : Symbol(c1.p2, Decl(commentsClassMembers.ts, 4, 22)) + +var i1_r = i1.p2(20); +>i1_r : Symbol(i1_r, Decl(commentsClassMembers.ts, 175, 3)) +>i1.p2 : Symbol(c1.p2, Decl(commentsClassMembers.ts, 4, 22)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>p2 : Symbol(c1.p2, Decl(commentsClassMembers.ts, 4, 22)) + +var i1_prop = i1.p3; +>i1_prop : Symbol(i1_prop, Decl(commentsClassMembers.ts, 176, 3)) +>i1.p3 : Symbol(c1.p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>p3 : Symbol(c1.p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) + +i1.p3 = i1_prop; +>i1.p3 : Symbol(c1.p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>p3 : Symbol(c1.p3, Decl(commentsClassMembers.ts, 8, 5), Decl(commentsClassMembers.ts, 12, 5)) +>i1_prop : Symbol(i1_prop, Decl(commentsClassMembers.ts, 176, 3)) + +var i1_nc_p = i1.nc_p1; +>i1_nc_p : Symbol(i1_nc_p, Decl(commentsClassMembers.ts, 178, 3)) +>i1.nc_p1 : Symbol(c1.nc_p1, Decl(commentsClassMembers.ts, 47, 5)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>nc_p1 : Symbol(c1.nc_p1, Decl(commentsClassMembers.ts, 47, 5)) + +var i1_ncf = i1.nc_p2; +>i1_ncf : Symbol(i1_ncf, Decl(commentsClassMembers.ts, 179, 3)) +>i1.nc_p2 : Symbol(c1.nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>nc_p2 : Symbol(c1.nc_p2, Decl(commentsClassMembers.ts, 48, 25)) + +var i1_ncr = i1.nc_p2(20); +>i1_ncr : Symbol(i1_ncr, Decl(commentsClassMembers.ts, 180, 3)) +>i1.nc_p2 : Symbol(c1.nc_p2, Decl(commentsClassMembers.ts, 48, 25)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>nc_p2 : Symbol(c1.nc_p2, Decl(commentsClassMembers.ts, 48, 25)) + +var i1_ncprop = i1.nc_p3; +>i1_ncprop : Symbol(i1_ncprop, Decl(commentsClassMembers.ts, 181, 3)) +>i1.nc_p3 : Symbol(c1.nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>nc_p3 : Symbol(c1.nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) + +i1.nc_p3 = i1_ncprop; +>i1.nc_p3 : Symbol(c1.nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) +>i1 : Symbol(i1, Decl(commentsClassMembers.ts, 172, 3)) +>nc_p3 : Symbol(c1.nc_p3, Decl(commentsClassMembers.ts, 51, 5), Decl(commentsClassMembers.ts, 54, 5)) +>i1_ncprop : Symbol(i1_ncprop, Decl(commentsClassMembers.ts, 181, 3)) + +var i1_s_p = c1.s1; +>i1_s_p : Symbol(i1_s_p, Decl(commentsClassMembers.ts, 183, 3)) +>c1.s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s1 : Symbol(c1.s1, Decl(commentsClassMembers.ts, 33, 5)) + +var i1_s_f = c1.s2; +>i1_s_f : Symbol(i1_s_f, Decl(commentsClassMembers.ts, 184, 3)) +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) + +var i1_s_r = c1.s2(20); +>i1_s_r : Symbol(i1_s_r, Decl(commentsClassMembers.ts, 185, 3)) +>c1.s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s2 : Symbol(c1.s2, Decl(commentsClassMembers.ts, 35, 22)) + +var i1_s_prop = c1.s3; +>i1_s_prop : Symbol(i1_s_prop, Decl(commentsClassMembers.ts, 186, 3)) +>c1.s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) + +c1.s3 = i1_s_prop; +>c1.s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>s3 : Symbol(c1.s3, Decl(commentsClassMembers.ts, 39, 5), Decl(commentsClassMembers.ts, 43, 5)) +>i1_s_prop : Symbol(i1_s_prop, Decl(commentsClassMembers.ts, 186, 3)) + +var i1_s_nc_p = c1.nc_s1; +>i1_s_nc_p : Symbol(i1_s_nc_p, Decl(commentsClassMembers.ts, 188, 3)) +>c1.nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s1 : Symbol(c1.nc_s1, Decl(commentsClassMembers.ts, 67, 5)) + +var i1_s_ncf = c1.nc_s2; +>i1_s_ncf : Symbol(i1_s_ncf, Decl(commentsClassMembers.ts, 189, 3)) +>c1.nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) + +var i1_s_ncr = c1.nc_s2(20); +>i1_s_ncr : Symbol(i1_s_ncr, Decl(commentsClassMembers.ts, 190, 3)) +>c1.nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s2 : Symbol(c1.nc_s2, Decl(commentsClassMembers.ts, 68, 25)) + +var i1_s_ncprop = c1.nc_s3; +>i1_s_ncprop : Symbol(i1_s_ncprop, Decl(commentsClassMembers.ts, 191, 3)) +>c1.nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) + +c1.nc_s3 = i1_s_ncprop; +>c1.nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) +>nc_s3 : Symbol(c1.nc_s3, Decl(commentsClassMembers.ts, 71, 5), Decl(commentsClassMembers.ts, 74, 5)) +>i1_s_ncprop : Symbol(i1_s_ncprop, Decl(commentsClassMembers.ts, 191, 3)) + +var i1_c = c1; +>i1_c : Symbol(i1_c, Decl(commentsClassMembers.ts, 193, 3)) +>c1 : Symbol(c1, Decl(commentsClassMembers.ts, 0, 0)) + +class cProperties { +>cProperties : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) + + private val: number; +>val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) + + /** getter only property*/ + public get p1() { +>p1 : Symbol(p1, Decl(commentsClassMembers.ts, 195, 24)) + + return this.val; +>this.val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>this : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) +>val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) + + } // trailing comment of only getter + public get nc_p1() { +>nc_p1 : Symbol(nc_p1, Decl(commentsClassMembers.ts, 199, 5)) + + return this.val; +>this.val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>this : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) +>val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) + } + /**setter only property*/ + public set p2(value: number) { +>p2 : Symbol(p2, Decl(commentsClassMembers.ts, 202, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 204, 18)) + + this.val = value; +>this.val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>this : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) +>val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 204, 18)) + } + public set nc_p2(value: number) { +>nc_p2 : Symbol(nc_p2, Decl(commentsClassMembers.ts, 206, 5)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 207, 21)) + + this.val = value; +>this.val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>this : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) +>val : Symbol(val, Decl(commentsClassMembers.ts, 194, 19)) +>value : Symbol(value, Decl(commentsClassMembers.ts, 207, 21)) + + } /* trailing comment of setter only*/ + + public x = 10; /*trailing comment for property*/ +>x : Symbol(x, Decl(commentsClassMembers.ts, 209, 5)) + + private y = 10; // trailing comment of // style +>y : Symbol(y, Decl(commentsClassMembers.ts, 211, 18)) +} +var cProperties_i = new cProperties(); +>cProperties_i : Symbol(cProperties_i, Decl(commentsClassMembers.ts, 214, 3)) +>cProperties : Symbol(cProperties, Decl(commentsClassMembers.ts, 193, 14)) + +cProperties_i.p2 = cProperties_i.p1; +>cProperties_i.p2 : Symbol(cProperties.p2, Decl(commentsClassMembers.ts, 202, 5)) +>cProperties_i : Symbol(cProperties_i, Decl(commentsClassMembers.ts, 214, 3)) +>p2 : Symbol(cProperties.p2, Decl(commentsClassMembers.ts, 202, 5)) +>cProperties_i.p1 : Symbol(cProperties.p1, Decl(commentsClassMembers.ts, 195, 24)) +>cProperties_i : Symbol(cProperties_i, Decl(commentsClassMembers.ts, 214, 3)) +>p1 : Symbol(cProperties.p1, Decl(commentsClassMembers.ts, 195, 24)) + +cProperties_i.nc_p2 = cProperties_i.nc_p1; +>cProperties_i.nc_p2 : Symbol(cProperties.nc_p2, Decl(commentsClassMembers.ts, 206, 5)) +>cProperties_i : Symbol(cProperties_i, Decl(commentsClassMembers.ts, 214, 3)) +>nc_p2 : Symbol(cProperties.nc_p2, Decl(commentsClassMembers.ts, 206, 5)) +>cProperties_i.nc_p1 : Symbol(cProperties.nc_p1, Decl(commentsClassMembers.ts, 199, 5)) +>cProperties_i : Symbol(cProperties_i, Decl(commentsClassMembers.ts, 214, 3)) +>nc_p1 : Symbol(cProperties.nc_p1, Decl(commentsClassMembers.ts, 199, 5)) + diff --git a/tests/baselines/reference/commentsClassMembers.types b/tests/baselines/reference/commentsClassMembers.types index d71ccd2e1e8..fbd514bf77b 100644 --- a/tests/baselines/reference/commentsClassMembers.types +++ b/tests/baselines/reference/commentsClassMembers.types @@ -574,6 +574,7 @@ var i1_r = i1.p2(20); >i1.p2 : (b: number) => number >i1 : c1 >p2 : (b: number) => number +>20 : number var i1_prop = i1.p3; >i1_prop : number @@ -606,6 +607,7 @@ var i1_ncr = i1.nc_p2(20); >i1.nc_p2 : (b: number) => number >i1 : c1 >nc_p2 : (b: number) => number +>20 : number var i1_ncprop = i1.nc_p3; >i1_ncprop : number @@ -638,6 +640,7 @@ var i1_s_r = c1.s2(20); >c1.s2 : (b: number) => number >c1 : typeof c1 >s2 : (b: number) => number +>20 : number var i1_s_prop = c1.s3; >i1_s_prop : number @@ -670,6 +673,7 @@ var i1_s_ncr = c1.nc_s2(20); >c1.nc_s2 : (b: number) => number >c1 : typeof c1 >nc_s2 : (b: number) => number +>20 : number var i1_s_ncprop = c1.nc_s3; >i1_s_ncprop : number @@ -739,9 +743,11 @@ class cProperties { public x = 10; /*trailing comment for property*/ >x : number +>10 : number private y = 10; // trailing comment of // style >y : number +>10 : number } var cProperties_i = new cProperties(); >cProperties_i : cProperties diff --git a/tests/baselines/reference/commentsCommentParsing.symbols b/tests/baselines/reference/commentsCommentParsing.symbols new file mode 100644 index 00000000000..abd98074b52 --- /dev/null +++ b/tests/baselines/reference/commentsCommentParsing.symbols @@ -0,0 +1,235 @@ +=== tests/cases/compiler/commentsCommentParsing.ts === + +/// This is simple /// comments +function simple() { +>simple : Symbol(simple, Decl(commentsCommentParsing.ts, 0, 0)) +} + +simple(); +>simple : Symbol(simple, Decl(commentsCommentParsing.ts, 0, 0)) + +/// multiLine /// Comments +/// This is example of multiline /// comments +/// Another multiLine +function multiLine() { +>multiLine : Symbol(multiLine, Decl(commentsCommentParsing.ts, 5, 9)) +} +multiLine(); +>multiLine : Symbol(multiLine, Decl(commentsCommentParsing.ts, 5, 9)) + +/** this is eg of single line jsdoc style comment */ +function jsDocSingleLine() { +>jsDocSingleLine : Symbol(jsDocSingleLine, Decl(commentsCommentParsing.ts, 12, 12)) +} +jsDocSingleLine(); +>jsDocSingleLine : Symbol(jsDocSingleLine, Decl(commentsCommentParsing.ts, 12, 12)) + + +/** this is multiple line jsdoc stule comment +*New line1 +*New Line2*/ +function jsDocMultiLine() { +>jsDocMultiLine : Symbol(jsDocMultiLine, Decl(commentsCommentParsing.ts, 17, 18)) +} +jsDocMultiLine(); +>jsDocMultiLine : Symbol(jsDocMultiLine, Decl(commentsCommentParsing.ts, 17, 18)) + +/** this is multiple line jsdoc stule comment +*New line1 +*New Line2*/ +/** Shoul mege this line as well +* and this too*/ /** Another this one too*/ +function jsDocMultiLineMerge() { +>jsDocMultiLineMerge : Symbol(jsDocMultiLineMerge, Decl(commentsCommentParsing.ts, 25, 17)) +} +jsDocMultiLineMerge(); +>jsDocMultiLineMerge : Symbol(jsDocMultiLineMerge, Decl(commentsCommentParsing.ts, 25, 17)) + + +/// Triple slash comment +/** jsdoc comment */ +function jsDocMixedComments1() { +>jsDocMixedComments1 : Symbol(jsDocMixedComments1, Decl(commentsCommentParsing.ts, 34, 22)) +} +jsDocMixedComments1(); +>jsDocMixedComments1 : Symbol(jsDocMixedComments1, Decl(commentsCommentParsing.ts, 34, 22)) + +/// Triple slash comment +/** jsdoc comment */ /*** another jsDocComment*/ +function jsDocMixedComments2() { +>jsDocMixedComments2 : Symbol(jsDocMixedComments2, Decl(commentsCommentParsing.ts, 41, 22)) +} +jsDocMixedComments2(); +>jsDocMixedComments2 : Symbol(jsDocMixedComments2, Decl(commentsCommentParsing.ts, 41, 22)) + +/** jsdoc comment */ /*** another jsDocComment*/ +/// Triple slash comment +function jsDocMixedComments3() { +>jsDocMixedComments3 : Symbol(jsDocMixedComments3, Decl(commentsCommentParsing.ts, 47, 22)) +} +jsDocMixedComments3(); +>jsDocMixedComments3 : Symbol(jsDocMixedComments3, Decl(commentsCommentParsing.ts, 47, 22)) + +/** jsdoc comment */ /*** another jsDocComment*/ +/// Triple slash comment +/// Triple slash comment 2 +function jsDocMixedComments4() { +>jsDocMixedComments4 : Symbol(jsDocMixedComments4, Decl(commentsCommentParsing.ts, 53, 22)) +} +jsDocMixedComments4(); +>jsDocMixedComments4 : Symbol(jsDocMixedComments4, Decl(commentsCommentParsing.ts, 53, 22)) + +/// Triple slash comment 1 +/** jsdoc comment */ /*** another jsDocComment*/ +/// Triple slash comment +/// Triple slash comment 2 +function jsDocMixedComments5() { +>jsDocMixedComments5 : Symbol(jsDocMixedComments5, Decl(commentsCommentParsing.ts, 60, 22)) +} +jsDocMixedComments5(); +>jsDocMixedComments5 : Symbol(jsDocMixedComments5, Decl(commentsCommentParsing.ts, 60, 22)) + +/*** another jsDocComment*/ +/// Triple slash comment 1 +/// Triple slash comment +/// Triple slash comment 2 +/** jsdoc comment */ +function jsDocMixedComments6() { +>jsDocMixedComments6 : Symbol(jsDocMixedComments6, Decl(commentsCommentParsing.ts, 68, 22)) +} +jsDocMixedComments6(); +>jsDocMixedComments6 : Symbol(jsDocMixedComments6, Decl(commentsCommentParsing.ts, 68, 22)) + +// This shoulnot be help comment +function noHelpComment1() { +>noHelpComment1 : Symbol(noHelpComment1, Decl(commentsCommentParsing.ts, 77, 22)) +} +noHelpComment1(); +>noHelpComment1 : Symbol(noHelpComment1, Decl(commentsCommentParsing.ts, 77, 22)) + +/* This shoulnot be help comment */ +function noHelpComment2() { +>noHelpComment2 : Symbol(noHelpComment2, Decl(commentsCommentParsing.ts, 82, 17)) +} +noHelpComment2(); +>noHelpComment2 : Symbol(noHelpComment2, Decl(commentsCommentParsing.ts, 82, 17)) + +function noHelpComment3() { +>noHelpComment3 : Symbol(noHelpComment3, Decl(commentsCommentParsing.ts, 87, 17)) +} +noHelpComment3(); +>noHelpComment3 : Symbol(noHelpComment3, Decl(commentsCommentParsing.ts, 87, 17)) + +/** Adds two integers and returns the result + * @param {number} a first number + * @param b second number + */ +function sum(a: number, b: number) { +>sum : Symbol(sum, Decl(commentsCommentParsing.ts, 91, 17)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 96, 13)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 96, 23)) + + return a + b; +>a : Symbol(a, Decl(commentsCommentParsing.ts, 96, 13)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 96, 23)) +} +sum(10, 20); +>sum : Symbol(sum, Decl(commentsCommentParsing.ts, 91, 17)) + +/** This is multiplication function*/ +/** @param */ +/** @param a first number*/ +/** @param b */ +/** @param c { + @param d @anotherTag*/ +/** @param e LastParam @anotherTag*/ +function multiply(a: number, b: number, c?: number, d?, e?) { +>multiply : Symbol(multiply, Decl(commentsCommentParsing.ts, 99, 12)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 107, 18)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 107, 28)) +>c : Symbol(c, Decl(commentsCommentParsing.ts, 107, 39)) +>d : Symbol(d, Decl(commentsCommentParsing.ts, 107, 51)) +>e : Symbol(e, Decl(commentsCommentParsing.ts, 107, 55)) +} +/** fn f1 with number +* @param { string} b about b +*/ +function f1(a: number); +>f1 : Symbol(f1, Decl(commentsCommentParsing.ts, 108, 1), Decl(commentsCommentParsing.ts, 112, 23), Decl(commentsCommentParsing.ts, 113, 23)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 112, 12)) + +function f1(b: string); +>f1 : Symbol(f1, Decl(commentsCommentParsing.ts, 108, 1), Decl(commentsCommentParsing.ts, 112, 23), Decl(commentsCommentParsing.ts, 113, 23)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 113, 12)) + +/**@param opt optional parameter*/ +function f1(aOrb, opt?) { +>f1 : Symbol(f1, Decl(commentsCommentParsing.ts, 108, 1), Decl(commentsCommentParsing.ts, 112, 23), Decl(commentsCommentParsing.ts, 113, 23)) +>aOrb : Symbol(aOrb, Decl(commentsCommentParsing.ts, 115, 12)) +>opt : Symbol(opt, Decl(commentsCommentParsing.ts, 115, 17)) + + return aOrb; +>aOrb : Symbol(aOrb, Decl(commentsCommentParsing.ts, 115, 12)) +} +/** This is subtract function +@param { a +*@param { number | } b this is about b +@param { { () => string; } } c this is optional param c +@param { { () => string; } d this is optional param d +@param { { () => string; } } e this is optional param e +@param { { { () => string; } } f this is optional param f +*/ +function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string) { +>subtract : Symbol(subtract, Decl(commentsCommentParsing.ts, 117, 1)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 126, 18)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 126, 28)) +>c : Symbol(c, Decl(commentsCommentParsing.ts, 126, 39)) +>d : Symbol(d, Decl(commentsCommentParsing.ts, 126, 57)) +>e : Symbol(e, Decl(commentsCommentParsing.ts, 126, 75)) +>f : Symbol(f, Decl(commentsCommentParsing.ts, 126, 93)) +} +/** this is square function +@paramTag { number } a this is input number of paramTag +@param { number } a this is input number +@returnType { number } it is return type +*/ +function square(a: number) { +>square : Symbol(square, Decl(commentsCommentParsing.ts, 127, 1)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 133, 16)) + + return a * a; +>a : Symbol(a, Decl(commentsCommentParsing.ts, 133, 16)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 133, 16)) +} +/** this is divide function +@param { number} a this is a +@paramTag { number } g this is optional param g +@param { number} b this is b +*/ +function divide(a: number, b: number) { +>divide : Symbol(divide, Decl(commentsCommentParsing.ts, 135, 1)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 141, 16)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 141, 26)) +} +/** this is jsdoc style function with param tag as well as inline parameter help +*@param a it is first parameter +*@param c it is third parameter +*/ +function jsDocParamTest(/** this is inline comment for a */a: number, /** this is inline comment for b*/ b: number, c: number, d: number) { +>jsDocParamTest : Symbol(jsDocParamTest, Decl(commentsCommentParsing.ts, 142, 1)) +>a : Symbol(a, Decl(commentsCommentParsing.ts, 147, 24)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 147, 69)) +>c : Symbol(c, Decl(commentsCommentParsing.ts, 147, 115)) +>d : Symbol(d, Decl(commentsCommentParsing.ts, 147, 126)) + + return a + b + c + d; +>a : Symbol(a, Decl(commentsCommentParsing.ts, 147, 24)) +>b : Symbol(b, Decl(commentsCommentParsing.ts, 147, 69)) +>c : Symbol(c, Decl(commentsCommentParsing.ts, 147, 115)) +>d : Symbol(d, Decl(commentsCommentParsing.ts, 147, 126)) +} + +/**/ +class NoQuickInfoClass { +>NoQuickInfoClass : Symbol(NoQuickInfoClass, Decl(commentsCommentParsing.ts, 149, 1)) +} diff --git a/tests/baselines/reference/commentsCommentParsing.types b/tests/baselines/reference/commentsCommentParsing.types index a9194f9a63a..a6e24609642 100644 --- a/tests/baselines/reference/commentsCommentParsing.types +++ b/tests/baselines/reference/commentsCommentParsing.types @@ -151,6 +151,8 @@ function sum(a: number, b: number) { sum(10, 20); >sum(10, 20) : number >sum : (a: number, b: number) => number +>10 : number +>20 : number /** This is multiplication function*/ /** @param */ diff --git a/tests/baselines/reference/commentsDottedModuleName.symbols b/tests/baselines/reference/commentsDottedModuleName.symbols new file mode 100644 index 00000000000..99083b11e3c --- /dev/null +++ b/tests/baselines/reference/commentsDottedModuleName.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/commentsDottedModuleName.ts === + +/** this is multi declare module*/ +export module outerModule.InnerModule { +>outerModule : Symbol(outerModule, Decl(commentsDottedModuleName.ts, 0, 0)) +>InnerModule : Symbol(InnerModule, Decl(commentsDottedModuleName.ts, 2, 26)) + + /// class b comment + export class b { +>b : Symbol(b, Decl(commentsDottedModuleName.ts, 2, 39)) + } +} diff --git a/tests/baselines/reference/commentsEnums.symbols b/tests/baselines/reference/commentsEnums.symbols new file mode 100644 index 00000000000..0f5910f4ee7 --- /dev/null +++ b/tests/baselines/reference/commentsEnums.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/commentsEnums.ts === + +/** Enum of colors*/ +enum Colors { +>Colors : Symbol(Colors, Decl(commentsEnums.ts, 0, 0)) + + /** Fancy name for 'blue'*/ + Cornflower /* blue */, +>Cornflower : Symbol(Colors.Cornflower, Decl(commentsEnums.ts, 2, 13)) + + /** Fancy name for 'pink'*/ + FancyPink +>FancyPink : Symbol(Colors.FancyPink, Decl(commentsEnums.ts, 4, 26)) + +} // trailing comment +var x = Colors.Cornflower; +>x : Symbol(x, Decl(commentsEnums.ts, 8, 3)) +>Colors.Cornflower : Symbol(Colors.Cornflower, Decl(commentsEnums.ts, 2, 13)) +>Colors : Symbol(Colors, Decl(commentsEnums.ts, 0, 0)) +>Cornflower : Symbol(Colors.Cornflower, Decl(commentsEnums.ts, 2, 13)) + +x = Colors.FancyPink; +>x : Symbol(x, Decl(commentsEnums.ts, 8, 3)) +>Colors.FancyPink : Symbol(Colors.FancyPink, Decl(commentsEnums.ts, 4, 26)) +>Colors : Symbol(Colors, Decl(commentsEnums.ts, 0, 0)) +>FancyPink : Symbol(Colors.FancyPink, Decl(commentsEnums.ts, 4, 26)) + + diff --git a/tests/baselines/reference/commentsExternalModules.symbols b/tests/baselines/reference/commentsExternalModules.symbols new file mode 100644 index 00000000000..6f7852245dd --- /dev/null +++ b/tests/baselines/reference/commentsExternalModules.symbols @@ -0,0 +1,143 @@ +=== tests/cases/compiler/commentsExternalModules_1.ts === +/**This is on import declaration*/ +import extMod = require("commentsExternalModules_0"); // trailing comment1 +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) + +extMod.m1.fooExport(); +>extMod.m1.fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules_0.ts, 16, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules_0.ts, 16, 5)) + +var newVar = new extMod.m1.m2.c(); +>newVar : Symbol(newVar, Decl(commentsExternalModules_1.ts, 3, 3)) +>extMod.m1.m2.c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules_0.ts, 10, 22)) +>extMod.m1.m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules_0.ts, 8, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules_0.ts, 8, 5)) +>c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules_0.ts, 10, 22)) + +extMod.m4.fooExport(); +>extMod.m4.fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules_0.ts, 42, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules_0.ts, 42, 5)) + +var newVar2 = new extMod.m4.m2.c(); +>newVar2 : Symbol(newVar2, Decl(commentsExternalModules_1.ts, 5, 3)) +>extMod.m4.m2.c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules_0.ts, 36, 22)) +>extMod.m4.m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules_0.ts, 33, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules_0.ts, 33, 5)) +>c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules_0.ts, 36, 22)) + +=== tests/cases/compiler/commentsExternalModules_0.ts === + +/** Module comment*/ +export module m1 { +>m1 : Symbol(m1, Decl(commentsExternalModules_0.ts, 0, 0)) + + /** b's comment*/ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules_0.ts, 4, 14)) + + /** foo's comment*/ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules_0.ts, 4, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules_0.ts, 4, 14)) + } + /** m2 comments*/ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules_0.ts, 8, 5)) + + /** class comment;*/ + export class c { +>c : Symbol(c, Decl(commentsExternalModules_0.ts, 10, 22)) + + }; + /** i*/ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules_0.ts, 15, 18)) +>c : Symbol(c, Decl(commentsExternalModules_0.ts, 10, 22)) + } + /** exported function*/ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules_0.ts, 16, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules_0.ts, 4, 25)) + } +} +m1.fooExport(); +>m1.fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules_0.ts, 16, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules_0.ts, 16, 5)) + +var myvar = new m1.m2.c(); +>myvar : Symbol(myvar, Decl(commentsExternalModules_0.ts, 23, 3)) +>m1.m2.c : Symbol(m1.m2.c, Decl(commentsExternalModules_0.ts, 10, 22)) +>m1.m2 : Symbol(m1.m2, Decl(commentsExternalModules_0.ts, 8, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules_0.ts, 0, 0)) +>m2 : Symbol(m1.m2, Decl(commentsExternalModules_0.ts, 8, 5)) +>c : Symbol(m1.m2.c, Decl(commentsExternalModules_0.ts, 10, 22)) + +/** Module comment */ +export module m4 { +>m4 : Symbol(m4, Decl(commentsExternalModules_0.ts, 23, 26)) + + /** b's comment */ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules_0.ts, 28, 14)) + + /** foo's comment + */ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules_0.ts, 28, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules_0.ts, 28, 14)) + } + /** m2 comments + */ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules_0.ts, 33, 5)) + + /** class comment; */ + export class c { +>c : Symbol(c, Decl(commentsExternalModules_0.ts, 36, 22)) + + }; + /** i */ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules_0.ts, 41, 18)) +>c : Symbol(c, Decl(commentsExternalModules_0.ts, 36, 22)) + } + /** exported function */ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules_0.ts, 42, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules_0.ts, 28, 25)) + } +} +m4.fooExport(); +>m4.fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules_0.ts, 42, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules_0.ts, 42, 5)) + +var myvar2 = new m4.m2.c(); +>myvar2 : Symbol(myvar2, Decl(commentsExternalModules_0.ts, 49, 3)) +>m4.m2.c : Symbol(m4.m2.c, Decl(commentsExternalModules_0.ts, 36, 22)) +>m4.m2 : Symbol(m4.m2, Decl(commentsExternalModules_0.ts, 33, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules_0.ts, 23, 26)) +>m2 : Symbol(m4.m2, Decl(commentsExternalModules_0.ts, 33, 5)) +>c : Symbol(m4.m2.c, Decl(commentsExternalModules_0.ts, 36, 22)) + diff --git a/tests/baselines/reference/commentsExternalModules2.symbols b/tests/baselines/reference/commentsExternalModules2.symbols new file mode 100644 index 00000000000..cfd01db377d --- /dev/null +++ b/tests/baselines/reference/commentsExternalModules2.symbols @@ -0,0 +1,143 @@ +=== tests/cases/compiler/commentsExternalModules_1.ts === +/**This is on import declaration*/ +import extMod = require("commentsExternalModules2_0"); // trailing comment 1 +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) + +extMod.m1.fooExport(); +>extMod.m1.fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + +export var newVar = new extMod.m1.m2.c(); +>newVar : Symbol(newVar, Decl(commentsExternalModules_1.ts, 3, 10)) +>extMod.m1.m2.c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) +>extMod.m1.m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) + +extMod.m4.fooExport(); +>extMod.m4.fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + +export var newVar2 = new extMod.m4.m2.c(); +>newVar2 : Symbol(newVar2, Decl(commentsExternalModules_1.ts, 5, 10)) +>extMod.m4.m2.c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) +>extMod.m4.m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) + +=== tests/cases/compiler/commentsExternalModules2_0.ts === + +/** Module comment*/ +export module m1 { +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) + + /** b's comment*/ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 4, 14)) + + /** foo's comment*/ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 4, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 4, 14)) + } + /** m2 comments*/ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules2_0.ts, 8, 5)) + + /** class comment;*/ + export class c { +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 10, 22)) + + }; + /** i*/ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules2_0.ts, 15, 18)) +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 10, 22)) + } + /** exported function*/ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 4, 25)) + } +} +m1.fooExport(); +>m1.fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + +var myvar = new m1.m2.c(); +>myvar : Symbol(myvar, Decl(commentsExternalModules2_0.ts, 23, 3)) +>m1.m2.c : Symbol(m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) +>m1.m2 : Symbol(m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>m2 : Symbol(m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>c : Symbol(m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) + +/** Module comment */ +export module m4 { +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) + + /** b's comment */ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 28, 14)) + + /** foo's comment + */ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 28, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 28, 14)) + } + /** m2 comments + */ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules2_0.ts, 33, 5)) + + /** class comment; */ + export class c { +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 36, 22)) + + }; + /** i */ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules2_0.ts, 41, 18)) +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 36, 22)) + } + /** exported function */ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 28, 25)) + } +} +m4.fooExport(); +>m4.fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + +var myvar2 = new m4.m2.c(); +>myvar2 : Symbol(myvar2, Decl(commentsExternalModules2_0.ts, 49, 3)) +>m4.m2.c : Symbol(m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) +>m4.m2 : Symbol(m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>m2 : Symbol(m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>c : Symbol(m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) + diff --git a/tests/baselines/reference/commentsExternalModules3.symbols b/tests/baselines/reference/commentsExternalModules3.symbols new file mode 100644 index 00000000000..cfd01db377d --- /dev/null +++ b/tests/baselines/reference/commentsExternalModules3.symbols @@ -0,0 +1,143 @@ +=== tests/cases/compiler/commentsExternalModules_1.ts === +/**This is on import declaration*/ +import extMod = require("commentsExternalModules2_0"); // trailing comment 1 +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) + +extMod.m1.fooExport(); +>extMod.m1.fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>fooExport : Symbol(extMod.m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + +export var newVar = new extMod.m1.m2.c(); +>newVar : Symbol(newVar, Decl(commentsExternalModules_1.ts, 3, 10)) +>extMod.m1.m2.c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) +>extMod.m1.m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>extMod.m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m1 : Symbol(extMod.m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>m2 : Symbol(extMod.m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>c : Symbol(extMod.m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) + +extMod.m4.fooExport(); +>extMod.m4.fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>fooExport : Symbol(extMod.m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + +export var newVar2 = new extMod.m4.m2.c(); +>newVar2 : Symbol(newVar2, Decl(commentsExternalModules_1.ts, 5, 10)) +>extMod.m4.m2.c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) +>extMod.m4.m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>extMod.m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>extMod : Symbol(extMod, Decl(commentsExternalModules_1.ts, 0, 0)) +>m4 : Symbol(extMod.m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>m2 : Symbol(extMod.m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>c : Symbol(extMod.m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) + +=== tests/cases/compiler/commentsExternalModules2_0.ts === + +/** Module comment*/ +export module m1 { +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) + + /** b's comment*/ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 4, 14)) + + /** foo's comment*/ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 4, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 4, 14)) + } + /** m2 comments*/ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules2_0.ts, 8, 5)) + + /** class comment;*/ + export class c { +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 10, 22)) + + }; + /** i*/ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules2_0.ts, 15, 18)) +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 10, 22)) + } + /** exported function*/ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 4, 25)) + } +} +m1.fooExport(); +>m1.fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>fooExport : Symbol(m1.fooExport, Decl(commentsExternalModules2_0.ts, 16, 5)) + +var myvar = new m1.m2.c(); +>myvar : Symbol(myvar, Decl(commentsExternalModules2_0.ts, 23, 3)) +>m1.m2.c : Symbol(m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) +>m1.m2 : Symbol(m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>m1 : Symbol(m1, Decl(commentsExternalModules2_0.ts, 0, 0)) +>m2 : Symbol(m1.m2, Decl(commentsExternalModules2_0.ts, 8, 5)) +>c : Symbol(m1.m2.c, Decl(commentsExternalModules2_0.ts, 10, 22)) + +/** Module comment */ +export module m4 { +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) + + /** b's comment */ + export var b: number; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 28, 14)) + + /** foo's comment + */ + function foo() { +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 28, 25)) + + return b; +>b : Symbol(b, Decl(commentsExternalModules2_0.ts, 28, 14)) + } + /** m2 comments + */ + export module m2 { +>m2 : Symbol(m2, Decl(commentsExternalModules2_0.ts, 33, 5)) + + /** class comment; */ + export class c { +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 36, 22)) + + }; + /** i */ + export var i = new c(); +>i : Symbol(i, Decl(commentsExternalModules2_0.ts, 41, 18)) +>c : Symbol(c, Decl(commentsExternalModules2_0.ts, 36, 22)) + } + /** exported function */ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsExternalModules2_0.ts, 28, 25)) + } +} +m4.fooExport(); +>m4.fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>fooExport : Symbol(m4.fooExport, Decl(commentsExternalModules2_0.ts, 42, 5)) + +var myvar2 = new m4.m2.c(); +>myvar2 : Symbol(myvar2, Decl(commentsExternalModules2_0.ts, 49, 3)) +>m4.m2.c : Symbol(m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) +>m4.m2 : Symbol(m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>m4 : Symbol(m4, Decl(commentsExternalModules2_0.ts, 23, 26)) +>m2 : Symbol(m4.m2, Decl(commentsExternalModules2_0.ts, 33, 5)) +>c : Symbol(m4.m2.c, Decl(commentsExternalModules2_0.ts, 36, 22)) + diff --git a/tests/baselines/reference/commentsFormatting.symbols b/tests/baselines/reference/commentsFormatting.symbols new file mode 100644 index 00000000000..a858d48ce67 --- /dev/null +++ b/tests/baselines/reference/commentsFormatting.symbols @@ -0,0 +1,93 @@ +=== tests/cases/compiler/commentsFormatting.ts === + +module m { +>m : Symbol(m, Decl(commentsFormatting.ts, 0, 0)) + + /** this is first line - aligned to class declaration +* this is 4 spaces left aligned + * this is 3 spaces left aligned + * this is 2 spaces left aligned + * this is 1 spaces left aligned + * this is at same level as first line + * this is 1 spaces right aligned + * this is 2 spaces right aligned + * this is 3 spaces right aligned + * this is 4 spaces right aligned + * this is 5 spaces right aligned + * this is 6 spaces right aligned + * this is 7 spaces right aligned + * this is 8 spaces right aligned */ + export class c { +>c : Symbol(c, Decl(commentsFormatting.ts, 1, 10)) + } + + /** this is first line - 4 spaces right aligned to class but in js file should be aligned to class declaration +* this is 8 spaces left aligned + * this is 7 spaces left aligned + * this is 6 spaces left aligned + * this is 5 spaces left aligned + * this is 4 spaces left aligned + * this is 3 spaces left aligned + * this is 2 spaces left aligned + * this is 1 spaces left aligned + * this is at same level as first line + * this is 1 spaces right aligned + * this is 2 spaces right aligned + * this is 3 spaces right aligned + * this is 4 spaces right aligned + * this is 5 spaces right aligned + * this is 6 spaces right aligned + * this is 7 spaces right aligned + * this is 8 spaces right aligned */ + export class c2 { +>c2 : Symbol(c2, Decl(commentsFormatting.ts, 17, 5)) + } + + /** this is comment with new lines in between + +this is 4 spaces left aligned but above line is empty + + this is 3 spaces left aligned but above line is empty + + this is 2 spaces left aligned but above line is empty + + this is 1 spaces left aligned but above line is empty + + this is at same level as first line but above line is empty + + this is 1 spaces right aligned but above line is empty + + this is 2 spaces right aligned but above line is empty + + this is 3 spaces right aligned but above line is empty + + this is 4 spaces right aligned but above line is empty + + + Above 2 lines are empty + + + + above 3 lines are empty*/ + export class c3 { +>c3 : Symbol(c3, Decl(commentsFormatting.ts, 38, 5)) + } + + /** this is first line - aligned to class declaration + * this is 0 space + tab + * this is 1 space + tab + * this is 2 spaces + tab + * this is 3 spaces + tab + * this is 4 spaces + tab + * this is 5 spaces + tab + * this is 6 spaces + tab + * this is 7 spaces + tab + * this is 8 spaces + tab + * this is 9 spaces + tab + * this is 10 spaces + tab + * this is 11 spaces + tab + * this is 12 spaces + tab */ + export class c4 { +>c4 : Symbol(c4, Decl(commentsFormatting.ts, 67, 5)) + } +} diff --git a/tests/baselines/reference/commentsFunction.symbols b/tests/baselines/reference/commentsFunction.symbols new file mode 100644 index 00000000000..dfc68eb6743 --- /dev/null +++ b/tests/baselines/reference/commentsFunction.symbols @@ -0,0 +1,109 @@ +=== tests/cases/compiler/commentsFunction.ts === + +/** This comment should appear for foo*/ +function foo() { +>foo : Symbol(foo, Decl(commentsFunction.ts, 0, 0)) + +} /* trailing comment of function */ +foo(); +>foo : Symbol(foo, Decl(commentsFunction.ts, 0, 0)) + +/** This is comment for function signature*/ +function fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(commentsFunction.ts, 4, 6)) +>a : Symbol(a, Decl(commentsFunction.ts, 6, 27)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(commentsFunction.ts, 6, 66)) + + var d = a; +>d : Symbol(d, Decl(commentsFunction.ts, 9, 7)) +>a : Symbol(a, Decl(commentsFunction.ts, 6, 27)) + +} // trailing comment of function +fooWithParameters("a", 10); +>fooWithParameters : Symbol(fooWithParameters, Decl(commentsFunction.ts, 4, 6)) + +/** fooFunc + * comment + */ +var fooFunc = function FooFunctionValue(/** fooFunctionValue param */ b: string) { +>fooFunc : Symbol(fooFunc, Decl(commentsFunction.ts, 15, 3)) +>FooFunctionValue : Symbol(FooFunctionValue, Decl(commentsFunction.ts, 15, 13)) +>b : Symbol(b, Decl(commentsFunction.ts, 15, 40)) + + return b; +>b : Symbol(b, Decl(commentsFunction.ts, 15, 40)) +} + +/// lamdaFoo var comment +var lambdaFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => a + b; +>lambdaFoo : Symbol(lambdaFoo, Decl(commentsFunction.ts, 20, 3)) +>a : Symbol(a, Decl(commentsFunction.ts, 20, 46)) +>b : Symbol(b, Decl(commentsFunction.ts, 20, 68)) +>a : Symbol(a, Decl(commentsFunction.ts, 20, 46)) +>b : Symbol(b, Decl(commentsFunction.ts, 20, 68)) + +var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b; +>lambddaNoVarComment : Symbol(lambddaNoVarComment, Decl(commentsFunction.ts, 21, 3)) +>a : Symbol(a, Decl(commentsFunction.ts, 21, 63)) +>b : Symbol(b, Decl(commentsFunction.ts, 21, 85)) +>a : Symbol(a, Decl(commentsFunction.ts, 21, 63)) +>b : Symbol(b, Decl(commentsFunction.ts, 21, 85)) + +lambdaFoo(10, 20); +>lambdaFoo : Symbol(lambdaFoo, Decl(commentsFunction.ts, 20, 3)) + +lambddaNoVarComment(10, 20); +>lambddaNoVarComment : Symbol(lambddaNoVarComment, Decl(commentsFunction.ts, 21, 3)) + +function blah(a: string /* multiline trailing comment +>blah : Symbol(blah, Decl(commentsFunction.ts, 23, 28)) +>a : Symbol(a, Decl(commentsFunction.ts, 25, 14)) + +multiline */) { +} + +function blah2(a: string /* single line multiple trailing comments */ /* second */) { +>blah2 : Symbol(blah2, Decl(commentsFunction.ts, 27, 1)) +>a : Symbol(a, Decl(commentsFunction.ts, 29, 15)) +} + +function blah3(a: string // trailing commen single line +>blah3 : Symbol(blah3, Decl(commentsFunction.ts, 30, 1)) +>a : Symbol(a, Decl(commentsFunction.ts, 32, 15)) + + ) { +} + +lambdaFoo = (a, b) => a * b; // This is trailing comment +>lambdaFoo : Symbol(lambdaFoo, Decl(commentsFunction.ts, 20, 3)) +>a : Symbol(a, Decl(commentsFunction.ts, 36, 13)) +>b : Symbol(b, Decl(commentsFunction.ts, 36, 15)) +>a : Symbol(a, Decl(commentsFunction.ts, 36, 13)) +>b : Symbol(b, Decl(commentsFunction.ts, 36, 15)) + +/*leading comment*/() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) +/*leading comment*/(() => 0); //trailing comment + +function blah4(/*1*/a: string/*2*/,/*3*/b: string/*4*/) { +>blah4 : Symbol(blah4, Decl(commentsFunction.ts, 39, 29)) +>a : Symbol(a, Decl(commentsFunction.ts, 41, 15)) +>b : Symbol(b, Decl(commentsFunction.ts, 41, 35)) +} + +function foo1() { +>foo1 : Symbol(foo1, Decl(commentsFunction.ts, 42, 1)) + + // should emit this +} + +function foo2() { +>foo2 : Symbol(foo2, Decl(commentsFunction.ts, 47, 1)) + + /// This is some detached comment + + // should emit this leading comment of } too +} + diff --git a/tests/baselines/reference/commentsFunction.types b/tests/baselines/reference/commentsFunction.types index 6d37e1732e0..db5e518339d 100644 --- a/tests/baselines/reference/commentsFunction.types +++ b/tests/baselines/reference/commentsFunction.types @@ -26,6 +26,8 @@ function fooWithParameters(/** this is comment about a*/a: string, fooWithParameters("a", 10); >fooWithParameters("a", 10) : void >fooWithParameters : (a: string, b: number) => void +>"a" : string +>10 : number /** fooFunc * comment @@ -62,10 +64,14 @@ var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: nu lambdaFoo(10, 20); >lambdaFoo(10, 20) : number >lambdaFoo : (a: number, b: number) => number +>10 : number +>20 : number lambddaNoVarComment(10, 20); >lambddaNoVarComment(10, 20) : number >lambddaNoVarComment : (a: number, b: number) => number +>10 : number +>20 : number function blah(a: string /* multiline trailing comment >blah : (a: string) => void @@ -98,10 +104,12 @@ lambdaFoo = (a, b) => a * b; // This is trailing comment /*leading comment*/() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) >() => 0 : () => number +>0 : number /*leading comment*/(() => 0); //trailing comment >(() => 0) : () => number >() => 0 : () => number +>0 : number function blah4(/*1*/a: string/*2*/,/*3*/b: string/*4*/) { >blah4 : (a: string, b: string) => void diff --git a/tests/baselines/reference/commentsInheritance.symbols b/tests/baselines/reference/commentsInheritance.symbols new file mode 100644 index 00000000000..f702f40a0d4 --- /dev/null +++ b/tests/baselines/reference/commentsInheritance.symbols @@ -0,0 +1,311 @@ +=== tests/cases/compiler/commentsInheritance.ts === + +/** i1 is interface with properties*/ +interface i1 { +>i1 : Symbol(i1, Decl(commentsInheritance.ts, 0, 0)) + + /** i1_p1*/ + i1_p1: number; +>i1_p1 : Symbol(i1_p1, Decl(commentsInheritance.ts, 2, 14)) + + /** i1_f1*/ + i1_f1(): void; +>i1_f1 : Symbol(i1_f1, Decl(commentsInheritance.ts, 4, 18)) + + /** i1_l1*/ + i1_l1: () => void; +>i1_l1 : Symbol(i1_l1, Decl(commentsInheritance.ts, 6, 18)) + + // il_nc_p1 + i1_nc_p1: number; +>i1_nc_p1 : Symbol(i1_nc_p1, Decl(commentsInheritance.ts, 8, 22)) + + i1_nc_f1(): void; +>i1_nc_f1 : Symbol(i1_nc_f1, Decl(commentsInheritance.ts, 10, 21)) + + i1_nc_l1: () => void; +>i1_nc_l1 : Symbol(i1_nc_l1, Decl(commentsInheritance.ts, 11, 21)) + + p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 12, 25)) + + f1(): void; +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 13, 15)) + + l1: () => void; +>l1 : Symbol(l1, Decl(commentsInheritance.ts, 14, 15)) + + nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 15, 19)) + + nc_f1(): void; +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 16, 18)) + + nc_l1: () => void; +>nc_l1 : Symbol(nc_l1, Decl(commentsInheritance.ts, 17, 18)) +} +class c1 implements i1 { +>c1 : Symbol(c1, Decl(commentsInheritance.ts, 19, 1)) +>i1 : Symbol(i1, Decl(commentsInheritance.ts, 0, 0)) + + public i1_p1: number; +>i1_p1 : Symbol(i1_p1, Decl(commentsInheritance.ts, 20, 24)) + + // i1_f1 + public i1_f1() { +>i1_f1 : Symbol(i1_f1, Decl(commentsInheritance.ts, 21, 25)) + } + public i1_l1: () => void; +>i1_l1 : Symbol(i1_l1, Decl(commentsInheritance.ts, 24, 5)) + + public i1_nc_p1: number; +>i1_nc_p1 : Symbol(i1_nc_p1, Decl(commentsInheritance.ts, 25, 29)) + + public i1_nc_f1() { +>i1_nc_f1 : Symbol(i1_nc_f1, Decl(commentsInheritance.ts, 26, 28)) + } + public i1_nc_l1: () => void; +>i1_nc_l1 : Symbol(i1_nc_l1, Decl(commentsInheritance.ts, 28, 5)) + + /** c1_p1*/ + public p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 29, 32)) + + /** c1_f1*/ + public f1() { +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 31, 22)) + } + /** c1_l1*/ + public l1: () => void; +>l1 : Symbol(l1, Decl(commentsInheritance.ts, 34, 5)) + + /** c1_nc_p1*/ + public nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 36, 26)) + + /** c1_nc_f1*/ + public nc_f1() { +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 38, 25)) + } + /** c1_nc_l1*/ + public nc_l1: () => void; +>nc_l1 : Symbol(nc_l1, Decl(commentsInheritance.ts, 41, 5)) +} +var i1_i: i1; +>i1_i : Symbol(i1_i, Decl(commentsInheritance.ts, 45, 3)) +>i1 : Symbol(i1, Decl(commentsInheritance.ts, 0, 0)) + +var c1_i = new c1(); +>c1_i : Symbol(c1_i, Decl(commentsInheritance.ts, 46, 3)) +>c1 : Symbol(c1, Decl(commentsInheritance.ts, 19, 1)) + +// assign to interface +i1_i = c1_i; +>i1_i : Symbol(i1_i, Decl(commentsInheritance.ts, 45, 3)) +>c1_i : Symbol(c1_i, Decl(commentsInheritance.ts, 46, 3)) + +class c2 { +>c2 : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) + + /** c2 c2_p1*/ + public c2_p1: number; +>c2_p1 : Symbol(c2_p1, Decl(commentsInheritance.ts, 49, 10)) + + /** c2 c2_f1*/ + public c2_f1() { +>c2_f1 : Symbol(c2_f1, Decl(commentsInheritance.ts, 51, 25)) + } + /** c2 c2_prop*/ + public get c2_prop() { +>c2_prop : Symbol(c2_prop, Decl(commentsInheritance.ts, 54, 5)) + + return 10; + } + public c2_nc_p1: number; +>c2_nc_p1 : Symbol(c2_nc_p1, Decl(commentsInheritance.ts, 58, 5)) + + public c2_nc_f1() { +>c2_nc_f1 : Symbol(c2_nc_f1, Decl(commentsInheritance.ts, 59, 28)) + } + public get c2_nc_prop() { +>c2_nc_prop : Symbol(c2_nc_prop, Decl(commentsInheritance.ts, 61, 5)) + + return 10; + } + /** c2 p1*/ + public p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 64, 5)) + + /** c2 f1*/ + public f1() { +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 66, 22)) + } + /** c2 prop*/ + public get prop() { +>prop : Symbol(prop, Decl(commentsInheritance.ts, 69, 5)) + + return 10; + } + public nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 73, 5)) + + public nc_f1() { +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 74, 25)) + } + public get nc_prop() { +>nc_prop : Symbol(nc_prop, Decl(commentsInheritance.ts, 76, 5)) + + return 10; + } + /** c2 constructor*/ + constructor(a: number) { +>a : Symbol(a, Decl(commentsInheritance.ts, 81, 16)) + + this.c2_p1 = a; +>this.c2_p1 : Symbol(c2_p1, Decl(commentsInheritance.ts, 49, 10)) +>this : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) +>c2_p1 : Symbol(c2_p1, Decl(commentsInheritance.ts, 49, 10)) +>a : Symbol(a, Decl(commentsInheritance.ts, 81, 16)) + } +} +class c3 extends c2 { +>c3 : Symbol(c3, Decl(commentsInheritance.ts, 84, 1)) +>c2 : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) + + constructor() { + super(10); +>super : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) + } + /** c3 p1*/ + public p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 88, 5)) + + /** c3 f1*/ + public f1() { +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 90, 22)) + } + /** c3 prop*/ + public get prop() { +>prop : Symbol(prop, Decl(commentsInheritance.ts, 93, 5)) + + return 10; + } + public nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 97, 5)) + + public nc_f1() { +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 98, 25)) + } + public get nc_prop() { +>nc_prop : Symbol(nc_prop, Decl(commentsInheritance.ts, 100, 5)) + + return 10; + } +} +var c2_i = new c2(10); +>c2_i : Symbol(c2_i, Decl(commentsInheritance.ts, 105, 3)) +>c2 : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) + +var c3_i = new c3(); +>c3_i : Symbol(c3_i, Decl(commentsInheritance.ts, 106, 3)) +>c3 : Symbol(c3, Decl(commentsInheritance.ts, 84, 1)) + +// assign +c2_i = c3_i; +>c2_i : Symbol(c2_i, Decl(commentsInheritance.ts, 105, 3)) +>c3_i : Symbol(c3_i, Decl(commentsInheritance.ts, 106, 3)) + +class c4 extends c2 { +>c4 : Symbol(c4, Decl(commentsInheritance.ts, 108, 12)) +>c2 : Symbol(c2, Decl(commentsInheritance.ts, 48, 12)) +} +var c4_i = new c4(10); +>c4_i : Symbol(c4_i, Decl(commentsInheritance.ts, 111, 3)) +>c4 : Symbol(c4, Decl(commentsInheritance.ts, 108, 12)) + +interface i2 { +>i2 : Symbol(i2, Decl(commentsInheritance.ts, 111, 22)) + + /** i2_p1*/ + i2_p1: number; +>i2_p1 : Symbol(i2_p1, Decl(commentsInheritance.ts, 112, 14)) + + /** i2_f1*/ + i2_f1(): void; +>i2_f1 : Symbol(i2_f1, Decl(commentsInheritance.ts, 114, 18)) + + /** i2_l1*/ + i2_l1: () => void; +>i2_l1 : Symbol(i2_l1, Decl(commentsInheritance.ts, 116, 18)) + + // i2_nc_p1 + i2_nc_p1: number; +>i2_nc_p1 : Symbol(i2_nc_p1, Decl(commentsInheritance.ts, 118, 22)) + + i2_nc_f1(): void; +>i2_nc_f1 : Symbol(i2_nc_f1, Decl(commentsInheritance.ts, 120, 21)) + + i2_nc_l1: () => void; +>i2_nc_l1 : Symbol(i2_nc_l1, Decl(commentsInheritance.ts, 121, 21)) + + /** i2 p1*/ + p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 122, 25)) + + /** i2 f1*/ + f1(): void; +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 124, 15)) + + /** i2 l1*/ + l1: () => void; +>l1 : Symbol(l1, Decl(commentsInheritance.ts, 126, 15)) + + nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 128, 19)) + + nc_f1(): void; +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 129, 18)) + + nc_l1: () => void; +>nc_l1 : Symbol(nc_l1, Decl(commentsInheritance.ts, 130, 18)) +} +interface i3 extends i2 { +>i3 : Symbol(i3, Decl(commentsInheritance.ts, 132, 1)) +>i2 : Symbol(i2, Decl(commentsInheritance.ts, 111, 22)) + + /** i3 p1 */ + p1: number; +>p1 : Symbol(p1, Decl(commentsInheritance.ts, 133, 25)) + + /** + * i3 f1 + */ + f1(): void; +>f1 : Symbol(f1, Decl(commentsInheritance.ts, 135, 15)) + + /** i3 l1*/ + l1: () => void; +>l1 : Symbol(l1, Decl(commentsInheritance.ts, 139, 15)) + + nc_p1: number; +>nc_p1 : Symbol(nc_p1, Decl(commentsInheritance.ts, 141, 19)) + + nc_f1(): void; +>nc_f1 : Symbol(nc_f1, Decl(commentsInheritance.ts, 142, 18)) + + nc_l1: () => void; +>nc_l1 : Symbol(nc_l1, Decl(commentsInheritance.ts, 143, 18)) +} +var i2_i: i2; +>i2_i : Symbol(i2_i, Decl(commentsInheritance.ts, 146, 3)) +>i2 : Symbol(i2, Decl(commentsInheritance.ts, 111, 22)) + +var i3_i: i3; +>i3_i : Symbol(i3_i, Decl(commentsInheritance.ts, 147, 3)) +>i3 : Symbol(i3, Decl(commentsInheritance.ts, 132, 1)) + +// assign to interface +i2_i = i3_i; +>i2_i : Symbol(i2_i, Decl(commentsInheritance.ts, 146, 3)) +>i3_i : Symbol(i3_i, Decl(commentsInheritance.ts, 147, 3)) + diff --git a/tests/baselines/reference/commentsInheritance.types b/tests/baselines/reference/commentsInheritance.types index b4db5767107..1c25f13937b 100644 --- a/tests/baselines/reference/commentsInheritance.types +++ b/tests/baselines/reference/commentsInheritance.types @@ -122,6 +122,7 @@ class c2 { >c2_prop : number return 10; +>10 : number } public c2_nc_p1: number; >c2_nc_p1 : number @@ -133,6 +134,7 @@ class c2 { >c2_nc_prop : number return 10; +>10 : number } /** c2 p1*/ public p1: number; @@ -147,6 +149,7 @@ class c2 { >prop : number return 10; +>10 : number } public nc_p1: number; >nc_p1 : number @@ -158,6 +161,7 @@ class c2 { >nc_prop : number return 10; +>10 : number } /** c2 constructor*/ constructor(a: number) { @@ -179,6 +183,7 @@ class c3 extends c2 { super(10); >super(10) : void >super : typeof c2 +>10 : number } /** c3 p1*/ public p1: number; @@ -193,6 +198,7 @@ class c3 extends c2 { >prop : number return 10; +>10 : number } public nc_p1: number; >nc_p1 : number @@ -204,12 +210,14 @@ class c3 extends c2 { >nc_prop : number return 10; +>10 : number } } var c2_i = new c2(10); >c2_i : c2 >new c2(10) : c2 >c2 : typeof c2 +>10 : number var c3_i = new c3(); >c3_i : c3 @@ -230,6 +238,7 @@ var c4_i = new c4(10); >c4_i : c4 >new c4(10) : c4 >c4 : typeof c4 +>10 : number interface i2 { >i2 : i2 diff --git a/tests/baselines/reference/commentsInterface.symbols b/tests/baselines/reference/commentsInterface.symbols new file mode 100644 index 00000000000..78d89989ed1 --- /dev/null +++ b/tests/baselines/reference/commentsInterface.symbols @@ -0,0 +1,224 @@ +=== tests/cases/compiler/commentsInterface.ts === +/** this is interface 1*/ +interface i1 { +>i1 : Symbol(i1, Decl(commentsInterface.ts, 0, 0)) +} +var i1_i: i1; +>i1_i : Symbol(i1_i, Decl(commentsInterface.ts, 3, 3)) +>i1 : Symbol(i1, Decl(commentsInterface.ts, 0, 0)) + +interface nc_i1 { +>nc_i1 : Symbol(nc_i1, Decl(commentsInterface.ts, 3, 13)) +} +var nc_i1_i: nc_i1; +>nc_i1_i : Symbol(nc_i1_i, Decl(commentsInterface.ts, 6, 3)) +>nc_i1 : Symbol(nc_i1, Decl(commentsInterface.ts, 3, 13)) + +/** this is interface 2 with memebers*/ +interface i2 { +>i2 : Symbol(i2, Decl(commentsInterface.ts, 6, 19)) + + /** this is x*/ + x: number; +>x : Symbol(x, Decl(commentsInterface.ts, 8, 14)) + + /** this is foo*/ + foo: (/**param help*/b: number) => string; +>foo : Symbol(foo, Decl(commentsInterface.ts, 10, 14)) +>b : Symbol(b, Decl(commentsInterface.ts, 12, 10)) + + /** this is indexer*/ + [/**string param*/i: string]: any; +>i : Symbol(i, Decl(commentsInterface.ts, 14, 5)) + + /**new method*/ + new (/** param*/i: i1); +>i : Symbol(i, Decl(commentsInterface.ts, 16, 9)) +>i1 : Symbol(i1, Decl(commentsInterface.ts, 0, 0)) + + nc_x: number; +>nc_x : Symbol(nc_x, Decl(commentsInterface.ts, 16, 27)) + + nc_foo: (b: number) => string; +>nc_foo : Symbol(nc_foo, Decl(commentsInterface.ts, 17, 17)) +>b : Symbol(b, Decl(commentsInterface.ts, 18, 13)) + + [i: number]: number; +>i : Symbol(i, Decl(commentsInterface.ts, 19, 5)) + + /** this is call signature*/ + (/**paramhelp a*/a: number,/**paramhelp b*/ b: number) : number; +>a : Symbol(a, Decl(commentsInterface.ts, 21, 5)) +>b : Symbol(b, Decl(commentsInterface.ts, 21, 31)) + + /** this is fnfoo*/ + fnfoo(/**param help*/b: number): string; +>fnfoo : Symbol(fnfoo, Decl(commentsInterface.ts, 21, 68)) +>b : Symbol(b, Decl(commentsInterface.ts, 23, 10)) + + nc_fnfoo(b: number): string; +>nc_fnfoo : Symbol(nc_fnfoo, Decl(commentsInterface.ts, 23, 44)) +>b : Symbol(b, Decl(commentsInterface.ts, 24, 13)) + + // nc_y + nc_y: number; +>nc_y : Symbol(nc_y, Decl(commentsInterface.ts, 24, 32)) +} +var i2_i: i2; +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>i2 : Symbol(i2, Decl(commentsInterface.ts, 6, 19)) + +var i2_i_x = i2_i.x; +>i2_i_x : Symbol(i2_i_x, Decl(commentsInterface.ts, 29, 3)) +>i2_i.x : Symbol(i2.x, Decl(commentsInterface.ts, 8, 14)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>x : Symbol(i2.x, Decl(commentsInterface.ts, 8, 14)) + +var i2_i_foo = i2_i.foo; +>i2_i_foo : Symbol(i2_i_foo, Decl(commentsInterface.ts, 30, 3)) +>i2_i.foo : Symbol(i2.foo, Decl(commentsInterface.ts, 10, 14)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>foo : Symbol(i2.foo, Decl(commentsInterface.ts, 10, 14)) + +var i2_i_foo_r = i2_i.foo(30); +>i2_i_foo_r : Symbol(i2_i_foo_r, Decl(commentsInterface.ts, 31, 3)) +>i2_i.foo : Symbol(i2.foo, Decl(commentsInterface.ts, 10, 14)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>foo : Symbol(i2.foo, Decl(commentsInterface.ts, 10, 14)) + +var i2_i_i2_si = i2_i["hello"]; +>i2_i_i2_si : Symbol(i2_i_i2_si, Decl(commentsInterface.ts, 32, 3)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) + +var i2_i_i2_ii = i2_i[30]; +>i2_i_i2_ii : Symbol(i2_i_i2_ii, Decl(commentsInterface.ts, 33, 3)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) + +var i2_i_n = new i2_i(i1_i); +>i2_i_n : Symbol(i2_i_n, Decl(commentsInterface.ts, 34, 3)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>i1_i : Symbol(i1_i, Decl(commentsInterface.ts, 3, 3)) + +var i2_i_nc_x = i2_i.nc_x; +>i2_i_nc_x : Symbol(i2_i_nc_x, Decl(commentsInterface.ts, 35, 3)) +>i2_i.nc_x : Symbol(i2.nc_x, Decl(commentsInterface.ts, 16, 27)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>nc_x : Symbol(i2.nc_x, Decl(commentsInterface.ts, 16, 27)) + +var i2_i_nc_foo = i2_i.nc_foo; +>i2_i_nc_foo : Symbol(i2_i_nc_foo, Decl(commentsInterface.ts, 36, 3)) +>i2_i.nc_foo : Symbol(i2.nc_foo, Decl(commentsInterface.ts, 17, 17)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>nc_foo : Symbol(i2.nc_foo, Decl(commentsInterface.ts, 17, 17)) + +var i2_i_nc_foo_r = i2_i.nc_foo(30); +>i2_i_nc_foo_r : Symbol(i2_i_nc_foo_r, Decl(commentsInterface.ts, 37, 3)) +>i2_i.nc_foo : Symbol(i2.nc_foo, Decl(commentsInterface.ts, 17, 17)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>nc_foo : Symbol(i2.nc_foo, Decl(commentsInterface.ts, 17, 17)) + +var i2_i_r = i2_i(10, 20); +>i2_i_r : Symbol(i2_i_r, Decl(commentsInterface.ts, 38, 3)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) + +var i2_i_fnfoo = i2_i.fnfoo; +>i2_i_fnfoo : Symbol(i2_i_fnfoo, Decl(commentsInterface.ts, 39, 3)) +>i2_i.fnfoo : Symbol(i2.fnfoo, Decl(commentsInterface.ts, 21, 68)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>fnfoo : Symbol(i2.fnfoo, Decl(commentsInterface.ts, 21, 68)) + +var i2_i_fnfoo_r = i2_i.fnfoo(10); +>i2_i_fnfoo_r : Symbol(i2_i_fnfoo_r, Decl(commentsInterface.ts, 40, 3)) +>i2_i.fnfoo : Symbol(i2.fnfoo, Decl(commentsInterface.ts, 21, 68)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>fnfoo : Symbol(i2.fnfoo, Decl(commentsInterface.ts, 21, 68)) + +var i2_i_nc_fnfoo = i2_i.nc_fnfoo; +>i2_i_nc_fnfoo : Symbol(i2_i_nc_fnfoo, Decl(commentsInterface.ts, 41, 3)) +>i2_i.nc_fnfoo : Symbol(i2.nc_fnfoo, Decl(commentsInterface.ts, 23, 44)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>nc_fnfoo : Symbol(i2.nc_fnfoo, Decl(commentsInterface.ts, 23, 44)) + +var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); +>i2_i_nc_fnfoo_r : Symbol(i2_i_nc_fnfoo_r, Decl(commentsInterface.ts, 42, 3)) +>i2_i.nc_fnfoo : Symbol(i2.nc_fnfoo, Decl(commentsInterface.ts, 23, 44)) +>i2_i : Symbol(i2_i, Decl(commentsInterface.ts, 28, 3)) +>nc_fnfoo : Symbol(i2.nc_fnfoo, Decl(commentsInterface.ts, 23, 44)) + +interface i3 { +>i3 : Symbol(i3, Decl(commentsInterface.ts, 42, 40)) + + /** Comment i3 x*/ + x: number; +>x : Symbol(x, Decl(commentsInterface.ts, 43, 14)) + + /** Function i3 f*/ + f(/**number parameter*/a: number): string; +>f : Symbol(f, Decl(commentsInterface.ts, 45, 14)) +>a : Symbol(a, Decl(commentsInterface.ts, 47, 6)) + + /** i3 l*/ + l: (/**comment i3 l b*/b: number) => string; +>l : Symbol(l, Decl(commentsInterface.ts, 47, 46)) +>b : Symbol(b, Decl(commentsInterface.ts, 49, 8)) + + nc_x: number; +>nc_x : Symbol(nc_x, Decl(commentsInterface.ts, 49, 48)) + + nc_f(a: number): string; +>nc_f : Symbol(nc_f, Decl(commentsInterface.ts, 50, 17)) +>a : Symbol(a, Decl(commentsInterface.ts, 51, 9)) + + nc_l: (b: number) => string; +>nc_l : Symbol(nc_l, Decl(commentsInterface.ts, 51, 28)) +>b : Symbol(b, Decl(commentsInterface.ts, 52, 11)) +} +var i3_i: i3; +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) +>i3 : Symbol(i3, Decl(commentsInterface.ts, 42, 40)) + +i3_i = { +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) + + f: /**own f*/ (/**i3_i a*/a: number) => "Hello" + a, +>f : Symbol(f, Decl(commentsInterface.ts, 55, 8)) +>a : Symbol(a, Decl(commentsInterface.ts, 56, 19)) +>a : Symbol(a, Decl(commentsInterface.ts, 56, 19)) + + l: this.f, +>l : Symbol(l, Decl(commentsInterface.ts, 56, 56)) + + /** own x*/ + x: this.f(10), +>x : Symbol(x, Decl(commentsInterface.ts, 57, 14)) + + nc_x: this.l(this.x), +>nc_x : Symbol(nc_x, Decl(commentsInterface.ts, 59, 18)) + + nc_f: this.f, +>nc_f : Symbol(nc_f, Decl(commentsInterface.ts, 60, 25)) + + nc_l: this.l +>nc_l : Symbol(nc_l, Decl(commentsInterface.ts, 61, 17)) + +}; +i3_i.f(10); +>i3_i.f : Symbol(i3.f, Decl(commentsInterface.ts, 45, 14)) +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) +>f : Symbol(i3.f, Decl(commentsInterface.ts, 45, 14)) + +i3_i.l(10); +>i3_i.l : Symbol(i3.l, Decl(commentsInterface.ts, 47, 46)) +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) +>l : Symbol(i3.l, Decl(commentsInterface.ts, 47, 46)) + +i3_i.nc_f(10); +>i3_i.nc_f : Symbol(i3.nc_f, Decl(commentsInterface.ts, 50, 17)) +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) +>nc_f : Symbol(i3.nc_f, Decl(commentsInterface.ts, 50, 17)) + +i3_i.nc_l(10); +>i3_i.nc_l : Symbol(i3.nc_l, Decl(commentsInterface.ts, 51, 28)) +>i3_i : Symbol(i3_i, Decl(commentsInterface.ts, 54, 3)) +>nc_l : Symbol(i3.nc_l, Decl(commentsInterface.ts, 51, 28)) + diff --git a/tests/baselines/reference/commentsInterface.types b/tests/baselines/reference/commentsInterface.types index 68d552882e2..13cc2b19f60 100644 --- a/tests/baselines/reference/commentsInterface.types +++ b/tests/baselines/reference/commentsInterface.types @@ -86,16 +86,19 @@ var i2_i_foo_r = i2_i.foo(30); >i2_i.foo : (b: number) => string >i2_i : i2 >foo : (b: number) => string +>30 : number var i2_i_i2_si = i2_i["hello"]; >i2_i_i2_si : any >i2_i["hello"] : any >i2_i : i2 +>"hello" : string var i2_i_i2_ii = i2_i[30]; >i2_i_i2_ii : number >i2_i[30] : number >i2_i : i2 +>30 : number var i2_i_n = new i2_i(i1_i); >i2_i_n : any @@ -121,11 +124,14 @@ var i2_i_nc_foo_r = i2_i.nc_foo(30); >i2_i.nc_foo : (b: number) => string >i2_i : i2 >nc_foo : (b: number) => string +>30 : number var i2_i_r = i2_i(10, 20); >i2_i_r : number >i2_i(10, 20) : number >i2_i : i2 +>10 : number +>20 : number var i2_i_fnfoo = i2_i.fnfoo; >i2_i_fnfoo : (b: number) => string @@ -139,6 +145,7 @@ var i2_i_fnfoo_r = i2_i.fnfoo(10); >i2_i.fnfoo : (b: number) => string >i2_i : i2 >fnfoo : (b: number) => string +>10 : number var i2_i_nc_fnfoo = i2_i.nc_fnfoo; >i2_i_nc_fnfoo : (b: number) => string @@ -152,6 +159,7 @@ var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); >i2_i.nc_fnfoo : (b: number) => string >i2_i : i2 >nc_fnfoo : (b: number) => string +>10 : number interface i3 { >i3 : i3 @@ -195,6 +203,7 @@ i3_i = { >(/**i3_i a*/a: number) => "Hello" + a : (a: number) => string >a : number >"Hello" + a : string +>"Hello" : string >a : number l: this.f, @@ -210,6 +219,7 @@ i3_i = { >this.f : any >this : any >f : any +>10 : number nc_x: this.l(this.x), >nc_x : any @@ -239,22 +249,26 @@ i3_i.f(10); >i3_i.f : (a: number) => string >i3_i : i3 >f : (a: number) => string +>10 : number i3_i.l(10); >i3_i.l(10) : string >i3_i.l : (b: number) => string >i3_i : i3 >l : (b: number) => string +>10 : number i3_i.nc_f(10); >i3_i.nc_f(10) : string >i3_i.nc_f : (a: number) => string >i3_i : i3 >nc_f : (a: number) => string +>10 : number i3_i.nc_l(10); >i3_i.nc_l(10) : string >i3_i.nc_l : (b: number) => string >i3_i : i3 >nc_l : (b: number) => string +>10 : number diff --git a/tests/baselines/reference/commentsModules.symbols b/tests/baselines/reference/commentsModules.symbols new file mode 100644 index 00000000000..9d962588d6a --- /dev/null +++ b/tests/baselines/reference/commentsModules.symbols @@ -0,0 +1,216 @@ +=== tests/cases/compiler/commentsModules.ts === +/** Module comment*/ +module m1 { +>m1 : Symbol(m1, Decl(commentsModules.ts, 0, 0)) + + /** b's comment*/ + export var b: number; +>b : Symbol(b, Decl(commentsModules.ts, 3, 14)) + + /** foo's comment*/ + function foo() { +>foo : Symbol(foo, Decl(commentsModules.ts, 3, 25)) + + return b; +>b : Symbol(b, Decl(commentsModules.ts, 3, 14)) + } + /** m2 comments*/ + export module m2 { +>m2 : Symbol(m2, Decl(commentsModules.ts, 7, 5)) + + /** class comment;*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 9, 22)) + + }; + /** i*/ + export var i = new c(); +>i : Symbol(i, Decl(commentsModules.ts, 14, 18)) +>c : Symbol(c, Decl(commentsModules.ts, 9, 22)) + } + /** exported function*/ + export function fooExport() { +>fooExport : Symbol(fooExport, Decl(commentsModules.ts, 15, 5)) + + return foo(); +>foo : Symbol(foo, Decl(commentsModules.ts, 3, 25)) + } + + // shouldn't appear + export function foo2Export(/**hm*/ a: string) { +>foo2Export : Symbol(foo2Export, Decl(commentsModules.ts, 19, 5)) +>a : Symbol(a, Decl(commentsModules.ts, 22, 31)) + } + + /** foo3Export + * comment + */ + export function foo3Export() { +>foo3Export : Symbol(foo3Export, Decl(commentsModules.ts, 23, 5)) + } + + /** foo4Export + * comment + */ + function foo4Export() { +>foo4Export : Symbol(foo4Export, Decl(commentsModules.ts, 29, 5)) + } +} // trailing comment module +m1.fooExport(); +>m1.fooExport : Symbol(m1.fooExport, Decl(commentsModules.ts, 15, 5)) +>m1 : Symbol(m1, Decl(commentsModules.ts, 0, 0)) +>fooExport : Symbol(m1.fooExport, Decl(commentsModules.ts, 15, 5)) + +var myvar = new m1.m2.c(); +>myvar : Symbol(myvar, Decl(commentsModules.ts, 38, 3)) +>m1.m2.c : Symbol(m1.m2.c, Decl(commentsModules.ts, 9, 22)) +>m1.m2 : Symbol(m1.m2, Decl(commentsModules.ts, 7, 5)) +>m1 : Symbol(m1, Decl(commentsModules.ts, 0, 0)) +>m2 : Symbol(m1.m2, Decl(commentsModules.ts, 7, 5)) +>c : Symbol(m1.m2.c, Decl(commentsModules.ts, 9, 22)) + +/** module comment of m2.m3*/ +module m2.m3 { +>m2 : Symbol(m2, Decl(commentsModules.ts, 38, 26)) +>m3 : Symbol(m3, Decl(commentsModules.ts, 40, 10)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 40, 14)) + } +} /* trailing dotted module comment*/ +new m2.m3.c(); +>m2.m3.c : Symbol(m2.m3.c, Decl(commentsModules.ts, 40, 14)) +>m2.m3 : Symbol(m2.m3, Decl(commentsModules.ts, 40, 10)) +>m2 : Symbol(m2, Decl(commentsModules.ts, 38, 26)) +>m3 : Symbol(m2.m3, Decl(commentsModules.ts, 40, 10)) +>c : Symbol(m2.m3.c, Decl(commentsModules.ts, 40, 14)) + +/** module comment of m3.m4.m5*/ +module m3.m4.m5 { +>m3 : Symbol(m3, Decl(commentsModules.ts, 45, 14)) +>m4 : Symbol(m4, Decl(commentsModules.ts, 47, 10)) +>m5 : Symbol(m5, Decl(commentsModules.ts, 47, 13)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 47, 17)) + } +} // trailing dotted module 2 +new m3.m4.m5.c(); +>m3.m4.m5.c : Symbol(m3.m4.m5.c, Decl(commentsModules.ts, 47, 17)) +>m3.m4.m5 : Symbol(m3.m4.m5, Decl(commentsModules.ts, 47, 13)) +>m3.m4 : Symbol(m3.m4, Decl(commentsModules.ts, 47, 10)) +>m3 : Symbol(m3, Decl(commentsModules.ts, 45, 14)) +>m4 : Symbol(m3.m4, Decl(commentsModules.ts, 47, 10)) +>m5 : Symbol(m3.m4.m5, Decl(commentsModules.ts, 47, 13)) +>c : Symbol(m3.m4.m5.c, Decl(commentsModules.ts, 47, 17)) + +/** module comment of m4.m5.m6*/ +module m4.m5.m6 { +>m4 : Symbol(m4, Decl(commentsModules.ts, 52, 17)) +>m5 : Symbol(m5, Decl(commentsModules.ts, 54, 10)) +>m6 : Symbol(m6, Decl(commentsModules.ts, 54, 13)) + + export module m7 { +>m7 : Symbol(m7, Decl(commentsModules.ts, 54, 17)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 55, 22)) + } + } /* trailing inner module */ /* multiple comments*/ +} +new m4.m5.m6.m7.c(); +>m4.m5.m6.m7.c : Symbol(m4.m5.m6.m7.c, Decl(commentsModules.ts, 55, 22)) +>m4.m5.m6.m7 : Symbol(m4.m5.m6.m7, Decl(commentsModules.ts, 54, 17)) +>m4.m5.m6 : Symbol(m4.m5.m6, Decl(commentsModules.ts, 54, 13)) +>m4.m5 : Symbol(m4.m5, Decl(commentsModules.ts, 54, 10)) +>m4 : Symbol(m4, Decl(commentsModules.ts, 52, 17)) +>m5 : Symbol(m4.m5, Decl(commentsModules.ts, 54, 10)) +>m6 : Symbol(m4.m5.m6, Decl(commentsModules.ts, 54, 13)) +>m7 : Symbol(m4.m5.m6.m7, Decl(commentsModules.ts, 54, 17)) +>c : Symbol(m4.m5.m6.m7.c, Decl(commentsModules.ts, 55, 22)) + +/** module comment of m5.m6.m7*/ +module m5.m6.m7 { +>m5 : Symbol(m5, Decl(commentsModules.ts, 61, 20)) +>m6 : Symbol(m6, Decl(commentsModules.ts, 63, 10)) +>m7 : Symbol(m7, Decl(commentsModules.ts, 63, 13)) + + /** module m8 comment*/ + export module m8 { +>m8 : Symbol(m8, Decl(commentsModules.ts, 63, 17)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 65, 22)) + } + } +} +new m5.m6.m7.m8.c(); +>m5.m6.m7.m8.c : Symbol(m5.m6.m7.m8.c, Decl(commentsModules.ts, 65, 22)) +>m5.m6.m7.m8 : Symbol(m5.m6.m7.m8, Decl(commentsModules.ts, 63, 17)) +>m5.m6.m7 : Symbol(m5.m6.m7, Decl(commentsModules.ts, 63, 13)) +>m5.m6 : Symbol(m5.m6, Decl(commentsModules.ts, 63, 10)) +>m5 : Symbol(m5, Decl(commentsModules.ts, 61, 20)) +>m6 : Symbol(m5.m6, Decl(commentsModules.ts, 63, 10)) +>m7 : Symbol(m5.m6.m7, Decl(commentsModules.ts, 63, 13)) +>m8 : Symbol(m5.m6.m7.m8, Decl(commentsModules.ts, 63, 17)) +>c : Symbol(m5.m6.m7.m8.c, Decl(commentsModules.ts, 65, 22)) + +module m6.m7 { +>m6 : Symbol(m6, Decl(commentsModules.ts, 71, 20)) +>m7 : Symbol(m7, Decl(commentsModules.ts, 72, 10)) + + export module m8 { +>m8 : Symbol(m8, Decl(commentsModules.ts, 72, 14)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 73, 22)) + } + } +} +new m6.m7.m8.c(); +>m6.m7.m8.c : Symbol(m6.m7.m8.c, Decl(commentsModules.ts, 73, 22)) +>m6.m7.m8 : Symbol(m6.m7.m8, Decl(commentsModules.ts, 72, 14)) +>m6.m7 : Symbol(m6.m7, Decl(commentsModules.ts, 72, 10)) +>m6 : Symbol(m6, Decl(commentsModules.ts, 71, 20)) +>m7 : Symbol(m6.m7, Decl(commentsModules.ts, 72, 10)) +>m8 : Symbol(m6.m7.m8, Decl(commentsModules.ts, 72, 14)) +>c : Symbol(m6.m7.m8.c, Decl(commentsModules.ts, 73, 22)) + +module m7.m8 { +>m7 : Symbol(m7, Decl(commentsModules.ts, 79, 17)) +>m8 : Symbol(m8, Decl(commentsModules.ts, 80, 10)) + + /** module m9 comment*/ + export module m9 { +>m9 : Symbol(m9, Decl(commentsModules.ts, 80, 14)) + + /** Exported class comment*/ + export class c { +>c : Symbol(c, Decl(commentsModules.ts, 82, 22)) + } + + /** class d */ + class d { +>d : Symbol(d, Decl(commentsModules.ts, 85, 9)) + } + + // class e + export class e { +>e : Symbol(e, Decl(commentsModules.ts, 89, 9)) + } + } +} +new m7.m8.m9.c(); +>m7.m8.m9.c : Symbol(m7.m8.m9.c, Decl(commentsModules.ts, 82, 22)) +>m7.m8.m9 : Symbol(m7.m8.m9, Decl(commentsModules.ts, 80, 14)) +>m7.m8 : Symbol(m7.m8, Decl(commentsModules.ts, 80, 10)) +>m7 : Symbol(m7, Decl(commentsModules.ts, 79, 17)) +>m8 : Symbol(m7.m8, Decl(commentsModules.ts, 80, 10)) +>m9 : Symbol(m7.m8.m9, Decl(commentsModules.ts, 80, 14)) +>c : Symbol(m7.m8.m9.c, Decl(commentsModules.ts, 82, 22)) + diff --git a/tests/baselines/reference/commentsMultiModuleMultiFile.symbols b/tests/baselines/reference/commentsMultiModuleMultiFile.symbols new file mode 100644 index 00000000000..1ca90840af4 --- /dev/null +++ b/tests/baselines/reference/commentsMultiModuleMultiFile.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/commentsMultiModuleMultiFile_1.ts === +import m = require('commentsMultiModuleMultiFile_0'); +>m : Symbol(m, Decl(commentsMultiModuleMultiFile_1.ts, 0, 0)) + +/** this is multi module 3 comment*/ +export module multiM { +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_1.ts, 0, 53)) + + /** class d comment*/ + export class d { +>d : Symbol(d, Decl(commentsMultiModuleMultiFile_1.ts, 2, 22)) + } + + /// class f comment + export class f { +>f : Symbol(f, Decl(commentsMultiModuleMultiFile_1.ts, 5, 5)) + } +} +new multiM.d(); +>multiM.d : Symbol(multiM.d, Decl(commentsMultiModuleMultiFile_1.ts, 2, 22)) +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_1.ts, 0, 53)) +>d : Symbol(multiM.d, Decl(commentsMultiModuleMultiFile_1.ts, 2, 22)) + +=== tests/cases/compiler/commentsMultiModuleMultiFile_0.ts === + +/** this is multi declare module*/ +export module multiM { +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_0.ts, 0, 0), Decl(commentsMultiModuleMultiFile_0.ts, 6, 1)) + + /// class b comment + export class b { +>b : Symbol(b, Decl(commentsMultiModuleMultiFile_0.ts, 2, 22)) + } +} +/** thi is multi module 2*/ +export module multiM { +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_0.ts, 0, 0), Decl(commentsMultiModuleMultiFile_0.ts, 6, 1)) + + /** class c comment*/ + export class c { +>c : Symbol(c, Decl(commentsMultiModuleMultiFile_0.ts, 8, 22)) + } + + // class e comment + export class e { +>e : Symbol(e, Decl(commentsMultiModuleMultiFile_0.ts, 11, 5)) + } +} + +new multiM.b(); +>multiM.b : Symbol(multiM.b, Decl(commentsMultiModuleMultiFile_0.ts, 2, 22)) +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_0.ts, 0, 0), Decl(commentsMultiModuleMultiFile_0.ts, 6, 1)) +>b : Symbol(multiM.b, Decl(commentsMultiModuleMultiFile_0.ts, 2, 22)) + +new multiM.c(); +>multiM.c : Symbol(multiM.c, Decl(commentsMultiModuleMultiFile_0.ts, 8, 22)) +>multiM : Symbol(multiM, Decl(commentsMultiModuleMultiFile_0.ts, 0, 0), Decl(commentsMultiModuleMultiFile_0.ts, 6, 1)) +>c : Symbol(multiM.c, Decl(commentsMultiModuleMultiFile_0.ts, 8, 22)) + diff --git a/tests/baselines/reference/commentsMultiModuleSingleFile.symbols b/tests/baselines/reference/commentsMultiModuleSingleFile.symbols new file mode 100644 index 00000000000..678d9aaf830 --- /dev/null +++ b/tests/baselines/reference/commentsMultiModuleSingleFile.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/commentsMultiModuleSingleFile.ts === + +/** this is multi declare module*/ +module multiM { +>multiM : Symbol(multiM, Decl(commentsMultiModuleSingleFile.ts, 0, 0), Decl(commentsMultiModuleSingleFile.ts, 10, 1)) + + /** class b*/ + export class b { +>b : Symbol(b, Decl(commentsMultiModuleSingleFile.ts, 2, 15)) + } + + // class d + export class d { +>d : Symbol(d, Decl(commentsMultiModuleSingleFile.ts, 5, 5)) + } +} + +/// this is multi module 2 +module multiM { +>multiM : Symbol(multiM, Decl(commentsMultiModuleSingleFile.ts, 0, 0), Decl(commentsMultiModuleSingleFile.ts, 10, 1)) + + /** class c comment*/ + export class c { +>c : Symbol(c, Decl(commentsMultiModuleSingleFile.ts, 13, 15)) + } + + /// class e + export class e { +>e : Symbol(e, Decl(commentsMultiModuleSingleFile.ts, 16, 5)) + } +} +new multiM.b(); +>multiM.b : Symbol(multiM.b, Decl(commentsMultiModuleSingleFile.ts, 2, 15)) +>multiM : Symbol(multiM, Decl(commentsMultiModuleSingleFile.ts, 0, 0), Decl(commentsMultiModuleSingleFile.ts, 10, 1)) +>b : Symbol(multiM.b, Decl(commentsMultiModuleSingleFile.ts, 2, 15)) + +new multiM.c(); +>multiM.c : Symbol(multiM.c, Decl(commentsMultiModuleSingleFile.ts, 13, 15)) +>multiM : Symbol(multiM, Decl(commentsMultiModuleSingleFile.ts, 0, 0), Decl(commentsMultiModuleSingleFile.ts, 10, 1)) +>c : Symbol(multiM.c, Decl(commentsMultiModuleSingleFile.ts, 13, 15)) + diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.symbols b/tests/baselines/reference/commentsOnObjectLiteral3.symbols new file mode 100644 index 00000000000..3d58fe2d6d7 --- /dev/null +++ b/tests/baselines/reference/commentsOnObjectLiteral3.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/commentsOnObjectLiteral3.ts === + +var v = { +>v : Symbol(v, Decl(commentsOnObjectLiteral3.ts, 1, 3)) + + //property + prop: 1 /* multiple trailing comments */ /*trailing comments*/, +>prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 1, 9)) + + //property + func: function () { +>func : Symbol(func, Decl(commentsOnObjectLiteral3.ts, 3, 64)) + + }, + //PropertyName + CallSignature + func1() { }, +>func1 : Symbol(func1, Decl(commentsOnObjectLiteral3.ts, 6, 3)) + + //getter + get a() { +>a : Symbol(a, Decl(commentsOnObjectLiteral3.ts, 8, 13), Decl(commentsOnObjectLiteral3.ts, 12, 18)) + + return this.prop; + } /*trailing 1*/, + //setter + set a(value) { +>a : Symbol(a, Decl(commentsOnObjectLiteral3.ts, 8, 13), Decl(commentsOnObjectLiteral3.ts, 12, 18)) +>value : Symbol(value, Decl(commentsOnObjectLiteral3.ts, 14, 7)) + + this.prop = value; +>value : Symbol(value, Decl(commentsOnObjectLiteral3.ts, 14, 7)) + + } // trailing 2 +}; + diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.types b/tests/baselines/reference/commentsOnObjectLiteral3.types index e81bd646b5a..a63920fce0f 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3.types +++ b/tests/baselines/reference/commentsOnObjectLiteral3.types @@ -7,6 +7,7 @@ var v = { //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, >prop : number +>1 : number //property func: function () { diff --git a/tests/baselines/reference/commentsOnObjectLiteral4.symbols b/tests/baselines/reference/commentsOnObjectLiteral4.symbols new file mode 100644 index 00000000000..c1762cb75c8 --- /dev/null +++ b/tests/baselines/reference/commentsOnObjectLiteral4.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/commentsOnObjectLiteral4.ts === + +var v = { +>v : Symbol(v, Decl(commentsOnObjectLiteral4.ts, 1, 3)) + + /** + * @type {number} + */ + get bar(): number { +>bar : Symbol(bar, Decl(commentsOnObjectLiteral4.ts, 1, 9)) + + return this._bar; + } +} diff --git a/tests/baselines/reference/commentsOnReturnStatement1.symbols b/tests/baselines/reference/commentsOnReturnStatement1.symbols new file mode 100644 index 00000000000..5c75e2e29d9 --- /dev/null +++ b/tests/baselines/reference/commentsOnReturnStatement1.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/commentsOnReturnStatement1.ts === +class DebugClass { +>DebugClass : Symbol(DebugClass, Decl(commentsOnReturnStatement1.ts, 0, 0)) + + public static debugFunc() { +>debugFunc : Symbol(DebugClass.debugFunc, Decl(commentsOnReturnStatement1.ts, 0, 18)) + + // Start Debugger Test Code + var i = 0; +>i : Symbol(i, Decl(commentsOnReturnStatement1.ts, 3, 11)) + + // End Debugger Test Code + return true; + } +} diff --git a/tests/baselines/reference/commentsOnReturnStatement1.types b/tests/baselines/reference/commentsOnReturnStatement1.types index 0d447b6536f..d44c91c0a8c 100644 --- a/tests/baselines/reference/commentsOnReturnStatement1.types +++ b/tests/baselines/reference/commentsOnReturnStatement1.types @@ -8,8 +8,10 @@ class DebugClass { // Start Debugger Test Code var i = 0; >i : number +>0 : number // End Debugger Test Code return true; +>true : boolean } } diff --git a/tests/baselines/reference/commentsOnStaticMembers.symbols b/tests/baselines/reference/commentsOnStaticMembers.symbols new file mode 100644 index 00000000000..4e59ba7bca9 --- /dev/null +++ b/tests/baselines/reference/commentsOnStaticMembers.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/commentsOnStaticMembers.ts === + +class test { +>test : Symbol(test, Decl(commentsOnStaticMembers.ts, 0, 0)) + + /** + * p1 comment appears in output + */ + public static p1: string = ""; +>p1 : Symbol(test.p1, Decl(commentsOnStaticMembers.ts, 1, 12)) + + /** + * p2 comment does not appear in output + */ + public static p2: string; +>p2 : Symbol(test.p2, Decl(commentsOnStaticMembers.ts, 5, 34)) + + /** + * p3 comment appears in output + */ + private static p3: string = ""; +>p3 : Symbol(test.p3, Decl(commentsOnStaticMembers.ts, 9, 29)) + + /** + * p4 comment does not appear in output + */ + private static p4: string; +>p4 : Symbol(test.p4, Decl(commentsOnStaticMembers.ts, 14, 35)) +} diff --git a/tests/baselines/reference/commentsOnStaticMembers.types b/tests/baselines/reference/commentsOnStaticMembers.types index 5c201c7709a..46a1ca211ff 100644 --- a/tests/baselines/reference/commentsOnStaticMembers.types +++ b/tests/baselines/reference/commentsOnStaticMembers.types @@ -8,6 +8,7 @@ class test { */ public static p1: string = ""; >p1 : string +>"" : string /** * p2 comment does not appear in output @@ -20,6 +21,7 @@ class test { */ private static p3: string = ""; >p3 : string +>"" : string /** * p4 comment does not appear in output diff --git a/tests/baselines/reference/commentsOverloads.symbols b/tests/baselines/reference/commentsOverloads.symbols new file mode 100644 index 00000000000..b504e35c5ac --- /dev/null +++ b/tests/baselines/reference/commentsOverloads.symbols @@ -0,0 +1,417 @@ +=== tests/cases/compiler/commentsOverloads.ts === +/** this is signature 1*/ +function f1(/**param a*/a: number): number; +>f1 : Symbol(f1, Decl(commentsOverloads.ts, 0, 0), Decl(commentsOverloads.ts, 1, 43), Decl(commentsOverloads.ts, 2, 31)) +>a : Symbol(a, Decl(commentsOverloads.ts, 1, 12)) + +function f1(b: string): number; +>f1 : Symbol(f1, Decl(commentsOverloads.ts, 0, 0), Decl(commentsOverloads.ts, 1, 43), Decl(commentsOverloads.ts, 2, 31)) +>b : Symbol(b, Decl(commentsOverloads.ts, 2, 12)) + +function f1(aOrb: any) { +>f1 : Symbol(f1, Decl(commentsOverloads.ts, 0, 0), Decl(commentsOverloads.ts, 1, 43), Decl(commentsOverloads.ts, 2, 31)) +>aOrb : Symbol(aOrb, Decl(commentsOverloads.ts, 3, 12)) + + return 10; +} +f1("hello"); +>f1 : Symbol(f1, Decl(commentsOverloads.ts, 0, 0), Decl(commentsOverloads.ts, 1, 43), Decl(commentsOverloads.ts, 2, 31)) + +f1(10); +>f1 : Symbol(f1, Decl(commentsOverloads.ts, 0, 0), Decl(commentsOverloads.ts, 1, 43), Decl(commentsOverloads.ts, 2, 31)) + +function f2(a: number): number; +>f2 : Symbol(f2, Decl(commentsOverloads.ts, 7, 7), Decl(commentsOverloads.ts, 8, 31), Decl(commentsOverloads.ts, 10, 31)) +>a : Symbol(a, Decl(commentsOverloads.ts, 8, 12)) + +/** this is signature 2*/ +function f2(b: string): number; +>f2 : Symbol(f2, Decl(commentsOverloads.ts, 7, 7), Decl(commentsOverloads.ts, 8, 31), Decl(commentsOverloads.ts, 10, 31)) +>b : Symbol(b, Decl(commentsOverloads.ts, 10, 12)) + +/** this is f2 var comment*/ +function f2(aOrb: any) { +>f2 : Symbol(f2, Decl(commentsOverloads.ts, 7, 7), Decl(commentsOverloads.ts, 8, 31), Decl(commentsOverloads.ts, 10, 31)) +>aOrb : Symbol(aOrb, Decl(commentsOverloads.ts, 12, 12)) + + return 10; +} +f2("hello"); +>f2 : Symbol(f2, Decl(commentsOverloads.ts, 7, 7), Decl(commentsOverloads.ts, 8, 31), Decl(commentsOverloads.ts, 10, 31)) + +f2(10); +>f2 : Symbol(f2, Decl(commentsOverloads.ts, 7, 7), Decl(commentsOverloads.ts, 8, 31), Decl(commentsOverloads.ts, 10, 31)) + +function f3(a: number): number; +>f3 : Symbol(f3, Decl(commentsOverloads.ts, 16, 7), Decl(commentsOverloads.ts, 17, 31), Decl(commentsOverloads.ts, 18, 31)) +>a : Symbol(a, Decl(commentsOverloads.ts, 17, 12)) + +function f3(b: string): number; +>f3 : Symbol(f3, Decl(commentsOverloads.ts, 16, 7), Decl(commentsOverloads.ts, 17, 31), Decl(commentsOverloads.ts, 18, 31)) +>b : Symbol(b, Decl(commentsOverloads.ts, 18, 12)) + +function f3(aOrb: any) { +>f3 : Symbol(f3, Decl(commentsOverloads.ts, 16, 7), Decl(commentsOverloads.ts, 17, 31), Decl(commentsOverloads.ts, 18, 31)) +>aOrb : Symbol(aOrb, Decl(commentsOverloads.ts, 19, 12)) + + return 10; +} +f3("hello"); +>f3 : Symbol(f3, Decl(commentsOverloads.ts, 16, 7), Decl(commentsOverloads.ts, 17, 31), Decl(commentsOverloads.ts, 18, 31)) + +f3(10); +>f3 : Symbol(f3, Decl(commentsOverloads.ts, 16, 7), Decl(commentsOverloads.ts, 17, 31), Decl(commentsOverloads.ts, 18, 31)) + +/** this is signature 4 - with number parameter*/ +function f4(/**param a*/a: number): number; +>f4 : Symbol(f4, Decl(commentsOverloads.ts, 23, 7), Decl(commentsOverloads.ts, 25, 43), Decl(commentsOverloads.ts, 27, 31)) +>a : Symbol(a, Decl(commentsOverloads.ts, 25, 12)) + +/** this is signature 4 - with string parameter*/ +function f4(b: string): number; +>f4 : Symbol(f4, Decl(commentsOverloads.ts, 23, 7), Decl(commentsOverloads.ts, 25, 43), Decl(commentsOverloads.ts, 27, 31)) +>b : Symbol(b, Decl(commentsOverloads.ts, 27, 12)) + +function f4(aOrb: any) { +>f4 : Symbol(f4, Decl(commentsOverloads.ts, 23, 7), Decl(commentsOverloads.ts, 25, 43), Decl(commentsOverloads.ts, 27, 31)) +>aOrb : Symbol(aOrb, Decl(commentsOverloads.ts, 28, 12)) + + return 10; +} +f4("hello"); +>f4 : Symbol(f4, Decl(commentsOverloads.ts, 23, 7), Decl(commentsOverloads.ts, 25, 43), Decl(commentsOverloads.ts, 27, 31)) + +f4(10); +>f4 : Symbol(f4, Decl(commentsOverloads.ts, 23, 7), Decl(commentsOverloads.ts, 25, 43), Decl(commentsOverloads.ts, 27, 31)) + +interface i1 { +>i1 : Symbol(i1, Decl(commentsOverloads.ts, 32, 7)) + + /**this signature 1*/ + (/**param a*/ a: number): number; +>a : Symbol(a, Decl(commentsOverloads.ts, 35, 5)) + + /**this is signature 2*/ + (b: string): number; +>b : Symbol(b, Decl(commentsOverloads.ts, 37, 5)) + + /** foo 1*/ + foo(a: number): number; +>foo : Symbol(foo, Decl(commentsOverloads.ts, 37, 24), Decl(commentsOverloads.ts, 39, 27), Decl(commentsOverloads.ts, 41, 27), Decl(commentsOverloads.ts, 43, 31)) +>a : Symbol(a, Decl(commentsOverloads.ts, 39, 8)) + + /** foo 2*/ + foo(b: string): number; +>foo : Symbol(foo, Decl(commentsOverloads.ts, 37, 24), Decl(commentsOverloads.ts, 39, 27), Decl(commentsOverloads.ts, 41, 27), Decl(commentsOverloads.ts, 43, 31)) +>b : Symbol(b, Decl(commentsOverloads.ts, 41, 8)) + + // foo 3 + foo(arr: number[]): number; +>foo : Symbol(foo, Decl(commentsOverloads.ts, 37, 24), Decl(commentsOverloads.ts, 39, 27), Decl(commentsOverloads.ts, 41, 27), Decl(commentsOverloads.ts, 43, 31)) +>arr : Symbol(arr, Decl(commentsOverloads.ts, 43, 8)) + + /** foo 4 */ + foo(arr: string[]): number; +>foo : Symbol(foo, Decl(commentsOverloads.ts, 37, 24), Decl(commentsOverloads.ts, 39, 27), Decl(commentsOverloads.ts, 41, 27), Decl(commentsOverloads.ts, 43, 31)) +>arr : Symbol(arr, Decl(commentsOverloads.ts, 45, 8)) + + foo2(a: number): number; +>foo2 : Symbol(foo2, Decl(commentsOverloads.ts, 45, 31), Decl(commentsOverloads.ts, 47, 28)) +>a : Symbol(a, Decl(commentsOverloads.ts, 47, 9)) + + /** foo2 2*/ + foo2(b: string): number; +>foo2 : Symbol(foo2, Decl(commentsOverloads.ts, 45, 31), Decl(commentsOverloads.ts, 47, 28)) +>b : Symbol(b, Decl(commentsOverloads.ts, 49, 9)) + + foo3(a: number): number; +>foo3 : Symbol(foo3, Decl(commentsOverloads.ts, 49, 28), Decl(commentsOverloads.ts, 50, 28)) +>a : Symbol(a, Decl(commentsOverloads.ts, 50, 9)) + + foo3(b: string): number; +>foo3 : Symbol(foo3, Decl(commentsOverloads.ts, 49, 28), Decl(commentsOverloads.ts, 50, 28)) +>b : Symbol(b, Decl(commentsOverloads.ts, 51, 9)) + + /** foo4 1*/ + foo4(a: number): number; +>foo4 : Symbol(foo4, Decl(commentsOverloads.ts, 51, 28), Decl(commentsOverloads.ts, 53, 28), Decl(commentsOverloads.ts, 54, 28)) +>a : Symbol(a, Decl(commentsOverloads.ts, 53, 9)) + + foo4(b: string): number; +>foo4 : Symbol(foo4, Decl(commentsOverloads.ts, 51, 28), Decl(commentsOverloads.ts, 53, 28), Decl(commentsOverloads.ts, 54, 28)) +>b : Symbol(b, Decl(commentsOverloads.ts, 54, 9)) + + /** foo4 any */ + foo4(c: any): any; +>foo4 : Symbol(foo4, Decl(commentsOverloads.ts, 51, 28), Decl(commentsOverloads.ts, 53, 28), Decl(commentsOverloads.ts, 54, 28)) +>c : Symbol(c, Decl(commentsOverloads.ts, 56, 9)) + + /// new 1 + new (a: string); +>a : Symbol(a, Decl(commentsOverloads.ts, 58, 9)) + + /** new 1*/ + new (b: number); +>b : Symbol(b, Decl(commentsOverloads.ts, 60, 9)) +} +var i1_i: i1; +>i1_i : Symbol(i1_i, Decl(commentsOverloads.ts, 62, 3)) +>i1 : Symbol(i1, Decl(commentsOverloads.ts, 32, 7)) + +interface i2 { +>i2 : Symbol(i2, Decl(commentsOverloads.ts, 62, 13)) + + new (a: string); +>a : Symbol(a, Decl(commentsOverloads.ts, 64, 9)) + + /** new 2*/ + new (b: number); +>b : Symbol(b, Decl(commentsOverloads.ts, 66, 9)) + + (a: number): number; +>a : Symbol(a, Decl(commentsOverloads.ts, 67, 5)) + + /**this is signature 2*/ + (b: string): number; +>b : Symbol(b, Decl(commentsOverloads.ts, 69, 5)) +} +var i2_i: i2; +>i2_i : Symbol(i2_i, Decl(commentsOverloads.ts, 71, 3)) +>i2 : Symbol(i2, Decl(commentsOverloads.ts, 62, 13)) + +interface i3 { +>i3 : Symbol(i3, Decl(commentsOverloads.ts, 71, 13)) + + /** new 1*/ + new (a: string); +>a : Symbol(a, Decl(commentsOverloads.ts, 74, 9)) + + /** new 2*/ + new (b: number); +>b : Symbol(b, Decl(commentsOverloads.ts, 76, 9)) + + /**this is signature 1*/ + (a: number): number; +>a : Symbol(a, Decl(commentsOverloads.ts, 78, 5)) + + (b: string): number; +>b : Symbol(b, Decl(commentsOverloads.ts, 79, 5)) +} +var i3_i: i3; +>i3_i : Symbol(i3_i, Decl(commentsOverloads.ts, 81, 3)) +>i3 : Symbol(i3, Decl(commentsOverloads.ts, 71, 13)) + +interface i4 { +>i4 : Symbol(i4, Decl(commentsOverloads.ts, 81, 13)) + + new (a: string); +>a : Symbol(a, Decl(commentsOverloads.ts, 83, 9)) + + new (b: number); +>b : Symbol(b, Decl(commentsOverloads.ts, 84, 9)) + + (a: number): number; +>a : Symbol(a, Decl(commentsOverloads.ts, 85, 5)) + + (b: string): number; +>b : Symbol(b, Decl(commentsOverloads.ts, 86, 5)) +} +class c { +>c : Symbol(c, Decl(commentsOverloads.ts, 87, 1)) + + public prop1(a: number): number; +>prop1 : Symbol(prop1, Decl(commentsOverloads.ts, 88, 9), Decl(commentsOverloads.ts, 89, 36), Decl(commentsOverloads.ts, 90, 36)) +>a : Symbol(a, Decl(commentsOverloads.ts, 89, 17)) + + public prop1(b: string): number; +>prop1 : Symbol(prop1, Decl(commentsOverloads.ts, 88, 9), Decl(commentsOverloads.ts, 89, 36), Decl(commentsOverloads.ts, 90, 36)) +>b : Symbol(b, Decl(commentsOverloads.ts, 90, 17)) + + public prop1(aorb: any) { +>prop1 : Symbol(prop1, Decl(commentsOverloads.ts, 88, 9), Decl(commentsOverloads.ts, 89, 36), Decl(commentsOverloads.ts, 90, 36)) +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 91, 17)) + + return 10; + } + /** prop2 1*/ + public prop2(a: number): number; +>prop2 : Symbol(prop2, Decl(commentsOverloads.ts, 93, 5), Decl(commentsOverloads.ts, 95, 36), Decl(commentsOverloads.ts, 96, 36)) +>a : Symbol(a, Decl(commentsOverloads.ts, 95, 17)) + + public prop2(b: string): number; +>prop2 : Symbol(prop2, Decl(commentsOverloads.ts, 93, 5), Decl(commentsOverloads.ts, 95, 36), Decl(commentsOverloads.ts, 96, 36)) +>b : Symbol(b, Decl(commentsOverloads.ts, 96, 17)) + + public prop2(aorb: any) { +>prop2 : Symbol(prop2, Decl(commentsOverloads.ts, 93, 5), Decl(commentsOverloads.ts, 95, 36), Decl(commentsOverloads.ts, 96, 36)) +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 97, 17)) + + return 10; + } + public prop3(a: number): number; +>prop3 : Symbol(prop3, Decl(commentsOverloads.ts, 99, 5), Decl(commentsOverloads.ts, 100, 36), Decl(commentsOverloads.ts, 102, 36)) +>a : Symbol(a, Decl(commentsOverloads.ts, 100, 17)) + + /** prop3 2*/ + public prop3(b: string): number; +>prop3 : Symbol(prop3, Decl(commentsOverloads.ts, 99, 5), Decl(commentsOverloads.ts, 100, 36), Decl(commentsOverloads.ts, 102, 36)) +>b : Symbol(b, Decl(commentsOverloads.ts, 102, 17)) + + public prop3(aorb: any) { +>prop3 : Symbol(prop3, Decl(commentsOverloads.ts, 99, 5), Decl(commentsOverloads.ts, 100, 36), Decl(commentsOverloads.ts, 102, 36)) +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 103, 17)) + + return 10; + } + /** prop4 1*/ + public prop4(a: number): number; +>prop4 : Symbol(prop4, Decl(commentsOverloads.ts, 105, 5), Decl(commentsOverloads.ts, 107, 36), Decl(commentsOverloads.ts, 109, 36)) +>a : Symbol(a, Decl(commentsOverloads.ts, 107, 17)) + + /** prop4 2*/ + public prop4(b: string): number; +>prop4 : Symbol(prop4, Decl(commentsOverloads.ts, 105, 5), Decl(commentsOverloads.ts, 107, 36), Decl(commentsOverloads.ts, 109, 36)) +>b : Symbol(b, Decl(commentsOverloads.ts, 109, 17)) + + public prop4(aorb: any) { +>prop4 : Symbol(prop4, Decl(commentsOverloads.ts, 105, 5), Decl(commentsOverloads.ts, 107, 36), Decl(commentsOverloads.ts, 109, 36)) +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 110, 17)) + + return 10; + } + /** prop5 1*/ + public prop5(a: number): number; +>prop5 : Symbol(prop5, Decl(commentsOverloads.ts, 112, 5), Decl(commentsOverloads.ts, 114, 36), Decl(commentsOverloads.ts, 116, 36)) +>a : Symbol(a, Decl(commentsOverloads.ts, 114, 17)) + + /** prop5 2*/ + public prop5(b: string): number; +>prop5 : Symbol(prop5, Decl(commentsOverloads.ts, 112, 5), Decl(commentsOverloads.ts, 114, 36), Decl(commentsOverloads.ts, 116, 36)) +>b : Symbol(b, Decl(commentsOverloads.ts, 116, 17)) + + /** Prop5 implementaion*/ + public prop5(aorb: any) { +>prop5 : Symbol(prop5, Decl(commentsOverloads.ts, 112, 5), Decl(commentsOverloads.ts, 114, 36), Decl(commentsOverloads.ts, 116, 36)) +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 118, 17)) + + return 10; + } +} +class c1 { +>c1 : Symbol(c1, Decl(commentsOverloads.ts, 121, 1)) + + constructor(a: number); +>a : Symbol(a, Decl(commentsOverloads.ts, 123, 16)) + + constructor(b: string); +>b : Symbol(b, Decl(commentsOverloads.ts, 124, 16)) + + constructor(aorb: any) { +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 125, 16)) + } +} +class c2 { +>c2 : Symbol(c2, Decl(commentsOverloads.ts, 127, 1)) + + /** c2 1*/ + constructor(a: number); +>a : Symbol(a, Decl(commentsOverloads.ts, 130, 16)) + + // c2 2 + constructor(b: string); +>b : Symbol(b, Decl(commentsOverloads.ts, 132, 16)) + + constructor(aorb: any) { +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 133, 16)) + } +} +class c3 { +>c3 : Symbol(c3, Decl(commentsOverloads.ts, 135, 1)) + + constructor(a: number); +>a : Symbol(a, Decl(commentsOverloads.ts, 137, 16)) + + /** c3 2*/ + constructor(b: string); +>b : Symbol(b, Decl(commentsOverloads.ts, 139, 16)) + + constructor(aorb: any) { +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 140, 16)) + } +} +class c4 { +>c4 : Symbol(c4, Decl(commentsOverloads.ts, 142, 1)) + + /** c4 1*/ + constructor(a: number); +>a : Symbol(a, Decl(commentsOverloads.ts, 145, 16)) + + /** c4 2*/ + constructor(b: string); +>b : Symbol(b, Decl(commentsOverloads.ts, 147, 16)) + + /** c4 3 */ + constructor(aorb: any) { +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 149, 16)) + } +} +class c5 { +>c5 : Symbol(c5, Decl(commentsOverloads.ts, 151, 1)) + + /** c5 1*/ + constructor(a: number); +>a : Symbol(a, Decl(commentsOverloads.ts, 154, 16)) + + /** c5 2*/ + constructor(b: string); +>b : Symbol(b, Decl(commentsOverloads.ts, 156, 16)) + + /** c5 implementation*/ + constructor(aorb: any) { +>aorb : Symbol(aorb, Decl(commentsOverloads.ts, 158, 16)) + } +} +var c_i = new c(); +>c_i : Symbol(c_i, Decl(commentsOverloads.ts, 161, 3)) +>c : Symbol(c, Decl(commentsOverloads.ts, 87, 1)) + +var c1_i_1 = new c1(10); +>c1_i_1 : Symbol(c1_i_1, Decl(commentsOverloads.ts, 163, 3)) +>c1 : Symbol(c1, Decl(commentsOverloads.ts, 121, 1)) + +var c1_i_2 = new c1("hello"); +>c1_i_2 : Symbol(c1_i_2, Decl(commentsOverloads.ts, 164, 3)) +>c1 : Symbol(c1, Decl(commentsOverloads.ts, 121, 1)) + +var c2_i_1 = new c2(10); +>c2_i_1 : Symbol(c2_i_1, Decl(commentsOverloads.ts, 165, 3)) +>c2 : Symbol(c2, Decl(commentsOverloads.ts, 127, 1)) + +var c2_i_2 = new c2("hello"); +>c2_i_2 : Symbol(c2_i_2, Decl(commentsOverloads.ts, 166, 3)) +>c2 : Symbol(c2, Decl(commentsOverloads.ts, 127, 1)) + +var c3_i_1 = new c3(10); +>c3_i_1 : Symbol(c3_i_1, Decl(commentsOverloads.ts, 167, 3)) +>c3 : Symbol(c3, Decl(commentsOverloads.ts, 135, 1)) + +var c3_i_2 = new c3("hello"); +>c3_i_2 : Symbol(c3_i_2, Decl(commentsOverloads.ts, 168, 3)) +>c3 : Symbol(c3, Decl(commentsOverloads.ts, 135, 1)) + +var c4_i_1 = new c4(10); +>c4_i_1 : Symbol(c4_i_1, Decl(commentsOverloads.ts, 169, 3)) +>c4 : Symbol(c4, Decl(commentsOverloads.ts, 142, 1)) + +var c4_i_2 = new c4("hello"); +>c4_i_2 : Symbol(c4_i_2, Decl(commentsOverloads.ts, 170, 3)) +>c4 : Symbol(c4, Decl(commentsOverloads.ts, 142, 1)) + +var c5_i_1 = new c5(10); +>c5_i_1 : Symbol(c5_i_1, Decl(commentsOverloads.ts, 171, 3)) +>c5 : Symbol(c5, Decl(commentsOverloads.ts, 151, 1)) + +var c5_i_2 = new c5("hello"); +>c5_i_2 : Symbol(c5_i_2, Decl(commentsOverloads.ts, 172, 3)) +>c5 : Symbol(c5, Decl(commentsOverloads.ts, 151, 1)) + diff --git a/tests/baselines/reference/commentsOverloads.types b/tests/baselines/reference/commentsOverloads.types index 9984c1b5b26..3281ab83ab6 100644 --- a/tests/baselines/reference/commentsOverloads.types +++ b/tests/baselines/reference/commentsOverloads.types @@ -13,14 +13,17 @@ function f1(aOrb: any) { >aOrb : any return 10; +>10 : number } f1("hello"); >f1("hello") : number >f1 : { (a: number): number; (b: string): number; } +>"hello" : string f1(10); >f1(10) : number >f1 : { (a: number): number; (b: string): number; } +>10 : number function f2(a: number): number; >f2 : { (a: number): number; (b: string): number; } @@ -37,14 +40,17 @@ function f2(aOrb: any) { >aOrb : any return 10; +>10 : number } f2("hello"); >f2("hello") : number >f2 : { (a: number): number; (b: string): number; } +>"hello" : string f2(10); >f2(10) : number >f2 : { (a: number): number; (b: string): number; } +>10 : number function f3(a: number): number; >f3 : { (a: number): number; (b: string): number; } @@ -59,14 +65,17 @@ function f3(aOrb: any) { >aOrb : any return 10; +>10 : number } f3("hello"); >f3("hello") : number >f3 : { (a: number): number; (b: string): number; } +>"hello" : string f3(10); >f3(10) : number >f3 : { (a: number): number; (b: string): number; } +>10 : number /** this is signature 4 - with number parameter*/ function f4(/**param a*/a: number): number; @@ -83,14 +92,17 @@ function f4(aOrb: any) { >aOrb : any return 10; +>10 : number } f4("hello"); >f4("hello") : number >f4 : { (a: number): number; (b: string): number; } +>"hello" : string f4(10); >f4(10) : number >f4 : { (a: number): number; (b: string): number; } +>10 : number interface i1 { >i1 : i1 @@ -240,6 +252,7 @@ class c { >aorb : any return 10; +>10 : number } /** prop2 1*/ public prop2(a: number): number; @@ -255,6 +268,7 @@ class c { >aorb : any return 10; +>10 : number } public prop3(a: number): number; >prop3 : { (a: number): number; (b: string): number; } @@ -270,6 +284,7 @@ class c { >aorb : any return 10; +>10 : number } /** prop4 1*/ public prop4(a: number): number; @@ -286,6 +301,7 @@ class c { >aorb : any return 10; +>10 : number } /** prop5 1*/ public prop5(a: number): number; @@ -303,6 +319,7 @@ class c { >aorb : any return 10; +>10 : number } } class c1 { @@ -388,49 +405,59 @@ var c1_i_1 = new c1(10); >c1_i_1 : c1 >new c1(10) : c1 >c1 : typeof c1 +>10 : number var c1_i_2 = new c1("hello"); >c1_i_2 : c1 >new c1("hello") : c1 >c1 : typeof c1 +>"hello" : string var c2_i_1 = new c2(10); >c2_i_1 : c2 >new c2(10) : c2 >c2 : typeof c2 +>10 : number var c2_i_2 = new c2("hello"); >c2_i_2 : c2 >new c2("hello") : c2 >c2 : typeof c2 +>"hello" : string var c3_i_1 = new c3(10); >c3_i_1 : c3 >new c3(10) : c3 >c3 : typeof c3 +>10 : number var c3_i_2 = new c3("hello"); >c3_i_2 : c3 >new c3("hello") : c3 >c3 : typeof c3 +>"hello" : string var c4_i_1 = new c4(10); >c4_i_1 : c4 >new c4(10) : c4 >c4 : typeof c4 +>10 : number var c4_i_2 = new c4("hello"); >c4_i_2 : c4 >new c4("hello") : c4 >c4 : typeof c4 +>"hello" : string var c5_i_1 = new c5(10); >c5_i_1 : c5 >new c5(10) : c5 >c5 : typeof c5 +>10 : number var c5_i_2 = new c5("hello"); >c5_i_2 : c5 >new c5("hello") : c5 >c5 : typeof c5 +>"hello" : string diff --git a/tests/baselines/reference/commentsPropertySignature1.symbols b/tests/baselines/reference/commentsPropertySignature1.symbols new file mode 100644 index 00000000000..2e97f701871 --- /dev/null +++ b/tests/baselines/reference/commentsPropertySignature1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/commentsPropertySignature1.ts === +var a = { +>a : Symbol(a, Decl(commentsPropertySignature1.ts, 0, 3)) + + /** own x*/ + x: 0 +>x : Symbol(x, Decl(commentsPropertySignature1.ts, 0, 9)) + +}; + diff --git a/tests/baselines/reference/commentsPropertySignature1.types b/tests/baselines/reference/commentsPropertySignature1.types index 857b0c98ee5..09dad1eaefb 100644 --- a/tests/baselines/reference/commentsPropertySignature1.types +++ b/tests/baselines/reference/commentsPropertySignature1.types @@ -6,6 +6,7 @@ var a = { /** own x*/ x: 0 >x : number +>0 : number }; diff --git a/tests/baselines/reference/commentsTypeParameters.symbols b/tests/baselines/reference/commentsTypeParameters.symbols new file mode 100644 index 00000000000..466ca3ff9a9 --- /dev/null +++ b/tests/baselines/reference/commentsTypeParameters.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/commentsTypeParameters.ts === +class C { +>C : Symbol(C, Decl(commentsTypeParameters.ts, 0, 0)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 0, 8)) + + method(a: U) { +>method : Symbol(method, Decl(commentsTypeParameters.ts, 0, 47)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 1, 11)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 0, 8)) +>a : Symbol(a, Decl(commentsTypeParameters.ts, 1, 66)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 1, 11)) + } + static staticmethod(a: U) { +>staticmethod : Symbol(C.staticmethod, Decl(commentsTypeParameters.ts, 2, 5)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 3, 24)) +>a : Symbol(a, Decl(commentsTypeParameters.ts, 3, 69)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 3, 24)) + } + + private privatemethod(a: U) { +>privatemethod : Symbol(privatemethod, Decl(commentsTypeParameters.ts, 4, 5)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 6, 26)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 0, 8)) +>a : Symbol(a, Decl(commentsTypeParameters.ts, 6, 81)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 6, 26)) + } + private static privatestaticmethod(a: U) { +>privatestaticmethod : Symbol(C.privatestaticmethod, Decl(commentsTypeParameters.ts, 7, 5)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 8, 39)) +>a : Symbol(a, Decl(commentsTypeParameters.ts, 8, 84)) +>U : Symbol(U, Decl(commentsTypeParameters.ts, 8, 39)) + } +} + +function compare(a: T, b: T) { +>compare : Symbol(compare, Decl(commentsTypeParameters.ts, 10, 1)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 12, 17)) +>a : Symbol(a, Decl(commentsTypeParameters.ts, 12, 29)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 12, 17)) +>b : Symbol(b, Decl(commentsTypeParameters.ts, 12, 34)) +>T : Symbol(T, Decl(commentsTypeParameters.ts, 12, 17)) + + return a === b; +>a : Symbol(a, Decl(commentsTypeParameters.ts, 12, 29)) +>b : Symbol(b, Decl(commentsTypeParameters.ts, 12, 34)) +} diff --git a/tests/baselines/reference/commentsVarDecl.symbols b/tests/baselines/reference/commentsVarDecl.symbols new file mode 100644 index 00000000000..d2ec3d4edcd --- /dev/null +++ b/tests/baselines/reference/commentsVarDecl.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/commentsVarDecl.ts === + +/** Variable comments*/ +var myVariable = 10; // This trailing Comment1 +>myVariable : Symbol(myVariable, Decl(commentsVarDecl.ts, 2, 3)) + +/** This is another variable comment*/ +var anotherVariable = 30; +>anotherVariable : Symbol(anotherVariable, Decl(commentsVarDecl.ts, 5, 3)) + +// shouldn't appear +var aVar = ""; +>aVar : Symbol(aVar, Decl(commentsVarDecl.ts, 8, 3)) + +/** this is multiline comment + * All these variables are of number type */ +var anotherAnotherVariable = 70; /* these are multiple trailing comments */ /* multiple trailing comments */ +>anotherAnotherVariable : Symbol(anotherAnotherVariable, Decl(commentsVarDecl.ts, 12, 3)) + +/** Triple slash multiline comment*/ +/** another line in the comment*/ +/** comment line 2*/ +var x = 70; /* multiline trailing comment +>x : Symbol(x, Decl(commentsVarDecl.ts, 17, 3)) + +this is multiline trailing comment */ +/** Triple slash comment on the assignement shouldnt be in .d.ts file*/ +x = myVariable; +>x : Symbol(x, Decl(commentsVarDecl.ts, 17, 3)) +>myVariable : Symbol(myVariable, Decl(commentsVarDecl.ts, 2, 3)) + +/** triple slash comment1*/ +/** jsdocstyle comment - only this comment should be in .d.ts file*/ +var n = 30; +>n : Symbol(n, Decl(commentsVarDecl.ts, 24, 3)) + +/** var deckaration with comment on type as well*/ +var y = /** value comment */ 20; +>y : Symbol(y, Decl(commentsVarDecl.ts, 27, 3)) + +/// var deckaration with comment on type as well +var yy = +>yy : Symbol(yy, Decl(commentsVarDecl.ts, 30, 3)) + + /// value comment + 20; + +/** comment2 */ +var z = /** lambda comment */ (x: number, y: number) => x + y; +>z : Symbol(z, Decl(commentsVarDecl.ts, 35, 3)) +>x : Symbol(x, Decl(commentsVarDecl.ts, 35, 31)) +>y : Symbol(y, Decl(commentsVarDecl.ts, 35, 41)) +>x : Symbol(x, Decl(commentsVarDecl.ts, 35, 31)) +>y : Symbol(y, Decl(commentsVarDecl.ts, 35, 41)) + +var z2: /** type comment*/ (x: number) => string; +>z2 : Symbol(z2, Decl(commentsVarDecl.ts, 37, 3)) +>x : Symbol(x, Decl(commentsVarDecl.ts, 37, 28)) + +var x2 = z2; +>x2 : Symbol(x2, Decl(commentsVarDecl.ts, 39, 3)) +>z2 : Symbol(z2, Decl(commentsVarDecl.ts, 37, 3)) + +var n4: (x: number) => string; +>n4 : Symbol(n4, Decl(commentsVarDecl.ts, 41, 3)) +>x : Symbol(x, Decl(commentsVarDecl.ts, 41, 9)) + +n4 = z2; +>n4 : Symbol(n4, Decl(commentsVarDecl.ts, 41, 3)) +>z2 : Symbol(z2, Decl(commentsVarDecl.ts, 37, 3)) + diff --git a/tests/baselines/reference/commentsVarDecl.types b/tests/baselines/reference/commentsVarDecl.types index 50db8984b1b..033590b3445 100644 --- a/tests/baselines/reference/commentsVarDecl.types +++ b/tests/baselines/reference/commentsVarDecl.types @@ -3,25 +3,30 @@ /** Variable comments*/ var myVariable = 10; // This trailing Comment1 >myVariable : number +>10 : number /** This is another variable comment*/ var anotherVariable = 30; >anotherVariable : number +>30 : number // shouldn't appear var aVar = ""; >aVar : string +>"" : string /** this is multiline comment * All these variables are of number type */ var anotherAnotherVariable = 70; /* these are multiple trailing comments */ /* multiple trailing comments */ >anotherAnotherVariable : number +>70 : number /** Triple slash multiline comment*/ /** another line in the comment*/ /** comment line 2*/ var x = 70; /* multiline trailing comment >x : number +>70 : number this is multiline trailing comment */ /** Triple slash comment on the assignement shouldnt be in .d.ts file*/ @@ -34,10 +39,12 @@ x = myVariable; /** jsdocstyle comment - only this comment should be in .d.ts file*/ var n = 30; >n : number +>30 : number /** var deckaration with comment on type as well*/ var y = /** value comment */ 20; >y : number +>20 : number /// var deckaration with comment on type as well var yy = @@ -45,6 +52,7 @@ var yy = /// value comment 20; +>20 : number /** comment2 */ var z = /** lambda comment */ (x: number, y: number) => x + y; diff --git a/tests/baselines/reference/commentsVariableStatement1.symbols b/tests/baselines/reference/commentsVariableStatement1.symbols new file mode 100644 index 00000000000..54f382da793 --- /dev/null +++ b/tests/baselines/reference/commentsVariableStatement1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/commentsVariableStatement1.ts === + +/** Comment */ +var v = 1; +>v : Symbol(v, Decl(commentsVariableStatement1.ts, 2, 3)) + diff --git a/tests/baselines/reference/commentsVariableStatement1.types b/tests/baselines/reference/commentsVariableStatement1.types index 7717be4a2a1..4bb6753db8a 100644 --- a/tests/baselines/reference/commentsVariableStatement1.types +++ b/tests/baselines/reference/commentsVariableStatement1.types @@ -3,4 +3,5 @@ /** Comment */ var v = 1; >v : number +>1 : number diff --git a/tests/baselines/reference/commentsdoNotEmitComments.symbols b/tests/baselines/reference/commentsdoNotEmitComments.symbols new file mode 100644 index 00000000000..a7ba4076d9d --- /dev/null +++ b/tests/baselines/reference/commentsdoNotEmitComments.symbols @@ -0,0 +1,161 @@ +=== tests/cases/compiler/commentsdoNotEmitComments.ts === + +/** Variable comments*/ +var myVariable = 10; +>myVariable : Symbol(myVariable, Decl(commentsdoNotEmitComments.ts, 2, 3)) + +/** function comments*/ +function foo(/** parameter comment*/p: number) { +>foo : Symbol(foo, Decl(commentsdoNotEmitComments.ts, 2, 20)) +>p : Symbol(p, Decl(commentsdoNotEmitComments.ts, 5, 13)) +} + +/** variable with function type comment*/ +var fooVar: () => void; +>fooVar : Symbol(fooVar, Decl(commentsdoNotEmitComments.ts, 9, 3)) + +foo(50); +>foo : Symbol(foo, Decl(commentsdoNotEmitComments.ts, 2, 20)) + +fooVar(); +>fooVar : Symbol(fooVar, Decl(commentsdoNotEmitComments.ts, 9, 3)) + +/**class comment*/ +class c { +>c : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9)) + + /** constructor comment*/ + constructor() { + } + + /** property comment */ + public b = 10; +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) + + /** function comment */ + public myFoo() { +>myFoo : Symbol(myFoo, Decl(commentsdoNotEmitComments.ts, 20, 18)) + + return this.b; +>this.b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) + } + + /** getter comment*/ + public get prop1() { +>prop1 : Symbol(prop1, Decl(commentsdoNotEmitComments.ts, 25, 5), Decl(commentsdoNotEmitComments.ts, 30, 5)) + + return this.b; +>this.b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) + } + + /** setter comment*/ + public set prop1(val: number) { +>prop1 : Symbol(prop1, Decl(commentsdoNotEmitComments.ts, 25, 5), Decl(commentsdoNotEmitComments.ts, 30, 5)) +>val : Symbol(val, Decl(commentsdoNotEmitComments.ts, 33, 21)) + + this.b = val; +>this.b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 17, 5)) +>val : Symbol(val, Decl(commentsdoNotEmitComments.ts, 33, 21)) + } + + /** overload signature1*/ + public foo1(a: number): string; +>foo1 : Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35)) +>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 38, 16)) + + /** Overload signature 2*/ + public foo1(b: string): string; +>foo1 : Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35)) +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 40, 16)) + + /** overload implementation signature*/ + public foo1(aOrb) { +>foo1 : Symbol(foo1, Decl(commentsdoNotEmitComments.ts, 35, 5), Decl(commentsdoNotEmitComments.ts, 38, 35), Decl(commentsdoNotEmitComments.ts, 40, 35)) +>aOrb : Symbol(aOrb, Decl(commentsdoNotEmitComments.ts, 42, 16)) + + return aOrb.toString(); +>aOrb : Symbol(aOrb, Decl(commentsdoNotEmitComments.ts, 42, 16)) + } +} + +/**instance comment*/ +var i = new c(); +>i : Symbol(i, Decl(commentsdoNotEmitComments.ts, 48, 3)) +>c : Symbol(c, Decl(commentsdoNotEmitComments.ts, 11, 9)) + +/** interface comments*/ +interface i1 { +>i1 : Symbol(i1, Decl(commentsdoNotEmitComments.ts, 48, 16)) + + /** caller comments*/ + (a: number): number; +>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 53, 5)) + + /** new comments*/ + new (b: string); +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 56, 9)) + + /**indexer property*/ + [a: number]: string; +>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 59, 5)) + + /** function property;*/ + myFoo(/*param prop*/a: number): string; +>myFoo : Symbol(myFoo, Decl(commentsdoNotEmitComments.ts, 59, 24)) +>a : Symbol(a, Decl(commentsdoNotEmitComments.ts, 62, 10)) + + /** prop*/ + prop: string; +>prop : Symbol(prop, Decl(commentsdoNotEmitComments.ts, 62, 43)) +} + +/**interface instance comments*/ +var i1_i: i1; +>i1_i : Symbol(i1_i, Decl(commentsdoNotEmitComments.ts, 69, 3)) +>i1 : Symbol(i1, Decl(commentsdoNotEmitComments.ts, 48, 16)) + +/** this is module comment*/ +module m1 { +>m1 : Symbol(m1, Decl(commentsdoNotEmitComments.ts, 69, 13)) + + /** class b */ + export class b { +>b : Symbol(b, Decl(commentsdoNotEmitComments.ts, 72, 11)) + + constructor(public x: number) { +>x : Symbol(x, Decl(commentsdoNotEmitComments.ts, 75, 20)) + + } + } + + /// module m2 + export module m2 { +>m2 : Symbol(m2, Decl(commentsdoNotEmitComments.ts, 78, 5)) + } +} + +/// this is x +declare var x; +>x : Symbol(x, Decl(commentsdoNotEmitComments.ts, 86, 11)) + + +/** const enum member value comment (generated by TS) */ +const enum color { red, green, blue } +>color : Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14)) +>red : Symbol(color.red, Decl(commentsdoNotEmitComments.ts, 90, 18)) +>green : Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23)) +>blue : Symbol(color.blue, Decl(commentsdoNotEmitComments.ts, 90, 30)) + +var shade: color = color.green; +>shade : Symbol(shade, Decl(commentsdoNotEmitComments.ts, 91, 3)) +>color : Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14)) +>color.green : Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23)) +>color : Symbol(color, Decl(commentsdoNotEmitComments.ts, 86, 14)) +>green : Symbol(color.green, Decl(commentsdoNotEmitComments.ts, 90, 23)) + diff --git a/tests/baselines/reference/commentsdoNotEmitComments.types b/tests/baselines/reference/commentsdoNotEmitComments.types index bbe3a685ca1..024f1c2a21f 100644 --- a/tests/baselines/reference/commentsdoNotEmitComments.types +++ b/tests/baselines/reference/commentsdoNotEmitComments.types @@ -3,6 +3,7 @@ /** Variable comments*/ var myVariable = 10; >myVariable : number +>10 : number /** function comments*/ function foo(/** parameter comment*/p: number) { @@ -17,6 +18,7 @@ var fooVar: () => void; foo(50); >foo(50) : void >foo : (p: number) => void +>50 : number fooVar(); >fooVar() : void @@ -33,6 +35,7 @@ class c { /** property comment */ public b = 10; >b : number +>10 : number /** function comment */ public myFoo() { @@ -143,7 +146,7 @@ module m1 { /// module m2 export module m2 { ->m2 : unknown +>m2 : any } } diff --git a/tests/baselines/reference/commentsemitComments.symbols b/tests/baselines/reference/commentsemitComments.symbols new file mode 100644 index 00000000000..6c0683d5372 --- /dev/null +++ b/tests/baselines/reference/commentsemitComments.symbols @@ -0,0 +1,146 @@ +=== tests/cases/compiler/commentsemitComments.ts === + +/** Variable comments*/ +var myVariable = 10; +>myVariable : Symbol(myVariable, Decl(commentsemitComments.ts, 2, 3)) + +/** function comments*/ +function foo(/** parameter comment*/p: number) { +>foo : Symbol(foo, Decl(commentsemitComments.ts, 2, 20)) +>p : Symbol(p, Decl(commentsemitComments.ts, 5, 13)) +} + +/** variable with function type comment*/ +var fooVar: () => void; +>fooVar : Symbol(fooVar, Decl(commentsemitComments.ts, 9, 3)) + +foo(50); +>foo : Symbol(foo, Decl(commentsemitComments.ts, 2, 20)) + +fooVar(); +>fooVar : Symbol(fooVar, Decl(commentsemitComments.ts, 9, 3)) + +/**class comment*/ +class c { +>c : Symbol(c, Decl(commentsemitComments.ts, 11, 9)) + + /** constructor comment*/ + constructor() { + } + + /** property comment */ + public b = 10; +>b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) + + /** function comment */ + public myFoo() { +>myFoo : Symbol(myFoo, Decl(commentsemitComments.ts, 20, 18)) + + return this.b; +>this.b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsemitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) + } + + /** getter comment*/ + public get prop1() { +>prop1 : Symbol(prop1, Decl(commentsemitComments.ts, 25, 5), Decl(commentsemitComments.ts, 30, 5)) + + return this.b; +>this.b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsemitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) + } + + /** setter comment*/ + public set prop1(val: number) { +>prop1 : Symbol(prop1, Decl(commentsemitComments.ts, 25, 5), Decl(commentsemitComments.ts, 30, 5)) +>val : Symbol(val, Decl(commentsemitComments.ts, 33, 21)) + + this.b = val; +>this.b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) +>this : Symbol(c, Decl(commentsemitComments.ts, 11, 9)) +>b : Symbol(b, Decl(commentsemitComments.ts, 17, 5)) +>val : Symbol(val, Decl(commentsemitComments.ts, 33, 21)) + } + + /** overload signature1*/ + public foo1(a: number): string; +>foo1 : Symbol(foo1, Decl(commentsemitComments.ts, 35, 5), Decl(commentsemitComments.ts, 38, 35), Decl(commentsemitComments.ts, 40, 35)) +>a : Symbol(a, Decl(commentsemitComments.ts, 38, 16)) + + /** Overload signature 2*/ + public foo1(b: string): string; +>foo1 : Symbol(foo1, Decl(commentsemitComments.ts, 35, 5), Decl(commentsemitComments.ts, 38, 35), Decl(commentsemitComments.ts, 40, 35)) +>b : Symbol(b, Decl(commentsemitComments.ts, 40, 16)) + + /** overload implementation signature*/ + public foo1(aOrb) { +>foo1 : Symbol(foo1, Decl(commentsemitComments.ts, 35, 5), Decl(commentsemitComments.ts, 38, 35), Decl(commentsemitComments.ts, 40, 35)) +>aOrb : Symbol(aOrb, Decl(commentsemitComments.ts, 42, 16)) + + return aOrb.toString(); +>aOrb : Symbol(aOrb, Decl(commentsemitComments.ts, 42, 16)) + } +} + +/**instance comment*/ +var i = new c(); +>i : Symbol(i, Decl(commentsemitComments.ts, 48, 3)) +>c : Symbol(c, Decl(commentsemitComments.ts, 11, 9)) + +/** interface comments*/ +interface i1 { +>i1 : Symbol(i1, Decl(commentsemitComments.ts, 48, 16)) + + /** caller comments*/ + (a: number): number; +>a : Symbol(a, Decl(commentsemitComments.ts, 53, 5)) + + /** new comments*/ + new (b: string); +>b : Symbol(b, Decl(commentsemitComments.ts, 56, 9)) + + /**indexer property*/ + [a: number]: string; +>a : Symbol(a, Decl(commentsemitComments.ts, 59, 5)) + + /** function property;*/ + myFoo(/*param prop*/a: number): string; +>myFoo : Symbol(myFoo, Decl(commentsemitComments.ts, 59, 24)) +>a : Symbol(a, Decl(commentsemitComments.ts, 62, 10)) + + /** prop*/ + prop: string; +>prop : Symbol(prop, Decl(commentsemitComments.ts, 62, 43)) +} + +/**interface instance comments*/ +var i1_i: i1; +>i1_i : Symbol(i1_i, Decl(commentsemitComments.ts, 69, 3)) +>i1 : Symbol(i1, Decl(commentsemitComments.ts, 48, 16)) + +/** this is module comment*/ +module m1 { +>m1 : Symbol(m1, Decl(commentsemitComments.ts, 69, 13)) + + /** class b */ + export class b { +>b : Symbol(b, Decl(commentsemitComments.ts, 72, 11)) + + constructor(public x: number) { +>x : Symbol(x, Decl(commentsemitComments.ts, 75, 20)) + + } + } + + /// module m2 + export module m2 { +>m2 : Symbol(m2, Decl(commentsemitComments.ts, 78, 5)) + } +} + +/// this is x +declare var x; +>x : Symbol(x, Decl(commentsemitComments.ts, 86, 11)) + diff --git a/tests/baselines/reference/commentsemitComments.types b/tests/baselines/reference/commentsemitComments.types index b87ef5ad6fd..2311ca09dd0 100644 --- a/tests/baselines/reference/commentsemitComments.types +++ b/tests/baselines/reference/commentsemitComments.types @@ -3,6 +3,7 @@ /** Variable comments*/ var myVariable = 10; >myVariable : number +>10 : number /** function comments*/ function foo(/** parameter comment*/p: number) { @@ -17,6 +18,7 @@ var fooVar: () => void; foo(50); >foo(50) : void >foo : (p: number) => void +>50 : number fooVar(); >fooVar() : void @@ -33,6 +35,7 @@ class c { /** property comment */ public b = 10; >b : number +>10 : number /** function comment */ public myFoo() { @@ -143,7 +146,7 @@ module m1 { /// module m2 export module m2 { ->m2 : unknown +>m2 : any } } diff --git a/tests/baselines/reference/commonJSImportAsPrimaryExpression.symbols b/tests/baselines/reference/commonJSImportAsPrimaryExpression.symbols new file mode 100644 index 00000000000..b640adc58a4 --- /dev/null +++ b/tests/baselines/reference/commonJSImportAsPrimaryExpression.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(foo.C1.s1){ +>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)) + + // Should cause runtime import +} + +=== 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)) +} + diff --git a/tests/baselines/reference/commonJSImportAsPrimaryExpression.types b/tests/baselines/reference/commonJSImportAsPrimaryExpression.types index 0d2e96afaa2..01d96b31fc7 100644 --- a/tests/baselines/reference/commonJSImportAsPrimaryExpression.types +++ b/tests/baselines/reference/commonJSImportAsPrimaryExpression.types @@ -18,8 +18,10 @@ export class C1 { m1 = 42; >m1 : number +>42 : number static s1 = true; >s1 : boolean +>true : boolean } diff --git a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.symbols b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.symbols new file mode 100644 index 00000000000..68a852c6165 --- /dev/null +++ b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.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/commonJSImportNotAsPrimaryExpression.types b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types index bde0cb02b1e..6c3978d93aa 100644 --- a/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/commonJSImportNotAsPrimaryExpression.types @@ -4,18 +4,18 @@ import foo = require("./foo_0"); // None of the below should cause a runtime dependency on foo_0 import f = foo.M1; ->f : unknown +>f : any >foo : typeof foo ->M1 : unknown +>M1 : any var i: f.I2; >i : f.I2 ->f : unknown +>f : any >I2 : f.I2 var x: foo.C1 = <{m1: number}>{}; >x : foo.C1 ->foo : unknown +>foo : any >C1 : foo.C1 ><{m1: number}>{} : { m1: number; } >m1 : number @@ -23,21 +23,25 @@ var x: foo.C1 = <{m1: number}>{}; var y: typeof foo.C1.s1 = false; >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 ->foo : unknown ->M1 : unknown +>foo : any +>M1 : any >I2 : f.I2 var e: number = 0; >e : number >0 : foo.E1 ->foo : unknown +>foo : any >E1 : foo.E1 +>0 : number === tests/cases/conformance/externalModules/foo_0.ts === export class C1 { @@ -45,9 +49,11 @@ export class C1 { m1 = 42; >m1 : number +>42 : number static s1 = true; >s1 : boolean +>true : boolean } export interface I1 { @@ -61,7 +67,7 @@ export interface I1 { } export module M1 { ->M1 : unknown +>M1 : any export interface I2 { >I2 : I2 diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.symbols b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.symbols new file mode 100644 index 00000000000..c6586cc3068 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.symbols @@ -0,0 +1,735 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalObjects.ts === +class A1 { +>A1 : Symbol(A1, Decl(comparisonOperatorWithIdenticalObjects.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 0, 10)) + + public b: number; +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalObjects.ts, 1, 21)) + + public c: boolean; +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalObjects.ts, 2, 21)) + + public d: any; +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalObjects.ts, 3, 22)) + + public e: Object; +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalObjects.ts, 4, 18)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + public fn(a: string): string { +>fn : Symbol(fn, Decl(comparisonOperatorWithIdenticalObjects.ts, 5, 21)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 6, 14)) + + return null; + } +} +class B1 { +>B1 : Symbol(B1, Decl(comparisonOperatorWithIdenticalObjects.ts, 9, 1)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 10, 10)) + + public b: number; +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalObjects.ts, 11, 21)) + + public c: boolean; +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalObjects.ts, 12, 21)) + + public d: any; +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalObjects.ts, 13, 22)) + + public e: Object; +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalObjects.ts, 14, 18)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + public fn(b: string): string { +>fn : Symbol(fn, Decl(comparisonOperatorWithIdenticalObjects.ts, 15, 21)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalObjects.ts, 16, 14)) + + return null; + } +} + +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithIdenticalObjects.ts, 19, 1)) + + private a: string; +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 21, 12)) + + private fn(b: string): string { +>fn : Symbol(fn, Decl(comparisonOperatorWithIdenticalObjects.ts, 22, 22)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalObjects.ts, 23, 15)) + + return null; + } +} +class A2 extends Base { } +>A2 : Symbol(A2, Decl(comparisonOperatorWithIdenticalObjects.ts, 26, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithIdenticalObjects.ts, 19, 1)) + +class B2 extends Base { } +>B2 : Symbol(B2, Decl(comparisonOperatorWithIdenticalObjects.ts, 27, 25)) +>Base : Symbol(Base, Decl(comparisonOperatorWithIdenticalObjects.ts, 19, 1)) + +interface A3 { f(a: number): string; } +>A3 : Symbol(A3, Decl(comparisonOperatorWithIdenticalObjects.ts, 28, 25)) +>f : Symbol(f, Decl(comparisonOperatorWithIdenticalObjects.ts, 30, 14)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 30, 17)) + +interface B3 { f(a: number): string; } +>B3 : Symbol(B3, Decl(comparisonOperatorWithIdenticalObjects.ts, 30, 38)) +>f : Symbol(f, Decl(comparisonOperatorWithIdenticalObjects.ts, 31, 14)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 31, 17)) + +interface A4 { new (a: string): A1; } +>A4 : Symbol(A4, Decl(comparisonOperatorWithIdenticalObjects.ts, 31, 38)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 33, 20)) +>A1 : Symbol(A1, Decl(comparisonOperatorWithIdenticalObjects.ts, 0, 0)) + +interface B4 { new (a: string): B1; } +>B4 : Symbol(B4, Decl(comparisonOperatorWithIdenticalObjects.ts, 33, 37)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalObjects.ts, 34, 20)) +>B1 : Symbol(B1, Decl(comparisonOperatorWithIdenticalObjects.ts, 9, 1)) + +interface A5 { [x: number]: number; } +>A5 : Symbol(A5, Decl(comparisonOperatorWithIdenticalObjects.ts, 34, 37)) +>x : Symbol(x, Decl(comparisonOperatorWithIdenticalObjects.ts, 36, 16)) + +interface B5 { [x: number]: number; } +>B5 : Symbol(B5, Decl(comparisonOperatorWithIdenticalObjects.ts, 36, 37)) +>x : Symbol(x, Decl(comparisonOperatorWithIdenticalObjects.ts, 37, 16)) + +interface A6 { [x: string]: string; } +>A6 : Symbol(A6, Decl(comparisonOperatorWithIdenticalObjects.ts, 37, 37)) +>x : Symbol(x, Decl(comparisonOperatorWithIdenticalObjects.ts, 39, 16)) + +interface B6 { [x: string]: string; } +>B6 : Symbol(B6, Decl(comparisonOperatorWithIdenticalObjects.ts, 39, 37)) +>x : Symbol(x, Decl(comparisonOperatorWithIdenticalObjects.ts, 40, 16)) + +var a1: A1; +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>A1 : Symbol(A1, Decl(comparisonOperatorWithIdenticalObjects.ts, 0, 0)) + +var a2: A2; +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>A2 : Symbol(A2, Decl(comparisonOperatorWithIdenticalObjects.ts, 26, 1)) + +var a3: A3; +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>A3 : Symbol(A3, Decl(comparisonOperatorWithIdenticalObjects.ts, 28, 25)) + +var a4: A4; +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>A4 : Symbol(A4, Decl(comparisonOperatorWithIdenticalObjects.ts, 31, 38)) + +var a5: A5; +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>A5 : Symbol(A5, Decl(comparisonOperatorWithIdenticalObjects.ts, 34, 37)) + +var a6: A6; +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>A6 : Symbol(A6, Decl(comparisonOperatorWithIdenticalObjects.ts, 37, 37)) + +var b1: B1; +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>B1 : Symbol(B1, Decl(comparisonOperatorWithIdenticalObjects.ts, 9, 1)) + +var b2: B2; +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>B2 : Symbol(B2, Decl(comparisonOperatorWithIdenticalObjects.ts, 27, 25)) + +var b3: B3; +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>B3 : Symbol(B3, Decl(comparisonOperatorWithIdenticalObjects.ts, 30, 38)) + +var b4: B4; +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>B4 : Symbol(B4, Decl(comparisonOperatorWithIdenticalObjects.ts, 33, 37)) + +var b5: B5; +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>B5 : Symbol(B5, Decl(comparisonOperatorWithIdenticalObjects.ts, 36, 37)) + +var b6: B6; +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>B6 : Symbol(B6, Decl(comparisonOperatorWithIdenticalObjects.ts, 39, 37)) + +var base1: Base; +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithIdenticalObjects.ts, 19, 1)) + +var base2: Base; +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithIdenticalObjects.ts, 19, 1)) + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 60, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r1a2 = base1 < base2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 61, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r1a3 = a2 < b2; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 62, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r1a4 = a3 < b3; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 63, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r1a5 = a4 < b4; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 64, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r1a6 = a5 < b5; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 65, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r1a7 = a6 < b6; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 66, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 68, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r1b2 = base2 < base1; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 69, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r1b3 = b2 < a2; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 70, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r1b4 = b3 < a3; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 71, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r1b5 = b4 < a4; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 72, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r1b6 = b5 < a5; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 73, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r1b7 = b6 < a6; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 74, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 77, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r2a2 = base1 > base2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 78, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r2a3 = a2 > b2; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 79, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r2a4 = a3 > b3; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 80, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r2a5 = a4 > b4; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 81, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r2a6 = a5 > b5; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 82, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r2a7 = a6 > b6; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 83, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 85, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r2b2 = base2 > base1; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 86, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r2b3 = b2 > a2; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 87, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r2b4 = b3 > a3; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 88, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r2b5 = b4 > a4; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 89, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r2b6 = b5 > a5; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 90, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r2b7 = b6 > a6; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 91, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 94, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r3a2 = base1 <= base2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 95, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r3a3 = a2 <= b2; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 96, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r3a4 = a3 <= b3; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 97, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r3a5 = a4 <= b4; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 98, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r3a6 = a5 <= b5; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 99, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r3a7 = a6 <= b6; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 100, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 102, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r3b2 = base2 <= base1; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 103, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r3b3 = b2 <= a2; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 104, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r3b4 = b3 <= a3; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 105, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r3b5 = b4 <= a4; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 106, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r3b6 = b5 <= a5; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 107, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r3b7 = b6 <= a6; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 108, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 111, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r4a2 = base1 >= base2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 112, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r4a3 = a2 >= b2; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 113, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r4a4 = a3 >= b3; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 114, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r4a5 = a4 >= b4; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 115, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r4a6 = a5 >= b5; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 116, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r4a7 = a6 >= b6; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 117, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 119, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r4b2 = base2 >= base1; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 120, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r4b3 = b2 >= a2; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 121, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r4b4 = b3 >= a3; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 122, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r4b5 = b4 >= a4; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 123, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r4b6 = b5 >= a5; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 124, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r4b7 = b6 >= a6; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 125, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 128, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r5a2 = base1 == base2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 129, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r5a3 = a2 == b2; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 130, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r5a4 = a3 == b3; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 131, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r5a5 = a4 == b4; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 132, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r5a6 = a5 == b5; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 133, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r5a7 = a6 == b6; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 134, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 136, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r5b2 = base2 == base1; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 137, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r5b3 = b2 == a2; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 138, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r5b4 = b3 == a3; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 139, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r5b5 = b4 == a4; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 140, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r5b6 = b5 == a5; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 141, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r5b7 = b6 == a6; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 142, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 145, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r6a2 = base1 != base2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 146, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r6a3 = a2 != b2; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 147, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r6a4 = a3 != b3; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 148, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r6a5 = a4 != b4; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 149, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r6a6 = a5 != b5; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 150, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r6a7 = a6 != b6; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 151, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 153, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r6b2 = base2 != base1; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 154, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r6b3 = b2 != a2; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 155, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r6b4 = b3 != a3; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 156, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r6b5 = b4 != a4; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 157, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r6b6 = b5 != a5; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 158, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r6b7 = b6 != a6; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 159, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 162, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r7a2 = base1 === base2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 163, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r7a3 = a2 === b2; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 164, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r7a4 = a3 === b3; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 165, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r7a5 = a4 === b4; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 166, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r7a6 = a5 === b5; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 167, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r7a7 = a6 === b6; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 168, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 170, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r7b2 = base2 === base1; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 171, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r7b3 = b2 === a2; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 172, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r7b4 = b3 === a3; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 173, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r7b5 = b4 === a4; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 174, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r7b6 = b5 === a5; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 175, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r7b7 = b6 === a6; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 176, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 179, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) + +var r8a2 = base1 !== base2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 180, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) + +var r8a3 = a2 !== b2; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 181, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) + +var r8a4 = a3 !== b3; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 182, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) + +var r8a5 = a4 !== b4; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 183, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) + +var r8a6 = a5 !== b5; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 184, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) + +var r8a7 = a6 !== b6; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithIdenticalObjects.ts, 185, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 187, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithIdenticalObjects.ts, 49, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithIdenticalObjects.ts, 42, 3)) + +var r8b2 = base2 !== base1; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 188, 3)) +>base2 : Symbol(base2, Decl(comparisonOperatorWithIdenticalObjects.ts, 57, 3)) +>base1 : Symbol(base1, Decl(comparisonOperatorWithIdenticalObjects.ts, 56, 3)) + +var r8b3 = b2 !== a2; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 189, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithIdenticalObjects.ts, 50, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithIdenticalObjects.ts, 43, 3)) + +var r8b4 = b3 !== a3; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 190, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithIdenticalObjects.ts, 51, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithIdenticalObjects.ts, 44, 3)) + +var r8b5 = b4 !== a4; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 191, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithIdenticalObjects.ts, 52, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithIdenticalObjects.ts, 45, 3)) + +var r8b6 = b5 !== a5; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 192, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithIdenticalObjects.ts, 53, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithIdenticalObjects.ts, 46, 3)) + +var r8b7 = b6 !== a6; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithIdenticalObjects.ts, 193, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithIdenticalObjects.ts, 54, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithIdenticalObjects.ts, 47, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types index 02316f94e54..7f202c38d3a 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types @@ -23,6 +23,7 @@ class A1 { >a : string return null; +>null : null } } class B1 { @@ -49,6 +50,7 @@ class B1 { >b : string return null; +>null : null } } @@ -63,6 +65,7 @@ class Base { >b : string return null; +>null : null } } class A2 extends Base { } diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.symbols b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.symbols new file mode 100644 index 00000000000..72c912e80cc --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.symbols @@ -0,0 +1,295 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalPrimitiveType.ts === +enum E { a, b, c } +>E : Symbol(E, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 0, 8)) +>b : Symbol(E.b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 0, 11)) +>c : Symbol(E.c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 0, 14)) + +var a: number; +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var b: boolean; +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var c: string; +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var d: void; +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var e: E; +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>E : Symbol(E, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 0, 0)) + +// operator < +var ra1 = a < a; +>ra1 : Symbol(ra1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 9, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var ra2 = b < b; +>ra2 : Symbol(ra2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 10, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var ra3 = c < c; +>ra3 : Symbol(ra3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 11, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var ra4 = d < d; +>ra4 : Symbol(ra4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 12, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var ra5 = e < e; +>ra5 : Symbol(ra5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 13, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var ra6 = null < null; +>ra6 : Symbol(ra6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 14, 3)) + +var ra7 = undefined < undefined; +>ra7 : Symbol(ra7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 15, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator > +var rb1 = a > a; +>rb1 : Symbol(rb1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 18, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rb2 = b > b; +>rb2 : Symbol(rb2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 19, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rb3 = c > c; +>rb3 : Symbol(rb3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 20, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rb4 = d > d; +>rb4 : Symbol(rb4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 21, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rb5 = e > e; +>rb5 : Symbol(rb5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 22, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rb6 = null > null; +>rb6 : Symbol(rb6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 23, 3)) + +var rb7 = undefined > undefined; +>rb7 : Symbol(rb7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 24, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator <= +var rc1 = a <= a; +>rc1 : Symbol(rc1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 27, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rc2 = b <= b; +>rc2 : Symbol(rc2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 28, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rc3 = c <= c; +>rc3 : Symbol(rc3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 29, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rc4 = d <= d; +>rc4 : Symbol(rc4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 30, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rc5 = e <= e; +>rc5 : Symbol(rc5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 31, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rc6 = null <= null; +>rc6 : Symbol(rc6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 32, 3)) + +var rc7 = undefined <= undefined; +>rc7 : Symbol(rc7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 33, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator >= +var rd1 = a >= a; +>rd1 : Symbol(rd1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 36, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rd2 = b >= b; +>rd2 : Symbol(rd2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 37, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rd3 = c >= c; +>rd3 : Symbol(rd3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 38, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rd4 = d >= d; +>rd4 : Symbol(rd4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 39, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rd5 = e >= e; +>rd5 : Symbol(rd5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 40, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rd6 = null >= null; +>rd6 : Symbol(rd6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 41, 3)) + +var rd7 = undefined >= undefined; +>rd7 : Symbol(rd7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 42, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator == +var re1 = a == a; +>re1 : Symbol(re1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 45, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var re2 = b == b; +>re2 : Symbol(re2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 46, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var re3 = c == c; +>re3 : Symbol(re3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 47, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var re4 = d == d; +>re4 : Symbol(re4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 48, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var re5 = e == e; +>re5 : Symbol(re5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 49, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var re6 = null == null; +>re6 : Symbol(re6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 50, 3)) + +var re7 = undefined == undefined; +>re7 : Symbol(re7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 51, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator != +var rf1 = a != a; +>rf1 : Symbol(rf1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 54, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rf2 = b != b; +>rf2 : Symbol(rf2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 55, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rf3 = c != c; +>rf3 : Symbol(rf3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 56, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rf4 = d != d; +>rf4 : Symbol(rf4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 57, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rf5 = e != e; +>rf5 : Symbol(rf5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 58, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rf6 = null != null; +>rf6 : Symbol(rf6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 59, 3)) + +var rf7 = undefined != undefined; +>rf7 : Symbol(rf7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 60, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator === +var rg1 = a === a; +>rg1 : Symbol(rg1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 63, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rg2 = b === b; +>rg2 : Symbol(rg2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 64, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rg3 = c === c; +>rg3 : Symbol(rg3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 65, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rg4 = d === d; +>rg4 : Symbol(rg4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 66, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rg5 = e === e; +>rg5 : Symbol(rg5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 67, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rg6 = null === null; +>rg6 : Symbol(rg6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 68, 3)) + +var rg7 = undefined === undefined; +>rg7 : Symbol(rg7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 69, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +// operator !== +var rh1 = a !== a; +>rh1 : Symbol(rh1, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 72, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 2, 3)) + +var rh2 = b !== b; +>rh2 : Symbol(rh2, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 73, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 3, 3)) + +var rh3 = c !== c; +>rh3 : Symbol(rh3, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 74, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 4, 3)) + +var rh4 = d !== d; +>rh4 : Symbol(rh4, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 75, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 5, 3)) + +var rh5 = e !== e; +>rh5 : Symbol(rh5, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 76, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 6, 3)) + +var rh6 = null !== null; +>rh6 : Symbol(rh6, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 77, 3)) + +var rh7 = undefined !== undefined; +>rh7 : Symbol(rh7, Decl(comparisonOperatorWithIdenticalPrimitiveType.ts, 78, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types index 8c823072ac3..a21af43e9c7 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.types @@ -55,6 +55,8 @@ var ra5 = e < e; var ra6 = null < null; >ra6 : boolean >null < null : boolean +>null : null +>null : null var ra7 = undefined < undefined; >ra7 : boolean @@ -96,6 +98,8 @@ var rb5 = e > e; var rb6 = null > null; >rb6 : boolean >null > null : boolean +>null : null +>null : null var rb7 = undefined > undefined; >rb7 : boolean @@ -137,6 +141,8 @@ var rc5 = e <= e; var rc6 = null <= null; >rc6 : boolean >null <= null : boolean +>null : null +>null : null var rc7 = undefined <= undefined; >rc7 : boolean @@ -178,6 +184,8 @@ var rd5 = e >= e; var rd6 = null >= null; >rd6 : boolean >null >= null : boolean +>null : null +>null : null var rd7 = undefined >= undefined; >rd7 : boolean @@ -219,6 +227,8 @@ var re5 = e == e; var re6 = null == null; >re6 : boolean >null == null : boolean +>null : null +>null : null var re7 = undefined == undefined; >re7 : boolean @@ -260,6 +270,8 @@ var rf5 = e != e; var rf6 = null != null; >rf6 : boolean >null != null : boolean +>null : null +>null : null var rf7 = undefined != undefined; >rf7 : boolean @@ -301,6 +313,8 @@ var rg5 = e === e; var rg6 = null === null; >rg6 : boolean >null === null : boolean +>null : null +>null : null var rg7 = undefined === undefined; >rg7 : boolean @@ -342,6 +356,8 @@ var rh5 = e !== e; var rh6 = null !== null; >rh6 : boolean >null !== null : boolean +>null : null +>null : null var rh7 = undefined !== undefined; >rh7 : boolean diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.symbols b/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.symbols new file mode 100644 index 00000000000..5dd728b39af --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalTypeParameter.ts === +function foo(t: T) { +>foo : Symbol(foo, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 13)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 13)) + + var r1 = t < t; +>r1 : Symbol(r1, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 1, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r2 = t > t; +>r2 : Symbol(r2, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 2, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r3 = t <= t; +>r3 : Symbol(r3, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 3, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r4 = t >= t; +>r4 : Symbol(r4, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 4, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r5 = t == t; +>r5 : Symbol(r5, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 5, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r6 = t != t; +>r6 : Symbol(r6, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 6, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r7 = t === t; +>r7 : Symbol(r7, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 7, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) + + var r8 = t !== t; +>r8 : Symbol(r8, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 8, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +>t : Symbol(t, Decl(comparisonOperatorWithIdenticalTypeParameter.ts, 0, 16)) +} diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.symbols b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.symbols new file mode 100644 index 00000000000..7cf9a21d09b --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.symbols @@ -0,0 +1,687 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithOneOperandIsAny.ts === +var x: any; +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +enum E { a, b, c } +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 11)) +>a : Symbol(E.a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 2, 8)) +>b : Symbol(E.b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 2, 11)) +>c : Symbol(E.c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 2, 14)) + +function foo(t: T) { +>foo : Symbol(foo, Decl(comparisonOperatorWithOneOperandIsAny.ts, 2, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 13)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 13)) + + var foo_r1 = t < x; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 14, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r2 = t > x; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 15, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r3 = t <= x; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 16, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r4 = t >= x; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 17, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r5 = t == x; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 18, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r6 = t != x; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 19, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r7 = t === x; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 11, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 20, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r8 = t !== x; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsAny.ts, 12, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 21, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + + var foo_r1 = x < t; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 14, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r2 = x > t; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 15, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r3 = x <= t; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 16, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r4 = x >= t; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 17, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r5 = x == t; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 18, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r6 = x != t; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 19, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r7 = x === t; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 11, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 20, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) + + var foo_r8 = x !== t; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsAny.ts, 12, 7), Decl(comparisonOperatorWithOneOperandIsAny.ts, 21, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsAny.ts, 4, 16)) +} + +var a: boolean; +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var b: number; +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var c: string; +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var d: void; +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var e: E; +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 11)) + +var f: {}; +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var g: string[]; +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +// operator < +var r1a1 = x < a; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 33, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r1a2 = x < b; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 34, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r1a3 = x < c; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 35, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r1a4 = x < d; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 36, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r1a5 = x < e; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 37, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r1a6 = x < f; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 38, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r1a7 = x < g; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 39, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r1b1 = a < x; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 41, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b2 = b < x; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 42, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b3 = c < x; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 43, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b4 = d < x; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 44, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b5 = e < x; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 45, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b6 = f < x; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 46, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r1b7 = g < x; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 47, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator > +var r2a1 = x > a; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 50, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r2a2 = x > b; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 51, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r2a3 = x > c; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 52, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r2a4 = x > d; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 53, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r2a5 = x > e; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 54, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r2a6 = x > f; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 55, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r2a7 = x > g; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 56, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r2b1 = a > x; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 58, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b2 = b > x; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 59, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b3 = c > x; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 60, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b4 = d > x; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 61, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b5 = e > x; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 62, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b6 = f > x; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 63, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r2b7 = g > x; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 64, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator <= +var r3a1 = x <= a; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 67, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r3a2 = x <= b; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 68, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r3a3 = x <= c; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 69, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r3a4 = x <= d; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 70, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r3a5 = x <= e; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 71, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r3a6 = x <= f; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 72, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r3a7 = x <= g; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 73, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r3b1 = a <= x; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 75, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b2 = b <= x; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 76, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b3 = c <= x; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 77, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b4 = d <= x; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 78, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b5 = e <= x; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 79, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b6 = f <= x; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 80, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r3b7 = g <= x; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 81, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator >= +var r4a1 = x >= a; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 84, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r4a2 = x >= b; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 85, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r4a3 = x >= c; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 86, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r4a4 = x >= d; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 87, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r4a5 = x >= e; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 88, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r4a6 = x >= f; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 89, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r4a7 = x >= g; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 90, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r4b1 = a >= x; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 92, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b2 = b >= x; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 93, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b3 = c >= x; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 94, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b4 = d >= x; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 95, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b5 = e >= x; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 96, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b6 = f >= x; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 97, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r4b7 = g >= x; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 98, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator == +var r5a1 = x == a; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 101, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r5a2 = x == b; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 102, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r5a3 = x == c; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 103, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r5a4 = x == d; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 104, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r5a5 = x == e; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 105, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r5a6 = x == f; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 106, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r5a7 = x == g; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 107, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r5b1 = a == x; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 109, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b2 = b == x; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 110, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b3 = c == x; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 111, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b4 = d == x; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 112, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b5 = e == x; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 113, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b6 = f == x; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 114, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r5b7 = g == x; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 115, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator != +var r6a1 = x != a; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 118, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r6a2 = x != b; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 119, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r6a3 = x != c; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 120, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r6a4 = x != d; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 121, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r6a5 = x != e; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 122, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r6a6 = x != f; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 123, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r6a7 = x != g; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 124, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r6b1 = a != x; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 126, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b2 = b != x; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 127, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b3 = c != x; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 128, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b4 = d != x; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 129, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b5 = e != x; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 130, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b6 = f != x; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 131, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r6b7 = g != x; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 132, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator === +var r7a1 = x === a; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 135, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r7a2 = x === b; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 136, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r7a3 = x === c; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 137, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r7a4 = x === d; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 138, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r7a5 = x === e; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 139, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r7a6 = x === f; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 140, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r7a7 = x === g; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 141, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r7b1 = a === x; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 143, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b2 = b === x; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 144, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b3 = c === x; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 145, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b4 = d === x; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 146, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b5 = e === x; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 147, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b6 = f === x; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 148, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r7b7 = g === x; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 149, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +// operator !== +var r8a1 = x !== a; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 152, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) + +var r8a2 = x !== b; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 153, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) + +var r8a3 = x !== c; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 154, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) + +var r8a4 = x !== d; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 155, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) + +var r8a5 = x !== e; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 156, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) + +var r8a6 = x !== f; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 157, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) + +var r8a7 = x !== g; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 158, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) + +var r8b1 = a !== x; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithOneOperandIsAny.ts, 160, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsAny.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b2 = b !== x; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithOneOperandIsAny.ts, 161, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsAny.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b3 = c !== x; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithOneOperandIsAny.ts, 162, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsAny.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b4 = d !== x; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithOneOperandIsAny.ts, 163, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsAny.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b5 = e !== x; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithOneOperandIsAny.ts, 164, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsAny.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b6 = f !== x; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithOneOperandIsAny.ts, 165, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsAny.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + +var r8b7 = g !== x; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithOneOperandIsAny.ts, 166, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsAny.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsAny.ts, 0, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.symbols b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.symbols new file mode 100644 index 00000000000..1bc52a2a517 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.symbols @@ -0,0 +1,556 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithOneOperandIsNull.ts === +enum E { a, b, c } +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 8)) +>b : Symbol(E.b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 11)) +>c : Symbol(E.c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 14)) + +function foo(t: T) { +>foo : Symbol(foo, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 13)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 13)) + + var foo_r1 = t < null; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 3, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 12, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r2 = t > null; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 4, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 13, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r3 = t <= null; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 14, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r4 = t >= null; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 15, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r5 = t == null; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 16, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r6 = t != null; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 17, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r7 = t === null; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 18, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r8 = t !== null; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsNull.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 19, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r1 = null < t; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 3, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 12, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r2 = null > t; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 4, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 13, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r3 = null <= t; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 14, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r4 = null >= t; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 15, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r5 = null == t; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 16, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r6 = null != t; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 17, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r7 = null === t; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 18, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) + + var foo_r8 = null !== t; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsNull.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsNull.ts, 19, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsNull.ts, 2, 16)) +} + +var a: boolean; +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var b: number; +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var c: string; +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var d: void; +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var e: E; +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsNull.ts, 0, 0)) + +var f: {}; +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var g: string[]; +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator < +var r1a1 = null < a; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 31, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r1a2 = null < b; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 32, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r1a3 = null < c; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 33, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r1a4 = null < d; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 34, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r1a5 = null < e; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 35, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r1a6 = null < f; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 36, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r1a7 = null < g; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 37, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r1b1 = a < null; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 39, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r1b2 = b < null; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 40, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r1b3 = c < null; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 41, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r1b4 = d < null; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 42, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r1b5 = e < null; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 43, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r1b6 = f < null; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 44, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r1b7 = g < null; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 45, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator > +var r2a1 = null > a; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 48, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r2a2 = null > b; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 49, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r2a3 = null > c; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 50, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r2a4 = null > d; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 51, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r2a5 = null > e; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 52, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r2a6 = null > f; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 53, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r2a7 = null > g; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 54, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r2b1 = a > null; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 56, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r2b2 = b > null; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 57, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r2b3 = c > null; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 58, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r2b4 = d > null; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 59, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r2b5 = e > null; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 60, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r2b6 = f > null; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 61, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r2b7 = g > null; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 62, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator <= +var r3a1 = null <= a; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 65, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r3a2 = null <= b; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 66, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r3a3 = null <= c; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 67, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r3a4 = null <= d; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 68, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r3a5 = null <= e; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 69, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r3a6 = null <= f; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 70, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r3a7 = null <= g; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 71, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r3b1 = a <= null; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 73, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r3b2 = b <= null; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 74, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r3b3 = c <= null; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 75, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r3b4 = d <= null; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 76, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r3b5 = e <= null; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 77, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r3b6 = f <= null; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 78, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r3b7 = g <= null; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 79, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator >= +var r4a1 = null >= a; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 82, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r4a2 = null >= b; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 83, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r4a3 = null >= c; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 84, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r4a4 = null >= d; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 85, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r4a5 = null >= e; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 86, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r4a6 = null >= f; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 87, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r4a7 = null >= g; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 88, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r4b1 = a >= null; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 90, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r4b2 = b >= null; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 91, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r4b3 = c >= null; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 92, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r4b4 = d >= null; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 93, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r4b5 = e >= null; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 94, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r4b6 = f >= null; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 95, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r4b7 = g >= null; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 96, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator == +var r5a1 = null == a; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 99, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r5a2 = null == b; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 100, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r5a3 = null == c; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 101, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r5a4 = null == d; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 102, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r5a5 = null == e; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 103, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r5a6 = null == f; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 104, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r5a7 = null == g; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 105, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r5b1 = a == null; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 107, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r5b2 = b == null; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 108, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r5b3 = c == null; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 109, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r5b4 = d == null; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 110, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r5b5 = e == null; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 111, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r5b6 = f == null; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 112, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r5b7 = g == null; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 113, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator != +var r6a1 = null != a; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 116, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r6a2 = null != b; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 117, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r6a3 = null != c; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 118, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r6a4 = null != d; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 119, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r6a5 = null != e; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 120, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r6a6 = null != f; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 121, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r6a7 = null != g; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 122, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r6b1 = a != null; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 124, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r6b2 = b != null; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 125, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r6b3 = c != null; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 126, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r6b4 = d != null; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 127, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r6b5 = e != null; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 128, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r6b6 = f != null; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 129, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r6b7 = g != null; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 130, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator === +var r7a1 = null === a; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 133, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r7a2 = null === b; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 134, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r7a3 = null === c; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 135, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r7a4 = null === d; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 136, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r7a5 = null === e; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 137, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r7a6 = null === f; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 138, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r7a7 = null === g; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 139, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r7b1 = a === null; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 141, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r7b2 = b === null; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 142, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r7b3 = c === null; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 143, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r7b4 = d === null; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 144, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r7b5 = e === null; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 145, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r7b6 = f === null; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 146, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r7b7 = g === null; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 147, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +// operator !== +var r8a1 = null !== a; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 150, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r8a2 = null !== b; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 151, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r8a3 = null !== c; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 152, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r8a4 = null !== d; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 153, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r8a5 = null !== e; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 154, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r8a6 = null !== f; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 155, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r8a7 = null !== g; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 156, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + +var r8b1 = a !== null; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithOneOperandIsNull.ts, 158, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsNull.ts, 22, 3)) + +var r8b2 = b !== null; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithOneOperandIsNull.ts, 159, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsNull.ts, 23, 3)) + +var r8b3 = c !== null; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithOneOperandIsNull.ts, 160, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsNull.ts, 24, 3)) + +var r8b4 = d !== null; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithOneOperandIsNull.ts, 161, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsNull.ts, 25, 3)) + +var r8b5 = e !== null; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithOneOperandIsNull.ts, 162, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsNull.ts, 26, 3)) + +var r8b6 = f !== null; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithOneOperandIsNull.ts, 163, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsNull.ts, 27, 3)) + +var r8b7 = g !== null; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithOneOperandIsNull.ts, 164, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsNull.ts, 28, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types index d1b30eb7f6a..12d9235d44b 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types @@ -15,80 +15,96 @@ function foo(t: T) { >foo_r1 : boolean >t < null : boolean >t : T +>null : null var foo_r2 = t > null; >foo_r2 : boolean >t > null : boolean >t : T +>null : null var foo_r3 = t <= null; >foo_r3 : boolean >t <= null : boolean >t : T +>null : null var foo_r4 = t >= null; >foo_r4 : boolean >t >= null : boolean >t : T +>null : null var foo_r5 = t == null; >foo_r5 : boolean >t == null : boolean >t : T +>null : null var foo_r6 = t != null; >foo_r6 : boolean >t != null : boolean >t : T +>null : null var foo_r7 = t === null; >foo_r7 : boolean >t === null : boolean >t : T +>null : null var foo_r8 = t !== null; >foo_r8 : boolean >t !== null : boolean >t : T +>null : null var foo_r1 = null < t; >foo_r1 : boolean >null < t : boolean +>null : null >t : T var foo_r2 = null > t; >foo_r2 : boolean >null > t : boolean +>null : null >t : T var foo_r3 = null <= t; >foo_r3 : boolean >null <= t : boolean +>null : null >t : T var foo_r4 = null >= t; >foo_r4 : boolean >null >= t : boolean +>null : null >t : T var foo_r5 = null == t; >foo_r5 : boolean >null == t : boolean +>null : null >t : T var foo_r6 = null != t; >foo_r6 : boolean >null != t : boolean +>null : null >t : T var foo_r7 = null === t; >foo_r7 : boolean >null === t : boolean +>null : null >t : T var foo_r8 = null !== t; >foo_r8 : boolean >null !== t : boolean +>null : null >t : T } @@ -118,567 +134,679 @@ var g: string[]; var r1a1 = null < a; >r1a1 : boolean >null < a : boolean +>null : null >a : boolean var r1a2 = null < b; >r1a2 : boolean >null < b : boolean +>null : null >b : number var r1a3 = null < c; >r1a3 : boolean >null < c : boolean +>null : null >c : string var r1a4 = null < d; >r1a4 : boolean >null < d : boolean +>null : null >d : void var r1a5 = null < e; >r1a5 : boolean >null < e : boolean +>null : null >e : E var r1a6 = null < f; >r1a6 : boolean >null < f : boolean +>null : null >f : {} var r1a7 = null < g; >r1a7 : boolean >null < g : boolean +>null : null >g : string[] var r1b1 = a < null; >r1b1 : boolean >a < null : boolean >a : boolean +>null : null var r1b2 = b < null; >r1b2 : boolean >b < null : boolean >b : number +>null : null var r1b3 = c < null; >r1b3 : boolean >c < null : boolean >c : string +>null : null var r1b4 = d < null; >r1b4 : boolean >d < null : boolean >d : void +>null : null var r1b5 = e < null; >r1b5 : boolean >e < null : boolean >e : E +>null : null var r1b6 = f < null; >r1b6 : boolean >f < null : boolean >f : {} +>null : null var r1b7 = g < null; >r1b7 : boolean >g < null : boolean >g : string[] +>null : null // operator > var r2a1 = null > a; >r2a1 : boolean >null > a : boolean +>null : null >a : boolean var r2a2 = null > b; >r2a2 : boolean >null > b : boolean +>null : null >b : number var r2a3 = null > c; >r2a3 : boolean >null > c : boolean +>null : null >c : string var r2a4 = null > d; >r2a4 : boolean >null > d : boolean +>null : null >d : void var r2a5 = null > e; >r2a5 : boolean >null > e : boolean +>null : null >e : E var r2a6 = null > f; >r2a6 : boolean >null > f : boolean +>null : null >f : {} var r2a7 = null > g; >r2a7 : boolean >null > g : boolean +>null : null >g : string[] var r2b1 = a > null; >r2b1 : boolean >a > null : boolean >a : boolean +>null : null var r2b2 = b > null; >r2b2 : boolean >b > null : boolean >b : number +>null : null var r2b3 = c > null; >r2b3 : boolean >c > null : boolean >c : string +>null : null var r2b4 = d > null; >r2b4 : boolean >d > null : boolean >d : void +>null : null var r2b5 = e > null; >r2b5 : boolean >e > null : boolean >e : E +>null : null var r2b6 = f > null; >r2b6 : boolean >f > null : boolean >f : {} +>null : null var r2b7 = g > null; >r2b7 : boolean >g > null : boolean >g : string[] +>null : null // operator <= var r3a1 = null <= a; >r3a1 : boolean >null <= a : boolean +>null : null >a : boolean var r3a2 = null <= b; >r3a2 : boolean >null <= b : boolean +>null : null >b : number var r3a3 = null <= c; >r3a3 : boolean >null <= c : boolean +>null : null >c : string var r3a4 = null <= d; >r3a4 : boolean >null <= d : boolean +>null : null >d : void var r3a5 = null <= e; >r3a5 : boolean >null <= e : boolean +>null : null >e : E var r3a6 = null <= f; >r3a6 : boolean >null <= f : boolean +>null : null >f : {} var r3a7 = null <= g; >r3a7 : boolean >null <= g : boolean +>null : null >g : string[] var r3b1 = a <= null; >r3b1 : boolean >a <= null : boolean >a : boolean +>null : null var r3b2 = b <= null; >r3b2 : boolean >b <= null : boolean >b : number +>null : null var r3b3 = c <= null; >r3b3 : boolean >c <= null : boolean >c : string +>null : null var r3b4 = d <= null; >r3b4 : boolean >d <= null : boolean >d : void +>null : null var r3b5 = e <= null; >r3b5 : boolean >e <= null : boolean >e : E +>null : null var r3b6 = f <= null; >r3b6 : boolean >f <= null : boolean >f : {} +>null : null var r3b7 = g <= null; >r3b7 : boolean >g <= null : boolean >g : string[] +>null : null // operator >= var r4a1 = null >= a; >r4a1 : boolean >null >= a : boolean +>null : null >a : boolean var r4a2 = null >= b; >r4a2 : boolean >null >= b : boolean +>null : null >b : number var r4a3 = null >= c; >r4a3 : boolean >null >= c : boolean +>null : null >c : string var r4a4 = null >= d; >r4a4 : boolean >null >= d : boolean +>null : null >d : void var r4a5 = null >= e; >r4a5 : boolean >null >= e : boolean +>null : null >e : E var r4a6 = null >= f; >r4a6 : boolean >null >= f : boolean +>null : null >f : {} var r4a7 = null >= g; >r4a7 : boolean >null >= g : boolean +>null : null >g : string[] var r4b1 = a >= null; >r4b1 : boolean >a >= null : boolean >a : boolean +>null : null var r4b2 = b >= null; >r4b2 : boolean >b >= null : boolean >b : number +>null : null var r4b3 = c >= null; >r4b3 : boolean >c >= null : boolean >c : string +>null : null var r4b4 = d >= null; >r4b4 : boolean >d >= null : boolean >d : void +>null : null var r4b5 = e >= null; >r4b5 : boolean >e >= null : boolean >e : E +>null : null var r4b6 = f >= null; >r4b6 : boolean >f >= null : boolean >f : {} +>null : null var r4b7 = g >= null; >r4b7 : boolean >g >= null : boolean >g : string[] +>null : null // operator == var r5a1 = null == a; >r5a1 : boolean >null == a : boolean +>null : null >a : boolean var r5a2 = null == b; >r5a2 : boolean >null == b : boolean +>null : null >b : number var r5a3 = null == c; >r5a3 : boolean >null == c : boolean +>null : null >c : string var r5a4 = null == d; >r5a4 : boolean >null == d : boolean +>null : null >d : void var r5a5 = null == e; >r5a5 : boolean >null == e : boolean +>null : null >e : E var r5a6 = null == f; >r5a6 : boolean >null == f : boolean +>null : null >f : {} var r5a7 = null == g; >r5a7 : boolean >null == g : boolean +>null : null >g : string[] var r5b1 = a == null; >r5b1 : boolean >a == null : boolean >a : boolean +>null : null var r5b2 = b == null; >r5b2 : boolean >b == null : boolean >b : number +>null : null var r5b3 = c == null; >r5b3 : boolean >c == null : boolean >c : string +>null : null var r5b4 = d == null; >r5b4 : boolean >d == null : boolean >d : void +>null : null var r5b5 = e == null; >r5b5 : boolean >e == null : boolean >e : E +>null : null var r5b6 = f == null; >r5b6 : boolean >f == null : boolean >f : {} +>null : null var r5b7 = g == null; >r5b7 : boolean >g == null : boolean >g : string[] +>null : null // operator != var r6a1 = null != a; >r6a1 : boolean >null != a : boolean +>null : null >a : boolean var r6a2 = null != b; >r6a2 : boolean >null != b : boolean +>null : null >b : number var r6a3 = null != c; >r6a3 : boolean >null != c : boolean +>null : null >c : string var r6a4 = null != d; >r6a4 : boolean >null != d : boolean +>null : null >d : void var r6a5 = null != e; >r6a5 : boolean >null != e : boolean +>null : null >e : E var r6a6 = null != f; >r6a6 : boolean >null != f : boolean +>null : null >f : {} var r6a7 = null != g; >r6a7 : boolean >null != g : boolean +>null : null >g : string[] var r6b1 = a != null; >r6b1 : boolean >a != null : boolean >a : boolean +>null : null var r6b2 = b != null; >r6b2 : boolean >b != null : boolean >b : number +>null : null var r6b3 = c != null; >r6b3 : boolean >c != null : boolean >c : string +>null : null var r6b4 = d != null; >r6b4 : boolean >d != null : boolean >d : void +>null : null var r6b5 = e != null; >r6b5 : boolean >e != null : boolean >e : E +>null : null var r6b6 = f != null; >r6b6 : boolean >f != null : boolean >f : {} +>null : null var r6b7 = g != null; >r6b7 : boolean >g != null : boolean >g : string[] +>null : null // operator === var r7a1 = null === a; >r7a1 : boolean >null === a : boolean +>null : null >a : boolean var r7a2 = null === b; >r7a2 : boolean >null === b : boolean +>null : null >b : number var r7a3 = null === c; >r7a3 : boolean >null === c : boolean +>null : null >c : string var r7a4 = null === d; >r7a4 : boolean >null === d : boolean +>null : null >d : void var r7a5 = null === e; >r7a5 : boolean >null === e : boolean +>null : null >e : E var r7a6 = null === f; >r7a6 : boolean >null === f : boolean +>null : null >f : {} var r7a7 = null === g; >r7a7 : boolean >null === g : boolean +>null : null >g : string[] var r7b1 = a === null; >r7b1 : boolean >a === null : boolean >a : boolean +>null : null var r7b2 = b === null; >r7b2 : boolean >b === null : boolean >b : number +>null : null var r7b3 = c === null; >r7b3 : boolean >c === null : boolean >c : string +>null : null var r7b4 = d === null; >r7b4 : boolean >d === null : boolean >d : void +>null : null var r7b5 = e === null; >r7b5 : boolean >e === null : boolean >e : E +>null : null var r7b6 = f === null; >r7b6 : boolean >f === null : boolean >f : {} +>null : null var r7b7 = g === null; >r7b7 : boolean >g === null : boolean >g : string[] +>null : null // operator !== var r8a1 = null !== a; >r8a1 : boolean >null !== a : boolean +>null : null >a : boolean var r8a2 = null !== b; >r8a2 : boolean >null !== b : boolean +>null : null >b : number var r8a3 = null !== c; >r8a3 : boolean >null !== c : boolean +>null : null >c : string var r8a4 = null !== d; >r8a4 : boolean >null !== d : boolean +>null : null >d : void var r8a5 = null !== e; >r8a5 : boolean >null !== e : boolean +>null : null >e : E var r8a6 = null !== f; >r8a6 : boolean >null !== f : boolean +>null : null >f : {} var r8a7 = null !== g; >r8a7 : boolean >null !== g : boolean +>null : null >g : string[] var r8b1 = a !== null; >r8b1 : boolean >a !== null : boolean >a : boolean +>null : null var r8b2 = b !== null; >r8b2 : boolean >b !== null : boolean >b : number +>null : null var r8b3 = c !== null; >r8b3 : boolean >c !== null : boolean >c : string +>null : null var r8b4 = d !== null; >r8b4 : boolean >d !== null : boolean >d : void +>null : null var r8b5 = e !== null; >r8b5 : boolean >e !== null : boolean >e : E +>null : null var r8b6 = f !== null; >r8b6 : boolean >f !== null : boolean >f : {} +>null : null var r8b7 = g !== null; >r8b7 : boolean >g !== null : boolean >g : string[] +>null : null diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.symbols b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.symbols new file mode 100644 index 00000000000..ef865c10abe --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.symbols @@ -0,0 +1,688 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithOneOperandIsUndefined.ts === +var x: typeof undefined; +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>undefined : Symbol(undefined) + +enum E { a, b, c } +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 24)) +>a : Symbol(E.a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 2, 8)) +>b : Symbol(E.b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 2, 11)) +>c : Symbol(E.c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 2, 14)) + +function foo(t: T) { +>foo : Symbol(foo, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 2, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 13)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 13)) + + var foo_r1 = t < x; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 14, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r2 = t > x; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 15, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r3 = t <= x; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 16, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r4 = t >= x; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 17, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r5 = t == x; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 18, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r6 = t != x; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 19, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r7 = t === x; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 11, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 20, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r8 = t !== x; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 12, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 21, 7)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + + var foo_r1 = x < t; +>foo_r1 : Symbol(foo_r1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 5, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 14, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r2 = x > t; +>foo_r2 : Symbol(foo_r2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 6, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 15, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r3 = x <= t; +>foo_r3 : Symbol(foo_r3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 7, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 16, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r4 = x >= t; +>foo_r4 : Symbol(foo_r4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 8, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 17, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r5 = x == t; +>foo_r5 : Symbol(foo_r5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 9, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 18, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r6 = x != t; +>foo_r6 : Symbol(foo_r6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 10, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 19, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r7 = x === t; +>foo_r7 : Symbol(foo_r7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 11, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 20, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) + + var foo_r8 = x !== t; +>foo_r8 : Symbol(foo_r8, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 12, 7), Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 21, 7)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>t : Symbol(t, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 4, 16)) +} + +var a: boolean; +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var b: number; +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var c: string; +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var d: void; +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var e: E; +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>E : Symbol(E, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 24)) + +var f: {}; +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var g: string[]; +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +// operator < +var r1a1 = x < a; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 33, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r1a2 = x < b; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 34, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r1a3 = x < c; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 35, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r1a4 = x < d; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 36, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r1a5 = x < e; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 37, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r1a6 = x < f; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 38, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r1a7 = x < g; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 39, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r1b1 = a < x; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 41, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b2 = b < x; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 42, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b3 = c < x; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 43, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b4 = d < x; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 44, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b5 = e < x; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 45, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b6 = f < x; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 46, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r1b7 = g < x; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 47, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator > +var r2a1 = x > a; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 50, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r2a2 = x > b; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 51, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r2a3 = x > c; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 52, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r2a4 = x > d; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 53, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r2a5 = x > e; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 54, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r2a6 = x > f; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 55, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r2a7 = x > g; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 56, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r2b1 = a > x; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 58, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b2 = b > x; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 59, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b3 = c > x; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 60, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b4 = d > x; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 61, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b5 = e > x; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 62, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b6 = f > x; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 63, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r2b7 = g > x; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 64, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator <= +var r3a1 = x <= a; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 67, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r3a2 = x <= b; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 68, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r3a3 = x <= c; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 69, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r3a4 = x <= d; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 70, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r3a5 = x <= e; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 71, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r3a6 = x <= f; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 72, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r3a7 = x <= g; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 73, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r3b1 = a <= x; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 75, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b2 = b <= x; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 76, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b3 = c <= x; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 77, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b4 = d <= x; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 78, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b5 = e <= x; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 79, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b6 = f <= x; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 80, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r3b7 = g <= x; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 81, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator >= +var r4a1 = x >= a; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 84, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r4a2 = x >= b; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 85, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r4a3 = x >= c; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 86, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r4a4 = x >= d; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 87, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r4a5 = x >= e; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 88, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r4a6 = x >= f; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 89, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r4a7 = x >= g; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 90, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r4b1 = a >= x; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 92, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b2 = b >= x; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 93, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b3 = c >= x; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 94, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b4 = d >= x; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 95, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b5 = e >= x; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 96, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b6 = f >= x; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 97, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r4b7 = g >= x; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 98, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator == +var r5a1 = x == a; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 101, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r5a2 = x == b; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 102, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r5a3 = x == c; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 103, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r5a4 = x == d; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 104, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r5a5 = x == e; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 105, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r5a6 = x == f; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 106, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r5a7 = x == g; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 107, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r5b1 = a == x; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 109, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b2 = b == x; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 110, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b3 = c == x; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 111, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b4 = d == x; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 112, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b5 = e == x; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 113, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b6 = f == x; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 114, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r5b7 = g == x; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 115, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator != +var r6a1 = x != a; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 118, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r6a2 = x != b; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 119, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r6a3 = x != c; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 120, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r6a4 = x != d; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 121, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r6a5 = x != e; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 122, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r6a6 = x != f; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 123, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r6a7 = x != g; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 124, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r6b1 = a != x; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 126, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b2 = b != x; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 127, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b3 = c != x; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 128, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b4 = d != x; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 129, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b5 = e != x; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 130, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b6 = f != x; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 131, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r6b7 = g != x; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 132, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator === +var r7a1 = x === a; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 135, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r7a2 = x === b; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 136, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r7a3 = x === c; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 137, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r7a4 = x === d; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 138, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r7a5 = x === e; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 139, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r7a6 = x === f; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 140, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r7a7 = x === g; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 141, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r7b1 = a === x; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 143, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b2 = b === x; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 144, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b3 = c === x; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 145, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b4 = d === x; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 146, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b5 = e === x; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 147, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b6 = f === x; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 148, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r7b7 = g === x; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 149, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +// operator !== +var r8a1 = x !== a; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 152, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) + +var r8a2 = x !== b; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 153, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) + +var r8a3 = x !== c; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 154, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) + +var r8a4 = x !== d; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 155, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) + +var r8a5 = x !== e; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 156, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) + +var r8a6 = x !== f; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 157, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) + +var r8a7 = x !== g; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 158, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) + +var r8b1 = a !== x; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 160, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b2 = b !== x; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 161, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b3 = c !== x; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 162, 3)) +>c : Symbol(c, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 26, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b4 = d !== x; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 163, 3)) +>d : Symbol(d, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b5 = e !== x; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 164, 3)) +>e : Symbol(e, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b6 = f !== x; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 165, 3)) +>f : Symbol(f, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 29, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + +var r8b7 = g !== x; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 166, 3)) +>g : Symbol(g, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 30, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithOneOperandIsUndefined.ts, 0, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.symbols new file mode 100644 index 00000000000..e197579ee9f --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.symbols @@ -0,0 +1,310 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeEnumAndNumber.ts === +enum E { a, b, c } +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(E.b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 11)) +>c : Symbol(E.c, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 14)) + +var a: E; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) + +var b: number; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +// operator < +var ra1 = a < b; +>ra1 : Symbol(ra1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 6, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var ra2 = b < a; +>ra2 : Symbol(ra2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 7, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var ra3 = E.a < b; +>ra3 : Symbol(ra3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 8, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var ra4 = b < E.a; +>ra4 : Symbol(ra4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var ra5 = E.a < 0; +>ra5 : Symbol(ra5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 10, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var ra6 = 0 < E.a; +>ra6 : Symbol(ra6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 11, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator > +var rb1 = a > b; +>rb1 : Symbol(rb1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 14, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rb2 = b > a; +>rb2 : Symbol(rb2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 15, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rb3 = E.a > b; +>rb3 : Symbol(rb3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 16, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rb4 = b > E.a; +>rb4 : Symbol(rb4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 17, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rb5 = E.a > 0; +>rb5 : Symbol(rb5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 18, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rb6 = 0 > E.a; +>rb6 : Symbol(rb6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 19, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator <= +var rc1 = a <= b; +>rc1 : Symbol(rc1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 22, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rc2 = b <= a; +>rc2 : Symbol(rc2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 23, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rc3 = E.a <= b; +>rc3 : Symbol(rc3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 24, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rc4 = b <= E.a; +>rc4 : Symbol(rc4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 25, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rc5 = E.a <= 0; +>rc5 : Symbol(rc5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 26, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rc6 = 0 <= E.a; +>rc6 : Symbol(rc6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 27, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator >= +var rd1 = a >= b; +>rd1 : Symbol(rd1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 30, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rd2 = b >= a; +>rd2 : Symbol(rd2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 31, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rd3 = E.a >= b; +>rd3 : Symbol(rd3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 32, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rd4 = b >= E.a; +>rd4 : Symbol(rd4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 33, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rd5 = E.a >= 0; +>rd5 : Symbol(rd5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 34, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rd6 = 0 >= E.a; +>rd6 : Symbol(rd6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 35, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator == +var re1 = a == b; +>re1 : Symbol(re1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 38, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var re2 = b == a; +>re2 : Symbol(re2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 39, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var re3 = E.a == b; +>re3 : Symbol(re3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 40, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var re4 = b == E.a; +>re4 : Symbol(re4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 41, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var re5 = E.a == 0; +>re5 : Symbol(re5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 42, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var re6 = 0 == E.a; +>re6 : Symbol(re6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 43, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator != +var rf1 = a != b; +>rf1 : Symbol(rf1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 46, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rf2 = b != a; +>rf2 : Symbol(rf2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 47, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rf3 = E.a != b; +>rf3 : Symbol(rf3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 48, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rf4 = b != E.a; +>rf4 : Symbol(rf4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 49, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rf5 = E.a != 0; +>rf5 : Symbol(rf5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 50, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rf6 = 0 != E.a; +>rf6 : Symbol(rf6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 51, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator === +var rg1 = a === b; +>rg1 : Symbol(rg1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 54, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rg2 = b === a; +>rg2 : Symbol(rg2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 55, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rg3 = E.a === b; +>rg3 : Symbol(rg3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 56, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rg4 = b === E.a; +>rg4 : Symbol(rg4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 57, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rg5 = E.a === 0; +>rg5 : Symbol(rg5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 58, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rg6 = 0 === E.a; +>rg6 : Symbol(rg6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 59, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +// operator !== +var rh1 = a !== b; +>rh1 : Symbol(rh1, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 62, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rh2 = b !== a; +>rh2 : Symbol(rh2, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 63, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 2, 3)) + +var rh3 = E.a !== b; +>rh3 : Symbol(rh3, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 64, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) + +var rh4 = b !== E.a; +>rh4 : Symbol(rh4, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 65, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 3, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rh5 = E.a !== 0; +>rh5 : Symbol(rh5, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 66, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + +var rh6 = 0 !== E.a; +>rh6 : Symbol(rh6, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 67, 3)) +>E.a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) +>E : Symbol(E, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 0)) +>a : Symbol(E.a, Decl(comparisonOperatorWithSubtypeEnumAndNumber.ts, 0, 8)) + diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types index 2dfe5913a24..67077683d87 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.types @@ -47,10 +47,12 @@ var ra5 = E.a < 0; >E.a : E >E : typeof E >a : E +>0 : number var ra6 = 0 < E.a; >ra6 : boolean >0 < E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -90,10 +92,12 @@ var rb5 = E.a > 0; >E.a : E >E : typeof E >a : E +>0 : number var rb6 = 0 > E.a; >rb6 : boolean >0 > E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -133,10 +137,12 @@ var rc5 = E.a <= 0; >E.a : E >E : typeof E >a : E +>0 : number var rc6 = 0 <= E.a; >rc6 : boolean >0 <= E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -176,10 +182,12 @@ var rd5 = E.a >= 0; >E.a : E >E : typeof E >a : E +>0 : number var rd6 = 0 >= E.a; >rd6 : boolean >0 >= E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -219,10 +227,12 @@ var re5 = E.a == 0; >E.a : E >E : typeof E >a : E +>0 : number var re6 = 0 == E.a; >re6 : boolean >0 == E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -262,10 +272,12 @@ var rf5 = E.a != 0; >E.a : E >E : typeof E >a : E +>0 : number var rf6 = 0 != E.a; >rf6 : boolean >0 != E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -305,10 +317,12 @@ var rg5 = E.a === 0; >E.a : E >E : typeof E >a : E +>0 : number var rg6 = 0 === E.a; >rg6 : boolean >0 === E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E @@ -348,10 +362,12 @@ var rh5 = E.a !== 0; >E.a : E >E : typeof E >a : E +>0 : number var rh6 = 0 !== E.a; >rh6 : boolean >0 !== E.a : boolean +>0 : number >E.a : E >E : typeof E >a : E diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.symbols new file mode 100644 index 00000000000..b82a68af007 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.symbols @@ -0,0 +1,1060 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnCallSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 4, 28)) +} + +var a1: { fn(): void }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 9)) + +var b1: { fn(): void }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 9)) + +var a2: { fn(a: number, b: string): void }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 13)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 23)) + +var b2: { fn(a: number, b: string): void }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 13)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 23)) + +var a3: { fn(a: number, b: string): void }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 13)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 23)) + +var b3: { fn(a: number): void }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 13)) + +var a4: { fn(a: number, b: string): void }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 13)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 23)) + +var b4: { fn(): void }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 9)) + +var a5: { fn(a: Base): void }; +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 13)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b5: { fn(a: Derived): void }; +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 13)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) + +var a6: { fn(a: Derived, b: Base): void }; +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 13)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 24)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b6: { fn(a: Base, b: Derived): void }; +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 9)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 13)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 21)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) + +var a7: { fn(): void }; +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 9)) + +var b7: { fn(): Base }; +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 9)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var a8: { fn(): Base }; +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 9)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b8: { fn(): Base }; +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 9)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var a9: { fn(): Base }; +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 9)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b9: { fn(): Derived }; +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 9)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) + +var a10: { fn(a?: Base): void }; +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 10)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 14)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b10: { fn(a?: Derived): void }; +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 10)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 14)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) + +var a11: { fn(...a: Base[]): void }; +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 10)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 14)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 0, 0)) + +var b11: { fn(...a: Derived[]): void }; +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 10)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 14)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 2, 1)) + +//var a12: { fn(t: T, u: U): T[] }; +//var b12: { fn(a: A, b: B): A[] }; + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 45, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r1a2 = a2 < b2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 46, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r1a3 = a3 < b3; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 47, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r1a4 = a4 < b4; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 48, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r1a5 = a5 < b5; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 49, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r1a6 = a6 < b6; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 50, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r1a7 = a7 < b7; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 51, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r1a8 = a8 < b8; +>r1a8 : Symbol(r1a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 52, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r1a9 = a9 < b9; +>r1a9 : Symbol(r1a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 53, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r1a10 = a10 < b10; +>r1a10 : Symbol(r1a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 54, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r1a11 = a11 < b11; +>r1a11 : Symbol(r1a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 55, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r1a12 = a12 < b12; + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 58, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r1b2 = b2 < a2; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 59, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r1b3 = b3 < a3; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 60, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r1b4 = b4 < a4; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 61, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r1b5 = b5 < a5; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 62, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r1b6 = b6 < a6; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 63, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r1b7 = b7 < a7; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 64, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r1b8 = b8 < a8; +>r1b8 : Symbol(r1b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 65, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r1b9 = b9 < a9; +>r1b9 : Symbol(r1b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 66, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r1b10 = b10 < a10; +>r1b10 : Symbol(r1b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 67, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r1b11 = b11 < a11; +>r1b11 : Symbol(r1b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 68, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r1b12 = b12 < a12; + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 72, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r2a2 = a2 > b2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 73, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r2a3 = a3 > b3; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 74, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r2a4 = a4 > b4; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 75, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r2a5 = a5 > b5; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 76, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r2a6 = a6 > b6; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 77, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r2a7 = a7 > b7; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 78, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r2a8 = a8 > b8; +>r2a8 : Symbol(r2a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 79, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r2a9 = a9 > b9; +>r2a9 : Symbol(r2a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 80, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r2a10 = a10 > b10; +>r2a10 : Symbol(r2a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 81, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r2a11 = a11 > b11; +>r2a11 : Symbol(r2a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 82, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r2a12 = a12 > b12; + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 85, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r2b2 = b2 > a2; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 86, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r2b3 = b3 > a3; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 87, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r2b4 = b4 > a4; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 88, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r2b5 = b5 > a5; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 89, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r2b6 = b6 > a6; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 90, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r2b7 = b7 > a7; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 91, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r2b8 = b8 > a8; +>r2b8 : Symbol(r2b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 92, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r2b9 = b9 > a9; +>r2b9 : Symbol(r2b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 93, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r2b10 = b10 > a10; +>r2b10 : Symbol(r2b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 94, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r2b11 = b11 > a11; +>r2b11 : Symbol(r2b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 95, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r2b12 = b12 > a12; + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 99, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r3a2 = a2 <= b2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 100, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r3a3 = a3 <= b3; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 101, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r3a4 = a4 <= b4; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 102, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r3a5 = a5 <= b5; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 103, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r3a6 = a6 <= b6; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 104, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r3a7 = a7 <= b7; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 105, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r3a8 = a8 <= b8; +>r3a8 : Symbol(r3a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 106, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r3a9 = a9 <= b9; +>r3a9 : Symbol(r3a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 107, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r3a10 = a10 <= b10; +>r3a10 : Symbol(r3a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 108, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r3a11 = a11 <= b11; +>r3a11 : Symbol(r3a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 109, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r3a12 = a12 <= b12; + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 112, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r3b2 = b2 <= a2; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 113, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r3b3 = b3 <= a3; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 114, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r3b4 = b4 <= a4; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 115, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r3b5 = b5 <= a5; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 116, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r3b6 = b6 <= a6; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 117, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r3b7 = b7 <= a7; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 118, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r3b8 = b8 <= a8; +>r3b8 : Symbol(r3b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 119, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r3b9 = b9 <= a9; +>r3b9 : Symbol(r3b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 120, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r3b10 = b10 <= a10; +>r3b10 : Symbol(r3b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 121, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r3b11 = b11 <= a11; +>r3b11 : Symbol(r3b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 122, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r3b12 = b12 <= a12; + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 126, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r4a2 = a2 >= b2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 127, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r4a3 = a3 >= b3; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 128, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r4a4 = a4 >= b4; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 129, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r4a5 = a5 >= b5; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 130, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r4a6 = a6 >= b6; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 131, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r4a7 = a7 >= b7; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 132, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r4a8 = a8 >= b8; +>r4a8 : Symbol(r4a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 133, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r4a9 = a9 >= b9; +>r4a9 : Symbol(r4a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 134, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r4a10 = a10 >= b10; +>r4a10 : Symbol(r4a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 135, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r4a11 = a11 >= b11; +>r4a11 : Symbol(r4a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 136, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r4a12 = a12 >= b12; + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 139, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r4b2 = b2 >= a2; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 140, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r4b3 = b3 >= a3; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 141, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r4b4 = b4 >= a4; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 142, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r4b5 = b5 >= a5; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 143, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r4b6 = b6 >= a6; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 144, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r4b7 = b7 >= a7; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 145, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r4b8 = b8 >= a8; +>r4b8 : Symbol(r4b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 146, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r4b9 = b9 >= a9; +>r4b9 : Symbol(r4b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 147, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r4b10 = b10 >= a10; +>r4b10 : Symbol(r4b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 148, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r4b11 = b11 >= a11; +>r4b11 : Symbol(r4b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 149, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r4b12 = b12 >= a12; + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 153, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r5a2 = a2 == b2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 154, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r5a3 = a3 == b3; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 155, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r5a4 = a4 == b4; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 156, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r5a5 = a5 == b5; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 157, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r5a6 = a6 == b6; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 158, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r5a7 = a7 == b7; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 159, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r5a8 = a8 == b8; +>r5a8 : Symbol(r5a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 160, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r5a9 = a9 == b9; +>r5a9 : Symbol(r5a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 161, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r5a10 = a10 == b10; +>r5a10 : Symbol(r5a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 162, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r5a11 = a11 == b11; +>r5a11 : Symbol(r5a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 163, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r5a12 = a12 == b12; + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 166, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r5b2 = b2 == a2; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 167, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r5b3 = b3 == a3; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 168, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r5b4 = b4 == a4; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 169, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r5b5 = b5 == a5; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 170, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r5b6 = b6 == a6; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 171, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r5b7 = b7 == a7; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 172, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r5b8 = b8 == a8; +>r5b8 : Symbol(r5b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 173, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r5b9 = b9 == a9; +>r5b9 : Symbol(r5b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 174, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r5b10 = b10 == a10; +>r5b10 : Symbol(r5b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 175, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r5b11 = b11 == a11; +>r5b11 : Symbol(r5b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 176, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r5b12 = b12 == a12; + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 180, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r6a2 = a2 != b2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 181, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r6a3 = a3 != b3; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 182, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r6a4 = a4 != b4; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 183, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r6a5 = a5 != b5; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 184, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r6a6 = a6 != b6; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 185, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r6a7 = a7 != b7; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 186, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r6a8 = a8 != b8; +>r6a8 : Symbol(r6a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 187, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r6a9 = a9 != b9; +>r6a9 : Symbol(r6a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 188, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r6a10 = a10 != b10; +>r6a10 : Symbol(r6a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 189, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r6a11 = a11 != b11; +>r6a11 : Symbol(r6a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 190, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r6a12 = a12 != b12; + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 193, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r6b2 = b2 != a2; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 194, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r6b3 = b3 != a3; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 195, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r6b4 = b4 != a4; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 196, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r6b5 = b5 != a5; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 197, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r6b6 = b6 != a6; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 198, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r6b7 = b7 != a7; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 199, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r6b8 = b8 != a8; +>r6b8 : Symbol(r6b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 200, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r6b9 = b9 != a9; +>r6b9 : Symbol(r6b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 201, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r6b10 = b10 != a10; +>r6b10 : Symbol(r6b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 202, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r6b11 = b11 != a11; +>r6b11 : Symbol(r6b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 203, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r6b12 = b12 != a12; + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 207, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r7a2 = a2 === b2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 208, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r7a3 = a3 === b3; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 209, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r7a4 = a4 === b4; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 210, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r7a5 = a5 === b5; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 211, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r7a6 = a6 === b6; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 212, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r7a7 = a7 === b7; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 213, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r7a8 = a8 === b8; +>r7a8 : Symbol(r7a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 214, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r7a9 = a9 === b9; +>r7a9 : Symbol(r7a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 215, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r7a10 = a10 === b10; +>r7a10 : Symbol(r7a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 216, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r7a11 = a11 === b11; +>r7a11 : Symbol(r7a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 217, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r7a12 = a12 === b12; + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 220, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r7b2 = b2 === a2; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 221, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r7b3 = b3 === a3; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 222, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r7b4 = b4 === a4; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 223, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r7b5 = b5 === a5; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 224, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r7b6 = b6 === a6; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 225, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r7b7 = b7 === a7; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 226, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r7b8 = b8 === a8; +>r7b8 : Symbol(r7b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 227, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r7b9 = b9 === a9; +>r7b9 : Symbol(r7b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 228, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r7b10 = b10 === a10; +>r7b10 : Symbol(r7b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 229, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r7b11 = b11 === a11; +>r7b11 : Symbol(r7b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 230, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r7b12 = b12 === a12; + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 234, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) + +var r8a2 = a2 !== b2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 235, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) + +var r8a3 = a3 !== b3; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 236, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) + +var r8a4 = a4 !== b4; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 237, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) + +var r8a5 = a5 !== b5; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 238, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) + +var r8a6 = a6 !== b6; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 239, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) + +var r8a7 = a7 !== b7; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 240, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) + +var r8a8 = a8 !== b8; +>r8a8 : Symbol(r8a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 241, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) + +var r8a9 = a9 !== b9; +>r8a9 : Symbol(r8a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 242, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) + +var r8a10 = a10 !== b10; +>r8a10 : Symbol(r8a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 243, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) + +var r8a11 = a11 !== b11; +>r8a11 : Symbol(r8a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 244, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) + +//var r8a12 = a12 !== b12; + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 247, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 8, 3)) + +var r8b2 = b2 !== a2; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 248, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 11, 3)) + +var r8b3 = b3 !== a3; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 249, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 14, 3)) + +var r8b4 = b4 !== a4; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 250, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 17, 3)) + +var r8b5 = b5 !== a5; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 251, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 20, 3)) + +var r8b6 = b6 !== a6; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 252, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 23, 3)) + +var r8b7 = b7 !== a7; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 253, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 26, 3)) + +var r8b8 = b8 !== a8; +>r8b8 : Symbol(r8b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 254, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 29, 3)) + +var r8b9 = b9 !== a9; +>r8b9 : Symbol(r8b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 255, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 32, 3)) + +var r8b10 = b10 !== a10; +>r8b10 : Symbol(r8b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 256, 3)) +>b10 : Symbol(b10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 36, 3)) +>a10 : Symbol(a10, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 35, 3)) + +var r8b11 = b11 !== a11; +>r8b11 : Symbol(r8b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 257, 3)) +>b11 : Symbol(b11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 39, 3)) +>a11 : Symbol(a11, Decl(comparisonOperatorWithSubtypeObjectOnCallSignature.ts, 38, 3)) + +//var r8b12 = b12 !== a12; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.symbols new file mode 100644 index 00000000000..6dd08fc0529 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.symbols @@ -0,0 +1,879 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 4, 28)) +} + +var a1: { new (): Base }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b1: { new (): Base }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a2: { new (a: number, b: string): Base }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 15)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 25)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b2: { new (a: number, b: string): Base }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 15)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 25)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a3: { new (a: number, b: string): Base }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 15)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 25)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b3: { new (a: number): Base }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a4: { new (a: number, b: string): Base }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 15)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 25)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b4: { new (): Base }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a5: { new (a: Base): Base }; +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b5: { new (a: Derived): Base }; +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 15)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a6: { new (a: Derived, b: Base): Base }; +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 15)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 26)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b6: { new (a: Base, b: Derived): Base }; +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 23)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a7: { new (): Base }; +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b7: { new (): Derived }; +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) + +var a8: { new (a?: Base): Base }; +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b8: { new (a?: Derived): Base }; +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 15)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var a9: { new (...a: Base[]): Base }; +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +var b9: { new (...a: Derived[]): Base }; +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 15)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 0, 0)) + +//var a10: { (t: T, u: U): T[] }; +//var b10: { (a: A, b: B): A[] }; + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 39, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r1a2 = a2 < b2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 40, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r1a3 = a3 < b3; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 41, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r1a4 = a4 < b4; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 42, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r1a5 = a5 < b5; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 43, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r1a6 = a6 < b6; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 44, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r1a7 = a7 < b7; +>r1a7 : Symbol(r1a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 45, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r1a8 = a8 < b8; +>r1a8 : Symbol(r1a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 46, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r1a9 = a9 < b9; +>r1a9 : Symbol(r1a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 47, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r1a10 = a10 < b10; + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 50, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r1b2 = b2 < a2; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 51, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r1b3 = b3 < a3; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 52, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r1b4 = b4 < a4; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 53, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r1b5 = b5 < a5; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 54, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r1b6 = b6 < a6; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 55, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r1b7 = b7 < a7; +>r1b7 : Symbol(r1b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 56, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r1b8 = b8 < a8; +>r1b8 : Symbol(r1b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 57, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r1b9 = b9 < a9; +>r1b9 : Symbol(r1b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 58, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r1b10 = b10 < a10; + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 62, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r2a2 = a2 > b2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 63, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r2a3 = a3 > b3; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 64, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r2a4 = a4 > b4; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 65, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r2a5 = a5 > b5; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 66, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r2a6 = a6 > b6; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 67, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r2a7 = a7 > b7; +>r2a7 : Symbol(r2a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 68, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r2a8 = a8 > b8; +>r2a8 : Symbol(r2a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 69, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r2a9 = a9 > b9; +>r2a9 : Symbol(r2a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 70, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r2a10 = a10 > b10; + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 73, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r2b2 = b2 > a2; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 74, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r2b3 = b3 > a3; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 75, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r2b4 = b4 > a4; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 76, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r2b5 = b5 > a5; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 77, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r2b6 = b6 > a6; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 78, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r2b7 = b7 > a7; +>r2b7 : Symbol(r2b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 79, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r2b8 = b8 > a8; +>r2b8 : Symbol(r2b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 80, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r2b9 = b9 > a9; +>r2b9 : Symbol(r2b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 81, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r2b10 = b10 > a10; + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 85, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r3a2 = a2 <= b2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 86, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r3a3 = a3 <= b3; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 87, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r3a4 = a4 <= b4; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 88, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r3a5 = a5 <= b5; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 89, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r3a6 = a6 <= b6; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 90, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r3a7 = a7 <= b7; +>r3a7 : Symbol(r3a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 91, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r3a8 = a8 <= b8; +>r3a8 : Symbol(r3a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 92, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r3a9 = a9 <= b9; +>r3a9 : Symbol(r3a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 93, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r3a10 = a10 <= b10; + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 96, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r3b2 = b2 <= a2; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 97, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r3b3 = b3 <= a3; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 98, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r3b4 = b4 <= a4; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 99, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r3b5 = b5 <= a5; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 100, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r3b6 = b6 <= a6; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 101, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r3b7 = b7 <= a7; +>r3b7 : Symbol(r3b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 102, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r3b8 = b8 <= a8; +>r3b8 : Symbol(r3b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 103, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r3b9 = b9 <= a9; +>r3b9 : Symbol(r3b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 104, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r3b10 = b10 <= a10; + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 108, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r4a2 = a2 >= b2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 109, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r4a3 = a3 >= b3; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 110, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r4a4 = a4 >= b4; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 111, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r4a5 = a5 >= b5; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 112, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r4a6 = a6 >= b6; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 113, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r4a7 = a7 >= b7; +>r4a7 : Symbol(r4a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 114, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r4a8 = a8 >= b8; +>r4a8 : Symbol(r4a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 115, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r4a9 = a9 >= b9; +>r4a9 : Symbol(r4a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 116, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r4a10 = a10 >= b10; + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 119, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r4b2 = b2 >= a2; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 120, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r4b3 = b3 >= a3; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 121, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r4b4 = b4 >= a4; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 122, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r4b5 = b5 >= a5; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 123, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r4b6 = b6 >= a6; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 124, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r4b7 = b7 >= a7; +>r4b7 : Symbol(r4b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 125, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r4b8 = b8 >= a8; +>r4b8 : Symbol(r4b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 126, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r4b9 = b9 >= a9; +>r4b9 : Symbol(r4b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 127, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r4b10 = b10 >= a10; + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 131, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r5a2 = a2 == b2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 132, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r5a3 = a3 == b3; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 133, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r5a4 = a4 == b4; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 134, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r5a5 = a5 == b5; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 135, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r5a6 = a6 == b6; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 136, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r5a7 = a7 == b7; +>r5a7 : Symbol(r5a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 137, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r5a8 = a8 == b8; +>r5a8 : Symbol(r5a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 138, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r5a9 = a9 == b9; +>r5a9 : Symbol(r5a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 139, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r5a10 = a10 == b10; + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 142, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r5b2 = b2 == a2; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 143, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r5b3 = b3 == a3; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 144, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r5b4 = b4 == a4; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 145, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r5b5 = b5 == a5; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 146, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r5b6 = b6 == a6; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 147, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r5b7 = b7 == a7; +>r5b7 : Symbol(r5b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 148, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r5b8 = b8 == a8; +>r5b8 : Symbol(r5b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 149, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r5b9 = b9 == a9; +>r5b9 : Symbol(r5b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 150, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r5b10 = b10 == a10; + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 154, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r6a2 = a2 != b2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 155, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r6a3 = a3 != b3; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 156, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r6a4 = a4 != b4; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 157, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r6a5 = a5 != b5; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 158, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r6a6 = a6 != b6; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 159, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r6a7 = a7 != b7; +>r6a7 : Symbol(r6a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 160, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r6a8 = a8 != b8; +>r6a8 : Symbol(r6a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 161, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r6a9 = a9 != b9; +>r6a9 : Symbol(r6a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 162, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r6a10 = a10 != b10; + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 165, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r6b2 = b2 != a2; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 166, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r6b3 = b3 != a3; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 167, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r6b4 = b4 != a4; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 168, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r6b5 = b5 != a5; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 169, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r6b6 = b6 != a6; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 170, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r6b7 = b7 != a7; +>r6b7 : Symbol(r6b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 171, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r6b8 = b8 != a8; +>r6b8 : Symbol(r6b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 172, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r6b9 = b9 != a9; +>r6b9 : Symbol(r6b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 173, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r6b10 = b10 != a10; + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 177, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r7a2 = a2 === b2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 178, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r7a3 = a3 === b3; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 179, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r7a4 = a4 === b4; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 180, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r7a5 = a5 === b5; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 181, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r7a6 = a6 === b6; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 182, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r7a7 = a7 === b7; +>r7a7 : Symbol(r7a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 183, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r7a8 = a8 === b8; +>r7a8 : Symbol(r7a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 184, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r7a9 = a9 === b9; +>r7a9 : Symbol(r7a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 185, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r7a10 = a10 === b10; + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 188, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r7b2 = b2 === a2; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 189, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r7b3 = b3 === a3; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 190, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r7b4 = b4 === a4; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 191, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r7b5 = b5 === a5; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 192, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r7b6 = b6 === a6; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 193, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r7b7 = b7 === a7; +>r7b7 : Symbol(r7b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 194, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r7b8 = b8 === a8; +>r7b8 : Symbol(r7b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 195, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r7b9 = b9 === a9; +>r7b9 : Symbol(r7b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 196, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r7b10 = b10 === a10; + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 200, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) + +var r8a2 = a2 !== b2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 201, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) + +var r8a3 = a3 !== b3; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 202, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) + +var r8a4 = a4 !== b4; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 203, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) + +var r8a5 = a5 !== b5; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 204, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) + +var r8a6 = a6 !== b6; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 205, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) + +var r8a7 = a7 !== b7; +>r8a7 : Symbol(r8a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 206, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) + +var r8a8 = a8 !== b8; +>r8a8 : Symbol(r8a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 207, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) + +var r8a9 = a9 !== b9; +>r8a9 : Symbol(r8a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 208, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) + +//var r8a10 = a10 !== b10; + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 211, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 8, 3)) + +var r8b2 = b2 !== a2; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 212, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 11, 3)) + +var r8b3 = b3 !== a3; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 213, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 14, 3)) + +var r8b4 = b4 !== a4; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 214, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 17, 3)) + +var r8b5 = b5 !== a5; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 215, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 20, 3)) + +var r8b6 = b6 !== a6; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 216, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 23, 3)) + +var r8b7 = b7 !== a7; +>r8b7 : Symbol(r8b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 217, 3)) +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 27, 3)) +>a7 : Symbol(a7, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 26, 3)) + +var r8b8 = b8 !== a8; +>r8b8 : Symbol(r8b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 218, 3)) +>b8 : Symbol(b8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 30, 3)) +>a8 : Symbol(a8, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 29, 3)) + +var r8b9 = b9 !== a9; +>r8b9 : Symbol(r8b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 219, 3)) +>b9 : Symbol(b9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 33, 3)) +>a9 : Symbol(a9, Decl(comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts, 32, 3)) + +//var r8b10 = b10 !== a10; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.symbols new file mode 100644 index 00000000000..be0537baee4 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.symbols @@ -0,0 +1,380 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnIndexSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 4, 28)) +} + +var a1: { [a: string]: string }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 11)) + +var b1: { [b: string]: string }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 11)) + +var a2: { [index: string]: Base }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 11)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 0, 0)) + +var b2: { [index: string]: Derived }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 11)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 2, 1)) + +var a3: { [index: number]: string }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 11)) + +var b3: { [index: number]: string }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 11)) + +var a4: { [index: number]: Base }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 11)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 0, 0)) + +var b4: { [index: string]: Derived }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>index : Symbol(index, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 11)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 2, 1)) + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 21, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 22, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 23, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 24, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r1a1 = a2 < b2; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 21, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 22, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 23, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 24, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r1a1 = a3 < b3; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 21, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 22, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 23, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 24, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r1a1 = a4 < b4; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 21, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 22, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 23, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 24, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 26, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 27, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 28, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 29, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r1b1 = b2 < a2; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 26, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 27, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 28, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 29, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r1b1 = b3 < a3; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 26, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 27, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 28, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 29, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r1b1 = b4 < a4; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 26, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 27, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 28, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 29, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 32, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 33, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 34, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 35, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r2a1 = a2 > b2; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 32, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 33, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 34, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 35, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r2a1 = a3 > b3; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 32, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 33, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 34, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 35, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r2a1 = a4 > b4; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 32, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 33, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 34, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 35, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 37, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 38, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 39, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 40, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r2b1 = b2 > a2; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 37, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 38, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 39, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 40, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r2b1 = b3 > a3; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 37, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 38, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 39, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 40, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r2b1 = b4 > a4; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 37, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 38, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 39, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 40, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 43, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 44, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 45, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 46, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r3a1 = a2 <= b2; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 43, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 44, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 45, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 46, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r3a1 = a3 <= b3; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 43, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 44, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 45, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 46, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r3a1 = a4 <= b4; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 43, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 44, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 45, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 46, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 48, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 49, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 50, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 51, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r3b1 = b2 <= a2; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 48, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 49, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 50, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 51, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r3b1 = b3 <= a3; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 48, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 49, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 50, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 51, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r3b1 = b4 <= a4; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 48, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 49, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 50, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 51, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 54, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 55, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 56, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 57, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r4a1 = a2 >= b2; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 54, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 55, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 56, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 57, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r4a1 = a3 >= b3; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 54, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 55, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 56, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 57, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r4a1 = a4 >= b4; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 54, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 55, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 56, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 57, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 59, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 60, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 61, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 62, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r4b1 = b2 >= a2; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 59, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 60, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 61, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 62, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r4b1 = b3 >= a3; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 59, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 60, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 61, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 62, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r4b1 = b4 >= a4; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 59, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 60, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 61, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 62, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 65, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 66, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 67, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 68, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r5a1 = a2 == b2; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 65, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 66, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 67, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 68, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r5a1 = a3 == b3; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 65, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 66, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 67, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 68, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r5a1 = a4 == b4; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 65, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 66, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 67, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 68, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 70, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 71, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 72, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 73, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r5b1 = b2 == a2; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 70, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 71, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 72, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 73, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r5b1 = b3 == a3; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 70, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 71, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 72, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 73, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r5b1 = b4 == a4; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 70, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 71, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 72, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 73, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 76, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 77, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 78, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 79, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r6a1 = a2 != b2; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 76, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 77, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 78, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 79, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r6a1 = a3 != b3; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 76, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 77, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 78, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 79, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r6a1 = a4 != b4; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 76, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 77, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 78, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 79, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 81, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 82, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 83, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 84, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r6b1 = b2 != a2; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 81, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 82, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 83, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 84, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r6b1 = b3 != a3; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 81, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 82, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 83, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 84, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r6b1 = b4 != a4; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 81, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 82, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 83, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 84, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 87, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 88, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 89, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 90, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r7a1 = a2 === b2; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 87, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 88, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 89, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 90, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r7a1 = a3 === b3; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 87, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 88, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 89, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 90, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r7a1 = a4 === b4; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 87, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 88, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 89, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 90, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 92, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 93, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 94, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 95, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r7b1 = b2 === a2; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 92, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 93, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 94, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 95, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r7b1 = b3 === a3; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 92, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 93, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 94, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 95, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r7b1 = b4 === a4; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 92, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 93, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 94, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 95, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 98, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 99, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 100, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 101, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) + +var r8a1 = a2 !== b2; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 98, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 99, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 100, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 101, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) + +var r8a1 = a3 !== b3; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 98, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 99, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 100, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 101, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) + +var r8a1 = a4 !== b4; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 98, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 99, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 100, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 101, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 103, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 104, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 105, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 106, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 8, 3)) + +var r8b1 = b2 !== a2; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 103, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 104, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 105, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 106, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 11, 3)) + +var r8b1 = b3 !== a3; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 103, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 104, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 105, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 106, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 14, 3)) + +var r8b1 = b4 !== a4; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 103, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 104, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 105, 3), Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 106, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnIndexSignature.ts, 17, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.symbols new file mode 100644 index 00000000000..635f926438f --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.symbols @@ -0,0 +1,631 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 4, 28)) +} + +var a1: { fn(x: T): T }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 13)) + +var b1: { fn(x: string): string }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 13)) + +var a2: { fn(x: T): T }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 13)) + +var b2: { fn(x: string, y: number): string }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 23)) + +var a3: { fn(x: T, y: U): T }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 13)) +>U : Symbol(U, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 19)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 24)) +>U : Symbol(U, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 13)) + +var b3: { fn(x: string, y: number): string }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 23)) + +var a4: { fn(x?: T): T }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 13)) + +var b4: { fn(x?: string): string }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 13)) + +var a5: { fn(...x: T[]): T }; +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 13)) + +var b5: { fn(...x: string[]): string }; +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 13)) + +var a6: { fn(x: T, y: T): T }; +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 21)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 13)) + +var b6: { fn(x: string, y: number): {} }; +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 23)) + +//var a7: { fn(x: T, y: U): T }; +var b7: { fn(x: Base, y: Derived): Base }; +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 27, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 27, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 27, 13)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 0, 0)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 27, 21)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 0, 0)) + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 30, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r1a2 = a2 < b2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 31, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r1a3 = a3 < b3; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 32, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r1a4 = a4 < b4; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 33, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r1a5 = a5 < b5; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 34, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r1a6 = a6 < b6; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 35, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r1a7 = a7 < b7; + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 38, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r1b2 = b2 < a2; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 39, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r1b3 = b3 < a3; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 40, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r1b4 = b4 < a4; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 41, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r1b5 = b5 < a5; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 42, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r1b6 = b6 < a6; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 43, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r1b7 = b7 < a7; + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 47, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r2a2 = a2 > b2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 48, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r2a3 = a3 > b3; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 49, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r2a4 = a4 > b4; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 50, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r2a5 = a5 > b5; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 51, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r2a6 = a6 > b6; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 52, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r2a7 = a7 > b7; + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 55, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r2b2 = b2 > a2; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 56, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r2b3 = b3 > a3; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 57, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r2b4 = b4 > a4; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 58, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r2b5 = b5 > a5; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 59, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r2b6 = b6 > a6; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 60, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r2b7 = b7 > a7; + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 64, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r3a2 = a2 <= b2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 65, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r3a3 = a3 <= b3; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 66, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r3a4 = a4 <= b4; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 67, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r3a5 = a5 <= b5; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 68, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r3a6 = a6 <= b6; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 69, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r3a7 = a7 <= b7; + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 72, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r3b2 = b2 <= a2; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 73, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r3b3 = b3 <= a3; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 74, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r3b4 = b4 <= a4; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 75, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r3b5 = b5 <= a5; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 76, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r3b6 = b6 <= a6; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 77, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r3b7 = b7 <= a7; + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 81, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r4a2 = a2 >= b2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 82, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r4a3 = a3 >= b3; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 83, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r4a4 = a4 >= b4; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 84, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r4a5 = a5 >= b5; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 85, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r4a6 = a6 >= b6; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 86, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r4a7 = a7 >= b7; + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 89, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r4b2 = b2 >= a2; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 90, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r4b3 = b3 >= a3; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 91, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r4b4 = b4 >= a4; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 92, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r4b5 = b5 >= a5; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 93, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r4b6 = b6 >= a6; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 94, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r4b7 = b7 >= a7; + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 98, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r5a2 = a2 == b2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 99, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r5a3 = a3 == b3; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 100, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r5a4 = a4 == b4; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 101, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r5a5 = a5 == b5; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 102, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r5a6 = a6 == b6; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 103, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r5a7 = a7 == b7; + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 106, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r5b2 = b2 == a2; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 107, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r5b3 = b3 == a3; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 108, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r5b4 = b4 == a4; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 109, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r5b5 = b5 == a5; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 110, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r5b6 = b6 == a6; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 111, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r5b7 = b7 == a7; + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 115, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r6a2 = a2 != b2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 116, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r6a3 = a3 != b3; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 117, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r6a4 = a4 != b4; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 118, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r6a5 = a5 != b5; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 119, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r6a6 = a6 != b6; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 120, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r6a7 = a7 != b7; + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 123, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r6b2 = b2 != a2; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 124, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r6b3 = b3 != a3; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 125, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r6b4 = b4 != a4; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 126, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r6b5 = b5 != a5; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 127, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r6b6 = b6 != a6; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 128, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r6b7 = b7 != a7; + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 132, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r7a2 = a2 === b2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 133, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r7a3 = a3 === b3; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 134, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r7a4 = a4 === b4; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 135, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r7a5 = a5 === b5; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 136, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r7a6 = a6 === b6; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 137, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r7a7 = a7 === b7; + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 140, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r7b2 = b2 === a2; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 141, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r7b3 = b3 === a3; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 142, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r7b4 = b4 === a4; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 143, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r7b5 = b5 === a5; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 144, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r7b6 = b6 === a6; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 145, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r7b7 = b7 === a7; + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 149, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) + +var r8a2 = a2 !== b2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 150, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) + +var r8a3 = a3 !== b3; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 151, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) + +var r8a4 = a4 !== b4; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 152, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) + +var r8a5 = a5 !== b5; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 153, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) + +var r8a6 = a6 !== b6; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 154, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) + +//var r8a7 = a7 !== b7; + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 157, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 8, 3)) + +var r8b2 = b2 !== a2; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 158, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 11, 3)) + +var r8b3 = b3 !== a3; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 159, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 14, 3)) + +var r8b4 = b4 !== a4; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 160, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 17, 3)) + +var r8b5 = b5 !== a5; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 161, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 20, 3)) + +var r8b6 = b6 !== a6; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 162, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts, 23, 3)) + +//var r8b7 = b7 !== a7; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.symbols new file mode 100644 index 00000000000..11f28765873 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.symbols @@ -0,0 +1,618 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 4, 28)) +} + +var a1: { new (x: T): T }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 15)) + +var b1: { new (x: string): string }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 15)) + +var a2: { new (x: T): T }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 15)) + +var b2: { new (x: string, y: number): string }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 25)) + +var a3: { new (x: T, y: U): T }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 15)) +>U : Symbol(U, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 17)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 21)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 26)) +>U : Symbol(U, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 17)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 15)) + +var b3: { new (x: string, y: number): string }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 25)) + +var a4: { new (x?: T): T }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 15)) + +var b4: { new (x?: string): string }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 15)) + +var a5: { new (...x: T[]): T }; +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 15)) + +var b5: { new (...x: string[]): string }; +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 15)) + +var a6: { new (x: T, y: T): T }; +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 23)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 15)) + +var b6: { new (x: string, y: number): {} }; +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 25)) + +//var a7: { new (x: T, y: U): T }; +var b7: { new (x: Base, y: Derived): Base }; +>b7 : Symbol(b7, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 27, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 27, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 0, 0)) +>y : Symbol(y, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 27, 23)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 0, 0)) + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 30, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r1a2 = a2 < b2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 31, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r1a3 = a3 < b3; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 32, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r1a4 = a4 < b4; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 33, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r1a5 = a5 < b5; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 34, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r1a6 = a6 < b6; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 35, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r1a7 = a7 < b7; + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 38, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r1b2 = b2 < a2; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 39, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r1b3 = b3 < a3; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 40, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r1b4 = b4 < a4; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 41, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r1b5 = b5 < a5; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 42, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r1b6 = b6 < a6; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 43, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r1b7 = b7 < a7; + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 47, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r2a2 = a2 > b2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 48, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r2a3 = a3 > b3; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 49, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r2a4 = a4 > b4; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 50, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r2a5 = a5 > b5; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 51, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r2a6 = a6 > b6; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 52, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r2a7 = a7 > b7; + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 55, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r2b2 = b2 > a2; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 56, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r2b3 = b3 > a3; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 57, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r2b4 = b4 > a4; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 58, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r2b5 = b5 > a5; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 59, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r2b6 = b6 > a6; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 60, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r2b7 = b7 > a7; + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 64, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r3a2 = a2 <= b2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 65, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r3a3 = a3 <= b3; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 66, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r3a4 = a4 <= b4; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 67, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r3a5 = a5 <= b5; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 68, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r3a6 = a6 <= b6; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 69, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r3a7 = a7 <= b7; + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 72, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r3b2 = b2 <= a2; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 73, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r3b3 = b3 <= a3; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 74, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r3b4 = b4 <= a4; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 75, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r3b5 = b5 <= a5; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 76, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r3b6 = b6 <= a6; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 77, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r3b7 = b7 <= a7; + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 81, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r4a2 = a2 >= b2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 82, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r4a3 = a3 >= b3; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 83, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r4a4 = a4 >= b4; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 84, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r4a5 = a5 >= b5; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 85, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r4a6 = a6 >= b6; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 86, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r4a7 = a7 >= b7; + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 89, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r4b2 = b2 >= a2; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 90, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r4b3 = b3 >= a3; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 91, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r4b4 = b4 >= a4; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 92, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r4b5 = b5 >= a5; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 93, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r4b6 = b6 >= a6; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 94, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r4b7 = b7 >= a7; + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 98, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r5a2 = a2 == b2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 99, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r5a3 = a3 == b3; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 100, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r5a4 = a4 == b4; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 101, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r5a5 = a5 == b5; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 102, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r5a6 = a6 == b6; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 103, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r5a7 = a7 == b7; + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 106, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r5b2 = b2 == a2; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 107, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r5b3 = b3 == a3; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 108, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r5b4 = b4 == a4; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 109, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r5b5 = b5 == a5; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 110, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r5b6 = b6 == a6; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 111, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r5b7 = b7 == a7; + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 115, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r6a2 = a2 != b2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 116, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r6a3 = a3 != b3; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 117, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r6a4 = a4 != b4; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 118, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r6a5 = a5 != b5; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 119, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r6a6 = a6 != b6; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 120, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r6a7 = a7 != b7; + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 123, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r6b2 = b2 != a2; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 124, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r6b3 = b3 != a3; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 125, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r6b4 = b4 != a4; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 126, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r6b5 = b5 != a5; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 127, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r6b6 = b6 != a6; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 128, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r6b7 = b7 != a7; + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 132, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r7a2 = a2 === b2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 133, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r7a3 = a3 === b3; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 134, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r7a4 = a4 === b4; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 135, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r7a5 = a5 === b5; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 136, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r7a6 = a6 === b6; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 137, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r7a7 = a7 === b7; + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 140, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r7b2 = b2 === a2; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 141, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r7b3 = b3 === a3; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 142, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r7b4 = b4 === a4; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 143, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r7b5 = b5 === a5; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 144, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r7b6 = b6 === a6; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 145, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r7b7 = b7 === a7; + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 149, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) + +var r8a2 = a2 !== b2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 150, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r8a3 = a3 !== b3; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 151, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r8a4 = a4 !== b4; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 152, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r8a5 = a5 !== b5; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 153, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r8a6 = a6 !== b6; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 154, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) + +//var r8a7 = a7 !== b7; + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 157, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 9, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 8, 3)) + +var r8b2 = b2 !== a2; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 158, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 12, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 11, 3)) + +var r8b3 = b3 !== a3; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 159, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 15, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 14, 3)) + +var r8b4 = b4 !== a4; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 160, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 18, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 17, 3)) + +var r8b5 = b5 !== a5; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 161, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 21, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 20, 3)) + +var r8b6 = b6 !== a6; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 162, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 24, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts, 23, 3)) + +//var r8b7 = b7 !== a7; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.symbols new file mode 100644 index 00000000000..6c6a3fa3ae2 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts === +interface I { +>I : Symbol(I, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 0, 0)) + + a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 0, 13)) + + b?: number; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 1, 14)) +} + +interface J { +>J : Symbol(J, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 3, 1)) + + a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 5, 13)) +} + +var a: I; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>I : Symbol(I, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 0, 0)) + +var b: J; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>J : Symbol(J, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 3, 1)) + +// operator < +var ra1 = a < b; +>ra1 : Symbol(ra1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 13, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var ra2 = b < a; +>ra2 : Symbol(ra2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 14, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator > +var rb1 = a > b; +>rb1 : Symbol(rb1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 17, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rb2 = b > a; +>rb2 : Symbol(rb2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 18, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator <= +var rc1 = a <= b; +>rc1 : Symbol(rc1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 21, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rc2 = b <= a; +>rc2 : Symbol(rc2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 22, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator >= +var rd1 = a >= b; +>rd1 : Symbol(rd1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 25, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rd2 = b >= a; +>rd2 : Symbol(rd2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 26, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator == +var re1 = a == b; +>re1 : Symbol(re1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 29, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var re2 = b == a; +>re2 : Symbol(re2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 30, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator != +var rf1 = a != b; +>rf1 : Symbol(rf1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 33, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rf2 = b != a; +>rf2 : Symbol(rf2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 34, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator === +var rg1 = a === b; +>rg1 : Symbol(rg1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 37, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rg2 = b === a; +>rg2 : Symbol(rg2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 38, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + +// operator !== +var rh1 = a !== b; +>rh1 : Symbol(rh1, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 41, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) + +var rh2 = b !== a; +>rh2 : Symbol(rh2, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 42, 3)) +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 10, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts, 9, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.symbols b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.symbols new file mode 100644 index 00000000000..52d6e35d65e --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.symbols @@ -0,0 +1,239 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithSubtypeObjectOnProperty.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 4, 28)) +} + +class A1 { +>A1 : Symbol(A1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 6, 1)) + + public a: Base; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 8, 10)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 0)) + + public b: Base; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 9, 19)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 0)) +} + +class B1 { +>B1 : Symbol(B1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 11, 1)) + + public a: Base; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 13, 10)) +>Base : Symbol(Base, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 0, 0)) + + public b: Derived; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 14, 19)) +>Derived : Symbol(Derived, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 2, 1)) +} + +class A2 { +>A2 : Symbol(A2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 16, 1)) + + private a; +>a : Symbol(a, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 18, 10)) +} + +class B2 extends A2 { +>B2 : Symbol(B2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 20, 1)) +>A2 : Symbol(A2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 16, 1)) + + private b; +>b : Symbol(b, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 22, 21)) +} + +var a1: A1; +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>A1 : Symbol(A1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 6, 1)) + +var a2: A2; +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>A2 : Symbol(A2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 16, 1)) + +var b1: B1; +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>B1 : Symbol(B1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 11, 1)) + +var b2: B2; +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>B2 : Symbol(B2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 20, 1)) + +// operator < +var ra1 = a1 < b1; +>ra1 : Symbol(ra1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 32, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var ra2 = a2 < b2; +>ra2 : Symbol(ra2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 33, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var ra3 = b1 < a1; +>ra3 : Symbol(ra3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 34, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var ra4 = b2 < a2; +>ra4 : Symbol(ra4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 35, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator > +var rb1 = a1 > b1; +>rb1 : Symbol(rb1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 38, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rb2 = a2 > b2; +>rb2 : Symbol(rb2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 39, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rb3 = b1 > a1; +>rb3 : Symbol(rb3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 40, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rb4 = b2 > a2; +>rb4 : Symbol(rb4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 41, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator <= +var rc1 = a1 <= b1; +>rc1 : Symbol(rc1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 44, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rc2 = a2 <= b2; +>rc2 : Symbol(rc2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 45, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rc3 = b1 <= a1; +>rc3 : Symbol(rc3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 46, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rc4 = b2 <= a2; +>rc4 : Symbol(rc4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 47, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator >= +var rd1 = a1 >= b1; +>rd1 : Symbol(rd1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 50, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rd2 = a2 >= b2; +>rd2 : Symbol(rd2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 51, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rd3 = b1 >= a1; +>rd3 : Symbol(rd3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 52, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rd4 = b2 >= a2; +>rd4 : Symbol(rd4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 53, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator == +var re1 = a1 == b1; +>re1 : Symbol(re1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 56, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var re2 = a2 == b2; +>re2 : Symbol(re2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 57, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var re3 = b1 == a1; +>re3 : Symbol(re3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 58, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var re4 = b2 == a2; +>re4 : Symbol(re4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 59, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator != +var rf1 = a1 != b1; +>rf1 : Symbol(rf1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 62, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rf2 = a2 != b2; +>rf2 : Symbol(rf2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 63, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rf3 = b1 != a1; +>rf3 : Symbol(rf3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 64, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rf4 = b2 != a2; +>rf4 : Symbol(rf4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 65, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator === +var rg1 = a1 === b1; +>rg1 : Symbol(rg1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 68, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rg2 = a2 === b2; +>rg2 : Symbol(rg2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 69, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rg3 = b1 === a1; +>rg3 : Symbol(rg3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 70, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rg4 = b2 === a2; +>rg4 : Symbol(rg4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 71, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + +// operator !== +var rh1 = a1 !== b1; +>rh1 : Symbol(rh1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 74, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) + +var rh2 = a2 !== b2; +>rh2 : Symbol(rh2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 75, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) + +var rh3 = b1 !== a1; +>rh3 : Symbol(rh3, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 76, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 28, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 26, 3)) + +var rh4 = b2 !== a2; +>rh4 : Symbol(rh4, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 77, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 29, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithSubtypeObjectOnProperty.ts, 27, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.symbols b/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.symbols new file mode 100644 index 00000000000..9d6c0a9ca03 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.symbols @@ -0,0 +1,44 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithTwoOperandsAreAny.ts === +var a: any; +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r1 = a < a; +>r1 : Symbol(r1, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 2, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r2 = a > a; +>r2 : Symbol(r2, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 3, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r3 = a <= a; +>r3 : Symbol(r3, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 4, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r4 = a >= a; +>r4 : Symbol(r4, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 5, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r5 = a == a; +>r5 : Symbol(r5, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 6, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r6 = a != a; +>r6 : Symbol(r6, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 7, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r7 = a === a; +>r7 : Symbol(r7, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 8, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + +var r8 = a !== a; +>r8 : Symbol(r8, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 9, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) +>a : Symbol(a, Decl(comparisonOperatorWithTwoOperandsAreAny.ts, 0, 3)) + diff --git a/tests/baselines/reference/complexClassRelationships.symbols b/tests/baselines/reference/complexClassRelationships.symbols new file mode 100644 index 00000000000..533c5171cf8 --- /dev/null +++ b/tests/baselines/reference/complexClassRelationships.symbols @@ -0,0 +1,117 @@ +=== tests/cases/compiler/complexClassRelationships.ts === +// There should be no errors in this file +class Derived extends Base { +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) +>Base : Symbol(Base, Decl(complexClassRelationships.ts, 11, 1)) + + public static createEmpty(): Derived { +>createEmpty : Symbol(Derived.createEmpty, Decl(complexClassRelationships.ts, 1, 28)) +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) + + var item = new Derived(); +>item : Symbol(item, Decl(complexClassRelationships.ts, 3, 11)) +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) + + return item; +>item : Symbol(item, Decl(complexClassRelationships.ts, 3, 11)) + } +} +class BaseCollection { +>BaseCollection : Symbol(BaseCollection, Decl(complexClassRelationships.ts, 6, 1)) +>T : Symbol(T, Decl(complexClassRelationships.ts, 7, 21)) +>Base : Symbol(Base, Decl(complexClassRelationships.ts, 11, 1)) + + constructor(f: () => T) { +>f : Symbol(f, Decl(complexClassRelationships.ts, 8, 16)) +>T : Symbol(T, Decl(complexClassRelationships.ts, 7, 21)) + + (item: Thing) => { return [item.Components]; }; +>item : Symbol(item, Decl(complexClassRelationships.ts, 9, 9)) +>Thing : Symbol(Thing, Decl(complexClassRelationships.ts, 14, 1)) +>item.Components : Symbol(Thing.Components, Decl(complexClassRelationships.ts, 16, 13)) +>item : Symbol(item, Decl(complexClassRelationships.ts, 9, 9)) +>Components : Symbol(Thing.Components, Decl(complexClassRelationships.ts, 16, 13)) + } +} +class Base { +>Base : Symbol(Base, Decl(complexClassRelationships.ts, 11, 1)) + + ownerCollection: BaseCollection; +>ownerCollection : Symbol(ownerCollection, Decl(complexClassRelationships.ts, 12, 12)) +>BaseCollection : Symbol(BaseCollection, Decl(complexClassRelationships.ts, 6, 1)) +>Base : Symbol(Base, Decl(complexClassRelationships.ts, 11, 1)) +} + +class Thing { +>Thing : Symbol(Thing, Decl(complexClassRelationships.ts, 14, 1)) + + public get Components(): ComponentCollection { return null } +>Components : Symbol(Components, Decl(complexClassRelationships.ts, 16, 13)) +>ComponentCollection : Symbol(ComponentCollection, Decl(complexClassRelationships.ts, 18, 1)) +} + +class ComponentCollection { +>ComponentCollection : Symbol(ComponentCollection, Decl(complexClassRelationships.ts, 18, 1)) +>T : Symbol(T, Decl(complexClassRelationships.ts, 20, 26)) + + private static sortComponents(p: Foo) { +>sortComponents : Symbol(ComponentCollection.sortComponents, Decl(complexClassRelationships.ts, 20, 30)) +>p : Symbol(p, Decl(complexClassRelationships.ts, 21, 34)) +>Foo : Symbol(Foo, Decl(complexClassRelationships.ts, 24, 1)) + + return p.prop1; +>p.prop1 : Symbol(Foo.prop1, Decl(complexClassRelationships.ts, 26, 11)) +>p : Symbol(p, Decl(complexClassRelationships.ts, 21, 34)) +>prop1 : Symbol(Foo.prop1, Decl(complexClassRelationships.ts, 26, 11)) + } +} + +class Foo { +>Foo : Symbol(Foo, Decl(complexClassRelationships.ts, 24, 1)) + + public get prop1() { +>prop1 : Symbol(prop1, Decl(complexClassRelationships.ts, 26, 11)) + + return new GenericType(this); +>GenericType : Symbol(GenericType, Decl(complexClassRelationships.ts, 36, 1)) +>this : Symbol(Foo, Decl(complexClassRelationships.ts, 24, 1)) + } + public populate() { +>populate : Symbol(populate, Decl(complexClassRelationships.ts, 29, 5)) + + this.prop2; +>this.prop2 : Symbol(prop2, Decl(complexClassRelationships.ts, 32, 5)) +>this : Symbol(Foo, Decl(complexClassRelationships.ts, 24, 1)) +>prop2 : Symbol(prop2, Decl(complexClassRelationships.ts, 32, 5)) + } + public get prop2(): BaseCollection { +>prop2 : Symbol(prop2, Decl(complexClassRelationships.ts, 32, 5)) +>BaseCollection : Symbol(BaseCollection, Decl(complexClassRelationships.ts, 6, 1)) +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) + + return new BaseCollection(Derived.createEmpty); +>BaseCollection : Symbol(BaseCollection, Decl(complexClassRelationships.ts, 6, 1)) +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) +>Derived.createEmpty : Symbol(Derived.createEmpty, Decl(complexClassRelationships.ts, 1, 28)) +>Derived : Symbol(Derived, Decl(complexClassRelationships.ts, 0, 0)) +>createEmpty : Symbol(Derived.createEmpty, Decl(complexClassRelationships.ts, 1, 28)) + } +} + +class GenericType { +>GenericType : Symbol(GenericType, Decl(complexClassRelationships.ts, 36, 1)) +>T : Symbol(T, Decl(complexClassRelationships.ts, 38, 18)) + + constructor(parent: FooBase) { } +>parent : Symbol(parent, Decl(complexClassRelationships.ts, 39, 16)) +>FooBase : Symbol(FooBase, Decl(complexClassRelationships.ts, 40, 1)) +} + +class FooBase { +>FooBase : Symbol(FooBase, Decl(complexClassRelationships.ts, 40, 1)) + + public populate() { +>populate : Symbol(populate, Decl(complexClassRelationships.ts, 42, 15)) + + } +} diff --git a/tests/baselines/reference/complexClassRelationships.types b/tests/baselines/reference/complexClassRelationships.types index 69bee9caade..43d0232e30a 100644 --- a/tests/baselines/reference/complexClassRelationships.types +++ b/tests/baselines/reference/complexClassRelationships.types @@ -51,6 +51,7 @@ class Thing { public get Components(): ComponentCollection { return null } >Components : ComponentCollection >ComponentCollection : ComponentCollection +>null : null } class ComponentCollection { diff --git a/tests/baselines/reference/compositeGenericFunction.symbols b/tests/baselines/reference/compositeGenericFunction.symbols new file mode 100644 index 00000000000..520f1eaf4ca --- /dev/null +++ b/tests/baselines/reference/compositeGenericFunction.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/compositeGenericFunction.ts === +function f(value: T) { return value; }; +>f : Symbol(f, Decl(compositeGenericFunction.ts, 0, 0)) +>T : Symbol(T, Decl(compositeGenericFunction.ts, 0, 11)) +>value : Symbol(value, Decl(compositeGenericFunction.ts, 0, 14)) +>T : Symbol(T, Decl(compositeGenericFunction.ts, 0, 11)) +>value : Symbol(value, Decl(compositeGenericFunction.ts, 0, 14)) + +function h(func: (x: number) => R): R { return null; } +>h : Symbol(h, Decl(compositeGenericFunction.ts, 0, 42)) +>R : Symbol(R, Decl(compositeGenericFunction.ts, 2, 11)) +>func : Symbol(func, Decl(compositeGenericFunction.ts, 2, 14)) +>x : Symbol(x, Decl(compositeGenericFunction.ts, 2, 21)) +>R : Symbol(R, Decl(compositeGenericFunction.ts, 2, 11)) +>R : Symbol(R, Decl(compositeGenericFunction.ts, 2, 11)) + +var z: number = h(f); +>z : Symbol(z, Decl(compositeGenericFunction.ts, 4, 3), Decl(compositeGenericFunction.ts, 5, 3)) +>h : Symbol(h, Decl(compositeGenericFunction.ts, 0, 42)) +>f : Symbol(f, Decl(compositeGenericFunction.ts, 0, 0)) + +var z: number = h(f); +>z : Symbol(z, Decl(compositeGenericFunction.ts, 4, 3), Decl(compositeGenericFunction.ts, 5, 3)) +>h : Symbol(h, Decl(compositeGenericFunction.ts, 0, 42)) +>f : Symbol(f, Decl(compositeGenericFunction.ts, 0, 0)) + diff --git a/tests/baselines/reference/compositeGenericFunction.types b/tests/baselines/reference/compositeGenericFunction.types index 421b7bbe514..1957c3bb62d 100644 --- a/tests/baselines/reference/compositeGenericFunction.types +++ b/tests/baselines/reference/compositeGenericFunction.types @@ -13,6 +13,7 @@ function h(func: (x: number) => R): R { return null; } >x : number >R : R >R : R +>null : null var z: number = h(f); >z : number diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.symbols b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.symbols new file mode 100644 index 00000000000..cb2a0975e0b --- /dev/null +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.symbols @@ -0,0 +1,155 @@ +=== tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCanBeAssigned.ts === +enum E { a, b } +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) +>b : Symbol(E.b, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 11)) + +var a: any; +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +var b: void; +>b : Symbol(b, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 3, 3)) + +var x1: any; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += a; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x1 += b; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) +>b : Symbol(b, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 3, 3)) + +x1 += true; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += 0; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += ''; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += E.a; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) +>E.a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) + +x1 += {}; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += null; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) + +x1 += undefined; +>x1 : Symbol(x1, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 5, 3)) +>undefined : Symbol(undefined) + +var x2: string; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += a; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x2 += b; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) +>b : Symbol(b, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 3, 3)) + +x2 += true; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += 0; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += ''; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += E.a; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) +>E.a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) + +x2 += {}; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += null; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) + +x2 += undefined; +>x2 : Symbol(x2, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 16, 3)) +>undefined : Symbol(undefined) + +var x3: number; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) + +x3 += a; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x3 += 0; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) + +x3 += E.a; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) +>E.a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) + +x3 += null; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) + +x3 += undefined; +>x3 : Symbol(x3, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 27, 3)) +>undefined : Symbol(undefined) + +var x4: E; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) + +x4 += a; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x4 += 0; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) + +x4 += E.a; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) +>E.a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) +>E : Symbol(E, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 0, 8)) + +x4 += null; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) + +x4 += undefined; +>x4 : Symbol(x4, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 34, 3)) +>undefined : Symbol(undefined) + +var x5: boolean; +>x5 : Symbol(x5, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 41, 3)) + +x5 += a; +>x5 : Symbol(x5, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 41, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +var x6: {}; +>x6 : Symbol(x6, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 44, 3)) + +x6 += a; +>x6 : Symbol(x6, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 44, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x6 += ''; +>x6 : Symbol(x6, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 44, 3)) + +var x7: void; +>x7 : Symbol(x7, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 48, 3)) + +x7 += a; +>x7 : Symbol(x7, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 48, 3)) +>a : Symbol(a, Decl(compoundAdditionAssignmentLHSCanBeAssigned.ts, 2, 3)) + diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types index 7b776389335..e40422450b4 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types @@ -26,14 +26,17 @@ x1 += b; x1 += true; >x1 += true : any >x1 : any +>true : boolean x1 += 0; >x1 += 0 : any >x1 : any +>0 : number x1 += ''; >x1 += '' : string >x1 : any +>'' : string x1 += E.a; >x1 += E.a : any @@ -50,6 +53,7 @@ x1 += {}; x1 += null; >x1 += null : any >x1 : any +>null : null x1 += undefined; >x1 += undefined : any @@ -72,14 +76,17 @@ x2 += b; x2 += true; >x2 += true : string >x2 : string +>true : boolean x2 += 0; >x2 += 0 : string >x2 : string +>0 : number x2 += ''; >x2 += '' : string >x2 : string +>'' : string x2 += E.a; >x2 += E.a : string @@ -96,6 +103,7 @@ x2 += {}; x2 += null; >x2 += null : string >x2 : string +>null : null x2 += undefined; >x2 += undefined : string @@ -113,6 +121,7 @@ x3 += a; x3 += 0; >x3 += 0 : number >x3 : number +>0 : number x3 += E.a; >x3 += E.a : number @@ -124,6 +133,7 @@ x3 += E.a; x3 += null; >x3 += null : number >x3 : number +>null : null x3 += undefined; >x3 += undefined : number @@ -142,6 +152,7 @@ x4 += a; x4 += 0; >x4 += 0 : number >x4 : E +>0 : number x4 += E.a; >x4 += E.a : number @@ -153,6 +164,7 @@ x4 += E.a; x4 += null; >x4 += null : number >x4 : E +>null : null x4 += undefined; >x4 += undefined : number @@ -178,6 +190,7 @@ x6 += a; x6 += ''; >x6 += '' : string >x6 : {} +>'' : string var x7: void; >x7 : void diff --git a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.symbols b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.symbols new file mode 100644 index 00000000000..b9d131217c9 --- /dev/null +++ b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.symbols @@ -0,0 +1,84 @@ +=== tests/cases/conformance/expressions/assignmentOperator/compoundArithmeticAssignmentLHSCanBeAssigned.ts === +enum E { a, b, c } +>E : Symbol(E, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 0)) +>a : Symbol(E.a, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 8)) +>b : Symbol(E.b, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 11)) +>c : Symbol(E.c, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 14)) + +var a: any; +>a : Symbol(a, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 2, 3)) + +var b: number; +>b : Symbol(b, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 3, 3)) + +var c: E; +>c : Symbol(c, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 4, 3)) +>E : Symbol(E, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 0)) + +var x1: any; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) + +x1 *= a; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) +>a : Symbol(a, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x1 *= b; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) +>b : Symbol(b, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 3, 3)) + +x1 *= c; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) +>c : Symbol(c, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 4, 3)) + +x1 *= null; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) + +x1 *= undefined; +>x1 : Symbol(x1, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 6, 3)) +>undefined : Symbol(undefined) + +var x2: number; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) + +x2 *= a; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) +>a : Symbol(a, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x2 *= b; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) +>b : Symbol(b, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 3, 3)) + +x2 *= c; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) +>c : Symbol(c, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 4, 3)) + +x2 *= null; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) + +x2 *= undefined; +>x2 : Symbol(x2, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 13, 3)) +>undefined : Symbol(undefined) + +var x3: E; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) +>E : Symbol(E, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 0, 0)) + +x3 *= a; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) +>a : Symbol(a, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 2, 3)) + +x3 *= b; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) +>b : Symbol(b, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 3, 3)) + +x3 *= c; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) +>c : Symbol(c, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 4, 3)) + +x3 *= null; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) + +x3 *= undefined; +>x3 : Symbol(x3, Decl(compoundArithmeticAssignmentLHSCanBeAssigned.ts, 20, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types index c4345b97413..3b346bac53b 100644 --- a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types +++ b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.types @@ -36,6 +36,7 @@ x1 *= c; x1 *= null; >x1 *= null : number >x1 : any +>null : null x1 *= undefined; >x1 *= undefined : number @@ -63,6 +64,7 @@ x2 *= c; x2 *= null; >x2 *= null : number >x2 : number +>null : null x2 *= undefined; >x2 *= undefined : number @@ -91,6 +93,7 @@ x3 *= c; x3 *= null; >x3 *= null : number >x3 : E +>null : null x3 *= undefined; >x3 *= undefined : number diff --git a/tests/baselines/reference/compoundAssignmentLHSIsReference.symbols b/tests/baselines/reference/compoundAssignmentLHSIsReference.symbols new file mode 100644 index 00000000000..e7c19e4d781 --- /dev/null +++ b/tests/baselines/reference/compoundAssignmentLHSIsReference.symbols @@ -0,0 +1,100 @@ +=== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsReference.ts === +var value; +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +// identifiers: variable and parameter +var x1: number; +>x1 : Symbol(x1, Decl(compoundAssignmentLHSIsReference.ts, 3, 3)) + +x1 *= value; +>x1 : Symbol(x1, Decl(compoundAssignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +x1 += value; +>x1 : Symbol(x1, Decl(compoundAssignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +function fn1(x2: number) { +>fn1 : Symbol(fn1, Decl(compoundAssignmentLHSIsReference.ts, 5, 12)) +>x2 : Symbol(x2, Decl(compoundAssignmentLHSIsReference.ts, 7, 13)) + + x2 *= value; +>x2 : Symbol(x2, Decl(compoundAssignmentLHSIsReference.ts, 7, 13)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + + x2 += value; +>x2 : Symbol(x2, Decl(compoundAssignmentLHSIsReference.ts, 7, 13)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) +} + +// property accesses +var x3: { a: number }; +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) + +x3.a *= value; +>x3.a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +x3.a += value; +>x3.a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +x3['a'] *= value; +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>'a' : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +x3['a'] += value; +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>'a' : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +// parentheses, the contained expression is reference +(x1) *= value; +>x1 : Symbol(x1, Decl(compoundAssignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +(x1) += value; +>x1 : Symbol(x1, Decl(compoundAssignmentLHSIsReference.ts, 3, 3)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +function fn2(x4: number) { +>fn2 : Symbol(fn2, Decl(compoundAssignmentLHSIsReference.ts, 22, 14)) +>x4 : Symbol(x4, Decl(compoundAssignmentLHSIsReference.ts, 24, 13)) + + (x4) *= value; +>x4 : Symbol(x4, Decl(compoundAssignmentLHSIsReference.ts, 24, 13)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + + (x4) += value; +>x4 : Symbol(x4, Decl(compoundAssignmentLHSIsReference.ts, 24, 13)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) +} + +(x3.a) *= value; +>x3.a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +(x3.a) += value; +>x3.a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>a : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +(x3['a']) *= value; +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>'a' : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + +(x3['a']) += value; +>x3 : Symbol(x3, Decl(compoundAssignmentLHSIsReference.ts, 13, 3)) +>'a' : Symbol(a, Decl(compoundAssignmentLHSIsReference.ts, 13, 9)) +>value : Symbol(value, Decl(compoundAssignmentLHSIsReference.ts, 0, 3)) + diff --git a/tests/baselines/reference/compoundAssignmentLHSIsReference.types b/tests/baselines/reference/compoundAssignmentLHSIsReference.types index e30cf19f3e3..12c601d377f 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsReference.types +++ b/tests/baselines/reference/compoundAssignmentLHSIsReference.types @@ -54,12 +54,14 @@ x3['a'] *= value; >x3['a'] *= value : number >x3['a'] : number >x3 : { a: number; } +>'a' : string >value : any x3['a'] += value; >x3['a'] += value : any >x3['a'] : number >x3 : { a: number; } +>'a' : string >value : any // parentheses, the contained expression is reference @@ -113,6 +115,7 @@ function fn2(x4: number) { >(x3['a']) : number >x3['a'] : number >x3 : { a: number; } +>'a' : string >value : any (x3['a']) += value; @@ -120,5 +123,6 @@ function fn2(x4: number) { >(x3['a']) : number >x3['a'] : number >x3 : { a: number; } +>'a' : string >value : any diff --git a/tests/baselines/reference/compoundVarDecl1.symbols b/tests/baselines/reference/compoundVarDecl1.symbols new file mode 100644 index 00000000000..d76571f6f44 --- /dev/null +++ b/tests/baselines/reference/compoundVarDecl1.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/compoundVarDecl1.ts === +module Foo { var a = 1, b = 1; a = b + 2; } +>Foo : Symbol(Foo, Decl(compoundVarDecl1.ts, 0, 0)) +>a : Symbol(a, Decl(compoundVarDecl1.ts, 0, 16)) +>b : Symbol(b, Decl(compoundVarDecl1.ts, 0, 23)) +>a : Symbol(a, Decl(compoundVarDecl1.ts, 0, 16)) +>b : Symbol(b, Decl(compoundVarDecl1.ts, 0, 23)) + +var foo = 4, bar = 5; +>foo : Symbol(foo, Decl(compoundVarDecl1.ts, 2, 3)) +>bar : Symbol(bar, Decl(compoundVarDecl1.ts, 2, 12)) + diff --git a/tests/baselines/reference/compoundVarDecl1.types b/tests/baselines/reference/compoundVarDecl1.types index e9a04bff9b2..40f12ea52c0 100644 --- a/tests/baselines/reference/compoundVarDecl1.types +++ b/tests/baselines/reference/compoundVarDecl1.types @@ -2,13 +2,18 @@ module Foo { var a = 1, b = 1; a = b + 2; } >Foo : typeof Foo >a : number +>1 : number >b : number +>1 : number >a = b + 2 : number >a : number >b + 2 : number >b : number +>2 : number var foo = 4, bar = 5; >foo : number +>4 : number >bar : number +>5 : number diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.symbols b/tests/baselines/reference/computedPropertyNames10_ES5.symbols new file mode 100644 index 00000000000..17d1f7ca117 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames10_ES5.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES5.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames10_ES5.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames10_ES5.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames10_ES5.ts, 3, 3)) + + [s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) + + [n]() { }, +>n : Symbol(n, Decl(computedPropertyNames10_ES5.ts, 1, 3)) + + [s + s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) + + [s + n]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames10_ES5.ts, 1, 3)) + + [+s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) + + [""]() { }, + [0]() { }, + [a]() { }, +>a : Symbol(a, Decl(computedPropertyNames10_ES5.ts, 2, 3)) + + [true]() { }, + [`hello bye`]() { }, + [`hello ${a} bye`]() { } +>a : Symbol(a, Decl(computedPropertyNames10_ES5.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.types b/tests/baselines/reference/computedPropertyNames10_ES5.types index cb49d5c3384..87648c1ed80 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.types +++ b/tests/baselines/reference/computedPropertyNames10_ES5.types @@ -33,14 +33,22 @@ var v = { >s : string [""]() { }, +>"" : string + [0]() { }, +>0 : number + [a]() { }, >a : any [true]() { }, >true : any +>true : boolean [`hello bye`]() { }, +>`hello bye` : string + [`hello ${a} bye`]() { } +>`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.symbols b/tests/baselines/reference/computedPropertyNames10_ES6.symbols new file mode 100644 index 00000000000..4141b787208 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames10_ES6.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames10_ES6.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames10_ES6.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames10_ES6.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames10_ES6.ts, 3, 3)) + + [s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) + + [n]() { }, +>n : Symbol(n, Decl(computedPropertyNames10_ES6.ts, 1, 3)) + + [s + s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) + + [s + n]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames10_ES6.ts, 1, 3)) + + [+s]() { }, +>s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) + + [""]() { }, + [0]() { }, + [a]() { }, +>a : Symbol(a, Decl(computedPropertyNames10_ES6.ts, 2, 3)) + + [true]() { }, + [`hello bye`]() { }, + [`hello ${a} bye`]() { } +>a : Symbol(a, Decl(computedPropertyNames10_ES6.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.types b/tests/baselines/reference/computedPropertyNames10_ES6.types index 5dcc4783b5e..996dfc99fe9 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.types +++ b/tests/baselines/reference/computedPropertyNames10_ES6.types @@ -33,14 +33,22 @@ var v = { >s : string [""]() { }, +>"" : string + [0]() { }, +>0 : number + [a]() { }, >a : any [true]() { }, >true : any +>true : boolean [`hello bye`]() { }, +>`hello bye` : string + [`hello ${a} bye`]() { } +>`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.symbols b/tests/baselines/reference/computedPropertyNames11_ES5.symbols new file mode 100644 index 00000000000..34326273e59 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames11_ES5.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES5.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames11_ES5.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames11_ES5.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 3, 3)) + + get [s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) + + set [n](v) { }, +>n : Symbol(n, Decl(computedPropertyNames11_ES5.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 5, 12)) + + get [s + s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) + + set [s + n](v) { }, +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames11_ES5.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 7, 16)) + + get [+s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) + + set [""](v) { }, +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 9, 13)) + + get [0]() { return 0; }, + set [a](v) { }, +>a : Symbol(a, Decl(computedPropertyNames11_ES5.ts, 2, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 11, 12)) + + get [true]() { return 0; }, + set [`hello bye`](v) { }, +>v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 13, 22)) + + get [`hello ${a} bye`]() { return 0; } +>a : Symbol(a, Decl(computedPropertyNames11_ES5.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.types b/tests/baselines/reference/computedPropertyNames11_ES5.types index ed3c51302b7..c3c59c2eb9c 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.types +++ b/tests/baselines/reference/computedPropertyNames11_ES5.types @@ -14,6 +14,7 @@ var v = { get [s]() { return 0; }, >s : string +>0 : number set [n](v) { }, >n : number @@ -23,6 +24,7 @@ var v = { >s + s : string >s : string >s : string +>0 : number set [s + n](v) { }, >s + n : string @@ -33,21 +35,31 @@ var v = { get [+s]() { return 0; }, >+s : number >s : string +>0 : number set [""](v) { }, +>"" : string >v : any get [0]() { return 0; }, +>0 : number +>0 : number + set [a](v) { }, >a : any >v : any get [true]() { return 0; }, >true : any +>true : boolean +>0 : number set [`hello bye`](v) { }, +>`hello bye` : string >v : any get [`hello ${a} bye`]() { return 0; } +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.symbols b/tests/baselines/reference/computedPropertyNames11_ES6.symbols new file mode 100644 index 00000000000..73503eb2758 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames11_ES6.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames11_ES6.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames11_ES6.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames11_ES6.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 3, 3)) + + get [s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) + + set [n](v) { }, +>n : Symbol(n, Decl(computedPropertyNames11_ES6.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 5, 12)) + + get [s + s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) + + set [s + n](v) { }, +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames11_ES6.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 7, 16)) + + get [+s]() { return 0; }, +>s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) + + set [""](v) { }, +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 9, 13)) + + get [0]() { return 0; }, + set [a](v) { }, +>a : Symbol(a, Decl(computedPropertyNames11_ES6.ts, 2, 3)) +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 11, 12)) + + get [true]() { return 0; }, + set [`hello bye`](v) { }, +>v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 13, 22)) + + get [`hello ${a} bye`]() { return 0; } +>a : Symbol(a, Decl(computedPropertyNames11_ES6.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.types b/tests/baselines/reference/computedPropertyNames11_ES6.types index a0b9e6eb99e..ef11511baae 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.types +++ b/tests/baselines/reference/computedPropertyNames11_ES6.types @@ -14,6 +14,7 @@ var v = { get [s]() { return 0; }, >s : string +>0 : number set [n](v) { }, >n : number @@ -23,6 +24,7 @@ var v = { >s + s : string >s : string >s : string +>0 : number set [s + n](v) { }, >s + n : string @@ -33,21 +35,31 @@ var v = { get [+s]() { return 0; }, >+s : number >s : string +>0 : number set [""](v) { }, +>"" : string >v : any get [0]() { return 0; }, +>0 : number +>0 : number + set [a](v) { }, >a : any >v : any get [true]() { return 0; }, >true : any +>true : boolean +>0 : number set [`hello bye`](v) { }, +>`hello bye` : string >v : any get [`hello ${a} bye`]() { return 0; } +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.symbols b/tests/baselines/reference/computedPropertyNames13_ES5.symbols new file mode 100644 index 00000000000..ea2e1b025e5 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames13_ES5.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES5.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames13_ES5.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames13_ES5.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames13_ES5.ts, 2, 11)) + + [s]() {} +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) + + [n]() { } +>n : Symbol(n, Decl(computedPropertyNames13_ES5.ts, 1, 3)) + + static [s + s]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) + + [s + n]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames13_ES5.ts, 1, 3)) + + [+s]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) + + static [""]() { } + [0]() { } + [a]() { } +>a : Symbol(a, Decl(computedPropertyNames13_ES5.ts, 2, 3)) + + static [true]() { } + [`hello bye`]() { } + static [`hello ${a} bye`]() { } +>a : Symbol(a, Decl(computedPropertyNames13_ES5.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.types b/tests/baselines/reference/computedPropertyNames13_ES5.types index ff98a3189a7..59694df32a7 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.types +++ b/tests/baselines/reference/computedPropertyNames13_ES5.types @@ -32,14 +32,22 @@ class C { >s : string static [""]() { } +>"" : string + [0]() { } +>0 : number + [a]() { } >a : any static [true]() { } >true : any +>true : boolean [`hello bye`]() { } +>`hello bye` : string + static [`hello ${a} bye`]() { } +>`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.symbols b/tests/baselines/reference/computedPropertyNames13_ES6.symbols new file mode 100644 index 00000000000..21f7700acef --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames13_ES6.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames13_ES6.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames13_ES6.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames13_ES6.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames13_ES6.ts, 2, 11)) + + [s]() {} +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) + + [n]() { } +>n : Symbol(n, Decl(computedPropertyNames13_ES6.ts, 1, 3)) + + static [s + s]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) + + [s + n]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames13_ES6.ts, 1, 3)) + + [+s]() { } +>s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) + + static [""]() { } + [0]() { } + [a]() { } +>a : Symbol(a, Decl(computedPropertyNames13_ES6.ts, 2, 3)) + + static [true]() { } + [`hello bye`]() { } + static [`hello ${a} bye`]() { } +>a : Symbol(a, Decl(computedPropertyNames13_ES6.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.types b/tests/baselines/reference/computedPropertyNames13_ES6.types index 78b2f3afc4a..a2d0f14e72c 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES6.types +++ b/tests/baselines/reference/computedPropertyNames13_ES6.types @@ -32,14 +32,22 @@ class C { >s : string static [""]() { } +>"" : string + [0]() { } +>0 : number + [a]() { } >a : any static [true]() { } >true : any +>true : boolean [`hello bye`]() { } +>`hello bye` : string + static [`hello ${a} bye`]() { } +>`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.symbols b/tests/baselines/reference/computedPropertyNames16_ES5.symbols new file mode 100644 index 00000000000..62450e0aa4a --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames16_ES5.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES5.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames16_ES5.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames16_ES5.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames16_ES5.ts, 2, 11)) + + get [s]() { return 0;} +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) + + set [n](v) { } +>n : Symbol(n, Decl(computedPropertyNames16_ES5.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 5, 12)) + + static get [s + s]() { return 0; } +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) + + set [s + n](v) { } +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames16_ES5.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 7, 16)) + + get [+s]() { return 0; } +>s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) + + static set [""](v) { } +>v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 9, 20)) + + get [0]() { return 0; } + set [a](v) { } +>a : Symbol(a, Decl(computedPropertyNames16_ES5.ts, 2, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 11, 12)) + + static get [true]() { return 0; } + set [`hello bye`](v) { } +>v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 13, 22)) + + get [`hello ${a} bye`]() { return 0; } +>a : Symbol(a, Decl(computedPropertyNames16_ES5.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.types b/tests/baselines/reference/computedPropertyNames16_ES5.types index 3914093c766..ab7ea23cffe 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.types +++ b/tests/baselines/reference/computedPropertyNames16_ES5.types @@ -13,6 +13,7 @@ class C { get [s]() { return 0;} >s : string +>0 : number set [n](v) { } >n : number @@ -22,6 +23,7 @@ class C { >s + s : string >s : string >s : string +>0 : number set [s + n](v) { } >s + n : string @@ -32,21 +34,31 @@ class C { get [+s]() { return 0; } >+s : number >s : string +>0 : number static set [""](v) { } +>"" : string >v : any get [0]() { return 0; } +>0 : number +>0 : number + set [a](v) { } >a : any >v : any static get [true]() { return 0; } >true : any +>true : boolean +>0 : number set [`hello bye`](v) { } +>`hello bye` : string >v : any get [`hello ${a} bye`]() { return 0; } +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.symbols b/tests/baselines/reference/computedPropertyNames16_ES6.symbols new file mode 100644 index 00000000000..dc241f67547 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames16_ES6.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames16_ES6.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames16_ES6.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames16_ES6.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames16_ES6.ts, 2, 11)) + + get [s]() { return 0;} +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) + + set [n](v) { } +>n : Symbol(n, Decl(computedPropertyNames16_ES6.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 5, 12)) + + static get [s + s]() { return 0; } +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) + + set [s + n](v) { } +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames16_ES6.ts, 1, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 7, 16)) + + get [+s]() { return 0; } +>s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) + + static set [""](v) { } +>v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 9, 20)) + + get [0]() { return 0; } + set [a](v) { } +>a : Symbol(a, Decl(computedPropertyNames16_ES6.ts, 2, 3)) +>v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 11, 12)) + + static get [true]() { return 0; } + set [`hello bye`](v) { } +>v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 13, 22)) + + get [`hello ${a} bye`]() { return 0; } +>a : Symbol(a, Decl(computedPropertyNames16_ES6.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.types b/tests/baselines/reference/computedPropertyNames16_ES6.types index 6503c75037d..c7286e6640e 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES6.types +++ b/tests/baselines/reference/computedPropertyNames16_ES6.types @@ -13,6 +13,7 @@ class C { get [s]() { return 0;} >s : string +>0 : number set [n](v) { } >n : number @@ -22,6 +23,7 @@ class C { >s + s : string >s : string >s : string +>0 : number set [s + n](v) { } >s + n : string @@ -32,21 +34,31 @@ class C { get [+s]() { return 0; } >+s : number >s : string +>0 : number static set [""](v) { } +>"" : string >v : any get [0]() { return 0; } +>0 : number +>0 : number + set [a](v) { } >a : any >v : any static get [true]() { return 0; } >true : any +>true : boolean +>0 : number set [`hello bye`](v) { } +>`hello bye` : string >v : any get [`hello ${a} bye`]() { return 0; } +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.symbols b/tests/baselines/reference/computedPropertyNames18_ES5.symbols new file mode 100644 index 00000000000..86d706bc44c --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames18_ES5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames18_ES5.ts === +function foo() { +>foo : Symbol(foo, Decl(computedPropertyNames18_ES5.ts, 0, 0)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames18_ES5.ts, 1, 7)) + + [this.bar]: 0 + } +} diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.types b/tests/baselines/reference/computedPropertyNames18_ES5.types index 732de08e2d6..c60ab32d3f8 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5.types +++ b/tests/baselines/reference/computedPropertyNames18_ES5.types @@ -10,5 +10,6 @@ function foo() { >this.bar : any >this : any >bar : any +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.symbols b/tests/baselines/reference/computedPropertyNames18_ES6.symbols new file mode 100644 index 00000000000..c530d1e811f --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames18_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames18_ES6.ts === +function foo() { +>foo : Symbol(foo, Decl(computedPropertyNames18_ES6.ts, 0, 0)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames18_ES6.ts, 1, 7)) + + [this.bar]: 0 + } +} diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.types b/tests/baselines/reference/computedPropertyNames18_ES6.types index af7081fa2ad..33a15b6c5a9 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES6.types +++ b/tests/baselines/reference/computedPropertyNames18_ES6.types @@ -10,5 +10,6 @@ function foo() { >this.bar : any >this : any >bar : any +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.symbols b/tests/baselines/reference/computedPropertyNames1_ES5.symbols new file mode 100644 index 00000000000..2bc11580c78 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames1_ES5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES5.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNames1_ES5.ts, 0, 3)) + + get [0 + 1]() { return 0 }, + set [0 + 1](v: string) { } //No error +>v : Symbol(v, Decl(computedPropertyNames1_ES5.ts, 2, 16)) +} diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.types b/tests/baselines/reference/computedPropertyNames1_ES5.types index 6627d53d1da..6c94c846f30 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5.types +++ b/tests/baselines/reference/computedPropertyNames1_ES5.types @@ -5,8 +5,13 @@ var v = { get [0 + 1]() { return 0 }, >0 + 1 : number +>0 : number +>1 : number +>0 : number set [0 + 1](v: string) { } //No error >0 + 1 : number +>0 : number +>1 : number >v : string } diff --git a/tests/baselines/reference/computedPropertyNames1_ES6.symbols b/tests/baselines/reference/computedPropertyNames1_ES6.symbols new file mode 100644 index 00000000000..5a1708b927d --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames1_ES6.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES6.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNames1_ES6.ts, 0, 3)) + + get [0 + 1]() { return 0 }, + set [0 + 1](v: string) { } //No error +>v : Symbol(v, Decl(computedPropertyNames1_ES6.ts, 2, 16)) +} diff --git a/tests/baselines/reference/computedPropertyNames1_ES6.types b/tests/baselines/reference/computedPropertyNames1_ES6.types index 966cfef579d..95e5a011ea2 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES6.types +++ b/tests/baselines/reference/computedPropertyNames1_ES6.types @@ -5,8 +5,13 @@ var v = { get [0 + 1]() { return 0 }, >0 + 1 : number +>0 : number +>1 : number +>0 : number set [0 + 1](v: string) { } //No error >0 + 1 : number +>0 : number +>1 : number >v : string } diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.symbols b/tests/baselines/reference/computedPropertyNames20_ES5.symbols new file mode 100644 index 00000000000..2ab61faa707 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames20_ES5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames20_ES5.ts === +var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames20_ES5.ts, 0, 3)) + + [this.bar]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.types b/tests/baselines/reference/computedPropertyNames20_ES5.types index eb2bbf34b7e..91cc2c42963 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5.types +++ b/tests/baselines/reference/computedPropertyNames20_ES5.types @@ -7,4 +7,5 @@ var obj = { >this.bar : any >this : any >bar : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames20_ES6.symbols b/tests/baselines/reference/computedPropertyNames20_ES6.symbols new file mode 100644 index 00000000000..f7ab8c84def --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames20_ES6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames20_ES6.ts === +var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames20_ES6.ts, 0, 3)) + + [this.bar]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNames20_ES6.types b/tests/baselines/reference/computedPropertyNames20_ES6.types index 2280c7c4820..4ef6f675cce 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES6.types +++ b/tests/baselines/reference/computedPropertyNames20_ES6.types @@ -7,4 +7,5 @@ var obj = { >this.bar : any >this : any >bar : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.symbols b/tests/baselines/reference/computedPropertyNames22_ES5.symbols new file mode 100644 index 00000000000..a1e08e5f487 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames22_ES5.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames22_ES5.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNames22_ES5.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames22_ES5.ts, 0, 9)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames22_ES5.ts, 2, 11)) + + [this.bar()]() { } +>this.bar : Symbol(bar, Decl(computedPropertyNames22_ES5.ts, 0, 9)) +>this : Symbol(C, Decl(computedPropertyNames22_ES5.ts, 0, 0)) +>bar : Symbol(bar, Decl(computedPropertyNames22_ES5.ts, 0, 9)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.types b/tests/baselines/reference/computedPropertyNames22_ES5.types index 7afeeb75fa3..d3008669b4d 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.types +++ b/tests/baselines/reference/computedPropertyNames22_ES5.types @@ -17,5 +17,6 @@ class C { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames22_ES6.symbols b/tests/baselines/reference/computedPropertyNames22_ES6.symbols new file mode 100644 index 00000000000..5940bfb4cfb --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames22_ES6.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames22_ES6.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNames22_ES6.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames22_ES6.ts, 0, 9)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames22_ES6.ts, 2, 11)) + + [this.bar()]() { } +>this.bar : Symbol(bar, Decl(computedPropertyNames22_ES6.ts, 0, 9)) +>this : Symbol(C, Decl(computedPropertyNames22_ES6.ts, 0, 0)) +>bar : Symbol(bar, Decl(computedPropertyNames22_ES6.ts, 0, 9)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames22_ES6.types b/tests/baselines/reference/computedPropertyNames22_ES6.types index b65f276881f..0936eab29ab 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES6.types +++ b/tests/baselines/reference/computedPropertyNames22_ES6.types @@ -17,5 +17,6 @@ class C { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.symbols b/tests/baselines/reference/computedPropertyNames25_ES5.symbols new file mode 100644 index 00000000000..e11753857cc --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames25_ES5.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames25_ES5.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames25_ES5.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames25_ES5.ts, 0, 12)) + + return 0; + } +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames25_ES5.ts, 4, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames25_ES5.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(computedPropertyNames25_ES5.ts, 5, 22)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames25_ES5.ts, 7, 11)) + + [super.bar()]() { } +>super.bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES5.ts, 0, 12)) +>super : Symbol(Base, Decl(computedPropertyNames25_ES5.ts, 0, 0)) +>bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES5.ts, 0, 12)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.types b/tests/baselines/reference/computedPropertyNames25_ES5.types index 6f34ce35b44..6ca67cce410 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.types +++ b/tests/baselines/reference/computedPropertyNames25_ES5.types @@ -6,6 +6,7 @@ class Base { >bar : () => number return 0; +>0 : number } } class C extends Base { @@ -27,5 +28,6 @@ class C extends Base { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames25_ES6.symbols b/tests/baselines/reference/computedPropertyNames25_ES6.symbols new file mode 100644 index 00000000000..8eb7393c6ac --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames25_ES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames25_ES6.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames25_ES6.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames25_ES6.ts, 0, 12)) + + return 0; + } +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames25_ES6.ts, 4, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames25_ES6.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(computedPropertyNames25_ES6.ts, 5, 22)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames25_ES6.ts, 7, 11)) + + [super.bar()]() { } +>super.bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES6.ts, 0, 12)) +>super : Symbol(Base, Decl(computedPropertyNames25_ES6.ts, 0, 0)) +>bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES6.ts, 0, 12)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames25_ES6.types b/tests/baselines/reference/computedPropertyNames25_ES6.types index c008a6173cf..1c093ebc59f 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES6.types +++ b/tests/baselines/reference/computedPropertyNames25_ES6.types @@ -6,6 +6,7 @@ class Base { >bar : () => number return 0; +>0 : number } } class C extends Base { @@ -27,5 +28,6 @@ class C extends Base { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.symbols b/tests/baselines/reference/computedPropertyNames28_ES5.symbols new file mode 100644 index 00000000000..2934c3d0401 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames28_ES5.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames28_ES5.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames28_ES5.ts, 0, 0)) +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames28_ES5.ts, 1, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames28_ES5.ts, 0, 0)) + + constructor() { + super(); +>super : Symbol(Base, Decl(computedPropertyNames28_ES5.ts, 0, 0)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames28_ES5.ts, 5, 11)) + + [(super(), "prop")]() { } +>super : Symbol(Base, Decl(computedPropertyNames28_ES5.ts, 0, 0)) + + }; + } +} diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.types b/tests/baselines/reference/computedPropertyNames28_ES5.types index 278576ab1ca..273dcd426d8 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.types +++ b/tests/baselines/reference/computedPropertyNames28_ES5.types @@ -20,6 +20,7 @@ class C extends Base { >super(), "prop" : string >super() : void >super : typeof Base +>"prop" : string }; } diff --git a/tests/baselines/reference/computedPropertyNames28_ES6.symbols b/tests/baselines/reference/computedPropertyNames28_ES6.symbols new file mode 100644 index 00000000000..6824f62e2a5 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames28_ES6.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames28_ES6.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames28_ES6.ts, 0, 0)) +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames28_ES6.ts, 1, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames28_ES6.ts, 0, 0)) + + constructor() { + super(); +>super : Symbol(Base, Decl(computedPropertyNames28_ES6.ts, 0, 0)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames28_ES6.ts, 5, 11)) + + [(super(), "prop")]() { } +>super : Symbol(Base, Decl(computedPropertyNames28_ES6.ts, 0, 0)) + + }; + } +} diff --git a/tests/baselines/reference/computedPropertyNames28_ES6.types b/tests/baselines/reference/computedPropertyNames28_ES6.types index 842cdbd32e0..a34fb33f6c7 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES6.types +++ b/tests/baselines/reference/computedPropertyNames28_ES6.types @@ -20,6 +20,7 @@ class C extends Base { >super(), "prop" : string >super() : void >super : typeof Base +>"prop" : string }; } diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.symbols b/tests/baselines/reference/computedPropertyNames29_ES5.symbols new file mode 100644 index 00000000000..c33a7390ce8 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames29_ES5.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames29_ES5.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNames29_ES5.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames29_ES5.ts, 0, 9)) + + () => { + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames29_ES5.ts, 3, 15)) + + [this.bar()]() { } // needs capture +>this.bar : Symbol(bar, Decl(computedPropertyNames29_ES5.ts, 0, 9)) +>this : Symbol(C, Decl(computedPropertyNames29_ES5.ts, 0, 0)) +>bar : Symbol(bar, Decl(computedPropertyNames29_ES5.ts, 0, 9)) + + }; + } + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.types b/tests/baselines/reference/computedPropertyNames29_ES5.types index e0da4b10da8..674343b3a1a 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.types +++ b/tests/baselines/reference/computedPropertyNames29_ES5.types @@ -21,5 +21,6 @@ class C { }; } return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames29_ES6.symbols b/tests/baselines/reference/computedPropertyNames29_ES6.symbols new file mode 100644 index 00000000000..41631ea63bb --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames29_ES6.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames29_ES6.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNames29_ES6.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames29_ES6.ts, 0, 9)) + + () => { + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames29_ES6.ts, 3, 15)) + + [this.bar()]() { } // needs capture +>this.bar : Symbol(bar, Decl(computedPropertyNames29_ES6.ts, 0, 9)) +>this : Symbol(C, Decl(computedPropertyNames29_ES6.ts, 0, 0)) +>bar : Symbol(bar, Decl(computedPropertyNames29_ES6.ts, 0, 9)) + + }; + } + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames29_ES6.types b/tests/baselines/reference/computedPropertyNames29_ES6.types index d520418749e..52f06bb9d88 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES6.types +++ b/tests/baselines/reference/computedPropertyNames29_ES6.types @@ -21,5 +21,6 @@ class C { }; } return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.symbols b/tests/baselines/reference/computedPropertyNames31_ES5.symbols new file mode 100644 index 00000000000..82a6acb286c --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames31_ES5.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames31_ES5.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames31_ES5.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames31_ES5.ts, 0, 12)) + + return 0; + } +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames31_ES5.ts, 4, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames31_ES5.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(computedPropertyNames31_ES5.ts, 5, 22)) + + () => { + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames31_ES5.ts, 8, 15)) + + [super.bar()]() { } // needs capture +>super.bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES5.ts, 0, 12)) +>super : Symbol(Base, Decl(computedPropertyNames31_ES5.ts, 0, 0)) +>bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES5.ts, 0, 12)) + + }; + } + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.types b/tests/baselines/reference/computedPropertyNames31_ES5.types index eb14b223ed3..6c0f2572a06 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.types +++ b/tests/baselines/reference/computedPropertyNames31_ES5.types @@ -6,6 +6,7 @@ class Base { >bar : () => number return 0; +>0 : number } } class C extends Base { @@ -31,5 +32,6 @@ class C extends Base { }; } return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.symbols b/tests/baselines/reference/computedPropertyNames31_ES6.symbols new file mode 100644 index 00000000000..778293bbb88 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames31_ES6.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames31_ES6.ts === +class Base { +>Base : Symbol(Base, Decl(computedPropertyNames31_ES6.ts, 0, 0)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames31_ES6.ts, 0, 12)) + + return 0; + } +} +class C extends Base { +>C : Symbol(C, Decl(computedPropertyNames31_ES6.ts, 4, 1)) +>Base : Symbol(Base, Decl(computedPropertyNames31_ES6.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(computedPropertyNames31_ES6.ts, 5, 22)) + + () => { + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames31_ES6.ts, 8, 15)) + + [super.bar()]() { } // needs capture +>super.bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES6.ts, 0, 12)) +>super : Symbol(Base, Decl(computedPropertyNames31_ES6.ts, 0, 0)) +>bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES6.ts, 0, 12)) + + }; + } + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.types b/tests/baselines/reference/computedPropertyNames31_ES6.types index 9d835a1fac1..eaddc036812 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES6.types +++ b/tests/baselines/reference/computedPropertyNames31_ES6.types @@ -6,6 +6,7 @@ class Base { >bar : () => number return 0; +>0 : number } } class C extends Base { @@ -31,5 +32,6 @@ class C extends Base { }; } return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.symbols b/tests/baselines/reference/computedPropertyNames33_ES5.symbols new file mode 100644 index 00000000000..ae6dd01e7bc --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames33_ES5.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames33_ES5.ts === +function foo() { return '' } +>foo : Symbol(foo, Decl(computedPropertyNames33_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames33_ES5.ts, 0, 13)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames33_ES5.ts, 0, 31)) +>T : Symbol(T, Decl(computedPropertyNames33_ES5.ts, 1, 8)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames33_ES5.ts, 1, 12)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames33_ES5.ts, 3, 11)) + + [foo()]() { } +>foo : Symbol(foo, Decl(computedPropertyNames33_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames33_ES5.ts, 1, 8)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.types b/tests/baselines/reference/computedPropertyNames33_ES5.types index a0d99ec8615..f44ac3ca769 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.types +++ b/tests/baselines/reference/computedPropertyNames33_ES5.types @@ -2,6 +2,7 @@ function foo() { return '' } >foo : () => string >T : T +>'' : string class C { >C : C @@ -21,5 +22,6 @@ class C { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames33_ES6.symbols b/tests/baselines/reference/computedPropertyNames33_ES6.symbols new file mode 100644 index 00000000000..cf0b3abde96 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames33_ES6.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames33_ES6.ts === +function foo() { return '' } +>foo : Symbol(foo, Decl(computedPropertyNames33_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames33_ES6.ts, 0, 13)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames33_ES6.ts, 0, 31)) +>T : Symbol(T, Decl(computedPropertyNames33_ES6.ts, 1, 8)) + + bar() { +>bar : Symbol(bar, Decl(computedPropertyNames33_ES6.ts, 1, 12)) + + var obj = { +>obj : Symbol(obj, Decl(computedPropertyNames33_ES6.ts, 3, 11)) + + [foo()]() { } +>foo : Symbol(foo, Decl(computedPropertyNames33_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames33_ES6.ts, 1, 8)) + + }; + return 0; + } +} diff --git a/tests/baselines/reference/computedPropertyNames33_ES6.types b/tests/baselines/reference/computedPropertyNames33_ES6.types index 331bd2b3e09..3081337c8bb 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES6.types +++ b/tests/baselines/reference/computedPropertyNames33_ES6.types @@ -2,6 +2,7 @@ function foo() { return '' } >foo : () => string >T : T +>'' : string class C { >C : C @@ -21,5 +22,6 @@ class C { }; return 0; +>0 : number } } diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.symbols b/tests/baselines/reference/computedPropertyNames37_ES5.symbols new file mode 100644 index 00000000000..7932b2c8fdc --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames37_ES5.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES5.ts === +class Foo { x } +>Foo : Symbol(Foo, Decl(computedPropertyNames37_ES5.ts, 0, 0)) +>x : Symbol(x, Decl(computedPropertyNames37_ES5.ts, 0, 11)) + +class Foo2 { x; y } +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES5.ts, 0, 15)) +>x : Symbol(x, Decl(computedPropertyNames37_ES5.ts, 1, 12)) +>y : Symbol(y, Decl(computedPropertyNames37_ES5.ts, 1, 15)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames37_ES5.ts, 1, 19)) + + [s: number]: Foo2; +>s : Symbol(s, Decl(computedPropertyNames37_ES5.ts, 4, 5)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES5.ts, 0, 15)) + + // Computed properties + get ["get1"]() { return new Foo } +>Foo : Symbol(Foo, Decl(computedPropertyNames37_ES5.ts, 0, 0)) + + set ["set1"](p: Foo2) { } +>p : Symbol(p, Decl(computedPropertyNames37_ES5.ts, 8, 17)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES5.ts, 0, 15)) +} diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.types b/tests/baselines/reference/computedPropertyNames37_ES5.types index a12324003bf..21b68c7c12c 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5.types +++ b/tests/baselines/reference/computedPropertyNames37_ES5.types @@ -17,10 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>"get1" : string >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } +>"set1" : string >p : Foo2 >Foo2 : Foo2 } diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.symbols b/tests/baselines/reference/computedPropertyNames37_ES6.symbols new file mode 100644 index 00000000000..f4439ef4f92 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames37_ES6.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames37_ES6.ts === +class Foo { x } +>Foo : Symbol(Foo, Decl(computedPropertyNames37_ES6.ts, 0, 0)) +>x : Symbol(x, Decl(computedPropertyNames37_ES6.ts, 0, 11)) + +class Foo2 { x; y } +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES6.ts, 0, 15)) +>x : Symbol(x, Decl(computedPropertyNames37_ES6.ts, 1, 12)) +>y : Symbol(y, Decl(computedPropertyNames37_ES6.ts, 1, 15)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames37_ES6.ts, 1, 19)) + + [s: number]: Foo2; +>s : Symbol(s, Decl(computedPropertyNames37_ES6.ts, 4, 5)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES6.ts, 0, 15)) + + // Computed properties + get ["get1"]() { return new Foo } +>Foo : Symbol(Foo, Decl(computedPropertyNames37_ES6.ts, 0, 0)) + + set ["set1"](p: Foo2) { } +>p : Symbol(p, Decl(computedPropertyNames37_ES6.ts, 8, 17)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES6.ts, 0, 15)) +} diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.types b/tests/baselines/reference/computedPropertyNames37_ES6.types index 288685f0e02..e436a54172b 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES6.types +++ b/tests/baselines/reference/computedPropertyNames37_ES6.types @@ -17,10 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>"get1" : string >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } +>"set1" : string >p : Foo2 >Foo2 : Foo2 } diff --git a/tests/baselines/reference/computedPropertyNames41_ES5.symbols b/tests/baselines/reference/computedPropertyNames41_ES5.symbols new file mode 100644 index 00000000000..e1438568f24 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames41_ES5.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames41_ES5.ts === +class Foo { x } +>Foo : Symbol(Foo, Decl(computedPropertyNames41_ES5.ts, 0, 0)) +>x : Symbol(x, Decl(computedPropertyNames41_ES5.ts, 0, 11)) + +class Foo2 { x; y } +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames41_ES5.ts, 0, 15)) +>x : Symbol(x, Decl(computedPropertyNames41_ES5.ts, 1, 12)) +>y : Symbol(y, Decl(computedPropertyNames41_ES5.ts, 1, 15)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames41_ES5.ts, 1, 19)) + + [s: string]: () => Foo2; +>s : Symbol(s, Decl(computedPropertyNames41_ES5.ts, 4, 5)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames41_ES5.ts, 0, 15)) + + // Computed properties + static [""]() { return new Foo } +>Foo : Symbol(Foo, Decl(computedPropertyNames41_ES5.ts, 0, 0)) +} diff --git a/tests/baselines/reference/computedPropertyNames41_ES5.types b/tests/baselines/reference/computedPropertyNames41_ES5.types index aac087ee958..5aa7ae44404 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES5.types +++ b/tests/baselines/reference/computedPropertyNames41_ES5.types @@ -17,6 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } +>"" : string >new Foo : Foo >Foo : typeof Foo } diff --git a/tests/baselines/reference/computedPropertyNames41_ES6.symbols b/tests/baselines/reference/computedPropertyNames41_ES6.symbols new file mode 100644 index 00000000000..3f4a7dff621 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames41_ES6.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames41_ES6.ts === +class Foo { x } +>Foo : Symbol(Foo, Decl(computedPropertyNames41_ES6.ts, 0, 0)) +>x : Symbol(x, Decl(computedPropertyNames41_ES6.ts, 0, 11)) + +class Foo2 { x; y } +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames41_ES6.ts, 0, 15)) +>x : Symbol(x, Decl(computedPropertyNames41_ES6.ts, 1, 12)) +>y : Symbol(y, Decl(computedPropertyNames41_ES6.ts, 1, 15)) + +class C { +>C : Symbol(C, Decl(computedPropertyNames41_ES6.ts, 1, 19)) + + [s: string]: () => Foo2; +>s : Symbol(s, Decl(computedPropertyNames41_ES6.ts, 4, 5)) +>Foo2 : Symbol(Foo2, Decl(computedPropertyNames41_ES6.ts, 0, 15)) + + // Computed properties + static [""]() { return new Foo } +>Foo : Symbol(Foo, Decl(computedPropertyNames41_ES6.ts, 0, 0)) +} diff --git a/tests/baselines/reference/computedPropertyNames41_ES6.types b/tests/baselines/reference/computedPropertyNames41_ES6.types index ffb3387d161..70bfcf12a75 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES6.types +++ b/tests/baselines/reference/computedPropertyNames41_ES6.types @@ -17,6 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } +>"" : string >new Foo : Foo >Foo : typeof Foo } diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.symbols b/tests/baselines/reference/computedPropertyNames46_ES5.symbols new file mode 100644 index 00000000000..10a7cf0b528 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames46_ES5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES5.ts === +var o = { +>o : Symbol(o, Decl(computedPropertyNames46_ES5.ts, 0, 3)) + + ["" || 0]: 0 +}; diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.types b/tests/baselines/reference/computedPropertyNames46_ES5.types index bdc2f2cf644..394b22bd904 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5.types +++ b/tests/baselines/reference/computedPropertyNames46_ES5.types @@ -5,5 +5,8 @@ var o = { ["" || 0]: 0 >"" || 0 : string | number +>"" : string +>0 : number +>0 : number }; diff --git a/tests/baselines/reference/computedPropertyNames46_ES6.symbols b/tests/baselines/reference/computedPropertyNames46_ES6.symbols new file mode 100644 index 00000000000..3028eb8e225 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames46_ES6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames46_ES6.ts === +var o = { +>o : Symbol(o, Decl(computedPropertyNames46_ES6.ts, 0, 3)) + + ["" || 0]: 0 +}; diff --git a/tests/baselines/reference/computedPropertyNames46_ES6.types b/tests/baselines/reference/computedPropertyNames46_ES6.types index 7abb10f1ba5..864fd81321d 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES6.types +++ b/tests/baselines/reference/computedPropertyNames46_ES6.types @@ -5,5 +5,8 @@ var o = { ["" || 0]: 0 >"" || 0 : string | number +>"" : string +>0 : number +>0 : number }; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.symbols b/tests/baselines/reference/computedPropertyNames47_ES5.symbols new file mode 100644 index 00000000000..c124850e5a6 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames47_ES5.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames47_ES5.ts === +enum E1 { x } +>E1 : Symbol(E1, Decl(computedPropertyNames47_ES5.ts, 0, 0)) +>x : Symbol(E1.x, Decl(computedPropertyNames47_ES5.ts, 0, 9)) + +enum E2 { x } +>E2 : Symbol(E2, Decl(computedPropertyNames47_ES5.ts, 0, 13)) +>x : Symbol(E2.x, Decl(computedPropertyNames47_ES5.ts, 1, 9)) + +var o = { +>o : Symbol(o, Decl(computedPropertyNames47_ES5.ts, 2, 3)) + + [E1.x || E2.x]: 0 +>E1.x : Symbol(E1.x, Decl(computedPropertyNames47_ES5.ts, 0, 9)) +>E1 : Symbol(E1, Decl(computedPropertyNames47_ES5.ts, 0, 0)) +>x : Symbol(E1.x, Decl(computedPropertyNames47_ES5.ts, 0, 9)) +>E2.x : Symbol(E2.x, Decl(computedPropertyNames47_ES5.ts, 1, 9)) +>E2 : Symbol(E2, Decl(computedPropertyNames47_ES5.ts, 0, 13)) +>x : Symbol(E2.x, Decl(computedPropertyNames47_ES5.ts, 1, 9)) + +}; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.types b/tests/baselines/reference/computedPropertyNames47_ES5.types index c79f2b20946..6aa841ffd62 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5.types +++ b/tests/baselines/reference/computedPropertyNames47_ES5.types @@ -19,5 +19,6 @@ var o = { >E2.x : E2 >E2 : typeof E2 >x : E2 +>0 : number }; diff --git a/tests/baselines/reference/computedPropertyNames47_ES6.symbols b/tests/baselines/reference/computedPropertyNames47_ES6.symbols new file mode 100644 index 00000000000..ec0850d5b13 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames47_ES6.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames47_ES6.ts === +enum E1 { x } +>E1 : Symbol(E1, Decl(computedPropertyNames47_ES6.ts, 0, 0)) +>x : Symbol(E1.x, Decl(computedPropertyNames47_ES6.ts, 0, 9)) + +enum E2 { x } +>E2 : Symbol(E2, Decl(computedPropertyNames47_ES6.ts, 0, 13)) +>x : Symbol(E2.x, Decl(computedPropertyNames47_ES6.ts, 1, 9)) + +var o = { +>o : Symbol(o, Decl(computedPropertyNames47_ES6.ts, 2, 3)) + + [E1.x || E2.x]: 0 +>E1.x : Symbol(E1.x, Decl(computedPropertyNames47_ES6.ts, 0, 9)) +>E1 : Symbol(E1, Decl(computedPropertyNames47_ES6.ts, 0, 0)) +>x : Symbol(E1.x, Decl(computedPropertyNames47_ES6.ts, 0, 9)) +>E2.x : Symbol(E2.x, Decl(computedPropertyNames47_ES6.ts, 1, 9)) +>E2 : Symbol(E2, Decl(computedPropertyNames47_ES6.ts, 0, 13)) +>x : Symbol(E2.x, Decl(computedPropertyNames47_ES6.ts, 1, 9)) + +}; diff --git a/tests/baselines/reference/computedPropertyNames47_ES6.types b/tests/baselines/reference/computedPropertyNames47_ES6.types index 840d77754cf..f038b172ca1 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES6.types +++ b/tests/baselines/reference/computedPropertyNames47_ES6.types @@ -19,5 +19,6 @@ var o = { >E2.x : E2 >E2 : typeof E2 >x : E2 +>0 : number }; diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.symbols b/tests/baselines/reference/computedPropertyNames48_ES5.symbols new file mode 100644 index 00000000000..14f7cc6352d --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames48_ES5.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES5.ts === +declare function extractIndexer(p: { [n: number]: T }): T; +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames48_ES5.ts, 0, 32)) +>p : Symbol(p, Decl(computedPropertyNames48_ES5.ts, 0, 35)) +>n : Symbol(n, Decl(computedPropertyNames48_ES5.ts, 0, 41)) +>T : Symbol(T, Decl(computedPropertyNames48_ES5.ts, 0, 32)) +>T : Symbol(T, Decl(computedPropertyNames48_ES5.ts, 0, 32)) + +enum E { x } +>E : Symbol(E, Decl(computedPropertyNames48_ES5.ts, 0, 61)) +>x : Symbol(E.x, Decl(computedPropertyNames48_ES5.ts, 2, 8)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames48_ES5.ts, 4, 3)) + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) + + [a]: "" +>a : Symbol(a, Decl(computedPropertyNames48_ES5.ts, 4, 3)) + +}); // Should return string + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) + + [E.x]: "" +>E.x : Symbol(E.x, Decl(computedPropertyNames48_ES5.ts, 2, 8)) +>E : Symbol(E, Decl(computedPropertyNames48_ES5.ts, 0, 61)) +>x : Symbol(E.x, Decl(computedPropertyNames48_ES5.ts, 2, 8)) + +}); // Should return string + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) + + ["" || 0]: "" +}); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.types b/tests/baselines/reference/computedPropertyNames48_ES5.types index 3ff4c966e89..2b9131a11c8 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.types +++ b/tests/baselines/reference/computedPropertyNames48_ES5.types @@ -21,6 +21,7 @@ extractIndexer({ [a]: "" >a : any +>"" : string }); // Should return string @@ -33,6 +34,7 @@ extractIndexer({ >E.x : E >E : typeof E >x : E +>"" : string }); // Should return string @@ -43,5 +45,8 @@ extractIndexer({ ["" || 0]: "" >"" || 0 : string | number +>"" : string +>0 : number +>"" : string }); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames48_ES6.symbols b/tests/baselines/reference/computedPropertyNames48_ES6.symbols new file mode 100644 index 00000000000..5d63c9f495d --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames48_ES6.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames48_ES6.ts === +declare function extractIndexer(p: { [n: number]: T }): T; +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNames48_ES6.ts, 0, 32)) +>p : Symbol(p, Decl(computedPropertyNames48_ES6.ts, 0, 35)) +>n : Symbol(n, Decl(computedPropertyNames48_ES6.ts, 0, 41)) +>T : Symbol(T, Decl(computedPropertyNames48_ES6.ts, 0, 32)) +>T : Symbol(T, Decl(computedPropertyNames48_ES6.ts, 0, 32)) + +enum E { x } +>E : Symbol(E, Decl(computedPropertyNames48_ES6.ts, 0, 61)) +>x : Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames48_ES6.ts, 4, 3)) + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) + + [a]: "" +>a : Symbol(a, Decl(computedPropertyNames48_ES6.ts, 4, 3)) + +}); // Should return string + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) + + [E.x]: "" +>E.x : Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8)) +>E : Symbol(E, Decl(computedPropertyNames48_ES6.ts, 0, 61)) +>x : Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8)) + +}); // Should return string + +extractIndexer({ +>extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) + + ["" || 0]: "" +}); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames48_ES6.types b/tests/baselines/reference/computedPropertyNames48_ES6.types index e10f078d11f..2b803b19bd6 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES6.types +++ b/tests/baselines/reference/computedPropertyNames48_ES6.types @@ -21,6 +21,7 @@ extractIndexer({ [a]: "" >a : any +>"" : string }); // Should return string @@ -33,6 +34,7 @@ extractIndexer({ >E.x : E >E : typeof E >x : E +>"" : string }); // Should return string @@ -43,5 +45,8 @@ extractIndexer({ ["" || 0]: "" >"" || 0 : string | number +>"" : string +>0 : number +>"" : string }); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.symbols b/tests/baselines/reference/computedPropertyNames4_ES5.symbols new file mode 100644 index 00000000000..be201486286 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames4_ES5.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES5.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames4_ES5.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames4_ES5.ts, 3, 3)) + + [s]: 0, +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) + + [n]: n, +>n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) +>n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) + + [s + s]: 1, +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) + + [s + n]: 2, +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) + + [+s]: s, +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) + + [""]: 0, + [0]: 0, + [a]: 1, +>a : Symbol(a, Decl(computedPropertyNames4_ES5.ts, 2, 3)) + + [true]: 0, + [`hello bye`]: 0, + [`hello ${a} bye`]: 0 +>a : Symbol(a, Decl(computedPropertyNames4_ES5.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.types b/tests/baselines/reference/computedPropertyNames4_ES5.types index 7c26cae6444..51baca26586 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.types +++ b/tests/baselines/reference/computedPropertyNames4_ES5.types @@ -14,6 +14,7 @@ var v = { [s]: 0, >s : string +>0 : number [n]: n, >n : number @@ -23,11 +24,13 @@ var v = { >s + s : string >s : string >s : string +>1 : number [s + n]: 2, >s + n : string >s : string >n : number +>2 : number [+s]: s, >+s : number @@ -35,14 +38,28 @@ var v = { >s : string [""]: 0, +>"" : string +>0 : number + [0]: 0, +>0 : number +>0 : number + [a]: 1, >a : any +>1 : number [true]: 0, >true : any +>true : boolean +>0 : number [`hello bye`]: 0, +>`hello bye` : string +>0 : number + [`hello ${a} bye`]: 0 +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.symbols b/tests/baselines/reference/computedPropertyNames4_ES6.symbols new file mode 100644 index 00000000000..b531a1b3d28 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames4_ES6.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames4_ES6.ts === +var s: string; +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) + +var n: number; +>n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) + +var a: any; +>a : Symbol(a, Decl(computedPropertyNames4_ES6.ts, 2, 3)) + +var v = { +>v : Symbol(v, Decl(computedPropertyNames4_ES6.ts, 3, 3)) + + [s]: 0, +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) + + [n]: n, +>n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) +>n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) + + [s + s]: 1, +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) + + [s + n]: 2, +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) +>n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) + + [+s]: s, +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) +>s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) + + [""]: 0, + [0]: 0, + [a]: 1, +>a : Symbol(a, Decl(computedPropertyNames4_ES6.ts, 2, 3)) + + [true]: 0, + [`hello bye`]: 0, + [`hello ${a} bye`]: 0 +>a : Symbol(a, Decl(computedPropertyNames4_ES6.ts, 2, 3)) +} diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.types b/tests/baselines/reference/computedPropertyNames4_ES6.types index 973dfbec3a5..05267049517 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.types +++ b/tests/baselines/reference/computedPropertyNames4_ES6.types @@ -14,6 +14,7 @@ var v = { [s]: 0, >s : string +>0 : number [n]: n, >n : number @@ -23,11 +24,13 @@ var v = { >s + s : string >s : string >s : string +>1 : number [s + n]: 2, >s + n : string >s : string >n : number +>2 : number [+s]: s, >+s : number @@ -35,14 +38,28 @@ var v = { >s : string [""]: 0, +>"" : string +>0 : number + [0]: 0, +>0 : number +>0 : number + [a]: 1, >a : any +>1 : number [true]: 0, >true : any +>true : boolean +>0 : number [`hello bye`]: 0, +>`hello bye` : string +>0 : number + [`hello ${a} bye`]: 0 +>`hello ${a} bye` : string >a : any +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.symbols b/tests/baselines/reference/computedPropertyNames7_ES5.symbols new file mode 100644 index 00000000000..7f5e7c0fd46 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames7_ES5.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames7_ES5.ts === +enum E { +>E : Symbol(E, Decl(computedPropertyNames7_ES5.ts, 0, 0)) + + member +>member : Symbol(E.member, Decl(computedPropertyNames7_ES5.ts, 0, 8)) +} +var v = { +>v : Symbol(v, Decl(computedPropertyNames7_ES5.ts, 3, 3)) + + [E.member]: 0 +>E.member : Symbol(E.member, Decl(computedPropertyNames7_ES5.ts, 0, 8)) +>E : Symbol(E, Decl(computedPropertyNames7_ES5.ts, 0, 0)) +>member : Symbol(E.member, Decl(computedPropertyNames7_ES5.ts, 0, 8)) +} diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.types b/tests/baselines/reference/computedPropertyNames7_ES5.types index 209e07769c0..8ebd4d75668 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5.types +++ b/tests/baselines/reference/computedPropertyNames7_ES5.types @@ -13,4 +13,5 @@ var v = { >E.member : E >E : typeof E >member : E +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNames7_ES6.symbols b/tests/baselines/reference/computedPropertyNames7_ES6.symbols new file mode 100644 index 00000000000..b008d47a843 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames7_ES6.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNames7_ES6.ts === +enum E { +>E : Symbol(E, Decl(computedPropertyNames7_ES6.ts, 0, 0)) + + member +>member : Symbol(E.member, Decl(computedPropertyNames7_ES6.ts, 0, 8)) +} +var v = { +>v : Symbol(v, Decl(computedPropertyNames7_ES6.ts, 3, 3)) + + [E.member]: 0 +>E.member : Symbol(E.member, Decl(computedPropertyNames7_ES6.ts, 0, 8)) +>E : Symbol(E, Decl(computedPropertyNames7_ES6.ts, 0, 0)) +>member : Symbol(E.member, Decl(computedPropertyNames7_ES6.ts, 0, 8)) +} diff --git a/tests/baselines/reference/computedPropertyNames7_ES6.types b/tests/baselines/reference/computedPropertyNames7_ES6.types index 371176acc16..3a78b9c0ec6 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES6.types +++ b/tests/baselines/reference/computedPropertyNames7_ES6.types @@ -13,4 +13,5 @@ var v = { >E.member : E >E : typeof E >member : E +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.symbols new file mode 100644 index 00000000000..a99a3899725 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType1_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType1_ES5.ts, 0, 0)) + + [s: string]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType1_ES5.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType1_ES5.ts, 1, 18)) + + [s: number]: (x: any) => number; // Doesn't get hit +>s : Symbol(s, Decl(computedPropertyNamesContextualType1_ES5.ts, 2, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType1_ES5.ts, 2, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType1_ES5.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType1_ES5.ts, 0, 0)) + + ["" + 0](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + ["" + 1]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 7, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 7, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types index ad7ddc30567..bea7267d7d1 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types @@ -18,6 +18,8 @@ var o: I = { ["" + 0](y) { return y.length; }, >"" + 0 : string +>"" : string +>0 : number >y : string >y.length : number >y : string @@ -25,6 +27,8 @@ var o: I = { ["" + 1]: y => y.length >"" + 1 : string +>"" : string +>1 : number >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols new file mode 100644 index 00000000000..e386b8e9efa --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType1_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType1_ES6.ts, 0, 0)) + + [s: string]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType1_ES6.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType1_ES6.ts, 1, 18)) + + [s: number]: (x: any) => number; // Doesn't get hit +>s : Symbol(s, Decl(computedPropertyNamesContextualType1_ES6.ts, 2, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType1_ES6.ts, 2, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType1_ES6.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType1_ES6.ts, 0, 0)) + + ["" + 0](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + ["" + 1]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 7, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 7, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types index 44bc8a51113..c8d0be6e833 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types @@ -18,6 +18,8 @@ var o: I = { ["" + 0](y) { return y.length; }, >"" + 0 : string +>"" : string +>0 : number >y : string >y.length : number >y : string @@ -25,6 +27,8 @@ var o: I = { ["" + 1]: y => y.length >"" + 1 : string +>"" : string +>1 : number >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.symbols new file mode 100644 index 00000000000..fcd89e032e6 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType2_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType2_ES5.ts, 0, 0)) + + [s: string]: (x: any) => number; // Doesn't get hit +>s : Symbol(s, Decl(computedPropertyNamesContextualType2_ES5.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType2_ES5.ts, 1, 18)) + + [s: number]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType2_ES5.ts, 2, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType2_ES5.ts, 2, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType2_ES5.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType2_ES5.ts, 0, 0)) + + [+"foo"](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + [+"bar"]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 7, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 7, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types index 0c1b9490abe..52de216b803 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types @@ -18,6 +18,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number +>"foo" : string >y : string >y.length : number >y : string @@ -25,6 +26,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number +>"bar" : string >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols new file mode 100644 index 00000000000..ce6be5194c0 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType2_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType2_ES6.ts, 0, 0)) + + [s: string]: (x: any) => number; // Doesn't get hit +>s : Symbol(s, Decl(computedPropertyNamesContextualType2_ES6.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType2_ES6.ts, 1, 18)) + + [s: number]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType2_ES6.ts, 2, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType2_ES6.ts, 2, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType2_ES6.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType2_ES6.ts, 0, 0)) + + [+"foo"](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + [+"bar"]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 7, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 7, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types index 222004cf8e3..cbbe0edc6a1 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types @@ -18,6 +18,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number +>"foo" : string >y : string >y.length : number >y : string @@ -25,6 +26,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number +>"bar" : string >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.symbols new file mode 100644 index 00000000000..d73c9c186d4 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType3_ES5.ts, 0, 0)) + + [s: string]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType3_ES5.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType3_ES5.ts, 1, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType3_ES5.ts, 4, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType3_ES5.ts, 0, 0)) + + [+"foo"](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 5, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 5, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + [+"bar"]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types index 482d58c3ee0..5f647fb4c1b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types @@ -14,6 +14,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number +>"foo" : string >y : string >y.length : number >y : string @@ -21,6 +22,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number +>"bar" : string >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols new file mode 100644 index 00000000000..48e93ee62f9 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType3_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType3_ES6.ts, 0, 0)) + + [s: string]: (x: string) => number; +>s : Symbol(s, Decl(computedPropertyNamesContextualType3_ES6.ts, 1, 5)) +>x : Symbol(x, Decl(computedPropertyNamesContextualType3_ES6.ts, 1, 18)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType3_ES6.ts, 4, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType3_ES6.ts, 0, 0)) + + [+"foo"](y) { return y.length; }, +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 5, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 5, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + [+"bar"]: y => y.length +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 6, 13)) +>y.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 6, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types index bc36ad8ae2c..e872df6f1b2 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types @@ -14,6 +14,7 @@ var o: I = { [+"foo"](y) { return y.length; }, >+"foo" : number +>"foo" : string >y : string >y.length : number >y : string @@ -21,6 +22,7 @@ var o: I = { [+"bar"]: y => y.length >+"bar" : number +>"bar" : string >y => y.length : (y: string) => number >y : string >y.length : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.symbols new file mode 100644 index 00000000000..f6f19f3fd61 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType4_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType4_ES5.ts, 0, 0)) + + [s: string]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType4_ES5.ts, 1, 5)) + + [s: number]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType4_ES5.ts, 2, 5)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType4_ES5.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType4_ES5.ts, 0, 0)) + + [""+"foo"]: "", + [""+"bar"]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types index c1662397527..e5a57363ca0 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types @@ -16,7 +16,13 @@ var o: I = { [""+"foo"]: "", >""+"foo" : string +>"" : string +>"foo" : string +>"" : string [""+"bar"]: 0 >""+"bar" : string +>"" : string +>"bar" : string +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.symbols new file mode 100644 index 00000000000..184a561425c --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType4_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType4_ES6.ts, 0, 0)) + + [s: string]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType4_ES6.ts, 1, 5)) + + [s: number]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType4_ES6.ts, 2, 5)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType4_ES6.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType4_ES6.ts, 0, 0)) + + [""+"foo"]: "", + [""+"bar"]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types index 82424f9410c..bdfa569752b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types @@ -16,7 +16,13 @@ var o: I = { [""+"foo"]: "", >""+"foo" : string +>"" : string +>"foo" : string +>"" : string [""+"bar"]: 0 >""+"bar" : string +>"" : string +>"bar" : string +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.symbols new file mode 100644 index 00000000000..e93cf3f94a1 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType5_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType5_ES5.ts, 0, 0)) + + [s: string]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType5_ES5.ts, 1, 5)) + + [s: number]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType5_ES5.ts, 2, 5)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType5_ES5.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType5_ES5.ts, 0, 0)) + + [+"foo"]: "", + [+"bar"]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types index bb382ca136e..e142fe937b9 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types @@ -16,7 +16,11 @@ var o: I = { [+"foo"]: "", >+"foo" : number +>"foo" : string +>"" : string [+"bar"]: 0 >+"bar" : number +>"bar" : string +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.symbols new file mode 100644 index 00000000000..46212968874 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType5_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType5_ES6.ts, 0, 0)) + + [s: string]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType5_ES6.ts, 1, 5)) + + [s: number]: any; +>s : Symbol(s, Decl(computedPropertyNamesContextualType5_ES6.ts, 2, 5)) +} + +var o: I = { +>o : Symbol(o, Decl(computedPropertyNamesContextualType5_ES6.ts, 5, 3)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType5_ES6.ts, 0, 0)) + + [+"foo"]: "", + [+"bar"]: 0 +} diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types index 6ab28f9583d..7b385b36770 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types @@ -16,7 +16,11 @@ var o: I = { [+"foo"]: "", >+"foo" : number +>"foo" : string +>"" : string [+"bar"]: 0 >+"bar" : number +>"bar" : string +>0 : number } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols new file mode 100644 index 00000000000..fb303b1f8b3 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType6_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES5.ts, 0, 12)) + + [s: string]: T; +>s : Symbol(s, Decl(computedPropertyNamesContextualType6_ES5.ts, 1, 5)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES5.ts, 0, 12)) +} + +declare function foo(obj: I): T +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType6_ES5.ts, 2, 1)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES5.ts, 4, 21)) +>obj : Symbol(obj, Decl(computedPropertyNamesContextualType6_ES5.ts, 4, 24)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType6_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES5.ts, 4, 21)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES5.ts, 4, 21)) + +foo({ +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType6_ES5.ts, 2, 1)) + + p: "", +>p : Symbol(p, Decl(computedPropertyNamesContextualType6_ES5.ts, 6, 5)) + + 0: () => { }, + ["hi" + "bye"]: true, + [0 + 1]: 0, + [+"hi"]: [0] +}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types index 2e16c7cb140..52ff0c1001d 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types @@ -23,18 +23,27 @@ foo({ p: "", >p : string +>"" : string 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string +>"hi" : string +>"bye" : string +>true : boolean [0 + 1]: 0, >0 + 1 : number +>0 : number +>1 : number +>0 : number [+"hi"]: [0] >+"hi" : number +>"hi" : string >[0] : number[] +>0 : number }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types.pull b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types.pull deleted file mode 100644 index ce7a4c0d026..00000000000 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types.pull +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES5.ts === -interface I { ->I : I ->T : T - - [s: string]: T; ->s : string ->T : T -} - -declare function foo(obj: I): T ->foo : (obj: I) => T ->T : T ->obj : I ->I : I ->T : T ->T : T - -foo({ ->foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] ->foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; 0: () => void; p: string; } - - p: "", ->p : string - - 0: () => { }, ->() => { } : () => void - - ["hi" + "bye"]: true, ->"hi" + "bye" : string - - [0 + 1]: 0, ->0 + 1 : number - - [+"hi"]: [0] ->+"hi" : number ->[0] : number[] - -}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols new file mode 100644 index 00000000000..b3e371447e2 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType6_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES6.ts, 0, 12)) + + [s: string]: T; +>s : Symbol(s, Decl(computedPropertyNamesContextualType6_ES6.ts, 1, 5)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES6.ts, 0, 12)) +} + +declare function foo(obj: I): T +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType6_ES6.ts, 2, 1)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES6.ts, 4, 21)) +>obj : Symbol(obj, Decl(computedPropertyNamesContextualType6_ES6.ts, 4, 24)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType6_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES6.ts, 4, 21)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType6_ES6.ts, 4, 21)) + +foo({ +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType6_ES6.ts, 2, 1)) + + p: "", +>p : Symbol(p, Decl(computedPropertyNamesContextualType6_ES6.ts, 6, 5)) + + 0: () => { }, + ["hi" + "bye"]: true, + [0 + 1]: 0, + [+"hi"]: [0] +}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types index 1684bfc573f..6998c9523cc 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types @@ -23,18 +23,27 @@ foo({ p: "", >p : string +>"" : string 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string +>"hi" : string +>"bye" : string +>true : boolean [0 + 1]: 0, >0 + 1 : number +>0 : number +>1 : number +>0 : number [+"hi"]: [0] >+"hi" : number +>"hi" : string >[0] : number[] +>0 : number }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types.pull b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types.pull deleted file mode 100644 index 6722edacd64..00000000000 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types.pull +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6_ES6.ts === -interface I { ->I : I ->T : T - - [s: string]: T; ->s : string ->T : T -} - -declare function foo(obj: I): T ->foo : (obj: I) => T ->T : T ->obj : I ->I : I ->T : T ->T : T - -foo({ ->foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] ->foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; 0: () => void; p: string; } - - p: "", ->p : string - - 0: () => { }, ->() => { } : () => void - - ["hi" + "bye"]: true, ->"hi" + "bye" : string - - [0 + 1]: 0, ->0 + 1 : number - - [+"hi"]: [0] ->+"hi" : number ->[0] : number[] - -}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols new file mode 100644 index 00000000000..22e4cf2b45b --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType7_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES5.ts, 0, 12)) + + [s: number]: T; +>s : Symbol(s, Decl(computedPropertyNamesContextualType7_ES5.ts, 1, 5)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES5.ts, 0, 12)) +} + +declare function foo(obj: I): T +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType7_ES5.ts, 2, 1)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES5.ts, 4, 21)) +>obj : Symbol(obj, Decl(computedPropertyNamesContextualType7_ES5.ts, 4, 24)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType7_ES5.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES5.ts, 4, 21)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES5.ts, 4, 21)) + +foo({ +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType7_ES5.ts, 2, 1)) + + p: "", +>p : Symbol(p, Decl(computedPropertyNamesContextualType7_ES5.ts, 6, 5)) + + 0: () => { }, + ["hi" + "bye"]: true, + [0 + 1]: 0, + [+"hi"]: [0] +}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types index 80ba2b9224f..1845d145966 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types @@ -23,18 +23,27 @@ foo({ p: "", >p : string +>"" : string 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string +>"hi" : string +>"bye" : string +>true : boolean [0 + 1]: 0, >0 + 1 : number +>0 : number +>1 : number +>0 : number [+"hi"]: [0] >+"hi" : number +>"hi" : string >[0] : number[] +>0 : number }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types.pull b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types.pull deleted file mode 100644 index 3511e913585..00000000000 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types.pull +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES5.ts === -interface I { ->I : I ->T : T - - [s: number]: T; ->s : number ->T : T -} - -declare function foo(obj: I): T ->foo : (obj: I) => T ->T : T ->obj : I ->I : I ->T : T ->T : T - -foo({ ->foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[] ->foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } - - p: "", ->p : string - - 0: () => { }, ->() => { } : () => void - - ["hi" + "bye"]: true, ->"hi" + "bye" : string - - [0 + 1]: 0, ->0 + 1 : number - - [+"hi"]: [0] ->+"hi" : number ->[0] : number[] - -}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols new file mode 100644 index 00000000000..7f33ebf58ad --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES6.ts === +interface I { +>I : Symbol(I, Decl(computedPropertyNamesContextualType7_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES6.ts, 0, 12)) + + [s: number]: T; +>s : Symbol(s, Decl(computedPropertyNamesContextualType7_ES6.ts, 1, 5)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES6.ts, 0, 12)) +} + +declare function foo(obj: I): T +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType7_ES6.ts, 2, 1)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES6.ts, 4, 21)) +>obj : Symbol(obj, Decl(computedPropertyNamesContextualType7_ES6.ts, 4, 24)) +>I : Symbol(I, Decl(computedPropertyNamesContextualType7_ES6.ts, 0, 0)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES6.ts, 4, 21)) +>T : Symbol(T, Decl(computedPropertyNamesContextualType7_ES6.ts, 4, 21)) + +foo({ +>foo : Symbol(foo, Decl(computedPropertyNamesContextualType7_ES6.ts, 2, 1)) + + p: "", +>p : Symbol(p, Decl(computedPropertyNamesContextualType7_ES6.ts, 6, 5)) + + 0: () => { }, + ["hi" + "bye"]: true, + [0 + 1]: 0, + [+"hi"]: [0] +}); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types index c9ed4437760..54d2afe4f61 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types @@ -23,18 +23,27 @@ foo({ p: "", >p : string +>"" : string 0: () => { }, >() => { } : () => void ["hi" + "bye"]: true, >"hi" + "bye" : string +>"hi" : string +>"bye" : string +>true : boolean [0 + 1]: 0, >0 + 1 : number +>0 : number +>1 : number +>0 : number [+"hi"]: [0] >+"hi" : number +>"hi" : string >[0] : number[] +>0 : number }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types.pull b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types.pull deleted file mode 100644 index c548aed2bae..00000000000 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types.pull +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7_ES6.ts === -interface I { ->I : I ->T : T - - [s: number]: T; ->s : number ->T : T -} - -declare function foo(obj: I): T ->foo : (obj: I) => T ->T : T ->obj : I ->I : I ->T : T ->T : T - -foo({ ->foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[] ->foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: number]: number | (() => void) | number[]; 0: () => void; p: string; } - - p: "", ->p : string - - 0: () => { }, ->() => { } : () => void - - ["hi" + "bye"]: true, ->"hi" + "bye" : string - - [0 + 1]: 0, ->0 + 1 : number - - [+"hi"]: [0] ->+"hi" : number ->[0] : number[] - -}); diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.symbols new file mode 100644 index 00000000000..cd10b9c77a1 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit1_ES5.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit1_ES5.ts, 0, 0)) + + ["" + ""]() { } + get ["" + ""]() { return 0; } + set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit1_ES5.ts, 3, 18)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types index a5fe3dc0fa1..a05d5556495 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types @@ -4,11 +4,18 @@ class C { ["" + ""]() { } >"" + "" : string +>"" : string +>"" : string get ["" + ""]() { return 0; } >"" + "" : string +>"" : string +>"" : string +>0 : number set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.symbols new file mode 100644 index 00000000000..96c9026d65b --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit1_ES6.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit1_ES6.ts, 0, 0)) + + ["" + ""]() { } + get ["" + ""]() { return 0; } + set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit1_ES6.ts, 3, 18)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types index a48c85f8602..8b635956dcd 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types @@ -4,11 +4,18 @@ class C { ["" + ""]() { } >"" + "" : string +>"" : string +>"" : string get ["" + ""]() { return 0; } >"" + "" : string +>"" : string +>"" : string +>0 : number set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.symbols new file mode 100644 index 00000000000..5f1fac066c4 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit2_ES5.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit2_ES5.ts, 0, 0)) + + static ["" + ""]() { } + static get ["" + ""]() { return 0; } + static set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit2_ES5.ts, 3, 25)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types index 949d82596c7..c49010b2c09 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types @@ -4,11 +4,18 @@ class C { static ["" + ""]() { } >"" + "" : string +>"" : string +>"" : string static get ["" + ""]() { return 0; } >"" + "" : string +>"" : string +>"" : string +>0 : number static set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.symbols new file mode 100644 index 00000000000..0797b7e6d7f --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit2_ES6.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit2_ES6.ts, 0, 0)) + + static ["" + ""]() { } + static get ["" + ""]() { return 0; } + static set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit2_ES6.ts, 3, 25)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types index eec55608a08..0b0083b9a1a 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types @@ -4,11 +4,18 @@ class C { static ["" + ""]() { } >"" + "" : string +>"" : string +>"" : string static get ["" + ""]() { return 0; } >"" + "" : string +>"" : string +>"" : string +>0 : number static set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.symbols new file mode 100644 index 00000000000..8d40d4c86c0 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES5.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNamesDeclarationEmit5_ES5.ts, 0, 3)) + + ["" + ""]: 0, + ["" + ""]() { }, + get ["" + ""]() { return 0; }, + set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit5_ES5.ts, 4, 18)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types index 3f5a7355a20..62faa5c2716 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types @@ -5,14 +5,24 @@ var v = { ["" + ""]: 0, >"" + "" : string +>"" : string +>"" : string +>0 : number ["" + ""]() { }, >"" + "" : string +>"" : string +>"" : string get ["" + ""]() { return 0; }, >"" + "" : string +>"" : string +>"" : string +>0 : number set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.symbols new file mode 100644 index 00000000000..e9a7b4b28ab --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesDeclarationEmit5_ES6.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNamesDeclarationEmit5_ES6.ts, 0, 3)) + + ["" + ""]: 0, + ["" + ""]() { }, + get ["" + ""]() { return 0; }, + set ["" + ""](x) { } +>x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit5_ES6.ts, 4, 18)) +} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types index 10b70587e32..3eb313d2687 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types @@ -5,14 +5,24 @@ var v = { ["" + ""]: 0, >"" + "" : string +>"" : string +>"" : string +>0 : number ["" + ""]() { }, >"" + "" : string +>"" : string +>"" : string get ["" + ""]() { return 0; }, >"" + "" : string +>"" : string +>"" : string +>0 : number set ["" + ""](x) { } >"" + "" : string +>"" : string +>"" : string >x : any } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols new file mode 100644 index 00000000000..89463c12c44 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES5.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesSourceMap1_ES5.ts, 0, 0)) + + ["hello"]() { + debugger; + } +} diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types index 1c57d97a7e8..7f467698a62 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types @@ -3,6 +3,8 @@ class C { >C : C ["hello"]() { +>"hello" : string + debugger; } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols new file mode 100644 index 00000000000..45d2acb2b10 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap1_ES6.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesSourceMap1_ES6.ts, 0, 0)) + + ["hello"]() { + debugger; + } +} diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types index d5dc8a857a0..4a78685e8a9 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types @@ -3,6 +3,8 @@ class C { >C : C ["hello"]() { +>"hello" : string + debugger; } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols new file mode 100644 index 00000000000..b9a389da636 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNamesSourceMap2_ES5.ts, 0, 3)) + + ["hello"]() { + debugger; + } +} diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types index 1dcc49a8fae..9470aee8eb6 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types @@ -4,6 +4,8 @@ var v = { >{ ["hello"]() { debugger; }} : {} ["hello"]() { +>"hello" : string + debugger; } } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols new file mode 100644 index 00000000000..6c9d1e1d5fd --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES6.ts === +var v = { +>v : Symbol(v, Decl(computedPropertyNamesSourceMap2_ES6.ts, 0, 3)) + + ["hello"]() { + debugger; + } +} diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types index 9a1c71364a2..c4f02155a95 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types @@ -4,6 +4,8 @@ var v = { >{ ["hello"]() { debugger; }} : {} ["hello"]() { +>"hello" : string + debugger; } } diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.symbols b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.symbols new file mode 100644 index 00000000000..70edfd89a97 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesWithStaticProperty.ts === +class C { +>C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) + + static staticProp = 10; +>staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) + + get [C.staticProp]() { +>C.staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) +>C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) +>staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) + + return "hello"; + } + set [C.staticProp](x: string) { +>C.staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) +>C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) +>staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) +>x : Symbol(x, Decl(computedPropertyNamesWithStaticProperty.ts, 5, 23)) + + var y = x; +>y : Symbol(y, Decl(computedPropertyNamesWithStaticProperty.ts, 6, 11)) +>x : Symbol(x, Decl(computedPropertyNamesWithStaticProperty.ts, 5, 23)) + } + [C.staticProp]() { } +>C.staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) +>C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) +>staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) +} diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types index b23d986f894..d003b6b32f1 100644 --- a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types @@ -4,6 +4,7 @@ class C { static staticProp = 10; >staticProp : number +>10 : number get [C.staticProp]() { >C.staticProp : number @@ -11,6 +12,7 @@ class C { >staticProp : number return "hello"; +>"hello" : string } set [C.staticProp](x: string) { >C.staticProp : number diff --git a/tests/baselines/reference/concatError.symbols b/tests/baselines/reference/concatError.symbols new file mode 100644 index 00000000000..6ed5ffd468f --- /dev/null +++ b/tests/baselines/reference/concatError.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/concatError.ts === + +var n1: number[]; +>n1 : Symbol(n1, Decl(concatError.ts, 1, 3)) + +/* +interface Array { + concat(...items: T[][]): T[]; // Note: This overload needs to be picked for arrays of arrays, even though both are applicable + concat(...items: T[]): T[]; +} +*/ +var fa: number[]; +>fa : Symbol(fa, Decl(concatError.ts, 8, 3)) + +fa = fa.concat([0]); +>fa : Symbol(fa, Decl(concatError.ts, 8, 3)) +>fa.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>fa : Symbol(fa, Decl(concatError.ts, 8, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) + +fa = fa.concat(0); +>fa : Symbol(fa, Decl(concatError.ts, 8, 3)) +>fa.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>fa : Symbol(fa, Decl(concatError.ts, 8, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) + + + + + +/* + + + + +declare class C { + public m(p1: C>): C; + //public p: T; +} + +var c: C; +var cc: C>; + +c = c.m(cc); +*/ diff --git a/tests/baselines/reference/concatError.types b/tests/baselines/reference/concatError.types index 46d74cfb6ec..c264e0b0204 100644 --- a/tests/baselines/reference/concatError.types +++ b/tests/baselines/reference/concatError.types @@ -20,6 +20,7 @@ fa = fa.concat([0]); >fa : number[] >concat : { (...items: U[]): number[]; (...items: number[]): number[]; } >[0] : number[] +>0 : number fa = fa.concat(0); >fa = fa.concat(0) : number[] @@ -28,6 +29,7 @@ fa = fa.concat(0); >fa.concat : { (...items: U[]): number[]; (...items: number[]): number[]; } >fa : number[] >concat : { (...items: U[]): number[]; (...items: number[]): number[]; } +>0 : number diff --git a/tests/baselines/reference/conditionalExpressions2.symbols b/tests/baselines/reference/conditionalExpressions2.symbols new file mode 100644 index 00000000000..63c8b417477 --- /dev/null +++ b/tests/baselines/reference/conditionalExpressions2.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/conditionalExpressions2.ts === +var a = false ? 1 : null; +>a : Symbol(a, Decl(conditionalExpressions2.ts, 0, 3)) + +var b = false ? undefined : 0; +>b : Symbol(b, Decl(conditionalExpressions2.ts, 1, 3)) +>undefined : Symbol(undefined) + +var c = false ? 1 : 0; +>c : Symbol(c, Decl(conditionalExpressions2.ts, 2, 3)) + +var d = false ? false : true; +>d : Symbol(d, Decl(conditionalExpressions2.ts, 3, 3)) + +var e = false ? "foo" : "bar"; +>e : Symbol(e, Decl(conditionalExpressions2.ts, 4, 3)) + +var f = false ? null : undefined; +>f : Symbol(f, Decl(conditionalExpressions2.ts, 5, 3)) +>undefined : Symbol(undefined) + +var g = true ? {g:5} : null; +>g : Symbol(g, Decl(conditionalExpressions2.ts, 6, 3)) +>g : Symbol(g, Decl(conditionalExpressions2.ts, 6, 16)) + +var h = [{h:5}, null]; +>h : Symbol(h, Decl(conditionalExpressions2.ts, 7, 3)) +>h : Symbol(h, Decl(conditionalExpressions2.ts, 7, 10)) + +function i() { if (true) { return { x: 5 }; } else { return null; } } +>i : Symbol(i, Decl(conditionalExpressions2.ts, 7, 22)) +>x : Symbol(x, Decl(conditionalExpressions2.ts, 8, 35)) + diff --git a/tests/baselines/reference/conditionalExpressions2.types b/tests/baselines/reference/conditionalExpressions2.types index 7fa483ad348..5f49410b1e4 100644 --- a/tests/baselines/reference/conditionalExpressions2.types +++ b/tests/baselines/reference/conditionalExpressions2.types @@ -2,43 +2,67 @@ var a = false ? 1 : null; >a : number >false ? 1 : null : number +>false : boolean +>1 : number +>null : null var b = false ? undefined : 0; >b : number >false ? undefined : 0 : number +>false : boolean >undefined : undefined +>0 : number var c = false ? 1 : 0; >c : number >false ? 1 : 0 : number +>false : boolean +>1 : number +>0 : number var d = false ? false : true; >d : boolean >false ? false : true : boolean +>false : boolean +>false : boolean +>true : boolean var e = false ? "foo" : "bar"; >e : string >false ? "foo" : "bar" : string +>false : boolean +>"foo" : string +>"bar" : string var f = false ? null : undefined; >f : any >false ? null : undefined : null +>false : boolean +>null : null >undefined : undefined var g = true ? {g:5} : null; >g : { g: number; } >true ? {g:5} : null : { g: number; } +>true : boolean >{g:5} : { g: number; } >g : number +>5 : number +>null : null var h = [{h:5}, null]; >h : { h: number; }[] >[{h:5}, null] : { h: number; }[] >{h:5} : { h: number; } >h : number +>5 : number +>null : null function i() { if (true) { return { x: 5 }; } else { return null; } } >i : () => { x: number; } +>true : boolean >{ x: 5 } : { x: number; } >x : number +>5 : number +>null : null diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.symbols b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.symbols new file mode 100644 index 00000000000..eade67512ad --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.symbols @@ -0,0 +1,223 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsBooleanType.ts === +//Cond ? Expr1 : Expr2, Cond is of boolean type, Expr1 and Expr2 have the same type +var condBoolean: boolean; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) + +var exprAny1: any; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) + +var exprBoolean1: boolean; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +var exprNumber1: number; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) + +var exprString1: string; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) + +var exprIsObject1: Object; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny2: any; +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +var exprBoolean2: boolean; +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +var exprNumber2: number; +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +var exprString2: string; +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +var exprIsObject2: Object; +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//Cond is a boolean type variable +condBoolean ? exprAny1 : exprAny2; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +condBoolean ? exprBoolean1 : exprBoolean2; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +condBoolean ? exprNumber1 : exprNumber2; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +condBoolean ? exprString1 : exprString2; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +condBoolean ? exprIsObject1 : exprIsObject2; +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +condBoolean ? exprString1 : exprBoolean1; // union +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +//Cond is a boolean type literal +true ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +false ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +true ? exprNumber1 : exprNumber2; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +false ? exprString1 : exprString2; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +true ? exprIsObject1 : exprIsObject2; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +true ? exprString1 : exprBoolean1; // union +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +//Cond is a boolean type expression +!true ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +typeof "123" == "string" ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +2 > 1 ? exprNumber1 : exprNumber2; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +null === undefined ? exprString1 : exprString2; +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +true || false ? exprIsObject1 : exprIsObject2; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +null === undefined ? exprString1 : exprBoolean1; // union +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condBoolean ? exprAny1 : exprAny2; +>resultIsAny1 : Symbol(resultIsAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 40, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +var resultIsBoolean1 = condBoolean ? exprBoolean1 : exprBoolean2; +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 41, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +var resultIsNumber1 = condBoolean ? exprNumber1 : exprNumber2; +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 42, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +var resultIsString1 = condBoolean ? exprString1 : exprString2; +>resultIsString1 : Symbol(resultIsString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 43, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +var resultIsObject1 = condBoolean ? exprIsObject1 : exprIsObject2; +>resultIsObject1 : Symbol(resultIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 44, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +var resultIsStringOrBoolean1 = condBoolean ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean1 : Symbol(resultIsStringOrBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 45, 3)) +>condBoolean : Symbol(condBoolean, Decl(conditionalOperatorConditionIsBooleanType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +var resultIsAny2 = true ? exprAny1 : exprAny2; +>resultIsAny2 : Symbol(resultIsAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 47, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +var resultIsBoolean2 = false ? exprBoolean1 : exprBoolean2; +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 48, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +var resultIsNumber2 = true ? exprNumber1 : exprNumber2; +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 49, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +var resultIsString2 = false ? exprString1 : exprString2; +>resultIsString2 : Symbol(resultIsString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 50, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +var resultIsObject2 = true ? exprIsObject1 : exprIsObject2; +>resultIsObject2 : Symbol(resultIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 51, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +var resultIsStringOrBoolean2 = true ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean2 : Symbol(resultIsStringOrBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 52, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +var resultIsStringOrBoolean3 = false ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean3 : Symbol(resultIsStringOrBoolean3, Decl(conditionalOperatorConditionIsBooleanType.ts, 53, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + +var resultIsAny3 = !true ? exprAny1 : exprAny2; +>resultIsAny3 : Symbol(resultIsAny3, Decl(conditionalOperatorConditionIsBooleanType.ts, 55, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsBooleanType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsBooleanType.ts, 9, 3)) + +var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditionIsBooleanType.ts, 56, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsBooleanType.ts, 10, 3)) + +var resultIsNumber3 = 2 > 1 ? exprNumber1 : exprNumber2; +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(conditionalOperatorConditionIsBooleanType.ts, 57, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsBooleanType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsBooleanType.ts, 11, 3)) + +var resultIsString3 = null === undefined ? exprString1 : exprString2; +>resultIsString3 : Symbol(resultIsString3, Decl(conditionalOperatorConditionIsBooleanType.ts, 58, 3)) +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsBooleanType.ts, 12, 3)) + +var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; +>resultIsObject3 : Symbol(resultIsObject3, Decl(conditionalOperatorConditionIsBooleanType.ts, 59, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsBooleanType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsBooleanType.ts, 13, 3)) + +var resultIsStringOrBoolean4 = typeof "123" === "string" ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean4 : Symbol(resultIsStringOrBoolean4, Decl(conditionalOperatorConditionIsBooleanType.ts, 60, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsBooleanType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsBooleanType.ts, 4, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types index 44fc9f5ed7b..4d28939b696 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types @@ -75,31 +75,37 @@ condBoolean ? exprString1 : exprBoolean1; // union //Cond is a boolean type literal true ? exprAny1 : exprAny2; >true ? exprAny1 : exprAny2 : any +>true : boolean >exprAny1 : any >exprAny2 : any false ? exprBoolean1 : exprBoolean2; >false ? exprBoolean1 : exprBoolean2 : boolean +>false : boolean >exprBoolean1 : boolean >exprBoolean2 : boolean true ? exprNumber1 : exprNumber2; >true ? exprNumber1 : exprNumber2 : number +>true : boolean >exprNumber1 : number >exprNumber2 : number false ? exprString1 : exprString2; >false ? exprString1 : exprString2 : string +>false : boolean >exprString1 : string >exprString2 : string true ? exprIsObject1 : exprIsObject2; >true ? exprIsObject1 : exprIsObject2 : Object +>true : boolean >exprIsObject1 : Object >exprIsObject2 : Object true ? exprString1 : exprBoolean1; // union >true ? exprString1 : exprBoolean1 : string | boolean +>true : boolean >exprString1 : string >exprBoolean1 : boolean @@ -107,6 +113,7 @@ true ? exprString1 : exprBoolean1; // union !true ? exprAny1 : exprAny2; >!true ? exprAny1 : exprAny2 : any >!true : boolean +>true : boolean >exprAny1 : any >exprAny2 : any @@ -114,18 +121,23 @@ typeof "123" == "string" ? exprBoolean1 : exprBoolean2; >typeof "123" == "string" ? exprBoolean1 : exprBoolean2 : boolean >typeof "123" == "string" : boolean >typeof "123" : string +>"123" : string +>"string" : string >exprBoolean1 : boolean >exprBoolean2 : boolean 2 > 1 ? exprNumber1 : exprNumber2; >2 > 1 ? exprNumber1 : exprNumber2 : number >2 > 1 : boolean +>2 : number +>1 : number >exprNumber1 : number >exprNumber2 : number null === undefined ? exprString1 : exprString2; >null === undefined ? exprString1 : exprString2 : string >null === undefined : boolean +>null : null >undefined : undefined >exprString1 : string >exprString2 : string @@ -133,12 +145,15 @@ null === undefined ? exprString1 : exprString2; true || false ? exprIsObject1 : exprIsObject2; >true || false ? exprIsObject1 : exprIsObject2 : Object >true || false : boolean +>true : boolean +>false : boolean >exprIsObject1 : Object >exprIsObject2 : Object null === undefined ? exprString1 : exprBoolean1; // union >null === undefined ? exprString1 : exprBoolean1 : string | boolean >null === undefined : boolean +>null : null >undefined : undefined >exprString1 : string >exprBoolean1 : boolean @@ -189,42 +204,49 @@ var resultIsStringOrBoolean1 = condBoolean ? exprString1 : exprBoolean1; // unio var resultIsAny2 = true ? exprAny1 : exprAny2; >resultIsAny2 : any >true ? exprAny1 : exprAny2 : any +>true : boolean >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = false ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >false ? exprBoolean1 : exprBoolean2 : boolean +>false : boolean >exprBoolean1 : boolean >exprBoolean2 : boolean var resultIsNumber2 = true ? exprNumber1 : exprNumber2; >resultIsNumber2 : number >true ? exprNumber1 : exprNumber2 : number +>true : boolean >exprNumber1 : number >exprNumber2 : number var resultIsString2 = false ? exprString1 : exprString2; >resultIsString2 : string >false ? exprString1 : exprString2 : string +>false : boolean >exprString1 : string >exprString2 : string var resultIsObject2 = true ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >true ? exprIsObject1 : exprIsObject2 : Object +>true : boolean >exprIsObject1 : Object >exprIsObject2 : Object var resultIsStringOrBoolean2 = true ? exprString1 : exprBoolean1; // union >resultIsStringOrBoolean2 : string | boolean >true ? exprString1 : exprBoolean1 : string | boolean +>true : boolean >exprString1 : string >exprBoolean1 : boolean var resultIsStringOrBoolean3 = false ? exprString1 : exprBoolean1; // union >resultIsStringOrBoolean3 : string | boolean >false ? exprString1 : exprBoolean1 : string | boolean +>false : boolean >exprString1 : string >exprBoolean1 : boolean @@ -232,6 +254,7 @@ var resultIsAny3 = !true ? exprAny1 : exprAny2; >resultIsAny3 : any >!true ? exprAny1 : exprAny2 : any >!true : boolean +>true : boolean >exprAny1 : any >exprAny2 : any @@ -240,6 +263,8 @@ var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; >typeof "123" == "string" ? exprBoolean1 : exprBoolean2 : boolean >typeof "123" == "string" : boolean >typeof "123" : string +>"123" : string +>"string" : string >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -247,6 +272,8 @@ var resultIsNumber3 = 2 > 1 ? exprNumber1 : exprNumber2; >resultIsNumber3 : number >2 > 1 ? exprNumber1 : exprNumber2 : number >2 > 1 : boolean +>2 : number +>1 : number >exprNumber1 : number >exprNumber2 : number @@ -254,6 +281,7 @@ var resultIsString3 = null === undefined ? exprString1 : exprString2; >resultIsString3 : string >null === undefined ? exprString1 : exprString2 : string >null === undefined : boolean +>null : null >undefined : undefined >exprString1 : string >exprString2 : string @@ -262,6 +290,8 @@ var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; >resultIsObject3 : Object >true || false ? exprIsObject1 : exprIsObject2 : Object >true || false : boolean +>true : boolean +>false : boolean >exprIsObject1 : Object >exprIsObject2 : Object @@ -270,6 +300,8 @@ var resultIsStringOrBoolean4 = typeof "123" === "string" ? exprString1 : exprBoo >typeof "123" === "string" ? exprString1 : exprBoolean1 : string | boolean >typeof "123" === "string" : boolean >typeof "123" : string +>"123" : string +>"string" : string >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.symbols b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.symbols new file mode 100644 index 00000000000..8ece5961636 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.symbols @@ -0,0 +1,234 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsNumberType.ts === +//Cond ? Expr1 : Expr2, Cond is of number type, Expr1 and Expr2 have the same type +var condNumber: number; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) + +var exprAny1: any; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) + +var exprBoolean1: boolean; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +var exprNumber1: number; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) + +var exprString1: string; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) + +var exprIsObject1: Object; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny2: any; +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +var exprBoolean2: boolean; +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +var exprNumber2: number; +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +var exprString2: string; +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +var exprIsObject2: Object; +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//Cond is a number type variable +condNumber ? exprAny1 : exprAny2; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +condNumber ? exprBoolean1 : exprBoolean2; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +condNumber ? exprNumber1 : exprNumber2; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +condNumber ? exprString1 : exprString2; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +condNumber ? exprIsObject1 : exprIsObject2; +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +condNumber ? exprString1 : exprBoolean1; // Union +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +//Cond is a number type literal +1 ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +0 ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +0.123456789 ? exprNumber1 : exprNumber2; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +- 10000000000000 ? exprString1 : exprString2; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +1000000000000 ? exprIsObject1 : exprIsObject2; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +10000 ? exprString1 : exprBoolean1; // Union +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +//Cond is a number type expression +function foo() { return 1 }; +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) + +var array = [1, 2, 3]; +>array : Symbol(array, Decl(conditionalOperatorConditionIsNumberType.ts, 33, 3)) + +1 * 0 ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +1 + 1 ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +"string".length ? exprNumber1 : exprNumber2; +>"string".length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +foo() ? exprString1 : exprString2; +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +foo() / array[1] ? exprIsObject1 : exprIsObject2; +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>array : Symbol(array, Decl(conditionalOperatorConditionIsNumberType.ts, 33, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +foo() ? exprString1 : exprBoolean1; // Union +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condNumber ? exprAny1 : exprAny2; +>resultIsAny1 : Symbol(resultIsAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 43, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +var resultIsBoolean1 = condNumber ? exprBoolean1 : exprBoolean2; +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 44, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +var resultIsNumber1 = condNumber ? exprNumber1 : exprNumber2; +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 45, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +var resultIsString1 = condNumber ? exprString1 : exprString2; +>resultIsString1 : Symbol(resultIsString1, Decl(conditionalOperatorConditionIsNumberType.ts, 46, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +var resultIsObject1 = condNumber ? exprIsObject1 : exprIsObject2; +>resultIsObject1 : Symbol(resultIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 47, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +var resultIsStringOrBoolean1 = condNumber ? exprString1 : exprBoolean1; // Union +>resultIsStringOrBoolean1 : Symbol(resultIsStringOrBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 48, 3)) +>condNumber : Symbol(condNumber, Decl(conditionalOperatorConditionIsNumberType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +var resultIsAny2 = 1 ? exprAny1 : exprAny2; +>resultIsAny2 : Symbol(resultIsAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 50, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +var resultIsBoolean2 = 0 ? exprBoolean1 : exprBoolean2; +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 51, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +var resultIsNumber2 = 0.123456789 ? exprNumber1 : exprNumber2; +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 52, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +var resultIsString2 = - 10000000000000 ? exprString1 : exprString2; +>resultIsString2 : Symbol(resultIsString2, Decl(conditionalOperatorConditionIsNumberType.ts, 53, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +var resultIsObject2 = 1000000000000 ? exprIsObject1 : exprIsObject2; +>resultIsObject2 : Symbol(resultIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 54, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +var resultIsStringOrBoolean2 = 10000 ? exprString1 : exprBoolean1; // Union +>resultIsStringOrBoolean2 : Symbol(resultIsStringOrBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 55, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + +var resultIsAny3 = 1 * 0 ? exprAny1 : exprAny2; +>resultIsAny3 : Symbol(resultIsAny3, Decl(conditionalOperatorConditionIsNumberType.ts, 57, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsNumberType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsNumberType.ts, 9, 3)) + +var resultIsBoolean3 = 1 + 1 ? exprBoolean1 : exprBoolean2; +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditionIsNumberType.ts, 58, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsNumberType.ts, 10, 3)) + +var resultIsNumber3 = "string".length ? exprNumber1 : exprNumber2; +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(conditionalOperatorConditionIsNumberType.ts, 59, 3)) +>"string".length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsNumberType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsNumberType.ts, 11, 3)) + +var resultIsString3 = foo() ? exprString1 : exprString2; +>resultIsString3 : Symbol(resultIsString3, Decl(conditionalOperatorConditionIsNumberType.ts, 60, 3)) +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsNumberType.ts, 12, 3)) + +var resultIsObject3 = foo() / array[1] ? exprIsObject1 : exprIsObject2; +>resultIsObject3 : Symbol(resultIsObject3, Decl(conditionalOperatorConditionIsNumberType.ts, 61, 3)) +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>array : Symbol(array, Decl(conditionalOperatorConditionIsNumberType.ts, 33, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsNumberType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsNumberType.ts, 13, 3)) + +var resultIsStringOrBoolean3 = foo() / array[1] ? exprString1 : exprBoolean1; // Union +>resultIsStringOrBoolean3 : Symbol(resultIsStringOrBoolean3, Decl(conditionalOperatorConditionIsNumberType.ts, 62, 3)) +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsNumberType.ts, 29, 35)) +>array : Symbol(array, Decl(conditionalOperatorConditionIsNumberType.ts, 33, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsNumberType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsNumberType.ts, 4, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types index 99a81081d6b..5951dc07350 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types @@ -75,58 +75,73 @@ condNumber ? exprString1 : exprBoolean1; // Union //Cond is a number type literal 1 ? exprAny1 : exprAny2; >1 ? exprAny1 : exprAny2 : any +>1 : number >exprAny1 : any >exprAny2 : any 0 ? exprBoolean1 : exprBoolean2; >0 ? exprBoolean1 : exprBoolean2 : boolean +>0 : number >exprBoolean1 : boolean >exprBoolean2 : boolean 0.123456789 ? exprNumber1 : exprNumber2; >0.123456789 ? exprNumber1 : exprNumber2 : number +>0.123456789 : number >exprNumber1 : number >exprNumber2 : number - 10000000000000 ? exprString1 : exprString2; >- 10000000000000 ? exprString1 : exprString2 : string >- 10000000000000 : number +>10000000000000 : number >exprString1 : string >exprString2 : string 1000000000000 ? exprIsObject1 : exprIsObject2; >1000000000000 ? exprIsObject1 : exprIsObject2 : Object +>1000000000000 : number >exprIsObject1 : Object >exprIsObject2 : Object 10000 ? exprString1 : exprBoolean1; // Union >10000 ? exprString1 : exprBoolean1 : string | boolean +>10000 : number >exprString1 : string >exprBoolean1 : boolean //Cond is a number type expression function foo() { return 1 }; >foo : () => number +>1 : number var array = [1, 2, 3]; >array : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number 1 * 0 ? exprAny1 : exprAny2; >1 * 0 ? exprAny1 : exprAny2 : any >1 * 0 : number +>1 : number +>0 : number >exprAny1 : any >exprAny2 : any 1 + 1 ? exprBoolean1 : exprBoolean2; >1 + 1 ? exprBoolean1 : exprBoolean2 : boolean >1 + 1 : number +>1 : number +>1 : number >exprBoolean1 : boolean >exprBoolean2 : boolean "string".length ? exprNumber1 : exprNumber2; >"string".length ? exprNumber1 : exprNumber2 : number >"string".length : number +>"string" : string >length : number >exprNumber1 : number >exprNumber2 : number @@ -145,6 +160,7 @@ foo() / array[1] ? exprIsObject1 : exprIsObject2; >foo : () => number >array[1] : number >array : number[] +>1 : number >exprIsObject1 : Object >exprIsObject2 : Object @@ -201,18 +217,21 @@ var resultIsStringOrBoolean1 = condNumber ? exprString1 : exprBoolean1; // Union var resultIsAny2 = 1 ? exprAny1 : exprAny2; >resultIsAny2 : any >1 ? exprAny1 : exprAny2 : any +>1 : number >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = 0 ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >0 ? exprBoolean1 : exprBoolean2 : boolean +>0 : number >exprBoolean1 : boolean >exprBoolean2 : boolean var resultIsNumber2 = 0.123456789 ? exprNumber1 : exprNumber2; >resultIsNumber2 : number >0.123456789 ? exprNumber1 : exprNumber2 : number +>0.123456789 : number >exprNumber1 : number >exprNumber2 : number @@ -220,18 +239,21 @@ var resultIsString2 = - 10000000000000 ? exprString1 : exprString2; >resultIsString2 : string >- 10000000000000 ? exprString1 : exprString2 : string >- 10000000000000 : number +>10000000000000 : number >exprString1 : string >exprString2 : string var resultIsObject2 = 1000000000000 ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >1000000000000 ? exprIsObject1 : exprIsObject2 : Object +>1000000000000 : number >exprIsObject1 : Object >exprIsObject2 : Object var resultIsStringOrBoolean2 = 10000 ? exprString1 : exprBoolean1; // Union >resultIsStringOrBoolean2 : string | boolean >10000 ? exprString1 : exprBoolean1 : string | boolean +>10000 : number >exprString1 : string >exprBoolean1 : boolean @@ -239,6 +261,8 @@ var resultIsAny3 = 1 * 0 ? exprAny1 : exprAny2; >resultIsAny3 : any >1 * 0 ? exprAny1 : exprAny2 : any >1 * 0 : number +>1 : number +>0 : number >exprAny1 : any >exprAny2 : any @@ -246,6 +270,8 @@ var resultIsBoolean3 = 1 + 1 ? exprBoolean1 : exprBoolean2; >resultIsBoolean3 : boolean >1 + 1 ? exprBoolean1 : exprBoolean2 : boolean >1 + 1 : number +>1 : number +>1 : number >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -253,6 +279,7 @@ var resultIsNumber3 = "string".length ? exprNumber1 : exprNumber2; >resultIsNumber3 : number >"string".length ? exprNumber1 : exprNumber2 : number >"string".length : number +>"string" : string >length : number >exprNumber1 : number >exprNumber2 : number @@ -273,6 +300,7 @@ var resultIsObject3 = foo() / array[1] ? exprIsObject1 : exprIsObject2; >foo : () => number >array[1] : number >array : number[] +>1 : number >exprIsObject1 : Object >exprIsObject2 : Object @@ -284,6 +312,7 @@ var resultIsStringOrBoolean3 = foo() / array[1] ? exprString1 : exprBoolean1; // >foo : () => number >array[1] : number >array : number[] +>1 : number >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.symbols b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.symbols new file mode 100644 index 00000000000..41f00e53b26 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.symbols @@ -0,0 +1,273 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts === +//Cond ? Expr1 : Expr2, Cond is of object type, Expr1 and Expr2 have the same type +var condObject: Object; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny1: any; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) + +var exprBoolean1: boolean; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +var exprNumber1: number; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) + +var exprString1: string; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) + +var exprIsObject1: Object; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny2: any; +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +var exprBoolean2: boolean; +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +var exprNumber2: number; +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +var exprString2: string; +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +var exprIsObject2: Object; +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +function foo() { }; +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 26)) + +class C { static doIt: () => void }; +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) + +//Cond is an object type variable +condObject ? exprAny1 : exprAny2; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +condObject ? exprBoolean1 : exprBoolean2; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +condObject ? exprNumber1 : exprNumber2; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +condObject ? exprString1 : exprString2; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +condObject ? exprIsObject1 : exprIsObject2; +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +condObject ? exprString1 : exprBoolean1; // union +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +//Cond is an object type literal +((a: string) => a.length) ? exprAny1 : exprAny2; +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 27, 2)) +>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 27, 2)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +((a: string) => a.length) ? exprBoolean1 : exprBoolean2; +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 28, 2)) +>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 28, 2)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +({}) ? exprNumber1 : exprNumber2; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +({ a: 1, b: "s" }) ? exprString1 : exprString2; +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 30, 2)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 30, 8)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 31, 2)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 31, 8)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +({ a: 1, b: "s" }) ? exprString1: exprBoolean1; // union +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 32, 2)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 32, 8)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +//Cond is an object type expression +foo() ? exprAny1 : exprAny2; +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 26)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +new Date() ? exprBoolean1 : exprBoolean2; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +new C() ? exprNumber1 : exprNumber2; +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +C.doIt() ? exprString1 : exprString2; +>C.doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +condObject.valueOf() ? exprIsObject1 : exprIsObject2; +>condObject.valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +new Date() ? exprString1 : exprBoolean1; // union +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condObject ? exprAny1 : exprAny2; +>resultIsAny1 : Symbol(resultIsAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 43, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +var resultIsBoolean1 = condObject ? exprBoolean1 : exprBoolean2; +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 44, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +var resultIsNumber1 = condObject ? exprNumber1 : exprNumber2; +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 45, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +var resultIsString1 = condObject ? exprString1 : exprString2; +>resultIsString1 : Symbol(resultIsString1, Decl(conditionalOperatorConditionIsObjectType.ts, 46, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +var resultIsObject1 = condObject ? exprIsObject1 : exprIsObject2; +>resultIsObject1 : Symbol(resultIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 47, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +var resultIsStringOrBoolean1 = condObject ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean1 : Symbol(resultIsStringOrBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 48, 3)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +var resultIsAny2 = ((a: string) => a.length) ? exprAny1 : exprAny2; +>resultIsAny2 : Symbol(resultIsAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 50, 3)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 50, 21)) +>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 50, 21)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +var resultIsBoolean2 = ((a: string) => a.length) ? exprBoolean1 : exprBoolean2; +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 51, 3)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 51, 25)) +>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 51, 25)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +var resultIsNumber2 = ({}) ? exprNumber1 : exprNumber2; +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 52, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +var resultIsString2 = ({ a: 1, b: "s" }) ? exprString1 : exprString2; +>resultIsString2 : Symbol(resultIsString2, Decl(conditionalOperatorConditionIsObjectType.ts, 53, 3)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 53, 24)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 53, 30)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +var resultIsObject2 = ({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; +>resultIsObject2 : Symbol(resultIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 54, 3)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 54, 24)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 54, 30)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +var resultIsStringOrBoolean2 = ({ a: 1, b: "s" }) ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean2 : Symbol(resultIsStringOrBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 55, 3)) +>a : Symbol(a, Decl(conditionalOperatorConditionIsObjectType.ts, 55, 33)) +>b : Symbol(b, Decl(conditionalOperatorConditionIsObjectType.ts, 55, 39)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + +var resultIsAny3 = foo() ? exprAny1 : exprAny2; +>resultIsAny3 : Symbol(resultIsAny3, Decl(conditionalOperatorConditionIsObjectType.ts, 57, 3)) +>foo : Symbol(foo, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 26)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditionIsObjectType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) + +var resultIsBoolean3 = new Date() ? exprBoolean1 : exprBoolean2; +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditionIsObjectType.ts, 58, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) + +var resultIsNumber3 = new C() ? exprNumber1 : exprNumber2; +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(conditionalOperatorConditionIsObjectType.ts, 59, 3)) +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditionIsObjectType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditionIsObjectType.ts, 11, 3)) + +var resultIsString3 = C.doIt() ? exprString1 : exprString2; +>resultIsString3 : Symbol(resultIsString3, Decl(conditionalOperatorConditionIsObjectType.ts, 60, 3)) +>C.doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditionIsObjectType.ts, 12, 3)) + +var resultIsObject3 = condObject.valueOf() ? exprIsObject1 : exprIsObject2; +>resultIsObject3 : Symbol(resultIsObject3, Decl(conditionalOperatorConditionIsObjectType.ts, 61, 3)) +>condObject.valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) +>condObject : Symbol(condObject, Decl(conditionalOperatorConditionIsObjectType.ts, 1, 3)) +>valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditionIsObjectType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) + +var resultIsStringOrBoolean3 = C.doIt() ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean3 : Symbol(resultIsStringOrBoolean3, Decl(conditionalOperatorConditionIsObjectType.ts, 62, 3)) +>C.doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>C : Symbol(C, Decl(conditionalOperatorConditionIsObjectType.ts, 15, 19)) +>doIt : Symbol(C.doIt, Decl(conditionalOperatorConditionIsObjectType.ts, 16, 9)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types index f99c591b593..14a0f375ead 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types @@ -115,7 +115,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprString1 : string >exprString2 : string @@ -124,7 +126,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprIsObject1 : Object >exprIsObject2 : Object @@ -133,7 +137,9 @@ condObject ? exprString1 : exprBoolean1; // union >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprString1 : string >exprBoolean1 : boolean @@ -265,7 +271,9 @@ var resultIsString2 = ({ a: 1, b: "s" }) ? exprString1 : exprString2; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprString1 : string >exprString2 : string @@ -275,7 +283,9 @@ var resultIsObject2 = ({ a: 1, b: "s" }) ? exprIsObject1 : exprIsObject2; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprIsObject1 : Object >exprIsObject2 : Object @@ -285,7 +295,9 @@ var resultIsStringOrBoolean2 = ({ a: 1, b: "s" }) ? exprString1 : exprBoolean1; >({ a: 1, b: "s" }) : { a: number; b: string; } >{ a: 1, b: "s" } : { a: number; b: string; } >a : number +>1 : number >b : string +>"s" : string >exprString1 : string >exprBoolean1 : boolean diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.symbols b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.symbols new file mode 100644 index 00000000000..aaaf4124eb6 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.symbols @@ -0,0 +1,251 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditoinIsAnyType.ts === +//Cond ? Expr1 : Expr2, Cond is of any type, Expr1 and Expr2 have the same type +var condAny: any; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) + +var x: any; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) + +var exprAny1: any; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) + +var exprBoolean1: boolean; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +var exprNumber1: number; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) + +var exprString1: string; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) + +var exprIsObject1: Object; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny2: any; +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +var exprBoolean2: boolean; +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +var exprNumber2: number; +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +var exprString2: string; +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +var exprIsObject2: Object; +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//Cond is an any type variable +condAny ? exprAny1 : exprAny2; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +condAny ? exprBoolean1 : exprBoolean2; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +condAny ? exprNumber1 : exprNumber2; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +condAny ? exprString1 : exprString2; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +condAny ? exprIsObject1 : exprIsObject2; +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +condAny ? exprString1 : exprBoolean1; // union +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +//Cond is an any type literal +null ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +null ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +undefined ? exprNumber1 : exprNumber2; +>undefined : Symbol(undefined) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +[null, undefined] ? exprString1 : exprString2; +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +[null, undefined] ? exprIsObject1 : exprIsObject2; +>undefined : Symbol(undefined) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +undefined ? exprString1 : exprBoolean1; // union +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +//Cond is an any type expression +x.doSomeThing() ? exprAny1 : exprAny2; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +x("x") ? exprBoolean1 : exprBoolean2; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +x(x) ? exprNumber1 : exprNumber2; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +x("x") ? exprString1 : exprString2; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +x.doSomeThing() ? exprIsObject1 : exprIsObject2; +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +x.doSomeThing() ? exprString1 : exprBoolean1; // union +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condAny ? exprAny1 : exprAny2; +>resultIsAny1 : Symbol(resultIsAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 41, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +var resultIsBoolean1 = condAny ? exprBoolean1 : exprBoolean2; +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 42, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +var resultIsNumber1 = condAny ? exprNumber1 : exprNumber2; +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 43, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +var resultIsString1 = condAny ? exprString1 : exprString2; +>resultIsString1 : Symbol(resultIsString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 44, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +var resultIsObject1 = condAny ? exprIsObject1 : exprIsObject2; +>resultIsObject1 : Symbol(resultIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 45, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +var resultIsStringOrBoolean1 = condAny ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean1 : Symbol(resultIsStringOrBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 46, 3)) +>condAny : Symbol(condAny, Decl(conditionalOperatorConditoinIsAnyType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +var resultIsAny2 = null ? exprAny1 : exprAny2; +>resultIsAny2 : Symbol(resultIsAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 48, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +var resultIsBoolean2 = null ? exprBoolean1 : exprBoolean2; +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 49, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +var resultIsNumber2 = undefined ? exprNumber1 : exprNumber2; +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 50, 3)) +>undefined : Symbol(undefined) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +var resultIsString2 = [null, undefined] ? exprString1 : exprString2; +>resultIsString2 : Symbol(resultIsString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 51, 3)) +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +var resultIsObject2 = [null, undefined] ? exprIsObject1 : exprIsObject2; +>resultIsObject2 : Symbol(resultIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 52, 3)) +>undefined : Symbol(undefined) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +var resultIsStringOrBoolean2 = null ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean2 : Symbol(resultIsStringOrBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 53, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +var resultIsStringOrBoolean3 = undefined ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean3 : Symbol(resultIsStringOrBoolean3, Decl(conditionalOperatorConditoinIsAnyType.ts, 54, 3)) +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +var resultIsStringOrBoolean4 = [null, undefined] ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean4 : Symbol(resultIsStringOrBoolean4, Decl(conditionalOperatorConditoinIsAnyType.ts, 55, 3)) +>undefined : Symbol(undefined) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + +var resultIsAny3 = x.doSomeThing() ? exprAny1 : exprAny2; +>resultIsAny3 : Symbol(resultIsAny3, Decl(conditionalOperatorConditoinIsAnyType.ts, 57, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsAnyType.ts, 4, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsAnyType.ts, 10, 3)) + +var resultIsBoolean3 = x("x") ? exprBoolean1 : exprBoolean2; +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditoinIsAnyType.ts, 58, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsAnyType.ts, 11, 3)) + +var resultIsNumber3 = x(x) ? exprNumber1 : exprNumber2; +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(conditionalOperatorConditoinIsAnyType.ts, 59, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsAnyType.ts, 6, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsAnyType.ts, 12, 3)) + +var resultIsString3 = x("x") ? exprString1 : exprString2; +>resultIsString3 : Symbol(resultIsString3, Decl(conditionalOperatorConditoinIsAnyType.ts, 60, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsAnyType.ts, 13, 3)) + +var resultIsObject3 = x.doSomeThing() ? exprIsObject1 : exprIsObject2; +>resultIsObject3 : Symbol(resultIsObject3, Decl(conditionalOperatorConditoinIsAnyType.ts, 61, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsAnyType.ts, 8, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsAnyType.ts, 14, 3)) + +var resultIsStringOrBoolean5 = x.doSomeThing() ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean5 : Symbol(resultIsStringOrBoolean5, Decl(conditionalOperatorConditoinIsAnyType.ts, 62, 3)) +>x : Symbol(x, Decl(conditionalOperatorConditoinIsAnyType.ts, 2, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsAnyType.ts, 7, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsAnyType.ts, 5, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types index 6542377795f..d79e570ec42 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types +++ b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types @@ -78,11 +78,13 @@ condAny ? exprString1 : exprBoolean1; // union //Cond is an any type literal null ? exprAny1 : exprAny2; >null ? exprAny1 : exprAny2 : any +>null : null >exprAny1 : any >exprAny2 : any null ? exprBoolean1 : exprBoolean2; >null ? exprBoolean1 : exprBoolean2 : boolean +>null : null >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -95,6 +97,7 @@ undefined ? exprNumber1 : exprNumber2; [null, undefined] ? exprString1 : exprString2; >[null, undefined] ? exprString1 : exprString2 : string >[null, undefined] : null[] +>null : null >undefined : undefined >exprString1 : string >exprString2 : string @@ -102,6 +105,7 @@ undefined ? exprNumber1 : exprNumber2; [null, undefined] ? exprIsObject1 : exprIsObject2; >[null, undefined] ? exprIsObject1 : exprIsObject2 : Object >[null, undefined] : null[] +>null : null >undefined : undefined >exprIsObject1 : Object >exprIsObject2 : Object @@ -126,6 +130,7 @@ x("x") ? exprBoolean1 : exprBoolean2; >x("x") ? exprBoolean1 : exprBoolean2 : boolean >x("x") : any >x : any +>"x" : string >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -141,6 +146,7 @@ x("x") ? exprString1 : exprString2; >x("x") ? exprString1 : exprString2 : string >x("x") : any >x : any +>"x" : string >exprString1 : string >exprString2 : string @@ -208,12 +214,14 @@ var resultIsStringOrBoolean1 = condAny ? exprString1 : exprBoolean1; // union var resultIsAny2 = null ? exprAny1 : exprAny2; >resultIsAny2 : any >null ? exprAny1 : exprAny2 : any +>null : null >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = null ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >null ? exprBoolean1 : exprBoolean2 : boolean +>null : null >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -228,6 +236,7 @@ var resultIsString2 = [null, undefined] ? exprString1 : exprString2; >resultIsString2 : string >[null, undefined] ? exprString1 : exprString2 : string >[null, undefined] : null[] +>null : null >undefined : undefined >exprString1 : string >exprString2 : string @@ -236,6 +245,7 @@ var resultIsObject2 = [null, undefined] ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >[null, undefined] ? exprIsObject1 : exprIsObject2 : Object >[null, undefined] : null[] +>null : null >undefined : undefined >exprIsObject1 : Object >exprIsObject2 : Object @@ -243,6 +253,7 @@ var resultIsObject2 = [null, undefined] ? exprIsObject1 : exprIsObject2; var resultIsStringOrBoolean2 = null ? exprString1 : exprBoolean1; // union >resultIsStringOrBoolean2 : string | boolean >null ? exprString1 : exprBoolean1 : string | boolean +>null : null >exprString1 : string >exprBoolean1 : boolean @@ -257,6 +268,7 @@ var resultIsStringOrBoolean4 = [null, undefined] ? exprString1 : exprBoolean1; / >resultIsStringOrBoolean4 : string | boolean >[null, undefined] ? exprString1 : exprBoolean1 : string | boolean >[null, undefined] : null[] +>null : null >undefined : undefined >exprString1 : string >exprBoolean1 : boolean @@ -276,6 +288,7 @@ var resultIsBoolean3 = x("x") ? exprBoolean1 : exprBoolean2; >x("x") ? exprBoolean1 : exprBoolean2 : boolean >x("x") : any >x : any +>"x" : string >exprBoolean1 : boolean >exprBoolean2 : boolean @@ -293,6 +306,7 @@ var resultIsString3 = x("x") ? exprString1 : exprString2; >x("x") ? exprString1 : exprString2 : string >x("x") : any >x : any +>"x" : string >exprString1 : string >exprString2 : string diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.symbols b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.symbols new file mode 100644 index 00000000000..76845a80ce6 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.symbols @@ -0,0 +1,245 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditoinIsStringType.ts === +//Cond ? Expr1 : Expr2, Cond is of string type, Expr1 and Expr2 have the same type +var condString: string; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) + +var exprAny1: any; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) + +var exprBoolean1: boolean; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +var exprNumber1: number; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) + +var exprString1: string; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) + +var exprIsObject1: Object; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var exprAny2: any; +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +var exprBoolean2: boolean; +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +var exprNumber2: number; +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +var exprString2: string; +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +var exprIsObject2: Object; +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +//Cond is a string type variable +condString ? exprAny1 : exprAny2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +condString ? exprBoolean1 : exprBoolean2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +condString ? exprNumber1 : exprNumber2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +condString ? exprString1 : exprString2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +condString ? exprIsObject1 : exprIsObject2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +condString ? exprString1 : exprBoolean1; // union +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +//Cond is a string type literal +"" ? exprAny1 : exprAny2; +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +"string" ? exprBoolean1 : exprBoolean2; +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +'c' ? exprNumber1 : exprNumber2; +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +'string' ? exprString1 : exprString2; +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +" " ? exprIsObject1 : exprIsObject2; +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +"hello " ? exprString1 : exprBoolean1; // union +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +//Cond is a string type expression +function foo() { return "string" }; +>foo : Symbol(foo, Decl(conditionalOperatorConditoinIsStringType.ts, 29, 38)) + +var array = ["1", "2", "3"]; +>array : Symbol(array, Decl(conditionalOperatorConditoinIsStringType.ts, 33, 3)) + +typeof condString ? exprAny1 : exprAny2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +condString.toUpperCase ? exprBoolean1 : exprBoolean2; +>condString.toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +condString + "string" ? exprNumber1 : exprNumber2; +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +foo() ? exprString1 : exprString2; +>foo : Symbol(foo, Decl(conditionalOperatorConditoinIsStringType.ts, 29, 38)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +array[1] ? exprIsObject1 : exprIsObject2; +>array : Symbol(array, Decl(conditionalOperatorConditoinIsStringType.ts, 33, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +foo() ? exprString1 : exprBoolean1; // union +>foo : Symbol(foo, Decl(conditionalOperatorConditoinIsStringType.ts, 29, 38)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +//Results shoud be same as Expr1 and Expr2 +var resultIsAny1 = condString ? exprAny1 : exprAny2; +>resultIsAny1 : Symbol(resultIsAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 43, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +var resultIsBoolean1 = condString ? exprBoolean1 : exprBoolean2; +>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 44, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +var resultIsNumber1 = condString ? exprNumber1 : exprNumber2; +>resultIsNumber1 : Symbol(resultIsNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 45, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +var resultIsString1 = condString ? exprString1 : exprString2; +>resultIsString1 : Symbol(resultIsString1, Decl(conditionalOperatorConditoinIsStringType.ts, 46, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +var resultIsObject1 = condString ? exprIsObject1 : exprIsObject2; +>resultIsObject1 : Symbol(resultIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 47, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +var resultIsStringOrBoolean1 = condString ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean1 : Symbol(resultIsStringOrBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 48, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +var resultIsAny2 = "" ? exprAny1 : exprAny2; +>resultIsAny2 : Symbol(resultIsAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 50, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +var resultIsBoolean2 = "string" ? exprBoolean1 : exprBoolean2; +>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 51, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +var resultIsNumber2 = 'c' ? exprNumber1 : exprNumber2; +>resultIsNumber2 : Symbol(resultIsNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 52, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +var resultIsString2 = 'string' ? exprString1 : exprString2; +>resultIsString2 : Symbol(resultIsString2, Decl(conditionalOperatorConditoinIsStringType.ts, 53, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +var resultIsObject2 = " " ? exprIsObject1 : exprIsObject2; +>resultIsObject2 : Symbol(resultIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 54, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +var resultIsStringOrBoolean2 = "hello" ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean2 : Symbol(resultIsStringOrBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 55, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +var resultIsAny3 = typeof condString ? exprAny1 : exprAny2; +>resultIsAny3 : Symbol(resultIsAny3, Decl(conditionalOperatorConditoinIsStringType.ts, 57, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprAny1 : Symbol(exprAny1, Decl(conditionalOperatorConditoinIsStringType.ts, 3, 3)) +>exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditoinIsStringType.ts, 9, 3)) + +var resultIsBoolean3 = condString.toUpperCase ? exprBoolean1 : exprBoolean2; +>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditoinIsStringType.ts, 58, 3)) +>condString.toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) +>exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditoinIsStringType.ts, 10, 3)) + +var resultIsNumber3 = condString + "string" ? exprNumber1 : exprNumber2; +>resultIsNumber3 : Symbol(resultIsNumber3, Decl(conditionalOperatorConditoinIsStringType.ts, 59, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprNumber1 : Symbol(exprNumber1, Decl(conditionalOperatorConditoinIsStringType.ts, 5, 3)) +>exprNumber2 : Symbol(exprNumber2, Decl(conditionalOperatorConditoinIsStringType.ts, 11, 3)) + +var resultIsString3 = foo() ? exprString1 : exprString2; +>resultIsString3 : Symbol(resultIsString3, Decl(conditionalOperatorConditoinIsStringType.ts, 60, 3)) +>foo : Symbol(foo, Decl(conditionalOperatorConditoinIsStringType.ts, 29, 38)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprString2 : Symbol(exprString2, Decl(conditionalOperatorConditoinIsStringType.ts, 12, 3)) + +var resultIsObject3 = array[1] ? exprIsObject1 : exprIsObject2; +>resultIsObject3 : Symbol(resultIsObject3, Decl(conditionalOperatorConditoinIsStringType.ts, 61, 3)) +>array : Symbol(array, Decl(conditionalOperatorConditoinIsStringType.ts, 33, 3)) +>exprIsObject1 : Symbol(exprIsObject1, Decl(conditionalOperatorConditoinIsStringType.ts, 7, 3)) +>exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditoinIsStringType.ts, 13, 3)) + +var resultIsStringOrBoolean3 = typeof condString ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean3 : Symbol(resultIsStringOrBoolean3, Decl(conditionalOperatorConditoinIsStringType.ts, 62, 3)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + +var resultIsStringOrBoolean4 = condString.toUpperCase ? exprString1 : exprBoolean1; // union +>resultIsStringOrBoolean4 : Symbol(resultIsStringOrBoolean4, Decl(conditionalOperatorConditoinIsStringType.ts, 63, 3)) +>condString.toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>condString : Symbol(condString, Decl(conditionalOperatorConditoinIsStringType.ts, 1, 3)) +>toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditoinIsStringType.ts, 6, 3)) +>exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditoinIsStringType.ts, 4, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types index 45a4db8d295..af5abb25063 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types @@ -75,41 +75,51 @@ condString ? exprString1 : exprBoolean1; // union //Cond is a string type literal "" ? exprAny1 : exprAny2; >"" ? exprAny1 : exprAny2 : any +>"" : string >exprAny1 : any >exprAny2 : any "string" ? exprBoolean1 : exprBoolean2; >"string" ? exprBoolean1 : exprBoolean2 : boolean +>"string" : string >exprBoolean1 : boolean >exprBoolean2 : boolean 'c' ? exprNumber1 : exprNumber2; >'c' ? exprNumber1 : exprNumber2 : number +>'c' : string >exprNumber1 : number >exprNumber2 : number 'string' ? exprString1 : exprString2; >'string' ? exprString1 : exprString2 : string +>'string' : string >exprString1 : string >exprString2 : string " " ? exprIsObject1 : exprIsObject2; >" " ? exprIsObject1 : exprIsObject2 : Object +>" " : string >exprIsObject1 : Object >exprIsObject2 : Object "hello " ? exprString1 : exprBoolean1; // union >"hello " ? exprString1 : exprBoolean1 : string | boolean +>"hello " : string >exprString1 : string >exprBoolean1 : boolean //Cond is a string type expression function foo() { return "string" }; >foo : () => string +>"string" : string var array = ["1", "2", "3"]; >array : string[] >["1", "2", "3"] : string[] +>"1" : string +>"2" : string +>"3" : string typeof condString ? exprAny1 : exprAny2; >typeof condString ? exprAny1 : exprAny2 : any @@ -130,6 +140,7 @@ condString + "string" ? exprNumber1 : exprNumber2; >condString + "string" ? exprNumber1 : exprNumber2 : number >condString + "string" : string >condString : string +>"string" : string >exprNumber1 : number >exprNumber2 : number @@ -144,6 +155,7 @@ array[1] ? exprIsObject1 : exprIsObject2; >array[1] ? exprIsObject1 : exprIsObject2 : Object >array[1] : string >array : string[] +>1 : number >exprIsObject1 : Object >exprIsObject2 : Object @@ -200,36 +212,42 @@ var resultIsStringOrBoolean1 = condString ? exprString1 : exprBoolean1; // union var resultIsAny2 = "" ? exprAny1 : exprAny2; >resultIsAny2 : any >"" ? exprAny1 : exprAny2 : any +>"" : string >exprAny1 : any >exprAny2 : any var resultIsBoolean2 = "string" ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean >"string" ? exprBoolean1 : exprBoolean2 : boolean +>"string" : string >exprBoolean1 : boolean >exprBoolean2 : boolean var resultIsNumber2 = 'c' ? exprNumber1 : exprNumber2; >resultIsNumber2 : number >'c' ? exprNumber1 : exprNumber2 : number +>'c' : string >exprNumber1 : number >exprNumber2 : number var resultIsString2 = 'string' ? exprString1 : exprString2; >resultIsString2 : string >'string' ? exprString1 : exprString2 : string +>'string' : string >exprString1 : string >exprString2 : string var resultIsObject2 = " " ? exprIsObject1 : exprIsObject2; >resultIsObject2 : Object >" " ? exprIsObject1 : exprIsObject2 : Object +>" " : string >exprIsObject1 : Object >exprIsObject2 : Object var resultIsStringOrBoolean2 = "hello" ? exprString1 : exprBoolean1; // union >resultIsStringOrBoolean2 : string | boolean >"hello" ? exprString1 : exprBoolean1 : string | boolean +>"hello" : string >exprString1 : string >exprBoolean1 : boolean @@ -255,6 +273,7 @@ var resultIsNumber3 = condString + "string" ? exprNumber1 : exprNumber2; >condString + "string" ? exprNumber1 : exprNumber2 : number >condString + "string" : string >condString : string +>"string" : string >exprNumber1 : number >exprNumber2 : number @@ -271,6 +290,7 @@ var resultIsObject3 = array[1] ? exprIsObject1 : exprIsObject2; >array[1] ? exprIsObject1 : exprIsObject2 : Object >array[1] : string >array : string[] +>1 : number >exprIsObject1 : Object >exprIsObject2 : Object diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.symbols b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.symbols new file mode 100644 index 00000000000..e4c2e43013d --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.symbols @@ -0,0 +1,149 @@ +=== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorWithIdenticalBCT.ts === +//Cond ? Expr1 : Expr2, Expr1 and Expr2 have identical best common type +class X { propertyX: any; propertyX1: number; propertyX2: string }; +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>propertyX : Symbol(propertyX, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 9)) +>propertyX1 : Symbol(propertyX1, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 25)) +>propertyX2 : Symbol(propertyX2, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 45)) + +class A extends X { propertyA: number }; +>A : Symbol(A, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 67)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>propertyA : Symbol(propertyA, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 19)) + +class B extends X { propertyB: string }; +>B : Symbol(B, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 40)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>propertyB : Symbol(propertyB, Decl(conditionalOperatorWithIdenticalBCT.ts, 3, 19)) + +var x: X; +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) + +var a: A; +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) +>A : Symbol(A, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 67)) + +var b: B; +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 7, 3)) +>B : Symbol(B, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 40)) + +//Cond ? Expr1 : Expr2, Expr1 is supertype +//Be Not contextually typed +true ? x : a; +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) + +var result1 = true ? x : a; +>result1 : Symbol(result1, Decl(conditionalOperatorWithIdenticalBCT.ts, 12, 3)) +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) + +//Expr1 and Expr2 are literals +true ? {} : 1; +true ? { a: 1 } : { a: 2, b: 'string' }; +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 16, 8)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 16, 19)) +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 16, 25)) + +var result2 = true ? {} : 1; +>result2 : Symbol(result2, Decl(conditionalOperatorWithIdenticalBCT.ts, 17, 3)) + +var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; +>result3 : Symbol(result3, Decl(conditionalOperatorWithIdenticalBCT.ts, 18, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 18, 22)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 18, 33)) +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 18, 39)) + +//Contextually typed +var resultIsX1: X = true ? x : a; +>resultIsX1 : Symbol(resultIsX1, Decl(conditionalOperatorWithIdenticalBCT.ts, 21, 3)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) + +var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; +>result4 : Symbol(result4, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 3)) +>t : Symbol(t, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 14)) +>A : Symbol(A, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 67)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 37)) +>m.propertyX : Symbol(X.propertyX, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 9)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 37)) +>propertyX : Symbol(X.propertyX, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 9)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 58)) +>n.propertyA : Symbol(A.propertyA, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 19)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 22, 58)) +>propertyA : Symbol(A.propertyA, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 19)) + +//Cond ? Expr1 : Expr2, Expr2 is supertype +//Be Not contextually typed +true ? a : x; +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) + +var result5 = true ? a : x; +>result5 : Symbol(result5, Decl(conditionalOperatorWithIdenticalBCT.ts, 27, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) + +//Expr1 and Expr2 are literals +true ? 1 : {}; +true ? { a: 2, b: 'string' } : { a: 1 }; +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 31, 8)) +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 31, 14)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 31, 32)) + +var result6 = true ? 1 : {}; +>result6 : Symbol(result6, Decl(conditionalOperatorWithIdenticalBCT.ts, 32, 3)) + +var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; +>result7 : Symbol(result7, Decl(conditionalOperatorWithIdenticalBCT.ts, 33, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 33, 22)) +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 33, 28)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 33, 46)) + +//Contextually typed +var resultIsX2: X = true ? x : a; +>resultIsX2 : Symbol(resultIsX2, Decl(conditionalOperatorWithIdenticalBCT.ts, 36, 3)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>x : Symbol(x, Decl(conditionalOperatorWithIdenticalBCT.ts, 5, 3)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) + +var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; +>result8 : Symbol(result8, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 3)) +>t : Symbol(t, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 14)) +>A : Symbol(A, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 67)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 37)) +>m.propertyA : Symbol(A.propertyA, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 19)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 37)) +>propertyA : Symbol(A.propertyA, Decl(conditionalOperatorWithIdenticalBCT.ts, 2, 19)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 58)) +>n.propertyX : Symbol(X.propertyX, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 9)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 37, 58)) +>propertyX : Symbol(X.propertyX, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 9)) + +//Result = Cond ? Expr1 : Expr2, Result is supertype +//Contextually typed +var resultIsX3: X = true ? a : b; +>resultIsX3 : Symbol(resultIsX3, Decl(conditionalOperatorWithIdenticalBCT.ts, 41, 3)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>a : Symbol(a, Decl(conditionalOperatorWithIdenticalBCT.ts, 6, 3)) +>b : Symbol(b, Decl(conditionalOperatorWithIdenticalBCT.ts, 7, 3)) + +var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; +>result10 : Symbol(result10, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 3)) +>t : Symbol(t, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 15)) +>X : Symbol(X, Decl(conditionalOperatorWithIdenticalBCT.ts, 0, 0)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 38)) +>m.propertyX1 : Symbol(X.propertyX1, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 25)) +>m : Symbol(m, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 38)) +>propertyX1 : Symbol(X.propertyX1, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 25)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 60)) +>n.propertyX2 : Symbol(X.propertyX2, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 45)) +>n : Symbol(n, Decl(conditionalOperatorWithIdenticalBCT.ts, 42, 60)) +>propertyX2 : Symbol(X.propertyX2, Decl(conditionalOperatorWithIdenticalBCT.ts, 1, 45)) + +//Expr1 and Expr2 are literals +var result11: any = true ? 1 : 'string'; +>result11 : Symbol(result11, Decl(conditionalOperatorWithIdenticalBCT.ts, 45, 3)) + diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types index f925f7f1db6..722ec13c684 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types @@ -32,47 +32,62 @@ var b: B; //Be Not contextually typed true ? x : a; >true ? x : a : X +>true : boolean >x : X >a : A var result1 = true ? x : a; >result1 : X >true ? x : a : X +>true : boolean >x : X >a : A //Expr1 and Expr2 are literals true ? {} : 1; >true ? {} : 1 : {} +>true : boolean >{} : {} +>1 : number true ? { a: 1 } : { a: 2, b: 'string' }; >true ? { a: 1 } : { a: 2, b: 'string' } : { a: number; } +>true : boolean >{ a: 1 } : { a: number; } >a : number +>1 : number >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number +>2 : number >b : string +>'string' : string var result2 = true ? {} : 1; >result2 : {} >true ? {} : 1 : {} +>true : boolean >{} : {} +>1 : number var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; >result3 : { a: number; } >true ? { a: 1 } : { a: 2, b: 'string' } : { a: number; } +>true : boolean >{ a: 1 } : { a: number; } >a : number +>1 : number >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number +>2 : number >b : string +>'string' : string //Contextually typed var resultIsX1: X = true ? x : a; >resultIsX1 : X >X : X >true ? x : a : X +>true : boolean >x : X >a : A @@ -81,6 +96,7 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; >t : A >A : A >true ? (m) => m.propertyX : (n) => n.propertyA : (m: A) => any +>true : boolean >(m) => m.propertyX : (m: A) => any >m : A >m.propertyX : any @@ -96,47 +112,62 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; //Be Not contextually typed true ? a : x; >true ? a : x : X +>true : boolean >a : A >x : X var result5 = true ? a : x; >result5 : X >true ? a : x : X +>true : boolean >a : A >x : X //Expr1 and Expr2 are literals true ? 1 : {}; >true ? 1 : {} : {} +>true : boolean +>1 : number >{} : {} true ? { a: 2, b: 'string' } : { a: 1 }; >true ? { a: 2, b: 'string' } : { a: 1 } : { a: number; } +>true : boolean >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number +>2 : number >b : string +>'string' : string >{ a: 1 } : { a: number; } >a : number +>1 : number var result6 = true ? 1 : {}; >result6 : {} >true ? 1 : {} : {} +>true : boolean +>1 : number >{} : {} var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; >result7 : { a: number; } >true ? { a: 2, b: 'string' } : { a: 1 } : { a: number; } +>true : boolean >{ a: 2, b: 'string' } : { a: number; b: string; } >a : number +>2 : number >b : string +>'string' : string >{ a: 1 } : { a: number; } >a : number +>1 : number //Contextually typed var resultIsX2: X = true ? x : a; >resultIsX2 : X >X : X >true ? x : a : X +>true : boolean >x : X >a : A @@ -145,6 +176,7 @@ var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; >t : A >A : A >true ? (m) => m.propertyA : (n) => n.propertyX : (n: A) => any +>true : boolean >(m) => m.propertyA : (m: A) => number >m : A >m.propertyA : number @@ -162,6 +194,7 @@ var resultIsX3: X = true ? a : b; >resultIsX3 : X >X : X >true ? a : b : A | B +>true : boolean >a : A >b : B @@ -170,6 +203,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; >t : X >X : X >true ? (m) => m.propertyX1 : (n) => n.propertyX2 : ((m: X) => number) | ((n: X) => string) +>true : boolean >(m) => m.propertyX1 : (m: X) => number >m : X >m.propertyX1 : number @@ -185,4 +219,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; var result11: any = true ? 1 : 'string'; >result11 : any >true ? 1 : 'string' : string | number +>true : boolean +>1 : number +>'string' : string diff --git a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.symbols b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.symbols new file mode 100644 index 00000000000..85f6c7ee4eb --- /dev/null +++ b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/conditionallyDuplicateOverloadsCausedByOverloadResolution.ts === +declare function foo(func: (x: string, y: string) => any): boolean; +>foo : Symbol(foo, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 0), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 67)) +>func : Symbol(func, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 21)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 28)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 38)) + +declare function foo(func: (x: string, y: number) => any): string; +>foo : Symbol(foo, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 0), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 67)) +>func : Symbol(func, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 1, 21)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 1, 28)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 1, 38)) + +var out = foo((x, y) => { +>out : Symbol(out, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 3)) +>foo : Symbol(foo, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 0), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 0, 67)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 15)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 17)) + + function bar(a: typeof x): void; +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 25), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 4, 36), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 5, 36)) +>a : Symbol(a, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 4, 17)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 15)) + + function bar(b: typeof y): void; +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 25), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 4, 36), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 5, 36)) +>b : Symbol(b, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 5, 17)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 17)) + + function bar() { } +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 25), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 4, 36), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 5, 36)) + + return bar; +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 3, 25), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 4, 36), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 5, 36)) + +}); + +declare function foo2(func: (x: string, y: string) => any): boolean; +>foo2 : Symbol(foo2, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 8, 3), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 68)) +>func : Symbol(func, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 22)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 29)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 39)) + +declare function foo2(func: (x: string, y: number) => any): string; +>foo2 : Symbol(foo2, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 8, 3), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 68)) +>func : Symbol(func, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 11, 22)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 11, 29)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 11, 39)) + +var out2 = foo2((x, y) => { +>out2 : Symbol(out2, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 13, 3)) +>foo2 : Symbol(foo2, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 8, 3), Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 10, 68)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 13, 17)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 13, 19)) + + var bar: { +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 14, 7)) + + (a: typeof x): void; +>a : Symbol(a, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 15, 9)) +>x : Symbol(x, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 13, 17)) + + (b: typeof y): void; +>b : Symbol(b, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 16, 9)) +>y : Symbol(y, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 13, 19)) + + }; + return bar; +>bar : Symbol(bar, Decl(conditionallyDuplicateOverloadsCausedByOverloadResolution.ts, 14, 7)) + +}); diff --git a/tests/baselines/reference/conformanceFunctionOverloads.symbols b/tests/baselines/reference/conformanceFunctionOverloads.symbols new file mode 100644 index 00000000000..a80814ea93e --- /dev/null +++ b/tests/baselines/reference/conformanceFunctionOverloads.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/functions/conformanceFunctionOverloads.ts === +// Function overloads do not emit code +No type information for this code. +No type information for this code.// Function overload signature with optional parameter +No type information for this code. +No type information for this code.// Function overload signature with optional parameter +No type information for this code. +No type information for this code.// Function overloads with generic and non-generic overloads +No type information for this code. +No type information for this code.// Function overloads whose only difference is returning different unconstrained generic parameters +No type information for this code. +No type information for this code.// Function overloads whose only difference is returning different constrained generic parameters +No type information for this code. +No type information for this code.// Function overloads that differ only by type parameter constraints +No type information for this code. +No type information for this code.// Function overloads with matching accessibility +No type information for this code. +No type information for this code.// Function overloads with matching export +No type information for this code. +No type information for this code.// Function overloads with more params than implementation signature +No type information for this code. +No type information for this code.// Function overloads where return types are same infinitely recursive type reference +No type information for this code. +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.symbols b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.symbols new file mode 100644 index 00000000000..db53aa8fb92 --- /dev/null +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/constDeclarationShadowedByVarDeclaration2.ts === + +// No errors, const declaration is not shadowed +function outer() { +>outer : Symbol(outer, Decl(constDeclarationShadowedByVarDeclaration2.ts, 0, 0)) + + const x = 0; +>x : Symbol(x, Decl(constDeclarationShadowedByVarDeclaration2.ts, 3, 9)) + + function inner() { +>inner : Symbol(inner, Decl(constDeclarationShadowedByVarDeclaration2.ts, 3, 16)) + + var x = "inner"; +>x : Symbol(x, Decl(constDeclarationShadowedByVarDeclaration2.ts, 5, 11)) + } +} diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types index 4217db45509..a5a7dd1d0cd 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.types @@ -6,11 +6,13 @@ function outer() { const x = 0; >x : number +>0 : number function inner() { >inner : () => void var x = "inner"; >x : string +>"inner" : string } } diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.symbols b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.symbols new file mode 100644 index 00000000000..99e11e12967 --- /dev/null +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/constDeclarationShadowedByVarDeclaration3.ts === +// Ensure only checking for const declarations shadowed by vars +class Rule { +>Rule : Symbol(Rule, Decl(constDeclarationShadowedByVarDeclaration3.ts, 0, 0)) + + public regex: RegExp = new RegExp(''); +>regex : Symbol(regex, Decl(constDeclarationShadowedByVarDeclaration3.ts, 1, 12)) +>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)) + + public name: string = ''; +>name : Symbol(name, Decl(constDeclarationShadowedByVarDeclaration3.ts, 2, 42)) + + constructor(name: string) { +>name : Symbol(name, Decl(constDeclarationShadowedByVarDeclaration3.ts, 5, 16)) + + this.name = name; +>this.name : Symbol(name, Decl(constDeclarationShadowedByVarDeclaration3.ts, 2, 42)) +>this : Symbol(Rule, Decl(constDeclarationShadowedByVarDeclaration3.ts, 0, 0)) +>name : Symbol(name, Decl(constDeclarationShadowedByVarDeclaration3.ts, 2, 42)) +>name : Symbol(name, Decl(constDeclarationShadowedByVarDeclaration3.ts, 5, 16)) + } +} diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types index 8241b319d84..c5b9ec9a6f2 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.types @@ -8,9 +8,11 @@ class Rule { >RegExp : RegExp >new RegExp('') : RegExp >RegExp : RegExpConstructor +>'' : string public name: string = ''; >name : string +>'' : string constructor(name: string) { >name : string diff --git a/tests/baselines/reference/constDeclarations-ambient.symbols b/tests/baselines/reference/constDeclarations-ambient.symbols new file mode 100644 index 00000000000..87dfecab0c0 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-ambient.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/constDeclarations-ambient.ts === + +// No error +declare const c1: boolean; +>c1 : Symbol(c1, Decl(constDeclarations-ambient.ts, 2, 13)) + +declare const c2: number; +>c2 : Symbol(c2, Decl(constDeclarations-ambient.ts, 3, 13)) + +declare const c3, c4 :string, c5: any; +>c3 : Symbol(c3, Decl(constDeclarations-ambient.ts, 4, 13)) +>c4 : Symbol(c4, Decl(constDeclarations-ambient.ts, 4, 17)) +>c5 : Symbol(c5, Decl(constDeclarations-ambient.ts, 4, 29)) + +declare module M { +>M : Symbol(M, Decl(constDeclarations-ambient.ts, 4, 38)) + + const c6; +>c6 : Symbol(c6, Decl(constDeclarations-ambient.ts, 7, 9)) + + const c7: number; +>c7 : Symbol(c7, Decl(constDeclarations-ambient.ts, 8, 9)) +} diff --git a/tests/baselines/reference/constDeclarations-es5.symbols b/tests/baselines/reference/constDeclarations-es5.symbols new file mode 100644 index 00000000000..116dd06573b --- /dev/null +++ b/tests/baselines/reference/constDeclarations-es5.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/constDeclarations-es5.ts === + +const z7 = false; +>z7 : Symbol(z7, Decl(constDeclarations-es5.ts, 1, 5)) + +const z8: number = 23; +>z8 : Symbol(z8, Decl(constDeclarations-es5.ts, 2, 5)) + +const z9 = 0, z10 :string = "", z11 = null; +>z9 : Symbol(z9, Decl(constDeclarations-es5.ts, 3, 5)) +>z10 : Symbol(z10, Decl(constDeclarations-es5.ts, 3, 13)) +>z11 : Symbol(z11, Decl(constDeclarations-es5.ts, 3, 31)) + diff --git a/tests/baselines/reference/constDeclarations-es5.types b/tests/baselines/reference/constDeclarations-es5.types index be55dc0febc..a897c3f9cd0 100644 --- a/tests/baselines/reference/constDeclarations-es5.types +++ b/tests/baselines/reference/constDeclarations-es5.types @@ -2,12 +2,17 @@ const z7 = false; >z7 : boolean +>false : boolean const z8: number = 23; >z8 : number +>23 : number const z9 = 0, z10 :string = "", z11 = null; >z9 : number +>0 : number >z10 : string +>"" : string >z11 : any +>null : null diff --git a/tests/baselines/reference/constDeclarations-scopes2.symbols b/tests/baselines/reference/constDeclarations-scopes2.symbols new file mode 100644 index 00000000000..15e466e8ea1 --- /dev/null +++ b/tests/baselines/reference/constDeclarations-scopes2.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/constDeclarations-scopes2.ts === + +// global +const c = "string"; +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 2, 5)) + +var n: number; +>n : Symbol(n, Decl(constDeclarations-scopes2.ts, 4, 3)) + +var b: boolean; +>b : Symbol(b, Decl(constDeclarations-scopes2.ts, 5, 3)) + +// for scope +for (const c = 0; c < 10; n = c ) { +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 8, 10)) +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 8, 10)) +>n : Symbol(n, Decl(constDeclarations-scopes2.ts, 4, 3)) +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 8, 10)) + + // for block + const c = false; +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 10, 9)) + + b = c; +>b : Symbol(b, Decl(constDeclarations-scopes2.ts, 5, 3)) +>c : Symbol(c, Decl(constDeclarations-scopes2.ts, 10, 9)) +} + + diff --git a/tests/baselines/reference/constDeclarations-scopes2.types b/tests/baselines/reference/constDeclarations-scopes2.types index 9609ef8f44b..a6bbdee7612 100644 --- a/tests/baselines/reference/constDeclarations-scopes2.types +++ b/tests/baselines/reference/constDeclarations-scopes2.types @@ -3,6 +3,7 @@ // global const c = "string"; >c : string +>"string" : string var n: number; >n : number @@ -13,8 +14,10 @@ var b: boolean; // for scope for (const c = 0; c < 10; n = c ) { >c : number +>0 : number >c < 10 : boolean >c : number +>10 : number >n = c : number >n : number >c : number @@ -22,6 +25,7 @@ for (const c = 0; c < 10; n = c ) { // for block const c = false; >c : boolean +>false : boolean b = c; >b = c : boolean diff --git a/tests/baselines/reference/constDeclarations.symbols b/tests/baselines/reference/constDeclarations.symbols new file mode 100644 index 00000000000..01653620dd0 --- /dev/null +++ b/tests/baselines/reference/constDeclarations.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/constDeclarations.ts === + +// No error +const c1 = false; +>c1 : Symbol(c1, Decl(constDeclarations.ts, 2, 5)) + +const c2: number = 23; +>c2 : Symbol(c2, Decl(constDeclarations.ts, 3, 5)) + +const c3 = 0, c4 :string = "", c5 = null; +>c3 : Symbol(c3, Decl(constDeclarations.ts, 4, 5)) +>c4 : Symbol(c4, Decl(constDeclarations.ts, 4, 13)) +>c5 : Symbol(c5, Decl(constDeclarations.ts, 4, 30)) + + +for(const c4 = 0; c4 < 9; ) { break; } +>c4 : Symbol(c4, Decl(constDeclarations.ts, 7, 9)) +>c4 : Symbol(c4, Decl(constDeclarations.ts, 7, 9)) + + +for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } +>c5 : Symbol(c5, Decl(constDeclarations.ts, 10, 9)) +>c6 : Symbol(c6, Decl(constDeclarations.ts, 10, 17)) +>c5 : Symbol(c5, Decl(constDeclarations.ts, 10, 9)) +>c6 : Symbol(c6, Decl(constDeclarations.ts, 10, 17)) + diff --git a/tests/baselines/reference/constDeclarations.types b/tests/baselines/reference/constDeclarations.types index e82a2f0035f..efdc534ef1c 100644 --- a/tests/baselines/reference/constDeclarations.types +++ b/tests/baselines/reference/constDeclarations.types @@ -3,25 +3,34 @@ // No error const c1 = false; >c1 : boolean +>false : boolean const c2: number = 23; >c2 : number +>23 : number const c3 = 0, c4 :string = "", c5 = null; >c3 : number +>0 : number >c4 : string +>"" : string >c5 : any +>null : null for(const c4 = 0; c4 < 9; ) { break; } >c4 : number +>0 : number >c4 < 9 : boolean >c4 : number +>9 : number for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } >c5 : number +>0 : number >c6 : number +>0 : number >c5 < c6 : boolean >c5 : number >c6 : number diff --git a/tests/baselines/reference/constDeclarations2.symbols b/tests/baselines/reference/constDeclarations2.symbols new file mode 100644 index 00000000000..daeced31f77 --- /dev/null +++ b/tests/baselines/reference/constDeclarations2.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/constDeclarations2.ts === + +// No error +module M { +>M : Symbol(M, Decl(constDeclarations2.ts, 0, 0)) + + export const c1 = false; +>c1 : Symbol(c1, Decl(constDeclarations2.ts, 3, 16)) + + export const c2: number = 23; +>c2 : Symbol(c2, Decl(constDeclarations2.ts, 4, 16)) + + export const c3 = 0, c4 :string = "", c5 = null; +>c3 : Symbol(c3, Decl(constDeclarations2.ts, 5, 16)) +>c4 : Symbol(c4, Decl(constDeclarations2.ts, 5, 24)) +>c5 : Symbol(c5, Decl(constDeclarations2.ts, 5, 41)) +} + diff --git a/tests/baselines/reference/constDeclarations2.types b/tests/baselines/reference/constDeclarations2.types index c81eca96b0d..f8184b8f8e0 100644 --- a/tests/baselines/reference/constDeclarations2.types +++ b/tests/baselines/reference/constDeclarations2.types @@ -6,13 +6,18 @@ module M { export const c1 = false; >c1 : boolean +>false : boolean export const c2: number = 23; >c2 : number +>23 : number export const c3 = 0, c4 :string = "", c5 = null; >c3 : number +>0 : number >c4 : string +>"" : string >c5 : any +>null : null } diff --git a/tests/baselines/reference/constEnumDeclarations.symbols b/tests/baselines/reference/constEnumDeclarations.symbols new file mode 100644 index 00000000000..72b833e4fae --- /dev/null +++ b/tests/baselines/reference/constEnumDeclarations.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/constEnumDeclarations.ts === + +const enum E { +>E : Symbol(E, Decl(constEnumDeclarations.ts, 0, 0)) + + A = 1, +>A : Symbol(E.A, Decl(constEnumDeclarations.ts, 1, 14)) + + B = 2, +>B : Symbol(E.B, Decl(constEnumDeclarations.ts, 2, 10)) + + C = A | B +>C : Symbol(E.C, Decl(constEnumDeclarations.ts, 3, 10)) +>A : Symbol(E.A, Decl(constEnumDeclarations.ts, 1, 14)) +>B : Symbol(E.B, Decl(constEnumDeclarations.ts, 2, 10)) +} + +const enum E2 { +>E2 : Symbol(E2, Decl(constEnumDeclarations.ts, 5, 1)) + + A = 1, +>A : Symbol(E2.A, Decl(constEnumDeclarations.ts, 7, 15)) + + B, +>B : Symbol(E2.B, Decl(constEnumDeclarations.ts, 8, 10)) + + C +>C : Symbol(E2.C, Decl(constEnumDeclarations.ts, 9, 6)) +} diff --git a/tests/baselines/reference/constEnumDeclarations.types b/tests/baselines/reference/constEnumDeclarations.types index 9dc87eadef7..481c2673660 100644 --- a/tests/baselines/reference/constEnumDeclarations.types +++ b/tests/baselines/reference/constEnumDeclarations.types @@ -5,9 +5,11 @@ const enum E { A = 1, >A : E +>1 : number B = 2, >B : E +>2 : number C = A | B >C : E @@ -21,6 +23,7 @@ const enum E2 { A = 1, >A : E2 +>1 : number B, >B : E2 diff --git a/tests/baselines/reference/constEnumExternalModule.symbols b/tests/baselines/reference/constEnumExternalModule.symbols new file mode 100644 index 00000000000..2502d6e4f28 --- /dev/null +++ b/tests/baselines/reference/constEnumExternalModule.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/m2.ts === +import A = require('m1') +>A : Symbol(A, Decl(m2.ts, 0, 0)) + +var v = A.V; +>v : Symbol(v, Decl(m2.ts, 1, 3)) +>A.V : Symbol(A.V, Decl(m1.ts, 0, 14)) +>A : Symbol(A, Decl(m2.ts, 0, 0)) +>V : Symbol(A.V, Decl(m1.ts, 0, 14)) + +=== tests/cases/compiler/m1.ts === +const enum E { +>E : Symbol(E, Decl(m1.ts, 0, 0)) + + V = 100 +>V : Symbol(E.V, Decl(m1.ts, 0, 14)) +} + +export = E +>E : Symbol(E, Decl(m1.ts, 0, 0)) + diff --git a/tests/baselines/reference/constEnumExternalModule.types b/tests/baselines/reference/constEnumExternalModule.types index 9c7b43a24d4..5d03b77b1b7 100644 --- a/tests/baselines/reference/constEnumExternalModule.types +++ b/tests/baselines/reference/constEnumExternalModule.types @@ -14,6 +14,7 @@ const enum E { V = 100 >V : E +>100 : number } export = E diff --git a/tests/baselines/reference/constEnumOnlyModuleMerging.symbols b/tests/baselines/reference/constEnumOnlyModuleMerging.symbols new file mode 100644 index 00000000000..093ce28ab94 --- /dev/null +++ b/tests/baselines/reference/constEnumOnlyModuleMerging.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/constEnumOnlyModuleMerging.ts === +module Outer { +>Outer : Symbol(Outer, Decl(constEnumOnlyModuleMerging.ts, 0, 0), Decl(constEnumOnlyModuleMerging.ts, 2, 1)) + + export var x = 1; +>x : Symbol(x, Decl(constEnumOnlyModuleMerging.ts, 1, 14)) +} + +module Outer { +>Outer : Symbol(Outer, Decl(constEnumOnlyModuleMerging.ts, 0, 0), Decl(constEnumOnlyModuleMerging.ts, 2, 1)) + + export const enum A { X } +>A : Symbol(A, Decl(constEnumOnlyModuleMerging.ts, 4, 14)) +>X : Symbol(A.X, Decl(constEnumOnlyModuleMerging.ts, 5, 25)) +} + +module B { +>B : Symbol(B, Decl(constEnumOnlyModuleMerging.ts, 6, 1)) + + import O = Outer; +>O : Symbol(O, Decl(constEnumOnlyModuleMerging.ts, 8, 10)) +>Outer : Symbol(O, Decl(constEnumOnlyModuleMerging.ts, 0, 0), Decl(constEnumOnlyModuleMerging.ts, 2, 1)) + + var x = O.A.X; +>x : Symbol(x, Decl(constEnumOnlyModuleMerging.ts, 10, 7)) +>O.A.X : Symbol(O.A.X, Decl(constEnumOnlyModuleMerging.ts, 5, 25)) +>O.A : Symbol(O.A, Decl(constEnumOnlyModuleMerging.ts, 4, 14)) +>O : Symbol(O, Decl(constEnumOnlyModuleMerging.ts, 8, 10)) +>A : Symbol(O.A, Decl(constEnumOnlyModuleMerging.ts, 4, 14)) +>X : Symbol(O.A.X, Decl(constEnumOnlyModuleMerging.ts, 5, 25)) + + var y = O.x; +>y : Symbol(y, Decl(constEnumOnlyModuleMerging.ts, 11, 7)) +>O.x : Symbol(O.x, Decl(constEnumOnlyModuleMerging.ts, 1, 14)) +>O : Symbol(O, Decl(constEnumOnlyModuleMerging.ts, 8, 10)) +>x : Symbol(O.x, Decl(constEnumOnlyModuleMerging.ts, 1, 14)) +} diff --git a/tests/baselines/reference/constEnumOnlyModuleMerging.types b/tests/baselines/reference/constEnumOnlyModuleMerging.types index 30426e3fa4c..452c0f46add 100644 --- a/tests/baselines/reference/constEnumOnlyModuleMerging.types +++ b/tests/baselines/reference/constEnumOnlyModuleMerging.types @@ -4,6 +4,7 @@ module Outer { export var x = 1; >x : number +>1 : number } module Outer { diff --git a/tests/baselines/reference/constEnums.symbols b/tests/baselines/reference/constEnums.symbols new file mode 100644 index 00000000000..9f88fb63493 --- /dev/null +++ b/tests/baselines/reference/constEnums.symbols @@ -0,0 +1,524 @@ +=== tests/cases/compiler/constEnums.ts === +const enum Enum1 { +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) + + A0 = 100, +>A0 : Symbol(Enum1.A0, Decl(constEnums.ts, 0, 18)) +} + +const enum Enum1 { +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) + + // correct cases + A, +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + B, +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + C = 10, +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) + + D = A | B, +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + E = A | 1, +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + F = 1 | A, +>F : Symbol(Enum1.F, Decl(constEnums.ts, 10, 14)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + G = (1 & 1), +>G : Symbol(Enum1.G, Decl(constEnums.ts, 11, 14)) + + H = ~(A | B), +>H : Symbol(Enum1.H, Decl(constEnums.ts, 12, 16)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + I = A >>> 1, +>I : Symbol(Enum1.I, Decl(constEnums.ts, 13, 17)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + J = 1 & A, +>J : Symbol(Enum1.J, Decl(constEnums.ts, 14, 16)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + K = ~(1 | 5), +>K : Symbol(Enum1.K, Decl(constEnums.ts, 15, 14)) + + L = ~D, +>L : Symbol(Enum1.L, Decl(constEnums.ts, 16, 17)) +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) + + M = E << B, +>M : Symbol(Enum1.M, Decl(constEnums.ts, 17, 11)) +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + N = E << 1, +>N : Symbol(Enum1.N, Decl(constEnums.ts, 18, 15)) +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) + + O = E >> B, +>O : Symbol(Enum1.O, Decl(constEnums.ts, 19, 15)) +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + P = E >> 1, +>P : Symbol(Enum1.P, Decl(constEnums.ts, 20, 15)) +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) + + Q = -D, +>Q : Symbol(Enum1.Q, Decl(constEnums.ts, 21, 15)) +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) + + R = C & 5, +>R : Symbol(Enum1.R, Decl(constEnums.ts, 22, 11)) +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) + + S = 5 & C, +>S : Symbol(Enum1.S, Decl(constEnums.ts, 23, 14)) +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) + + T = C | D, +>T : Symbol(Enum1.T, Decl(constEnums.ts, 24, 14)) +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) + + U = C | 1, +>U : Symbol(Enum1.U, Decl(constEnums.ts, 25, 14)) +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) + + V = 10 | D, +>V : Symbol(Enum1.V, Decl(constEnums.ts, 26, 14)) +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) + + W = Enum1.V, +>W : Symbol(Enum1.W, Decl(constEnums.ts, 27, 15)) +>Enum1.V : Symbol(Enum1.V, Decl(constEnums.ts, 26, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>V : Symbol(Enum1.V, Decl(constEnums.ts, 26, 14)) + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, +>W1 : Symbol(Enum1.W1, Decl(constEnums.ts, 28, 16)) +>A0 : Symbol(Enum1.A0, Decl(constEnums.ts, 0, 18)) + + W2 = Enum1.A0, +>W2 : Symbol(Enum1.W2, Decl(constEnums.ts, 31, 12)) +>Enum1.A0 : Symbol(Enum1.A0, Decl(constEnums.ts, 0, 18)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>A0 : Symbol(Enum1.A0, Decl(constEnums.ts, 0, 18)) + + W3 = Enum1["A0"], +>W3 : Symbol(Enum1.W3, Decl(constEnums.ts, 32, 18)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>"A0" : Symbol(Enum1.A0, Decl(constEnums.ts, 0, 18)) + + W4 = Enum1["W"], +>W4 : Symbol(Enum1.W4, Decl(constEnums.ts, 33, 21)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>"W" : Symbol(Enum1.W, Decl(constEnums.ts, 27, 15)) +} + + +module A { +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) + + export module B { +>B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) + + export module C { +>C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) + + export const enum E { +>E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) + + V1 = 1, +>V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) + + V2 = A.B.C.E.V1 | 100 +>V2 : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) +>A.B.C.E.V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) +>A.B.C.E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>A.B.C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>A.B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) + } + } + } +} + +module A { +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) + + export module B { +>B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) + + export module C { +>C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) + + export const enum E { +>E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) + + V3 = A.B.C.E["V2"] & 200, +>V3 : Symbol(I.V3, Decl(constEnums.ts, 52, 33)) +>A.B.C.E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>A.B.C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>A.B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(E, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>"V2" : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) + } + } + } +} + +module A1 { +>A1 : Symbol(A1, Decl(constEnums.ts, 57, 1)) + + export module B { +>B : Symbol(B, Decl(constEnums.ts, 59, 11)) + + export module C { +>C : Symbol(C, Decl(constEnums.ts, 60, 21)) + + export const enum E { +>E : Symbol(E, Decl(constEnums.ts, 61, 25)) + + V1 = 10, +>V1 : Symbol(E.V1, Decl(constEnums.ts, 62, 33)) + + V2 = 110, +>V2 : Symbol(E.V2, Decl(constEnums.ts, 63, 24)) + } + } + } +} + +module A2 { +>A2 : Symbol(A2, Decl(constEnums.ts, 68, 1)) + + export module B { +>B : Symbol(B, Decl(constEnums.ts, 70, 11)) + + export module C { +>C : Symbol(C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) + + export const enum E { +>E : Symbol(E, Decl(constEnums.ts, 72, 25)) + + V1 = 10, +>V1 : Symbol(E.V1, Decl(constEnums.ts, 73, 33)) + + V2 = 110, +>V2 : Symbol(E.V2, Decl(constEnums.ts, 74, 24)) + } + } + // module C will be classified as value + export module C { +>C : Symbol(C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) + + var x = 1 +>x : Symbol(x, Decl(constEnums.ts, 80, 15)) + } + } +} + +import I = A.B.C.E; +>I : Symbol(I, Decl(constEnums.ts, 83, 1)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) + +import I1 = A1.B; +>I1 : Symbol(I1, Decl(constEnums.ts, 85, 19)) +>A1 : Symbol(A1, Decl(constEnums.ts, 57, 1)) +>B : Symbol(I1, Decl(constEnums.ts, 59, 11)) + +import I2 = A2.B; +>I2 : Symbol(I2, Decl(constEnums.ts, 86, 17)) +>A2 : Symbol(A2, Decl(constEnums.ts, 68, 1)) +>B : Symbol(I2, Decl(constEnums.ts, 70, 11)) + +function foo0(e: I): void { +>foo0 : Symbol(foo0, Decl(constEnums.ts, 87, 17)) +>e : Symbol(e, Decl(constEnums.ts, 89, 14)) +>I : Symbol(I, Decl(constEnums.ts, 83, 1)) + + if (e === I.V1) { +>e : Symbol(e, Decl(constEnums.ts, 89, 14)) +>I.V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) +>I : Symbol(I, Decl(constEnums.ts, 83, 1)) +>V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) + } + else if (e === I.V2) { +>e : Symbol(e, Decl(constEnums.ts, 89, 14)) +>I.V2 : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) +>I : Symbol(I, Decl(constEnums.ts, 83, 1)) +>V2 : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) + } +} + +function foo1(e: I1.C.E): void { +>foo1 : Symbol(foo1, Decl(constEnums.ts, 94, 1)) +>e : Symbol(e, Decl(constEnums.ts, 96, 14)) +>I1 : Symbol(I1, Decl(constEnums.ts, 85, 19)) +>C : Symbol(I1.C, Decl(constEnums.ts, 60, 21)) +>E : Symbol(I1.C.E, Decl(constEnums.ts, 61, 25)) + + if (e === I1.C.E.V1) { +>e : Symbol(e, Decl(constEnums.ts, 96, 14)) +>I1.C.E.V1 : Symbol(I1.C.E.V1, Decl(constEnums.ts, 62, 33)) +>I1.C.E : Symbol(I1.C.E, Decl(constEnums.ts, 61, 25)) +>I1.C : Symbol(I1.C, Decl(constEnums.ts, 60, 21)) +>I1 : Symbol(I1, Decl(constEnums.ts, 85, 19)) +>C : Symbol(I1.C, Decl(constEnums.ts, 60, 21)) +>E : Symbol(I1.C.E, Decl(constEnums.ts, 61, 25)) +>V1 : Symbol(I1.C.E.V1, Decl(constEnums.ts, 62, 33)) + } + else if (e === I1.C.E.V2) { +>e : Symbol(e, Decl(constEnums.ts, 96, 14)) +>I1.C.E.V2 : Symbol(I1.C.E.V2, Decl(constEnums.ts, 63, 24)) +>I1.C.E : Symbol(I1.C.E, Decl(constEnums.ts, 61, 25)) +>I1.C : Symbol(I1.C, Decl(constEnums.ts, 60, 21)) +>I1 : Symbol(I1, Decl(constEnums.ts, 85, 19)) +>C : Symbol(I1.C, Decl(constEnums.ts, 60, 21)) +>E : Symbol(I1.C.E, Decl(constEnums.ts, 61, 25)) +>V2 : Symbol(I1.C.E.V2, Decl(constEnums.ts, 63, 24)) + } +} + +function foo2(e: I2.C.E): void { +>foo2 : Symbol(foo2, Decl(constEnums.ts, 101, 1)) +>e : Symbol(e, Decl(constEnums.ts, 103, 14)) +>I2 : Symbol(I2, Decl(constEnums.ts, 86, 17)) +>C : Symbol(I2.C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) +>E : Symbol(I2.C.E, Decl(constEnums.ts, 72, 25)) + + if (e === I2.C.E.V1) { +>e : Symbol(e, Decl(constEnums.ts, 103, 14)) +>I2.C.E.V1 : Symbol(I2.C.E.V1, Decl(constEnums.ts, 73, 33)) +>I2.C.E : Symbol(I2.C.E, Decl(constEnums.ts, 72, 25)) +>I2.C : Symbol(I2.C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) +>I2 : Symbol(I2, Decl(constEnums.ts, 86, 17)) +>C : Symbol(I2.C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) +>E : Symbol(I2.C.E, Decl(constEnums.ts, 72, 25)) +>V1 : Symbol(I2.C.E.V1, Decl(constEnums.ts, 73, 33)) + } + else if (e === I2.C.E.V2) { +>e : Symbol(e, Decl(constEnums.ts, 103, 14)) +>I2.C.E.V2 : Symbol(I2.C.E.V2, Decl(constEnums.ts, 74, 24)) +>I2.C.E : Symbol(I2.C.E, Decl(constEnums.ts, 72, 25)) +>I2.C : Symbol(I2.C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) +>I2 : Symbol(I2, Decl(constEnums.ts, 86, 17)) +>C : Symbol(I2.C, Decl(constEnums.ts, 71, 21), Decl(constEnums.ts, 77, 9)) +>E : Symbol(I2.C.E, Decl(constEnums.ts, 72, 25)) +>V2 : Symbol(I2.C.E.V2, Decl(constEnums.ts, 74, 24)) + } +} + + +function foo(x: Enum1) { +>foo : Symbol(foo, Decl(constEnums.ts, 108, 1)) +>x : Symbol(x, Decl(constEnums.ts, 111, 13)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) + + switch (x) { +>x : Symbol(x, Decl(constEnums.ts, 111, 13)) + + case Enum1.A: +>Enum1.A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>A : Symbol(Enum1.A, Decl(constEnums.ts, 4, 18)) + + case Enum1.B: +>Enum1.B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>B : Symbol(Enum1.B, Decl(constEnums.ts, 6, 6)) + + case Enum1.C: +>Enum1.C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>C : Symbol(Enum1.C, Decl(constEnums.ts, 7, 6)) + + case Enum1.D: +>Enum1.D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>D : Symbol(Enum1.D, Decl(constEnums.ts, 8, 11)) + + case Enum1.E: +>Enum1.E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>E : Symbol(Enum1.E, Decl(constEnums.ts, 9, 14)) + + case Enum1.F: +>Enum1.F : Symbol(Enum1.F, Decl(constEnums.ts, 10, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>F : Symbol(Enum1.F, Decl(constEnums.ts, 10, 14)) + + case Enum1.G: +>Enum1.G : Symbol(Enum1.G, Decl(constEnums.ts, 11, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>G : Symbol(Enum1.G, Decl(constEnums.ts, 11, 14)) + + case Enum1.H: +>Enum1.H : Symbol(Enum1.H, Decl(constEnums.ts, 12, 16)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>H : Symbol(Enum1.H, Decl(constEnums.ts, 12, 16)) + + case Enum1.I: +>Enum1.I : Symbol(Enum1.I, Decl(constEnums.ts, 13, 17)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>I : Symbol(Enum1.I, Decl(constEnums.ts, 13, 17)) + + case Enum1.J: +>Enum1.J : Symbol(Enum1.J, Decl(constEnums.ts, 14, 16)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>J : Symbol(Enum1.J, Decl(constEnums.ts, 14, 16)) + + case Enum1.K: +>Enum1.K : Symbol(Enum1.K, Decl(constEnums.ts, 15, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>K : Symbol(Enum1.K, Decl(constEnums.ts, 15, 14)) + + case Enum1.L: +>Enum1.L : Symbol(Enum1.L, Decl(constEnums.ts, 16, 17)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>L : Symbol(Enum1.L, Decl(constEnums.ts, 16, 17)) + + case Enum1.M: +>Enum1.M : Symbol(Enum1.M, Decl(constEnums.ts, 17, 11)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>M : Symbol(Enum1.M, Decl(constEnums.ts, 17, 11)) + + case Enum1.N: +>Enum1.N : Symbol(Enum1.N, Decl(constEnums.ts, 18, 15)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>N : Symbol(Enum1.N, Decl(constEnums.ts, 18, 15)) + + case Enum1.O: +>Enum1.O : Symbol(Enum1.O, Decl(constEnums.ts, 19, 15)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>O : Symbol(Enum1.O, Decl(constEnums.ts, 19, 15)) + + case Enum1.P: +>Enum1.P : Symbol(Enum1.P, Decl(constEnums.ts, 20, 15)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>P : Symbol(Enum1.P, Decl(constEnums.ts, 20, 15)) + + case Enum1.Q: +>Enum1.Q : Symbol(Enum1.Q, Decl(constEnums.ts, 21, 15)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>Q : Symbol(Enum1.Q, Decl(constEnums.ts, 21, 15)) + + case Enum1.R: +>Enum1.R : Symbol(Enum1.R, Decl(constEnums.ts, 22, 11)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>R : Symbol(Enum1.R, Decl(constEnums.ts, 22, 11)) + + case Enum1.S: +>Enum1.S : Symbol(Enum1.S, Decl(constEnums.ts, 23, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>S : Symbol(Enum1.S, Decl(constEnums.ts, 23, 14)) + + case Enum1["T"]: +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>"T" : Symbol(Enum1.T, Decl(constEnums.ts, 24, 14)) + + case Enum1.U: +>Enum1.U : Symbol(Enum1.U, Decl(constEnums.ts, 25, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>U : Symbol(Enum1.U, Decl(constEnums.ts, 25, 14)) + + case Enum1.V: +>Enum1.V : Symbol(Enum1.V, Decl(constEnums.ts, 26, 14)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>V : Symbol(Enum1.V, Decl(constEnums.ts, 26, 14)) + + case Enum1.W: +>Enum1.W : Symbol(Enum1.W, Decl(constEnums.ts, 27, 15)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>W : Symbol(Enum1.W, Decl(constEnums.ts, 27, 15)) + + case Enum1.W1: +>Enum1.W1 : Symbol(Enum1.W1, Decl(constEnums.ts, 28, 16)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>W1 : Symbol(Enum1.W1, Decl(constEnums.ts, 28, 16)) + + case Enum1.W2: +>Enum1.W2 : Symbol(Enum1.W2, Decl(constEnums.ts, 31, 12)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>W2 : Symbol(Enum1.W2, Decl(constEnums.ts, 31, 12)) + + case Enum1.W3: +>Enum1.W3 : Symbol(Enum1.W3, Decl(constEnums.ts, 32, 18)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>W3 : Symbol(Enum1.W3, Decl(constEnums.ts, 32, 18)) + + case Enum1.W4: +>Enum1.W4 : Symbol(Enum1.W4, Decl(constEnums.ts, 33, 21)) +>Enum1 : Symbol(Enum1, Decl(constEnums.ts, 0, 0), Decl(constEnums.ts, 2, 1)) +>W4 : Symbol(Enum1.W4, Decl(constEnums.ts, 33, 21)) + + break; + } +} + +function bar(e: A.B.C.E): number { +>bar : Symbol(bar, Decl(constEnums.ts, 142, 1)) +>e : Symbol(e, Decl(constEnums.ts, 144, 13)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) + + switch (e) { +>e : Symbol(e, Decl(constEnums.ts, 144, 13)) + + case A.B.C.E.V1: return 1; +>A.B.C.E.V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) +>A.B.C.E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>A.B.C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>A.B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>V1 : Symbol(I.V1, Decl(constEnums.ts, 41, 33)) + + case A.B.C.E.V2: return 1; +>A.B.C.E.V2 : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) +>A.B.C.E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>A.B.C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>A.B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>V2 : Symbol(I.V2, Decl(constEnums.ts, 42, 23)) + + case A.B.C.E.V3: return 1; +>A.B.C.E.V3 : Symbol(I.V3, Decl(constEnums.ts, 52, 33)) +>A.B.C.E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>A.B.C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>A.B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>A : Symbol(A, Decl(constEnums.ts, 35, 1), Decl(constEnums.ts, 47, 1)) +>B : Symbol(A.B, Decl(constEnums.ts, 38, 10), Decl(constEnums.ts, 49, 10)) +>C : Symbol(A.B.C, Decl(constEnums.ts, 39, 21), Decl(constEnums.ts, 50, 21)) +>E : Symbol(I, Decl(constEnums.ts, 40, 25), Decl(constEnums.ts, 51, 25)) +>V3 : Symbol(I.V3, Decl(constEnums.ts, 52, 33)) + } +} diff --git a/tests/baselines/reference/constEnums.types b/tests/baselines/reference/constEnums.types index 396b2e1c32b..a59bd2d012a 100644 --- a/tests/baselines/reference/constEnums.types +++ b/tests/baselines/reference/constEnums.types @@ -4,6 +4,7 @@ const enum Enum1 { A0 = 100, >A0 : Enum1 +>100 : number } const enum Enum1 { @@ -18,6 +19,7 @@ const enum Enum1 { C = 10, >C : Enum1 +>10 : number D = A | B, >D : Enum1 @@ -29,16 +31,20 @@ const enum Enum1 { >E : Enum1 >A | 1 : number >A : Enum1 +>1 : number F = 1 | A, >F : Enum1 >1 | A : number +>1 : number >A : Enum1 G = (1 & 1), >G : Enum1 >(1 & 1) : number >1 & 1 : number +>1 : number +>1 : number H = ~(A | B), >H : Enum1 @@ -52,10 +58,12 @@ const enum Enum1 { >I : Enum1 >A >>> 1 : number >A : Enum1 +>1 : number J = 1 & A, >J : Enum1 >1 & A : number +>1 : number >A : Enum1 K = ~(1 | 5), @@ -63,6 +71,8 @@ const enum Enum1 { >~(1 | 5) : number >(1 | 5) : number >1 | 5 : number +>1 : number +>5 : number L = ~D, >L : Enum1 @@ -79,6 +89,7 @@ const enum Enum1 { >N : Enum1 >E << 1 : number >E : Enum1 +>1 : number O = E >> B, >O : Enum1 @@ -90,6 +101,7 @@ const enum Enum1 { >P : Enum1 >E >> 1 : number >E : Enum1 +>1 : number Q = -D, >Q : Enum1 @@ -100,10 +112,12 @@ const enum Enum1 { >R : Enum1 >C & 5 : number >C : Enum1 +>5 : number S = 5 & C, >S : Enum1 >5 & C : number +>5 : number >C : Enum1 T = C | D, @@ -116,10 +130,12 @@ const enum Enum1 { >U : Enum1 >C | 1 : number >C : Enum1 +>1 : number V = 10 | D, >V : Enum1 >10 | D : number +>10 : number >D : Enum1 W = Enum1.V, @@ -143,11 +159,13 @@ const enum Enum1 { >W3 : Enum1 >Enum1["A0"] : Enum1 >Enum1 : typeof Enum1 +>"A0" : string W4 = Enum1["W"], >W4 : Enum1 >Enum1["W"] : Enum1 >Enum1 : typeof Enum1 +>"W" : string } @@ -165,6 +183,7 @@ module A { V1 = 1, >V1 : E +>1 : number V2 = A.B.C.E.V1 | 100 >V2 : E @@ -178,6 +197,7 @@ module A { >C : typeof C >E : typeof E >V1 : E +>100 : number } } } @@ -206,6 +226,8 @@ module A { >B : typeof B >C : typeof C >E : typeof E +>"V2" : string +>200 : number } } } @@ -225,9 +247,11 @@ module A1 { V1 = 10, >V1 : E +>10 : number V2 = 110, >V2 : E +>110 : number } } } @@ -247,9 +271,11 @@ module A2 { V1 = 10, >V1 : E +>10 : number V2 = 110, >V2 : E +>110 : number } } // module C will be classified as value @@ -258,6 +284,7 @@ module A2 { var x = 1 >x : number +>1 : number } } } @@ -303,8 +330,8 @@ function foo0(e: I): void { function foo1(e: I1.C.E): void { >foo1 : (e: I1.C.E) => void >e : I1.C.E ->I1 : unknown ->C : unknown +>I1 : any +>C : any >E : I1.C.E if (e === I1.C.E.V1) { @@ -334,8 +361,8 @@ function foo1(e: I1.C.E): void { function foo2(e: I2.C.E): void { >foo2 : (e: I2.C.E) => void >e : I2.C.E ->I2 : unknown ->C : unknown +>I2 : any +>C : any >E : I2.C.E if (e === I2.C.E.V1) { @@ -469,6 +496,7 @@ function foo(x: Enum1) { case Enum1["T"]: >Enum1["T"] : Enum1 >Enum1 : typeof Enum1 +>"T" : string case Enum1.U: >Enum1.U : Enum1 @@ -512,9 +540,9 @@ function foo(x: Enum1) { function bar(e: A.B.C.E): number { >bar : (e: I) => number >e : I ->A : unknown ->B : unknown ->C : unknown +>A : any +>B : any +>C : any >E : I switch (e) { @@ -530,6 +558,7 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V1 : I +>1 : number case A.B.C.E.V2: return 1; >A.B.C.E.V2 : I @@ -541,6 +570,7 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V2 : I +>1 : number case A.B.C.E.V3: return 1; >A.B.C.E.V3 : I @@ -552,5 +582,6 @@ function bar(e: A.B.C.E): number { >C : typeof A.B.C >E : typeof I >V3 : I +>1 : number } } diff --git a/tests/baselines/reference/constantOverloadFunction.symbols b/tests/baselines/reference/constantOverloadFunction.symbols new file mode 100644 index 00000000000..60234623ed6 --- /dev/null +++ b/tests/baselines/reference/constantOverloadFunction.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/constantOverloadFunction.ts === +class Base { foo() { } } +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 0, 12)) + +class Derived1 extends Base { bar() { } } +>Derived1 : Symbol(Derived1, Decl(constantOverloadFunction.ts, 0, 24)) +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) +>bar : Symbol(bar, Decl(constantOverloadFunction.ts, 1, 29)) + +class Derived2 extends Base { baz() { } } +>Derived2 : Symbol(Derived2, Decl(constantOverloadFunction.ts, 1, 41)) +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) +>baz : Symbol(baz, Decl(constantOverloadFunction.ts, 2, 29)) + +class Derived3 extends Base { biz() { } } +>Derived3 : Symbol(Derived3, Decl(constantOverloadFunction.ts, 2, 41)) +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) +>biz : Symbol(biz, Decl(constantOverloadFunction.ts, 3, 29)) + +function foo(tagName: 'canvas'): Derived1; +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 3, 41), Decl(constantOverloadFunction.ts, 5, 42), Decl(constantOverloadFunction.ts, 6, 40), Decl(constantOverloadFunction.ts, 7, 40), Decl(constantOverloadFunction.ts, 8, 36)) +>tagName : Symbol(tagName, Decl(constantOverloadFunction.ts, 5, 13)) +>Derived1 : Symbol(Derived1, Decl(constantOverloadFunction.ts, 0, 24)) + +function foo(tagName: 'div'): Derived2; +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 3, 41), Decl(constantOverloadFunction.ts, 5, 42), Decl(constantOverloadFunction.ts, 6, 40), Decl(constantOverloadFunction.ts, 7, 40), Decl(constantOverloadFunction.ts, 8, 36)) +>tagName : Symbol(tagName, Decl(constantOverloadFunction.ts, 6, 13)) +>Derived2 : Symbol(Derived2, Decl(constantOverloadFunction.ts, 1, 41)) + +function foo(tagName: 'span'): Derived3; +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 3, 41), Decl(constantOverloadFunction.ts, 5, 42), Decl(constantOverloadFunction.ts, 6, 40), Decl(constantOverloadFunction.ts, 7, 40), Decl(constantOverloadFunction.ts, 8, 36)) +>tagName : Symbol(tagName, Decl(constantOverloadFunction.ts, 7, 13)) +>Derived3 : Symbol(Derived3, Decl(constantOverloadFunction.ts, 2, 41)) + +function foo(tagName: string): Base; +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 3, 41), Decl(constantOverloadFunction.ts, 5, 42), Decl(constantOverloadFunction.ts, 6, 40), Decl(constantOverloadFunction.ts, 7, 40), Decl(constantOverloadFunction.ts, 8, 36)) +>tagName : Symbol(tagName, Decl(constantOverloadFunction.ts, 8, 13)) +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) + +function foo(tagName: any): Base { +>foo : Symbol(foo, Decl(constantOverloadFunction.ts, 3, 41), Decl(constantOverloadFunction.ts, 5, 42), Decl(constantOverloadFunction.ts, 6, 40), Decl(constantOverloadFunction.ts, 7, 40), Decl(constantOverloadFunction.ts, 8, 36)) +>tagName : Symbol(tagName, Decl(constantOverloadFunction.ts, 9, 13)) +>Base : Symbol(Base, Decl(constantOverloadFunction.ts, 0, 0)) + + return null; +} + diff --git a/tests/baselines/reference/constantOverloadFunction.types b/tests/baselines/reference/constantOverloadFunction.types index 1e74486cb32..d643d3a726d 100644 --- a/tests/baselines/reference/constantOverloadFunction.types +++ b/tests/baselines/reference/constantOverloadFunction.types @@ -44,5 +44,6 @@ function foo(tagName: any): Base { >Base : Base return null; +>null : null } diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.symbols b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.symbols new file mode 100644 index 00000000000..ad63e11b7ed --- /dev/null +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/constraintCheckInGenericBaseTypeReference.ts === +// No errors +class Constraint { +>Constraint : Symbol(Constraint, Decl(constraintCheckInGenericBaseTypeReference.ts, 0, 0)) + + public method() { } +>method : Symbol(method, Decl(constraintCheckInGenericBaseTypeReference.ts, 1, 18)) +} +class GenericBase { +>GenericBase : Symbol(GenericBase, Decl(constraintCheckInGenericBaseTypeReference.ts, 3, 1)) +>T : Symbol(T, Decl(constraintCheckInGenericBaseTypeReference.ts, 4, 18)) +>Constraint : Symbol(Constraint, Decl(constraintCheckInGenericBaseTypeReference.ts, 0, 0)) + + public items: any; +>items : Symbol(items, Decl(constraintCheckInGenericBaseTypeReference.ts, 4, 41)) +} +class Derived extends GenericBase { +>Derived : Symbol(Derived, Decl(constraintCheckInGenericBaseTypeReference.ts, 6, 1)) +>GenericBase : Symbol(GenericBase, Decl(constraintCheckInGenericBaseTypeReference.ts, 3, 1)) +>TypeArg : Symbol(TypeArg, Decl(constraintCheckInGenericBaseTypeReference.ts, 9, 1)) + +} +class TypeArg { +>TypeArg : Symbol(TypeArg, Decl(constraintCheckInGenericBaseTypeReference.ts, 9, 1)) + + public method() { +>method : Symbol(method, Decl(constraintCheckInGenericBaseTypeReference.ts, 10, 15)) + + Container.People.items; +>Container.People.items : Symbol(GenericBase.items, Decl(constraintCheckInGenericBaseTypeReference.ts, 4, 41)) +>Container.People : Symbol(Container.People, Decl(constraintCheckInGenericBaseTypeReference.ts, 16, 17)) +>Container : Symbol(Container, Decl(constraintCheckInGenericBaseTypeReference.ts, 14, 1)) +>People : Symbol(Container.People, Decl(constraintCheckInGenericBaseTypeReference.ts, 16, 17)) +>items : Symbol(GenericBase.items, Decl(constraintCheckInGenericBaseTypeReference.ts, 4, 41)) + } +} + +class Container { +>Container : Symbol(Container, Decl(constraintCheckInGenericBaseTypeReference.ts, 14, 1)) + + public static People: Derived +>People : Symbol(Container.People, Decl(constraintCheckInGenericBaseTypeReference.ts, 16, 17)) +>Derived : Symbol(Derived, Decl(constraintCheckInGenericBaseTypeReference.ts, 6, 1)) +} diff --git a/tests/baselines/reference/constraintPropagationThroughReturnTypes.symbols b/tests/baselines/reference/constraintPropagationThroughReturnTypes.symbols new file mode 100644 index 00000000000..50cccd22db0 --- /dev/null +++ b/tests/baselines/reference/constraintPropagationThroughReturnTypes.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/constraintPropagationThroughReturnTypes.ts === +function g(x: T): T { +>g : Symbol(g, Decl(constraintPropagationThroughReturnTypes.ts, 0, 0)) +>T : Symbol(T, Decl(constraintPropagationThroughReturnTypes.ts, 0, 11)) +>x : Symbol(x, Decl(constraintPropagationThroughReturnTypes.ts, 0, 14)) +>T : Symbol(T, Decl(constraintPropagationThroughReturnTypes.ts, 0, 11)) +>T : Symbol(T, Decl(constraintPropagationThroughReturnTypes.ts, 0, 11)) + + return x; +>x : Symbol(x, Decl(constraintPropagationThroughReturnTypes.ts, 0, 14)) +} + +function f(x: S) { +>f : Symbol(f, Decl(constraintPropagationThroughReturnTypes.ts, 2, 1)) +>S : Symbol(S, Decl(constraintPropagationThroughReturnTypes.ts, 4, 11)) +>foo : Symbol(foo, Decl(constraintPropagationThroughReturnTypes.ts, 4, 22)) +>x : Symbol(x, Decl(constraintPropagationThroughReturnTypes.ts, 4, 38)) +>S : Symbol(S, Decl(constraintPropagationThroughReturnTypes.ts, 4, 11)) + + var y = g(x); +>y : Symbol(y, Decl(constraintPropagationThroughReturnTypes.ts, 5, 5)) +>g : Symbol(g, Decl(constraintPropagationThroughReturnTypes.ts, 0, 0)) +>x : Symbol(x, Decl(constraintPropagationThroughReturnTypes.ts, 4, 38)) + + y; +>y : Symbol(y, Decl(constraintPropagationThroughReturnTypes.ts, 5, 5)) +} + diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.symbols b/tests/baselines/reference/constraintSatisfactionWithAny.symbols new file mode 100644 index 00000000000..fdf1bdce7e8 --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithAny.symbols @@ -0,0 +1,138 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny.ts === +// any is not a valid type argument unless there is no constraint, or the constraint is any + +function foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(constraintSatisfactionWithAny.ts, 0, 0)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 2, 13)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 2, 31)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 2, 13)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 2, 13)) + +function foo2(x: T): T { return null; } +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithAny.ts, 2, 56)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 3, 14)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 3, 25)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 3, 39)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 3, 14)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 3, 14)) + +//function foo3(x: T): T { return null; } +function foo4(x: T) => void>(x: T): T { return null; } +>foo4 : Symbol(foo4, Decl(constraintSatisfactionWithAny.ts, 3, 64)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 5, 14)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 5, 25)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 5, 28)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 5, 25)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 5, 43)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 5, 14)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 5, 14)) + +var a; +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +foo(a); +>foo : Symbol(foo, Decl(constraintSatisfactionWithAny.ts, 0, 0)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +foo2(a); +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithAny.ts, 2, 56)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +//foo3(a); +foo4(a); +>foo4 : Symbol(foo4, Decl(constraintSatisfactionWithAny.ts, 3, 64)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +var b: number; +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +foo(b); +>foo : Symbol(foo, Decl(constraintSatisfactionWithAny.ts, 0, 0)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +foo2(b); +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithAny.ts, 2, 56)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +//foo3(b); +foo4(b); +>foo4 : Symbol(foo4, Decl(constraintSatisfactionWithAny.ts, 3, 64)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +//function foo5(x: T, y: U): T { return null; } +//foo5(a, a); +//foo5(b, b); + +class C { +>C : Symbol(C, Decl(constraintSatisfactionWithAny.ts, 16, 13)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 22, 8)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + + constructor(public x: T) { } +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 23, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 22, 8)) +} + +var c1 = new C(a); +>c1 : Symbol(c1, Decl(constraintSatisfactionWithAny.ts, 26, 3)) +>C : Symbol(C, Decl(constraintSatisfactionWithAny.ts, 16, 13)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +var c2 = new C(b); +>c2 : Symbol(c2, Decl(constraintSatisfactionWithAny.ts, 27, 3)) +>C : Symbol(C, Decl(constraintSatisfactionWithAny.ts, 16, 13)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +class C2 { +>C2 : Symbol(C2, Decl(constraintSatisfactionWithAny.ts, 27, 23)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 29, 9)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 29, 20)) + + constructor(public x: T) { } +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 30, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 29, 9)) +} + +var c3 = new C2(a); +>c3 : Symbol(c3, Decl(constraintSatisfactionWithAny.ts, 33, 3)) +>C2 : Symbol(C2, Decl(constraintSatisfactionWithAny.ts, 27, 23)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +var c4 = new C2(b); +>c4 : Symbol(c4, Decl(constraintSatisfactionWithAny.ts, 34, 3)) +>C2 : Symbol(C2, Decl(constraintSatisfactionWithAny.ts, 27, 23)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + +//class C3 { +// constructor(public x: T) { } +//} + +//var c5 = new C3(a); +//var c6 = new C3(b); + +class C4(x:T) => T> { +>C4 : Symbol(C4, Decl(constraintSatisfactionWithAny.ts, 34, 24)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 43, 9)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 43, 20)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 43, 23)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 43, 20)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 43, 20)) + + constructor(public x: T) { } +>x : Symbol(x, Decl(constraintSatisfactionWithAny.ts, 44, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny.ts, 43, 9)) +} + +var c7 = new C4(a); +>c7 : Symbol(c7, Decl(constraintSatisfactionWithAny.ts, 47, 3)) +>C4 : Symbol(C4, Decl(constraintSatisfactionWithAny.ts, 34, 24)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny.ts, 6, 3)) + +var c8 = new C4(b); +>c8 : Symbol(c8, Decl(constraintSatisfactionWithAny.ts, 48, 3)) +>C4 : Symbol(C4, Decl(constraintSatisfactionWithAny.ts, 34, 24)) +>b : Symbol(b, Decl(constraintSatisfactionWithAny.ts, 12, 3)) + + + diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.types b/tests/baselines/reference/constraintSatisfactionWithAny.types index e007d3cec73..f3363fe1a90 100644 --- a/tests/baselines/reference/constraintSatisfactionWithAny.types +++ b/tests/baselines/reference/constraintSatisfactionWithAny.types @@ -8,6 +8,7 @@ function foo(x: T): T { return null; } >x : T >T : T >T : T +>null : null function foo2(x: T): T { return null; } >foo2 : (x: T) => T @@ -16,6 +17,7 @@ function foo2(x: T): T { return null; } >x : T >T : T >T : T +>null : null //function foo3(x: T): T { return null; } function foo4(x: T) => void>(x: T): T { return null; } @@ -27,6 +29,7 @@ function foo4(x: T) => void>(x: T): T { return null; } >x : T >T : T >T : T +>null : null var a; >a : any diff --git a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.symbols b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.symbols new file mode 100644 index 00000000000..fd5aae69b86 --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.symbols @@ -0,0 +1,93 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithEmptyObject.ts === +// valid uses of a basic object constraint, no errors expected + +// Object constraint +function foo(x: T) { } +>foo : Symbol(foo, Decl(constraintSatisfactionWithEmptyObject.ts, 0, 0)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 3, 13)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 3, 31)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 3, 13)) + +var r = foo({}); +>r : Symbol(r, Decl(constraintSatisfactionWithEmptyObject.ts, 4, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 6, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 21, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 23, 3)) +>foo : Symbol(foo, Decl(constraintSatisfactionWithEmptyObject.ts, 0, 0)) + +var a = {}; +>a : Symbol(a, Decl(constraintSatisfactionWithEmptyObject.ts, 5, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 22, 3)) + +var r = foo({}); +>r : Symbol(r, Decl(constraintSatisfactionWithEmptyObject.ts, 4, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 6, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 21, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 23, 3)) +>foo : Symbol(foo, Decl(constraintSatisfactionWithEmptyObject.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(constraintSatisfactionWithEmptyObject.ts, 6, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 8, 8)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + constructor(public x: T) { } +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 9, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 8, 8)) +} + +var r2 = new C({}); +>r2 : Symbol(r2, Decl(constraintSatisfactionWithEmptyObject.ts, 12, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 29, 3)) +>C : Symbol(C, Decl(constraintSatisfactionWithEmptyObject.ts, 6, 16)) + +interface I { +>I : Symbol(I, Decl(constraintSatisfactionWithEmptyObject.ts, 12, 19)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 14, 12)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + x: T; +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 14, 31)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 14, 12)) +} +var i: I<{}>; +>i : Symbol(i, Decl(constraintSatisfactionWithEmptyObject.ts, 17, 3)) +>I : Symbol(I, Decl(constraintSatisfactionWithEmptyObject.ts, 12, 19)) + +// {} constraint +function foo2(x: T) { } +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithEmptyObject.ts, 17, 13)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 20, 14)) +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 20, 28)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 20, 14)) + +var r = foo2({}); +>r : Symbol(r, Decl(constraintSatisfactionWithEmptyObject.ts, 4, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 6, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 21, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 23, 3)) +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithEmptyObject.ts, 17, 13)) + +var a = {}; +>a : Symbol(a, Decl(constraintSatisfactionWithEmptyObject.ts, 5, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 22, 3)) + +var r = foo2({}); +>r : Symbol(r, Decl(constraintSatisfactionWithEmptyObject.ts, 4, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 6, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 21, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 23, 3)) +>foo2 : Symbol(foo2, Decl(constraintSatisfactionWithEmptyObject.ts, 17, 13)) + +class C2 { +>C2 : Symbol(C2, Decl(constraintSatisfactionWithEmptyObject.ts, 23, 17)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 25, 9)) + + constructor(public x: T) { } +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 26, 16)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 25, 9)) +} + +var r2 = new C2({}); +>r2 : Symbol(r2, Decl(constraintSatisfactionWithEmptyObject.ts, 12, 3), Decl(constraintSatisfactionWithEmptyObject.ts, 29, 3)) +>C2 : Symbol(C2, Decl(constraintSatisfactionWithEmptyObject.ts, 23, 17)) + +interface I2 { +>I2 : Symbol(I2, Decl(constraintSatisfactionWithEmptyObject.ts, 29, 20)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 31, 13)) + + x: T; +>x : Symbol(x, Decl(constraintSatisfactionWithEmptyObject.ts, 31, 28)) +>T : Symbol(T, Decl(constraintSatisfactionWithEmptyObject.ts, 31, 13)) +} +var i2: I2<{}>; +>i2 : Symbol(i2, Decl(constraintSatisfactionWithEmptyObject.ts, 34, 3)) +>I2 : Symbol(I2, Decl(constraintSatisfactionWithEmptyObject.ts, 29, 20)) + + diff --git a/tests/baselines/reference/constraintsUsedInPrototypeProperty.symbols b/tests/baselines/reference/constraintsUsedInPrototypeProperty.symbols new file mode 100644 index 00000000000..23a1c08398e --- /dev/null +++ b/tests/baselines/reference/constraintsUsedInPrototypeProperty.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/constraintsUsedInPrototypeProperty.ts === +class Foo { } +>Foo : Symbol(Foo, Decl(constraintsUsedInPrototypeProperty.ts, 0, 0)) +>T : Symbol(T, Decl(constraintsUsedInPrototypeProperty.ts, 0, 10)) +>U : Symbol(U, Decl(constraintsUsedInPrototypeProperty.ts, 0, 27)) +>V : Symbol(V, Decl(constraintsUsedInPrototypeProperty.ts, 0, 30)) + +Foo.prototype; // Foo +>Foo.prototype : Symbol(Foo.prototype) +>Foo : Symbol(Foo, Decl(constraintsUsedInPrototypeProperty.ts, 0, 0)) +>prototype : Symbol(Foo.prototype) + diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.symbols b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.symbols new file mode 100644 index 00000000000..b85ae3e90d8 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.symbols @@ -0,0 +1,398 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance2.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance2.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance2.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>baz : Symbol(baz, Decl(constructSignatureAssignabilityInInheritance2.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(constructSignatureAssignabilityInInheritance2.ts, 4, 47)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance2.ts, 5, 33)) + +interface A { // T +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance2.ts, 5, 49)) + + // M's + a: new (x: number) => number[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 7, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 9, 12)) + + a2: new (x: number) => string[]; +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance2.ts, 9, 35)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 10, 13)) + + a3: new (x: number) => void; +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance2.ts, 10, 36)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 11, 13)) + + a4: new (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance2.ts, 11, 32)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 12, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 12, 23)) + + a5: new (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance2.ts, 12, 45)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 13, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 13, 17)) + + a6: new (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance2.ts, 13, 51)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 14, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 14, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) + + a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(constructSignatureAssignabilityInInheritance2.ts, 14, 48)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 15, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 15, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 15, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(constructSignatureAssignabilityInInheritance2.ts, 15, 64)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 39)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 72)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(constructSignatureAssignabilityInInheritance2.ts, 16, 92)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 39)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 72)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a10: new (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(constructSignatureAssignabilityInInheritance2.ts, 17, 92)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 18, 14)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance2.ts, 18, 42)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 14)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 18)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 33)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 38)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 51)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) + + a12: new (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(constructSignatureAssignabilityInInheritance2.ts, 19, 75)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 20, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 20, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance2.ts, 3, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a13: new (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(constructSignatureAssignabilityInInheritance2.ts, 20, 68)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 21, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 21, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a14: new (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(constructSignatureAssignabilityInInheritance2.ts, 21, 67)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 22, 14)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 22, 18)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance2.ts, 22, 29)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + a15: { +>a15 : Symbol(a15, Decl(constructSignatureAssignabilityInInheritance2.ts, 22, 53)) + + new (x: number): number[]; +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 24, 13)) + + new (x: string): string[]; +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 25, 13)) + + }; + a16: { +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance2.ts, 26, 6)) + + new (x: T): number[]; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 28, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 28, 32)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 28, 13)) + + new (x: U): number[]; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 29, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 29, 29)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 29, 13)) + + }; + a17: { +>a17 : Symbol(a17, Decl(constructSignatureAssignabilityInInheritance2.ts, 30, 6)) + + new (x: new (a: number) => number): number[]; +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 32, 13)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 32, 21)) + + new (x: new (a: string) => string): string[]; +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 33, 13)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 33, 21)) + + }; + a18: { +>a18 : Symbol(a18, Decl(constructSignatureAssignabilityInInheritance2.ts, 34, 6)) + + new (x: { +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 36, 13)) + + new (a: number): number; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 37, 17)) + + new (a: string): string; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 38, 17)) + + }): any[]; + new (x: { +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 40, 13)) + + new (a: boolean): boolean; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 41, 17)) + + new (a: Date): Date; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 42, 17)) +>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)) + + }): any[]; + }; +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(constructSignatureAssignabilityInInheritance2.ts, 45, 1)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance2.ts, 5, 49)) + + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 48, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 50, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 50, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 50, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 50, 12)) + + a2: new (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance2.ts, 50, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 51, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 51, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 51, 13)) + + a3: new (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance2.ts, 51, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 52, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 52, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 52, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 52, 13)) + + a4: new (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance2.ts, 52, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 19)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 13)) + + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance2.ts, 53, 36)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 19)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 13)) + + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance2.ts, 54, 42)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 13)) + + a7: new (x: (arg: T) => U) => (r: T) => U; // ok +>a7 : Symbol(a7, Decl(constructSignatureAssignabilityInInheritance2.ts, 55, 71)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 70)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 28)) + + a8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok +>a8 : Symbol(a8, Decl(constructSignatureAssignabilityInInheritance2.ts, 56, 81)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 28)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 65)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 70)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 89)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 28)) + + a9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal +>a9 : Symbol(a9, Decl(constructSignatureAssignabilityInInheritance2.ts, 57, 100)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 28)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 65)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 70)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 77)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 90)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 117)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 28)) + + a10: new (...x: T[]) => T; // ok +>a10 : Symbol(a10, Decl(constructSignatureAssignabilityInInheritance2.ts, 58, 128)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 59, 14)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 59, 33)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 59, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 59, 14)) + + a11: new (x: T, y: T) => T; // ok +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance2.ts, 59, 49)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 14)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 35)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 14)) + + a12: new >(x: Array, y: T) => Array; // ok, less specific parameter type +>a12 : Symbol(a12, Decl(constructSignatureAssignabilityInInheritance2.ts, 60, 47)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 61, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 61, 37)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 61, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 61, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) + + a13: new >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds +>a13 : Symbol(a13, Decl(constructSignatureAssignabilityInInheritance2.ts, 61, 77)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance2.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 40)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 55)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 14)) + + a14: new (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature +>a14 : Symbol(a14, Decl(constructSignatureAssignabilityInInheritance2.ts, 62, 67)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 14)) + + a15: new (x: T) => T[]; // ok +>a15 : Symbol(a15, Decl(constructSignatureAssignabilityInInheritance2.ts, 63, 41)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 64, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 64, 17)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 64, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 64, 14)) + + a16: new (x: T) => number[]; // ok +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance2.ts, 64, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 65, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance2.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 65, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 65, 14)) + + a17: new (x: new (a: T) => T) => T[]; // ok +>a17 : Symbol(a17, Decl(constructSignatureAssignabilityInInheritance2.ts, 65, 48)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 25)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 14)) + + a18: new (x: new (a: T) => T) => T[]; // ok, no inferences for T but assignable to any +>a18 : Symbol(a18, Decl(constructSignatureAssignabilityInInheritance2.ts, 66, 44)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 25)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance2.ts, 67, 14)) +} diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.symbols b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.symbols new file mode 100644 index 00000000000..33ae7e0f6d6 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.symbols @@ -0,0 +1,332 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance4.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation + +class Base { foo: string; } +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance4.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance4.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>baz : Symbol(baz, Decl(constructSignatureAssignabilityInInheritance4.ts, 4, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(constructSignatureAssignabilityInInheritance4.ts, 4, 47)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance4.ts, 5, 33)) + +interface A { // T +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance4.ts, 5, 49)) + + // M's + a: new (x: T) => T[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 7, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 9, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 9, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 9, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 9, 12)) + + a2: new (x: T) => string[]; +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance4.ts, 9, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 10, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 10, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 10, 13)) + + a3: new (x: T) => void; +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance4.ts, 10, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 11, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 11, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 11, 13)) + + a4: new (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance4.ts, 11, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 19)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 15)) + + a5: new (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance4.ts, 12, 41)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 19)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 13)) + + a6: new (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance4.ts, 13, 42)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 29)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 33)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 13)) + + a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance4.ts, 14, 58)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 17)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 14)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 31)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 36)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 14)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 44)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) + + a15: new (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(constructSignatureAssignabilityInInheritance4.ts, 15, 63)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 14)) + + a16: new (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance4.ts, 16, 43)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 30)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 40)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 14)) + + a17: { +>a17 : Symbol(a17, Decl(constructSignatureAssignabilityInInheritance4.ts, 17, 56)) + + new (x: T): T[]; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 19, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 19, 29)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 19, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 19, 13)) + + new (x: U): U[]; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 20, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 20, 32)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 20, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 20, 13)) + + }; + a18: { +>a18 : Symbol(a18, Decl(constructSignatureAssignabilityInInheritance4.ts, 21, 6)) + + new (x: T): number[]; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 23, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 23, 32)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 23, 13)) + + new (x: U): number[]; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 24, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 24, 29)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 24, 13)) + + }; + a19: { +>a19 : Symbol(a19, Decl(constructSignatureAssignabilityInInheritance4.ts, 25, 6)) + + new (x: new (a: T) => T): T[]; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 32)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 40)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 27, 13)) + + new (x: new (a: U) => U): U[]; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 29)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 37)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 28, 13)) + + }; + a20: { +>a20 : Symbol(a20, Decl(constructSignatureAssignabilityInInheritance4.ts, 29, 6)) + + new (x: { +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 31, 13)) + + new (a: T): T; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 32, 17)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 32, 36)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 32, 17)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 32, 17)) + + new (a: U): U; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 33, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 33, 33)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 33, 17)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 33, 17)) + + }): any[]; + new (x: { +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 35, 13)) + + new (a: T): T; +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 36, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 36, 33)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 36, 17)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 36, 17)) + + new (a: U): U; +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 37, 17)) +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance4.ts, 3, 43)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 37, 37)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 37, 17)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 37, 17)) + + }): any[]; + }; +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(constructSignatureAssignabilityInInheritance4.ts, 40, 1)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance4.ts, 5, 49)) + + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 43, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 45, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 45, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 45, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 45, 12)) + + a2: new (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance4.ts, 45, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 46, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 46, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 46, 13)) + + a3: new (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance4.ts, 46, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 47, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 47, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 47, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 47, 13)) + + a4: new (x: T, y: U) => string; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance4.ts, 47, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 19)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 15)) + + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance4.ts, 48, 41)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 19)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 13)) + + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance4.ts, 49, 42)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance4.ts, 2, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 13)) + + a11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance4.ts, 50, 71)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 14)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 16)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 20)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 24)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 14)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 34)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 39)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 16)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 47)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 16)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) + + a15: new (x: { a: U; b: V; }) => U[]; // ok, T = U, T = V +>a15 : Symbol(a15, Decl(constructSignatureAssignabilityInInheritance4.ts, 51, 66)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 14)) +>V : Symbol(V, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 16)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 20)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 30)) +>V : Symbol(V, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 16)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 14)) + + a16: new (x: { a: T; b: T }) => T[]; // ok, more general parameter type +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance4.ts, 52, 47)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 14)) + + a17: new (x: T) => T[]; // ok, more general parameter type +>a17 : Symbol(a17, Decl(constructSignatureAssignabilityInInheritance4.ts, 53, 43)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 54, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 54, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 54, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 54, 14)) + + a18: new (x: T) => number[]; // ok, more general parameter type +>a18 : Symbol(a18, Decl(constructSignatureAssignabilityInInheritance4.ts, 54, 43)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 55, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 55, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 55, 14)) + + a19: new (x: new (a: T) => T) => T[]; // ok +>a19 : Symbol(a19, Decl(constructSignatureAssignabilityInInheritance4.ts, 55, 48)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 30)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 38)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 14)) + + a20: new (x: new (a: T) => T) => any[]; // ok +>a20 : Symbol(a20, Decl(constructSignatureAssignabilityInInheritance4.ts, 56, 57)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance4.ts, 57, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 57, 22)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance4.ts, 0, 0)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance4.ts, 57, 38)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 57, 22)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance4.ts, 57, 22)) +} diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.symbols b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.symbols new file mode 100644 index 00000000000..2be72546bee --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.symbols @@ -0,0 +1,314 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance5.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain + +class Base { foo: string; } +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance5.ts, 4, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance5.ts, 4, 43)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>baz : Symbol(baz, Decl(constructSignatureAssignabilityInInheritance5.ts, 5, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(constructSignatureAssignabilityInInheritance5.ts, 5, 47)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance5.ts, 6, 33)) + +interface A { // T +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance5.ts, 6, 49)) + + // M's + a: new (x: number) => number[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance5.ts, 8, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 10, 12)) + + a2: new (x: number) => string[]; +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance5.ts, 10, 35)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 11, 13)) + + a3: new (x: number) => void; +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance5.ts, 11, 36)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 12, 13)) + + a4: new (x: string, y: number) => string; +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance5.ts, 12, 32)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 13, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 13, 23)) + + a5: new (x: (arg: string) => number) => string; +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance5.ts, 13, 45)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 14, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 14, 17)) + + a6: new (x: (arg: Base) => Derived) => Base; +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance5.ts, 14, 51)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 15, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 15, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) + + a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; +>a7 : Symbol(a7, Decl(constructSignatureAssignabilityInInheritance5.ts, 15, 48)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 16, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 16, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 16, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a8 : Symbol(a8, Decl(constructSignatureAssignabilityInInheritance5.ts, 16, 64)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 39)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 72)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; +>a9 : Symbol(a9, Decl(constructSignatureAssignabilityInInheritance5.ts, 17, 92)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 13)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 17)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 39)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 44)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 72)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a10: new (...x: Derived[]) => Derived; +>a10 : Symbol(a10, Decl(constructSignatureAssignabilityInInheritance5.ts, 18, 92)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 19, 14)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance5.ts, 19, 42)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 14)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 18)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 33)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 38)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 51)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) + + a12: new (x: Array, y: Array) => Array; +>a12 : Symbol(a12, Decl(constructSignatureAssignabilityInInheritance5.ts, 20, 75)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 21, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 21, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance5.ts, 4, 43)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a13: new (x: Array, y: Array) => Array; +>a13 : Symbol(a13, Decl(constructSignatureAssignabilityInInheritance5.ts, 21, 68)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 22, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 22, 29)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a14: new (x: { a: string; b: number }) => Object; +>a14 : Symbol(a14, Decl(constructSignatureAssignabilityInInheritance5.ts, 22, 67)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 23, 14)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance5.ts, 23, 18)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance5.ts, 23, 29)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +interface B extends A { +>B : Symbol(B, Decl(constructSignatureAssignabilityInInheritance5.ts, 24, 1)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance5.ts, 6, 49)) + + a: new (x: T) => T[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance5.ts, 26, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 27, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 27, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 27, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 27, 12)) +} + +// S's +interface I extends B { +>I : Symbol(I, Decl(constructSignatureAssignabilityInInheritance5.ts, 28, 1)) +>B : Symbol(B, Decl(constructSignatureAssignabilityInInheritance5.ts, 24, 1)) + + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance5.ts, 31, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 33, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 33, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 33, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 33, 12)) + + a2: new (x: T) => string[]; // ok +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance5.ts, 33, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 34, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 34, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 34, 13)) + + a3: new (x: T) => T; // ok since Base returns void +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance5.ts, 34, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 35, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 35, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 35, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 35, 13)) + + a4: new (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance5.ts, 35, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 19)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 13)) + + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance5.ts, 36, 36)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 19)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 13)) + + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance5.ts, 37, 42)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 13)) + + a7: new (x: (arg: T) => U) => (r: T) => U; // ok +>a7 : Symbol(a7, Decl(constructSignatureAssignabilityInInheritance5.ts, 38, 71)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 70)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 28)) + + a8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok +>a8 : Symbol(a8, Decl(constructSignatureAssignabilityInInheritance5.ts, 39, 81)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 28)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 65)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 70)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 89)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 28)) + + a9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal +>a9 : Symbol(a9, Decl(constructSignatureAssignabilityInInheritance5.ts, 40, 100)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 28)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 48)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 28)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 65)) +>arg2 : Symbol(arg2, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 70)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 77)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 90)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 28)) +>r : Symbol(r, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 117)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 28)) + + a10: new (...x: T[]) => T; // ok +>a10 : Symbol(a10, Decl(constructSignatureAssignabilityInInheritance5.ts, 41, 128)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 42, 14)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 42, 33)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 42, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 42, 14)) + + a11: new (x: T, y: T) => T; // ok +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance5.ts, 42, 49)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 14)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 35)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 14)) + + a12: new >(x: Array, y: T) => Array; // ok, less specific parameter type +>a12 : Symbol(a12, Decl(constructSignatureAssignabilityInInheritance5.ts, 43, 47)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 44, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 44, 37)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 44, 52)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 44, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) + + a13: new >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds +>a13 : Symbol(a13, Decl(constructSignatureAssignabilityInInheritance5.ts, 44, 77)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance5.ts, 3, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 40)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance5.ts, 0, 0)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 55)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 14)) + + a14: new (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature +>a14 : Symbol(a14, Decl(constructSignatureAssignabilityInInheritance5.ts, 45, 67)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance5.ts, 46, 14)) +} diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.symbols b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.symbols new file mode 100644 index 00000000000..6f80b15484c --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.symbols @@ -0,0 +1,209 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance6.ts === +// checking subtype relations for function types as it relates to contextual signature instantiation +// same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures +// all are errors + +class Base { foo: string; } +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance6.ts, 4, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance6.ts, 4, 27)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance6.ts, 5, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(constructSignatureAssignabilityInInheritance6.ts, 5, 43)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance6.ts, 4, 27)) +>baz : Symbol(baz, Decl(constructSignatureAssignabilityInInheritance6.ts, 6, 32)) + +class OtherDerived extends Base { bing: string; } +>OtherDerived : Symbol(OtherDerived, Decl(constructSignatureAssignabilityInInheritance6.ts, 6, 47)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +>bing : Symbol(bing, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 33)) + +interface A { // T +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + // M's + a: new (x: T) => T[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance6.ts, 9, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 11, 12)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 11, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 11, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 11, 12)) + + a2: new (x: T) => string[]; +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance6.ts, 11, 28)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 12, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 12, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 12, 13)) + + a3: new (x: T) => void; +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance6.ts, 12, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 13, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 13, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 13, 13)) + + a4: new (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance6.ts, 13, 30)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 19)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 24)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 15)) + + a5: new (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance6.ts, 14, 41)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 15)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 19)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 23)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 15)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 13)) + + a6: new (x: (arg: T) => Derived) => T; +>a6 : Symbol(a6, Decl(constructSignatureAssignabilityInInheritance6.ts, 15, 42)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 13)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 29)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 33)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 13)) +>Derived : Symbol(Derived, Decl(constructSignatureAssignabilityInInheritance6.ts, 4, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 13)) + + a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance6.ts, 16, 58)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 17)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 14)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 31)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 36)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 14)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 44)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) + + a15: new (x: { a: T; b: T }) => T[]; +>a15 : Symbol(a15, Decl(constructSignatureAssignabilityInInheritance6.ts, 17, 63)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 17)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 27)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 14)) + + a16: new (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance6.ts, 18, 43)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 30)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 34)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 14)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 40)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 14)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 19, 14)) +} + +// S's +interface I extends A { +>I : Symbol(I, Decl(constructSignatureAssignabilityInInheritance6.ts, 20, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 23, 12)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a: new (x: T) => T[]; +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance6.ts, 23, 26)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 24, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 23, 12)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 23, 12)) +} + +interface I2 extends A { +>I2 : Symbol(I2, Decl(constructSignatureAssignabilityInInheritance6.ts, 25, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 27, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a2: new (x: T) => string[]; +>a2 : Symbol(a2, Decl(constructSignatureAssignabilityInInheritance6.ts, 27, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 28, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 27, 13)) +} + +interface I3 extends A { +>I3 : Symbol(I3, Decl(constructSignatureAssignabilityInInheritance6.ts, 29, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 31, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a3: new (x: T) => T; +>a3 : Symbol(a3, Decl(constructSignatureAssignabilityInInheritance6.ts, 31, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 32, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 31, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 31, 13)) +} + +interface I4 extends A { +>I4 : Symbol(I4, Decl(constructSignatureAssignabilityInInheritance6.ts, 33, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 35, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a4: new (x: T, y: U) => string; +>a4 : Symbol(a4, Decl(constructSignatureAssignabilityInInheritance6.ts, 35, 27)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 36, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 36, 16)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 35, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance6.ts, 36, 21)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 36, 13)) +} + +interface I5 extends A { +>I5 : Symbol(I5, Decl(constructSignatureAssignabilityInInheritance6.ts, 37, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 39, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a5: new (x: (arg: T) => U) => T; +>a5 : Symbol(a5, Decl(constructSignatureAssignabilityInInheritance6.ts, 39, 27)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 40, 13)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 40, 16)) +>arg : Symbol(arg, Decl(constructSignatureAssignabilityInInheritance6.ts, 40, 20)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 39, 13)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 40, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 39, 13)) +} + +interface I7 extends A { +>I7 : Symbol(I7, Decl(constructSignatureAssignabilityInInheritance6.ts, 41, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 43, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; +>a11 : Symbol(a11, Decl(constructSignatureAssignabilityInInheritance6.ts, 43, 27)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 14)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 17)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 21)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 43, 13)) +>y : Symbol(y, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 31)) +>foo : Symbol(foo, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 36)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 14)) +>bar : Symbol(bar, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 44)) +>U : Symbol(U, Decl(constructSignatureAssignabilityInInheritance6.ts, 44, 14)) +>Base : Symbol(Base, Decl(constructSignatureAssignabilityInInheritance6.ts, 0, 0)) +} + +interface I9 extends A { +>I9 : Symbol(I9, Decl(constructSignatureAssignabilityInInheritance6.ts, 45, 1)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 47, 13)) +>A : Symbol(A, Decl(constructSignatureAssignabilityInInheritance6.ts, 7, 49)) + + a16: new (x: { a: T; b: T }) => T[]; +>a16 : Symbol(a16, Decl(constructSignatureAssignabilityInInheritance6.ts, 47, 27)) +>x : Symbol(x, Decl(constructSignatureAssignabilityInInheritance6.ts, 48, 14)) +>a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance6.ts, 48, 18)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 47, 13)) +>b : Symbol(b, Decl(constructSignatureAssignabilityInInheritance6.ts, 48, 24)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 47, 13)) +>T : Symbol(T, Decl(constructSignatureAssignabilityInInheritance6.ts, 47, 13)) +} diff --git a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.symbols b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.symbols new file mode 100644 index 00000000000..77ab51f057a --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.symbols @@ -0,0 +1,152 @@ +=== tests/cases/conformance/types/objectTypeLiteral/constructSignatures/constructSignaturesWithIdenticalOverloads.ts === +// Duplicate overloads of construct signatures should generate errors + +class C { +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) + + constructor(x: number, y: string); +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 3, 16)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 3, 26)) + + constructor(x: number, y: string); // error +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 4, 16)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 4, 26)) + + constructor(x: number) { } +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 5, 16)) +} + +var r1 = new C(1, ''); +>r1 : Symbol(r1, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 3)) +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) + +class C2 { +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 10, 9)) + + constructor(x: T, y: string); +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 11, 16)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 10, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 11, 21)) + + constructor(x: T, y: string); // error +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 12, 16)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 10, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 12, 21)) + + constructor(x: T) { } +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 13, 16)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 10, 9)) +} + +var r2 = new C2(1, ''); +>r2 : Symbol(r2, Decl(constructSignaturesWithIdenticalOverloads.ts, 16, 3)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) + +interface I { +>I : Symbol(I, Decl(constructSignaturesWithIdenticalOverloads.ts, 16, 23)) + + new (x: number, y: string): C; +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 19, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 19, 19)) +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) + + new (x: number, y: string): C; // error +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 20, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 20, 19)) +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) +} + +var i: I; +>i : Symbol(i, Decl(constructSignaturesWithIdenticalOverloads.ts, 23, 3)) +>I : Symbol(I, Decl(constructSignaturesWithIdenticalOverloads.ts, 16, 23)) + +var r3 = new i(1, ''); +>r3 : Symbol(r3, Decl(constructSignaturesWithIdenticalOverloads.ts, 24, 3)) +>i : Symbol(i, Decl(constructSignaturesWithIdenticalOverloads.ts, 23, 3)) + +interface I2 { +>I2 : Symbol(I2, Decl(constructSignaturesWithIdenticalOverloads.ts, 24, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 26, 13)) + + new (x: T, y: string): C2; +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 27, 9)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 26, 13)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 27, 14)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 26, 13)) + + new (x: T, y: string): C2; // error +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 28, 9)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 26, 13)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 28, 14)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 26, 13)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 29, 9)) +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 29, 12)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 29, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 29, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 29, 9)) + + new (x: T, y: string): C2; // error +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 30, 9)) +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 30, 12)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 30, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 30, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 30, 9)) +} + +var i2: I2; +>i2 : Symbol(i2, Decl(constructSignaturesWithIdenticalOverloads.ts, 33, 3)) +>I2 : Symbol(I2, Decl(constructSignaturesWithIdenticalOverloads.ts, 24, 22)) + +var r4 = new i2(1, ''); +>r4 : Symbol(r4, Decl(constructSignaturesWithIdenticalOverloads.ts, 34, 3)) +>i2 : Symbol(i2, Decl(constructSignaturesWithIdenticalOverloads.ts, 33, 3)) + +var a: { +>a : Symbol(a, Decl(constructSignaturesWithIdenticalOverloads.ts, 36, 3)) + + new (x: number, y: string): C; +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 37, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 37, 19)) +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) + + new (x: number, y: string): C; // error +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 38, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 38, 19)) +>C : Symbol(C, Decl(constructSignaturesWithIdenticalOverloads.ts, 0, 0)) +} + +var r5 = new a(1, ''); +>r5 : Symbol(r5, Decl(constructSignaturesWithIdenticalOverloads.ts, 41, 3)) +>a : Symbol(a, Decl(constructSignaturesWithIdenticalOverloads.ts, 36, 3)) + +var b: { +>b : Symbol(b, Decl(constructSignaturesWithIdenticalOverloads.ts, 43, 3)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 44, 9)) +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 44, 12)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 44, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 44, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 44, 9)) + + new (x: T, y: string): C2; // error +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 45, 9)) +>x : Symbol(x, Decl(constructSignaturesWithIdenticalOverloads.ts, 45, 12)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 45, 9)) +>y : Symbol(y, Decl(constructSignaturesWithIdenticalOverloads.ts, 45, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithIdenticalOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithIdenticalOverloads.ts, 45, 9)) +} + +var r6 = new b(1, ''); +>r6 : Symbol(r6, Decl(constructSignaturesWithIdenticalOverloads.ts, 48, 3)) +>b : Symbol(b, Decl(constructSignaturesWithIdenticalOverloads.ts, 43, 3)) + diff --git a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types index a34c5365f2d..ca2cb6fefb7 100644 --- a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types +++ b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.types @@ -20,6 +20,8 @@ var r1 = new C(1, ''); >r1 : C >new C(1, '') : C >C : typeof C +>1 : number +>'' : string class C2 { >C2 : C2 @@ -44,6 +46,8 @@ var r2 = new C2(1, ''); >r2 : C2 >new C2(1, '') : C2 >C2 : typeof C2 +>1 : number +>'' : string interface I { >I : I @@ -67,6 +71,8 @@ var r3 = new i(1, ''); >r3 : C >new i(1, '') : C >i : I +>1 : number +>'' : string interface I2 { >I2 : I2 @@ -111,6 +117,8 @@ var r4 = new i2(1, ''); >r4 : C2 >new i2(1, '') : C2 >i2 : I2 +>1 : number +>'' : string var a: { >a : { new (x: number, y: string): C; new (x: number, y: string): C; } @@ -130,6 +138,8 @@ var r5 = new a(1, ''); >r5 : C >new a(1, '') : C >a : { new (x: number, y: string): C; new (x: number, y: string): C; } +>1 : number +>'' : string var b: { >b : { new (x: T, y: string): C2; new (x: T, y: string): C2; } @@ -155,4 +165,6 @@ var r6 = new b(1, ''); >r6 : C2 >new b(1, '') : C2 >b : { new (x: T, y: string): C2; new (x: T, y: string): C2; } +>1 : number +>'' : string diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.symbols b/tests/baselines/reference/constructSignaturesWithOverloads.symbols new file mode 100644 index 00000000000..9130cb3f38a --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithOverloads.symbols @@ -0,0 +1,153 @@ +=== tests/cases/conformance/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads.ts === +// No errors expected for basic overloads of construct signatures + +class C { +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) + + constructor(x: number, y?: string); +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 3, 16)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 3, 26)) + + constructor(x: number, y: string); +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 4, 16)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 4, 26)) + + constructor(x: number) { } +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 5, 16)) +} + +var r1 = new C(1, ''); +>r1 : Symbol(r1, Decl(constructSignaturesWithOverloads.ts, 8, 3)) +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) + +class C2 { +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9)) + + constructor(x: T, y?: string); +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 11, 16)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 11, 21)) + + constructor(x: T, y: string); +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 12, 16)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 12, 21)) + + constructor(x: T) { } +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 13, 16)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 10, 9)) +} + +var r2 = new C2(1, ''); +>r2 : Symbol(r2, Decl(constructSignaturesWithOverloads.ts, 16, 3)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) + +interface I { +>I : Symbol(I, Decl(constructSignaturesWithOverloads.ts, 16, 23)) + + new(x: number, y?: string): C; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 19, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 19, 18)) +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) + + new(x: number, y: string): C; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 20, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 20, 18)) +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) +} + +var i: I; +>i : Symbol(i, Decl(constructSignaturesWithOverloads.ts, 23, 3)) +>I : Symbol(I, Decl(constructSignaturesWithOverloads.ts, 16, 23)) + +var r3 = new i(1, ''); +>r3 : Symbol(r3, Decl(constructSignaturesWithOverloads.ts, 24, 3)) +>i : Symbol(i, Decl(constructSignaturesWithOverloads.ts, 23, 3)) + +interface I2 { +>I2 : Symbol(I2, Decl(constructSignaturesWithOverloads.ts, 24, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13)) + + new (x: T, y?: string): C2; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 27, 9)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 27, 14)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13)) + + new (x: T, y: string): C2; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 28, 9)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 28, 14)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 26, 13)) + + new (x: T, y?: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 29, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 29, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 29, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 29, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 29, 9)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 30, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 30, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 30, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 30, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 30, 9)) + +} + +var i2: I2; +>i2 : Symbol(i2, Decl(constructSignaturesWithOverloads.ts, 34, 3)) +>I2 : Symbol(I2, Decl(constructSignaturesWithOverloads.ts, 24, 22)) + +var r4 = new i2(1, ''); +>r4 : Symbol(r4, Decl(constructSignaturesWithOverloads.ts, 35, 3)) +>i2 : Symbol(i2, Decl(constructSignaturesWithOverloads.ts, 34, 3)) + +var a: { +>a : Symbol(a, Decl(constructSignaturesWithOverloads.ts, 37, 3)) + + new(x: number, y?: string): C; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 38, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 38, 18)) +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) + + new(x: number, y: string): C; +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 39, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 39, 18)) +>C : Symbol(C, Decl(constructSignaturesWithOverloads.ts, 0, 0)) +} + +var r5 = new a(1, ''); +>r5 : Symbol(r5, Decl(constructSignaturesWithOverloads.ts, 42, 3)) +>a : Symbol(a, Decl(constructSignaturesWithOverloads.ts, 37, 3)) + +var b: { +>b : Symbol(b, Decl(constructSignaturesWithOverloads.ts, 44, 3)) + + new(x: T, y?: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 45, 8)) +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 45, 11)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 45, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 45, 16)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 45, 8)) + + new(x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 46, 8)) +>x : Symbol(x, Decl(constructSignaturesWithOverloads.ts, 46, 11)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 46, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloads.ts, 46, 16)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloads.ts, 8, 22)) +>T : Symbol(T, Decl(constructSignaturesWithOverloads.ts, 46, 8)) +} + +var r6 = new b(1, ''); +>r6 : Symbol(r6, Decl(constructSignaturesWithOverloads.ts, 49, 3)) +>b : Symbol(b, Decl(constructSignaturesWithOverloads.ts, 44, 3)) + diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.types b/tests/baselines/reference/constructSignaturesWithOverloads.types index 0cd9b744ee7..8ff678c5de8 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads.types +++ b/tests/baselines/reference/constructSignaturesWithOverloads.types @@ -20,6 +20,8 @@ var r1 = new C(1, ''); >r1 : C >new C(1, '') : C >C : typeof C +>1 : number +>'' : string class C2 { >C2 : C2 @@ -44,6 +46,8 @@ var r2 = new C2(1, ''); >r2 : C2 >new C2(1, '') : C2 >C2 : typeof C2 +>1 : number +>'' : string interface I { >I : I @@ -67,6 +71,8 @@ var r3 = new i(1, ''); >r3 : C >new i(1, '') : C >i : I +>1 : number +>'' : string interface I2 { >I2 : I2 @@ -112,6 +118,8 @@ var r4 = new i2(1, ''); >r4 : C2 >new i2(1, '') : C2 >i2 : I2 +>1 : number +>'' : string var a: { >a : { new (x: number, y?: string): C; new (x: number, y: string): C; } @@ -131,6 +139,8 @@ var r5 = new a(1, ''); >r5 : C >new a(1, '') : C >a : { new (x: number, y?: string): C; new (x: number, y: string): C; } +>1 : number +>'' : string var b: { >b : { new (x: T, y?: string): C2; new (x: T, y: string): C2; } @@ -156,4 +166,6 @@ var r6 = new b(1, ''); >r6 : C2 >new b(1, '') : C2 >b : { new (x: T, y?: string): C2; new (x: T, y: string): C2; } +>1 : number +>'' : string diff --git a/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.symbols b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.symbols new file mode 100644 index 00000000000..c231d9457c4 --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.symbols @@ -0,0 +1,99 @@ +=== tests/cases/conformance/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts === +// Error for construct signature overloads to differ only by return type + +class C { +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) + + constructor(x: number) { } +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 3, 16)) +} + +class C2 { +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 6, 9)) + + constructor(x: T, y?: string) { } +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 7, 16)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 6, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 7, 21)) +} + +interface I { +>I : Symbol(I, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 8, 1)) + + new(x: number, y: string): C; +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 11, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 11, 18)) +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) + + new(x: number, y: string): C2; // error +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 12, 8)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 12, 18)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 13, 1)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 15, 13)) + + new (x: T, y: string): C2; +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 16, 9)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 15, 13)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 16, 14)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) + + new (x: T, y: string): C; // error +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 17, 9)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 15, 13)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 17, 14)) +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 18, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 18, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 18, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 18, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 18, 9)) + + new (x: T, y: string): C; // error +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 19, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 19, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 19, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 19, 17)) +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) + +} + +var a: { +>a : Symbol(a, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 23, 3)) + + new (x: number, y: string): C2; +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 24, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 24, 19)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) + + new (x: number, y: string): C; // error +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 25, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 25, 19)) +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) +} + +var b: { +>b : Symbol(b, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 28, 3)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 29, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 29, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 29, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 29, 17)) +>C2 : Symbol(C2, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 4, 1)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 29, 9)) + + new (x: T, y: string): C; // error +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 30, 9)) +>x : Symbol(x, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 30, 12)) +>T : Symbol(T, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 30, 9)) +>y : Symbol(y, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 30, 17)) +>C : Symbol(C, Decl(constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts, 0, 0)) +} diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.symbols b/tests/baselines/reference/constructorArgWithGenericCallSignature.symbols new file mode 100644 index 00000000000..ffb166e6681 --- /dev/null +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/constructorArgWithGenericCallSignature.ts === +module Test { +>Test : Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0)) + + export interface MyFunc { +>MyFunc : Symbol(MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13)) + + (value1: T): T; +>T : Symbol(T, Decl(constructorArgWithGenericCallSignature.ts, 2, 9)) +>value1 : Symbol(value1, Decl(constructorArgWithGenericCallSignature.ts, 2, 12)) +>T : Symbol(T, Decl(constructorArgWithGenericCallSignature.ts, 2, 9)) +>T : Symbol(T, Decl(constructorArgWithGenericCallSignature.ts, 2, 9)) + } + export class MyClass { +>MyClass : Symbol(MyClass, Decl(constructorArgWithGenericCallSignature.ts, 3, 5)) + + constructor(func: MyFunc) { } +>func : Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 5, 20)) +>MyFunc : Symbol(MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13)) + } + + export function F(func: MyFunc) { } +>F : Symbol(F, Decl(constructorArgWithGenericCallSignature.ts, 6, 5)) +>func : Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 8, 19)) +>MyFunc : Symbol(MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13)) +} +var func: Test.MyFunc; +>func : Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 10, 3)) +>Test : Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0)) +>MyFunc : Symbol(Test.MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13)) + +Test.F(func); // OK +>Test.F : Symbol(Test.F, Decl(constructorArgWithGenericCallSignature.ts, 6, 5)) +>Test : Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0)) +>F : Symbol(Test.F, Decl(constructorArgWithGenericCallSignature.ts, 6, 5)) +>func : Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 10, 3)) + +var test = new Test.MyClass(func); // Should be OK +>test : Symbol(test, Decl(constructorArgWithGenericCallSignature.ts, 12, 3)) +>Test.MyClass : Symbol(Test.MyClass, Decl(constructorArgWithGenericCallSignature.ts, 3, 5)) +>Test : Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0)) +>MyClass : Symbol(Test.MyClass, Decl(constructorArgWithGenericCallSignature.ts, 3, 5)) +>func : Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 10, 3)) + diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.types b/tests/baselines/reference/constructorArgWithGenericCallSignature.types index a419f3a3427..5899ffe186a 100644 --- a/tests/baselines/reference/constructorArgWithGenericCallSignature.types +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.types @@ -26,7 +26,7 @@ module Test { } var func: Test.MyFunc; >func : Test.MyFunc ->Test : unknown +>Test : any >MyFunc : Test.MyFunc Test.F(func); // OK diff --git a/tests/baselines/reference/constructorArgs.symbols b/tests/baselines/reference/constructorArgs.symbols new file mode 100644 index 00000000000..083a094a4cd --- /dev/null +++ b/tests/baselines/reference/constructorArgs.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/constructorArgs.ts === +interface Options { +>Options : Symbol(Options, Decl(constructorArgs.ts, 0, 0)) + + value: number; +>value : Symbol(value, Decl(constructorArgs.ts, 0, 19)) +} + +class Super { +>Super : Symbol(Super, Decl(constructorArgs.ts, 2, 1)) + + constructor(value:number) { +>value : Symbol(value, Decl(constructorArgs.ts, 5, 13)) + } +} + +class Sub extends Super { +>Sub : Symbol(Sub, Decl(constructorArgs.ts, 7, 1)) +>Super : Symbol(Super, Decl(constructorArgs.ts, 2, 1)) + + constructor(public options:Options) { +>options : Symbol(options, Decl(constructorArgs.ts, 10, 13)) +>Options : Symbol(Options, Decl(constructorArgs.ts, 0, 0)) + + super(options.value); +>super : Symbol(Super, Decl(constructorArgs.ts, 2, 1)) +>options.value : Symbol(Options.value, Decl(constructorArgs.ts, 0, 19)) +>options : Symbol(options, Decl(constructorArgs.ts, 10, 13)) +>value : Symbol(Options.value, Decl(constructorArgs.ts, 0, 19)) + } +} + diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.symbols b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.symbols new file mode 100644 index 00000000000..8ca8fb6a5d8 --- /dev/null +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/constructorFunctionTypeIsAssignableToBaseType.ts === +class Base { +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 0, 0)) + + static foo: { +>foo : Symbol(Base.foo, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 0, 12)) + + bar: Object; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 1, 17)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + } +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 4, 1)) +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 0, 0)) + + // ok + static foo: { +>foo : Symbol(Derived.foo, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 6, 28)) + + bar: number; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 8, 17)) + } +} + +class Derived2 extends Base { +>Derived2 : Symbol(Derived2, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 11, 1)) +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 0, 0)) + + // ok, use assignability here + static foo: { +>foo : Symbol(Derived2.foo, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 13, 29)) + + bar: any; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType.ts, 15, 17)) + } +} diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.symbols b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.symbols new file mode 100644 index 00000000000..e915b6e705d --- /dev/null +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/constructorFunctionTypeIsAssignableToBaseType2.ts === +// the constructor function itself does not need to be a subtype of the base type constructor function + +class Base { +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 0, 0)) + + static foo: { +>foo : Symbol(Base.foo, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 2, 12)) + + bar: Object; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 3, 17)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + } + constructor(x: Object) { +>x : Symbol(x, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 6, 16)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + } +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 8, 1)) +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 0, 0)) + + // ok + static foo: { +>foo : Symbol(Derived.foo, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 10, 28)) + + bar: number; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 12, 17)) + } + + constructor(x: number) { +>x : Symbol(x, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 16, 16)) + + super(x); +>super : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 0, 0)) +>x : Symbol(x, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 16, 16)) + } +} + +class Derived2 extends Base { +>Derived2 : Symbol(Derived2, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 19, 1)) +>Base : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 0, 0)) + + static foo: { +>foo : Symbol(Derived2.foo, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 21, 29)) + + bar: number; +>bar : Symbol(bar, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 22, 17)) + } + + // ok, not enforcing assignability relation on this + constructor(x: any) { +>x : Symbol(x, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 27, 16)) + + super(x); +>super : Symbol(Base, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 0, 0)) +>x : Symbol(x, Decl(constructorFunctionTypeIsAssignableToBaseType2.ts, 27, 16)) + + return 1; + } +} diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types index 53853163827..e0e86df4a26 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.types @@ -60,5 +60,6 @@ class Derived2 extends Base { >x : any return 1; +>1 : number } } diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.symbols b/tests/baselines/reference/constructorHasPrototypeProperty.symbols new file mode 100644 index 00000000000..0a90834ac51 --- /dev/null +++ b/tests/baselines/reference/constructorHasPrototypeProperty.symbols @@ -0,0 +1,100 @@ +=== tests/cases/conformance/classes/members/constructorFunctionTypes/constructorHasPrototypeProperty.ts === +module NonGeneric { +>NonGeneric : Symbol(NonGeneric, Decl(constructorHasPrototypeProperty.ts, 0, 0)) + + class C { +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 0, 19)) + + foo: string; +>foo : Symbol(foo, Decl(constructorHasPrototypeProperty.ts, 1, 13)) + } + + class D extends C { +>D : Symbol(D, Decl(constructorHasPrototypeProperty.ts, 3, 5)) +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 0, 19)) + + bar: string; +>bar : Symbol(bar, Decl(constructorHasPrototypeProperty.ts, 5, 23)) + } + + var r = C.prototype; +>r : Symbol(r, Decl(constructorHasPrototypeProperty.ts, 9, 7)) +>C.prototype : Symbol(C.prototype) +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 0, 19)) +>prototype : Symbol(C.prototype) + + r.foo; +>r.foo : Symbol(C.foo, Decl(constructorHasPrototypeProperty.ts, 1, 13)) +>r : Symbol(r, Decl(constructorHasPrototypeProperty.ts, 9, 7)) +>foo : Symbol(C.foo, Decl(constructorHasPrototypeProperty.ts, 1, 13)) + + var r2 = D.prototype; +>r2 : Symbol(r2, Decl(constructorHasPrototypeProperty.ts, 11, 7)) +>D.prototype : Symbol(D.prototype) +>D : Symbol(D, Decl(constructorHasPrototypeProperty.ts, 3, 5)) +>prototype : Symbol(D.prototype) + + r2.bar; +>r2.bar : Symbol(D.bar, Decl(constructorHasPrototypeProperty.ts, 5, 23)) +>r2 : Symbol(r2, Decl(constructorHasPrototypeProperty.ts, 11, 7)) +>bar : Symbol(D.bar, Decl(constructorHasPrototypeProperty.ts, 5, 23)) +} + +module Generic { +>Generic : Symbol(Generic, Decl(constructorHasPrototypeProperty.ts, 13, 1)) + + class C { +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 15, 16)) +>T : Symbol(T, Decl(constructorHasPrototypeProperty.ts, 16, 12)) +>U : Symbol(U, Decl(constructorHasPrototypeProperty.ts, 16, 14)) + + foo: T; +>foo : Symbol(foo, Decl(constructorHasPrototypeProperty.ts, 16, 18)) +>T : Symbol(T, Decl(constructorHasPrototypeProperty.ts, 16, 12)) + + bar: U; +>bar : Symbol(bar, Decl(constructorHasPrototypeProperty.ts, 17, 15)) +>U : Symbol(U, Decl(constructorHasPrototypeProperty.ts, 16, 14)) + } + + class D extends C { +>D : Symbol(D, Decl(constructorHasPrototypeProperty.ts, 19, 5)) +>T : Symbol(T, Decl(constructorHasPrototypeProperty.ts, 21, 12)) +>U : Symbol(U, Decl(constructorHasPrototypeProperty.ts, 21, 14)) +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 15, 16)) +>T : Symbol(T, Decl(constructorHasPrototypeProperty.ts, 21, 12)) +>U : Symbol(U, Decl(constructorHasPrototypeProperty.ts, 21, 14)) + + baz: T; +>baz : Symbol(baz, Decl(constructorHasPrototypeProperty.ts, 21, 33)) +>T : Symbol(T, Decl(constructorHasPrototypeProperty.ts, 21, 12)) + + bing: U; +>bing : Symbol(bing, Decl(constructorHasPrototypeProperty.ts, 22, 15)) +>U : Symbol(U, Decl(constructorHasPrototypeProperty.ts, 21, 14)) + } + + var r = C.prototype; // C +>r : Symbol(r, Decl(constructorHasPrototypeProperty.ts, 26, 7)) +>C.prototype : Symbol(C.prototype) +>C : Symbol(C, Decl(constructorHasPrototypeProperty.ts, 15, 16)) +>prototype : Symbol(C.prototype) + + var ra = r.foo; // any +>ra : Symbol(ra, Decl(constructorHasPrototypeProperty.ts, 27, 7)) +>r.foo : Symbol(C.foo, Decl(constructorHasPrototypeProperty.ts, 16, 18)) +>r : Symbol(r, Decl(constructorHasPrototypeProperty.ts, 26, 7)) +>foo : Symbol(C.foo, Decl(constructorHasPrototypeProperty.ts, 16, 18)) + + var r2 = D.prototype; // D +>r2 : Symbol(r2, Decl(constructorHasPrototypeProperty.ts, 28, 7)) +>D.prototype : Symbol(D.prototype) +>D : Symbol(D, Decl(constructorHasPrototypeProperty.ts, 19, 5)) +>prototype : Symbol(D.prototype) + + var rb = r2.baz; // any +>rb : Symbol(rb, Decl(constructorHasPrototypeProperty.ts, 29, 7)) +>r2.baz : Symbol(D.baz, Decl(constructorHasPrototypeProperty.ts, 21, 33)) +>r2 : Symbol(r2, Decl(constructorHasPrototypeProperty.ts, 28, 7)) +>baz : Symbol(D.baz, Decl(constructorHasPrototypeProperty.ts, 21, 33)) +} diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues.symbols b/tests/baselines/reference/constructorImplementationWithDefaultValues.symbols new file mode 100644 index 00000000000..384aa692da6 --- /dev/null +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues.symbols @@ -0,0 +1,50 @@ +=== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorImplementationWithDefaultValues.ts === +class C { +>C : Symbol(C, Decl(constructorImplementationWithDefaultValues.ts, 0, 0)) + + constructor(x); +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 1, 16)) + + constructor(x = 1) { +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 2, 16)) + + var y = x; +>y : Symbol(y, Decl(constructorImplementationWithDefaultValues.ts, 3, 11)) +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 2, 16)) + } +} + +class D { +>D : Symbol(D, Decl(constructorImplementationWithDefaultValues.ts, 5, 1)) +>T : Symbol(T, Decl(constructorImplementationWithDefaultValues.ts, 7, 8)) + + constructor(x); +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 8, 16)) + + constructor(x:T = null) { +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 9, 16)) +>T : Symbol(T, Decl(constructorImplementationWithDefaultValues.ts, 7, 8)) + + var y = x; +>y : Symbol(y, Decl(constructorImplementationWithDefaultValues.ts, 10, 11)) +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 9, 16)) + } +} + +class E { +>E : Symbol(E, Decl(constructorImplementationWithDefaultValues.ts, 12, 1)) +>T : Symbol(T, Decl(constructorImplementationWithDefaultValues.ts, 14, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + constructor(x); +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 15, 16)) + + constructor(x: T = null) { +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 16, 16)) +>T : Symbol(T, Decl(constructorImplementationWithDefaultValues.ts, 14, 8)) + + var y = x; +>y : Symbol(y, Decl(constructorImplementationWithDefaultValues.ts, 17, 11)) +>x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 16, 16)) + } +} diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues.types b/tests/baselines/reference/constructorImplementationWithDefaultValues.types index 6dc2b4f285b..fa99cc17fe0 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues.types +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues.types @@ -7,6 +7,7 @@ class C { constructor(x = 1) { >x : number +>1 : number var y = x; >y : number @@ -24,6 +25,7 @@ class D { constructor(x:T = null) { >x : T >T : T +>null : null var y = x; >y : T @@ -42,6 +44,7 @@ class E { constructor(x: T = null) { >x : T >T : T +>null : null var y = x; >y : T diff --git a/tests/baselines/reference/constructorOverloads2.symbols b/tests/baselines/reference/constructorOverloads2.symbols new file mode 100644 index 00000000000..b2b9db6eda3 --- /dev/null +++ b/tests/baselines/reference/constructorOverloads2.symbols @@ -0,0 +1,67 @@ +=== tests/cases/compiler/constructorOverloads2.ts === +class FooBase { +>FooBase : Symbol(FooBase, Decl(constructorOverloads2.ts, 0, 0)) + + constructor(s: string); +>s : Symbol(s, Decl(constructorOverloads2.ts, 1, 16)) + + constructor(n: number); +>n : Symbol(n, Decl(constructorOverloads2.ts, 2, 16)) + + constructor(x: any) { +>x : Symbol(x, Decl(constructorOverloads2.ts, 3, 16)) + } + bar1() { /*WScript.Echo("base bar1");*/ } +>bar1 : Symbol(bar1, Decl(constructorOverloads2.ts, 4, 5)) +} + +class Foo extends FooBase { +>Foo : Symbol(Foo, Decl(constructorOverloads2.ts, 6, 1)) +>FooBase : Symbol(FooBase, Decl(constructorOverloads2.ts, 0, 0)) + + constructor(s: string); +>s : Symbol(s, Decl(constructorOverloads2.ts, 9, 16)) + + constructor(n: number); +>n : Symbol(n, Decl(constructorOverloads2.ts, 10, 16)) + + constructor(a:any); +>a : Symbol(a, Decl(constructorOverloads2.ts, 11, 16)) + + constructor(x: any, y?: any) { +>x : Symbol(x, Decl(constructorOverloads2.ts, 12, 16)) +>y : Symbol(y, Decl(constructorOverloads2.ts, 12, 23)) + + super(x); +>super : Symbol(FooBase, Decl(constructorOverloads2.ts, 0, 0)) +>x : Symbol(x, Decl(constructorOverloads2.ts, 12, 16)) + } + bar1() { /*WScript.Echo("bar1");*/ } +>bar1 : Symbol(bar1, Decl(constructorOverloads2.ts, 14, 5)) +} + +var f1 = new Foo("hey"); +>f1 : Symbol(f1, Decl(constructorOverloads2.ts, 18, 3)) +>Foo : Symbol(Foo, Decl(constructorOverloads2.ts, 6, 1)) + +var f2 = new Foo(0); +>f2 : Symbol(f2, Decl(constructorOverloads2.ts, 19, 3)) +>Foo : Symbol(Foo, Decl(constructorOverloads2.ts, 6, 1)) + +var f3 = new Foo(f1); +>f3 : Symbol(f3, Decl(constructorOverloads2.ts, 20, 3)) +>Foo : Symbol(Foo, Decl(constructorOverloads2.ts, 6, 1)) +>f1 : Symbol(f1, Decl(constructorOverloads2.ts, 18, 3)) + +var f4 = new Foo([f1,f2,f3]); +>f4 : Symbol(f4, Decl(constructorOverloads2.ts, 21, 3)) +>Foo : Symbol(Foo, Decl(constructorOverloads2.ts, 6, 1)) +>f1 : Symbol(f1, Decl(constructorOverloads2.ts, 18, 3)) +>f2 : Symbol(f2, Decl(constructorOverloads2.ts, 19, 3)) +>f3 : Symbol(f3, Decl(constructorOverloads2.ts, 20, 3)) + +f1.bar1(); +>f1.bar1 : Symbol(Foo.bar1, Decl(constructorOverloads2.ts, 14, 5)) +>f1 : Symbol(f1, Decl(constructorOverloads2.ts, 18, 3)) +>bar1 : Symbol(Foo.bar1, Decl(constructorOverloads2.ts, 14, 5)) + diff --git a/tests/baselines/reference/constructorOverloads2.types b/tests/baselines/reference/constructorOverloads2.types index 65da67f04fe..dde032c0fd2 100644 --- a/tests/baselines/reference/constructorOverloads2.types +++ b/tests/baselines/reference/constructorOverloads2.types @@ -45,11 +45,13 @@ var f1 = new Foo("hey"); >f1 : Foo >new Foo("hey") : Foo >Foo : typeof Foo +>"hey" : string var f2 = new Foo(0); >f2 : Foo >new Foo(0) : Foo >Foo : typeof Foo +>0 : number var f3 = new Foo(f1); >f3 : Foo diff --git a/tests/baselines/reference/constructorOverloadsWithOptionalParameters.symbols b/tests/baselines/reference/constructorOverloadsWithOptionalParameters.symbols new file mode 100644 index 00000000000..68cecd8f912 --- /dev/null +++ b/tests/baselines/reference/constructorOverloadsWithOptionalParameters.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorOverloadsWithOptionalParameters.ts === +class C { +>C : Symbol(C, Decl(constructorOverloadsWithOptionalParameters.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(constructorOverloadsWithOptionalParameters.ts, 0, 9)) + + constructor(x?, y?: any[]); +>x : Symbol(x, Decl(constructorOverloadsWithOptionalParameters.ts, 2, 16)) +>y : Symbol(y, Decl(constructorOverloadsWithOptionalParameters.ts, 2, 19)) + + constructor() { + } +} + +class D { +>D : Symbol(D, Decl(constructorOverloadsWithOptionalParameters.ts, 5, 1)) +>T : Symbol(T, Decl(constructorOverloadsWithOptionalParameters.ts, 7, 8)) + + foo: string; +>foo : Symbol(foo, Decl(constructorOverloadsWithOptionalParameters.ts, 7, 12)) + + constructor(x?, y?: any[]); +>x : Symbol(x, Decl(constructorOverloadsWithOptionalParameters.ts, 9, 16)) +>y : Symbol(y, Decl(constructorOverloadsWithOptionalParameters.ts, 9, 19)) + + constructor() { + } +} diff --git a/tests/baselines/reference/constructorReturningAPrimitive.symbols b/tests/baselines/reference/constructorReturningAPrimitive.symbols new file mode 100644 index 00000000000..6206b6d87b8 --- /dev/null +++ b/tests/baselines/reference/constructorReturningAPrimitive.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/constructorReturningAPrimitive.ts === +// technically not allowed by JavaScript but we don't have a 'not-primitive' constraint +// functionally only possible when your class is otherwise devoid of members so of little consequence in practice + +class A { +>A : Symbol(A, Decl(constructorReturningAPrimitive.ts, 0, 0)) + + constructor() { + return 1; + } +} + +var a = new A(); +>a : Symbol(a, Decl(constructorReturningAPrimitive.ts, 9, 3)) +>A : Symbol(A, Decl(constructorReturningAPrimitive.ts, 0, 0)) + +class B { +>B : Symbol(B, Decl(constructorReturningAPrimitive.ts, 9, 16)) +>T : Symbol(T, Decl(constructorReturningAPrimitive.ts, 11, 8)) + + constructor() { + var x: T; +>x : Symbol(x, Decl(constructorReturningAPrimitive.ts, 13, 11)) +>T : Symbol(T, Decl(constructorReturningAPrimitive.ts, 11, 8)) + + return x; +>x : Symbol(x, Decl(constructorReturningAPrimitive.ts, 13, 11)) + } +} + +var b = new B(); +>b : Symbol(b, Decl(constructorReturningAPrimitive.ts, 18, 3)) +>B : Symbol(B, Decl(constructorReturningAPrimitive.ts, 9, 16)) + diff --git a/tests/baselines/reference/constructorReturningAPrimitive.types b/tests/baselines/reference/constructorReturningAPrimitive.types index c4ca2ba7078..4b431cfb36b 100644 --- a/tests/baselines/reference/constructorReturningAPrimitive.types +++ b/tests/baselines/reference/constructorReturningAPrimitive.types @@ -7,6 +7,7 @@ class A { constructor() { return 1; +>1 : number } } diff --git a/tests/baselines/reference/constructorTypeWithTypeParameters.symbols b/tests/baselines/reference/constructorTypeWithTypeParameters.symbols new file mode 100644 index 00000000000..0ea9e854d77 --- /dev/null +++ b/tests/baselines/reference/constructorTypeWithTypeParameters.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/constructorTypeWithTypeParameters.ts === +declare var X: { +>X : Symbol(X, Decl(constructorTypeWithTypeParameters.ts, 0, 11)) + + new (): number; +>T : Symbol(T, Decl(constructorTypeWithTypeParameters.ts, 1, 9)) +} +declare var Y: { +>Y : Symbol(Y, Decl(constructorTypeWithTypeParameters.ts, 3, 11)) + + new (): number; +} +var anotherVar: new () => number; +>anotherVar : Symbol(anotherVar, Decl(constructorTypeWithTypeParameters.ts, 6, 3)) +>T : Symbol(T, Decl(constructorTypeWithTypeParameters.ts, 6, 21)) + diff --git a/tests/baselines/reference/constructorWithExpressionLessReturn.symbols b/tests/baselines/reference/constructorWithExpressionLessReturn.symbols new file mode 100644 index 00000000000..0d6f06a91a4 --- /dev/null +++ b/tests/baselines/reference/constructorWithExpressionLessReturn.symbols @@ -0,0 +1,41 @@ +=== tests/cases/conformance/classes/constructorDeclarations/constructorWithExpressionLessReturn.ts === +class C { +>C : Symbol(C, Decl(constructorWithExpressionLessReturn.ts, 0, 0)) + + constructor() { + return; + } +} + +class D { +>D : Symbol(D, Decl(constructorWithExpressionLessReturn.ts, 4, 1)) + + x: number; +>x : Symbol(x, Decl(constructorWithExpressionLessReturn.ts, 6, 9)) + + constructor() { + return; + } +} + +class E { +>E : Symbol(E, Decl(constructorWithExpressionLessReturn.ts, 11, 1)) + + constructor(public x: number) { +>x : Symbol(x, Decl(constructorWithExpressionLessReturn.ts, 14, 16)) + + return; + } +} + +class F { +>F : Symbol(F, Decl(constructorWithExpressionLessReturn.ts, 17, 1)) +>T : Symbol(T, Decl(constructorWithExpressionLessReturn.ts, 19, 8)) + + constructor(public x: T) { +>x : Symbol(x, Decl(constructorWithExpressionLessReturn.ts, 20, 16)) +>T : Symbol(T, Decl(constructorWithExpressionLessReturn.ts, 19, 8)) + + return; + } +} diff --git a/tests/baselines/reference/contextualSigInstantiationRestParams.symbols b/tests/baselines/reference/contextualSigInstantiationRestParams.symbols new file mode 100644 index 00000000000..5b18899e5f2 --- /dev/null +++ b/tests/baselines/reference/contextualSigInstantiationRestParams.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/contextualSigInstantiationRestParams.ts === +declare function toInstantiate(a?: A, b?: B): B; +>toInstantiate : Symbol(toInstantiate, Decl(contextualSigInstantiationRestParams.ts, 0, 0)) +>A : Symbol(A, Decl(contextualSigInstantiationRestParams.ts, 0, 31)) +>B : Symbol(B, Decl(contextualSigInstantiationRestParams.ts, 0, 33)) +>a : Symbol(a, Decl(contextualSigInstantiationRestParams.ts, 0, 37)) +>A : Symbol(A, Decl(contextualSigInstantiationRestParams.ts, 0, 31)) +>b : Symbol(b, Decl(contextualSigInstantiationRestParams.ts, 0, 43)) +>B : Symbol(B, Decl(contextualSigInstantiationRestParams.ts, 0, 33)) +>B : Symbol(B, Decl(contextualSigInstantiationRestParams.ts, 0, 33)) + +declare function contextual(...s: string[]): string +>contextual : Symbol(contextual, Decl(contextualSigInstantiationRestParams.ts, 0, 54)) +>s : Symbol(s, Decl(contextualSigInstantiationRestParams.ts, 1, 28)) + +var sig: typeof contextual = toInstantiate; +>sig : Symbol(sig, Decl(contextualSigInstantiationRestParams.ts, 3, 3)) +>contextual : Symbol(contextual, Decl(contextualSigInstantiationRestParams.ts, 0, 54)) +>toInstantiate : Symbol(toInstantiate, Decl(contextualSigInstantiationRestParams.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiation.symbols b/tests/baselines/reference/contextualSignatureInstantiation.symbols new file mode 100644 index 00000000000..c16ffed84b7 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation.symbols @@ -0,0 +1,132 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts === +// TypeScript Spec, section 4.12.2: +// If e is an expression of a function type that contains exactly one generic call signature and no other members, +// and T is a function type with exactly one non - generic call signature and no other members, then any inferences +// made for type parameters referenced by the parameters of T's call signature are fixed, and e's type is changed +// to a function type with e's call signature instantiated in the context of T's call signature (section 3.8.5). + +declare function foo(cb: (x: number, y: string) => T): T; +>foo : Symbol(foo, Decl(contextualSignatureInstantiation.ts, 0, 0)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 6, 21)) +>cb : Symbol(cb, Decl(contextualSignatureInstantiation.ts, 6, 24)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 6, 29)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 6, 39)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 6, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 6, 21)) + +declare function bar(x: T, y: U, cb: (x: T, y: U) => V): V; +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 7, 21)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 7, 23)) +>V : Symbol(V, Decl(contextualSignatureInstantiation.ts, 7, 26)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 7, 30)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 7, 21)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 7, 35)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 7, 23)) +>cb : Symbol(cb, Decl(contextualSignatureInstantiation.ts, 7, 41)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 7, 47)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 7, 21)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 7, 52)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 7, 23)) +>V : Symbol(V, Decl(contextualSignatureInstantiation.ts, 7, 26)) +>V : Symbol(V, Decl(contextualSignatureInstantiation.ts, 7, 26)) + +declare function baz(x: T, y: T, cb: (x: T, y: T) => U): U; +>baz : Symbol(baz, Decl(contextualSignatureInstantiation.ts, 7, 68)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 8, 21)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 8, 23)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 8, 27)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 8, 21)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 8, 32)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 8, 21)) +>cb : Symbol(cb, Decl(contextualSignatureInstantiation.ts, 8, 38)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 8, 44)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 8, 21)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 8, 49)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 8, 21)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 8, 23)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 8, 23)) + +declare function g(x: T, y: T): T; +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 10, 19)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 10, 22)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 10, 19)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 10, 27)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 10, 19)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 10, 19)) + +declare function h(x: T, y: U): T[] | U[]; +>h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 11, 19)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 11, 21)) +>x : Symbol(x, Decl(contextualSignatureInstantiation.ts, 11, 25)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 11, 19)) +>y : Symbol(y, Decl(contextualSignatureInstantiation.ts, 11, 30)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 11, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation.ts, 11, 19)) +>U : Symbol(U, Decl(contextualSignatureInstantiation.ts, 11, 21)) + +var a: number; +>a : Symbol(a, Decl(contextualSignatureInstantiation.ts, 13, 3), Decl(contextualSignatureInstantiation.ts, 14, 3), Decl(contextualSignatureInstantiation.ts, 15, 3)) + +var a = bar(1, 1, g); // Should be number +>a : Symbol(a, Decl(contextualSignatureInstantiation.ts, 13, 3), Decl(contextualSignatureInstantiation.ts, 14, 3), Decl(contextualSignatureInstantiation.ts, 15, 3)) +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var a = baz(1, 1, g); // Should be number +>a : Symbol(a, Decl(contextualSignatureInstantiation.ts, 13, 3), Decl(contextualSignatureInstantiation.ts, 14, 3), Decl(contextualSignatureInstantiation.ts, 15, 3)) +>baz : Symbol(baz, Decl(contextualSignatureInstantiation.ts, 7, 68)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var b: number | string; +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) + +var b = foo(g); // Should be number | string +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>foo : Symbol(foo, Decl(contextualSignatureInstantiation.ts, 0, 0)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var b = bar(1, "one", g); // Should be number | string +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var b = bar("one", 1, g); // Should be number | string +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var b = baz(b, b, g); // Should be number | string +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>baz : Symbol(baz, Decl(contextualSignatureInstantiation.ts, 7, 68)) +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + +var d: number[] | string[]; +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) + +var d = foo(h); // Should be number[] | string[] +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>foo : Symbol(foo, Decl(contextualSignatureInstantiation.ts, 0, 0)) +>h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) + +var d = bar(1, "one", h); // Should be number[] | string[] +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) + +var d = bar("one", 1, h); // Should be number[] | string[] +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) +>h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) + +var d = baz(d, d, g); // Should be number[] | string[] +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>baz : Symbol(baz, Decl(contextualSignatureInstantiation.ts, 7, 68)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiation.types b/tests/baselines/reference/contextualSignatureInstantiation.types index 4363272622a..e7be6da51c5 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.types +++ b/tests/baselines/reference/contextualSignatureInstantiation.types @@ -74,12 +74,16 @@ var a = bar(1, 1, g); // Should be number >a : number >bar(1, 1, g) : number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>1 : number +>1 : number >g : (x: T, y: T) => T var a = baz(1, 1, g); // Should be number >a : number >baz(1, 1, g) : number >baz : (x: T, y: T, cb: (x: T, y: T) => U) => U +>1 : number +>1 : number >g : (x: T, y: T) => T var b: number | string; @@ -95,12 +99,16 @@ var b = bar(1, "one", g); // Should be number | string >b : string | number >bar(1, "one", g) : string | number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>1 : number +>"one" : string >g : (x: T, y: T) => T var b = bar("one", 1, g); // Should be number | string >b : string | number >bar("one", 1, g) : string | number >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>"one" : string +>1 : number >g : (x: T, y: T) => T var b = baz(b, b, g); // Should be number | string @@ -124,12 +132,16 @@ var d = bar(1, "one", h); // Should be number[] | string[] >d : string[] | number[] >bar(1, "one", h) : string[] | number[] >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>1 : number +>"one" : string >h : (x: T, y: U) => T[] | U[] var d = bar("one", 1, h); // Should be number[] | string[] >d : string[] | number[] >bar("one", 1, h) : string[] | number[] >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V +>"one" : string +>1 : number >h : (x: T, y: U) => T[] | U[] var d = baz(d, d, g); // Should be number[] | string[] diff --git a/tests/baselines/reference/contextualSignatureInstantiation.types.pull b/tests/baselines/reference/contextualSignatureInstantiation.types.pull deleted file mode 100644 index d7246ab79aa..00000000000 --- a/tests/baselines/reference/contextualSignatureInstantiation.types.pull +++ /dev/null @@ -1,142 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts === -// TypeScript Spec, section 4.12.2: -// If e is an expression of a function type that contains exactly one generic call signature and no other members, -// and T is a function type with exactly one non - generic call signature and no other members, then any inferences -// made for type parameters referenced by the parameters of T's call signature are fixed, and e's type is changed -// to a function type with e's call signature instantiated in the context of T's call signature (section 3.8.5). - -declare function foo(cb: (x: number, y: string) => T): T; ->foo : (cb: (x: number, y: string) => T) => T ->T : T ->cb : (x: number, y: string) => T ->x : number ->y : string ->T : T ->T : T - -declare function bar(x: T, y: U, cb: (x: T, y: U) => V): V; ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->T : T ->U : U ->V : V ->x : T ->T : T ->y : U ->U : U ->cb : (x: T, y: U) => V ->x : T ->T : T ->y : U ->U : U ->V : V ->V : V - -declare function baz(x: T, y: T, cb: (x: T, y: T) => U): U; ->baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->T : T ->U : U ->x : T ->T : T ->y : T ->T : T ->cb : (x: T, y: T) => U ->x : T ->T : T ->y : T ->T : T ->U : U ->U : U - -declare function g(x: T, y: T): T; ->g : (x: T, y: T) => T ->T : T ->x : T ->T : T ->y : T ->T : T ->T : T - -declare function h(x: T, y: U): T[] | U[]; ->h : (x: T, y: U) => T[] | U[] ->T : T ->U : U ->x : T ->T : T ->y : U ->U : U ->T : T ->U : U - -var a: number; ->a : number - -var a = bar(1, 1, g); // Should be number ->a : number ->bar(1, 1, g) : number ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->g : (x: T, y: T) => T - -var a = baz(1, 1, g); // Should be number ->a : number ->baz(1, 1, g) : number ->baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->g : (x: T, y: T) => T - -var b: number | string; ->b : string | number - -var b = foo(g); // Should be number | string ->b : string | number ->foo(g) : string | number ->foo : (cb: (x: number, y: string) => T) => T ->g : (x: T, y: T) => T - -var b = bar(1, "one", g); // Should be number | string ->b : string | number ->bar(1, "one", g) : string | number ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->g : (x: T, y: T) => T - -var b = bar("one", 1, g); // Should be number | string ->b : string | number ->bar("one", 1, g) : string | number ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->g : (x: T, y: T) => T - -var b = baz(b, b, g); // Should be number | string ->b : string | number ->baz(b, b, g) : string | number ->baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->b : string | number ->b : string | number ->g : (x: T, y: T) => T - -var d: number[] | string[]; ->d : number[] | string[] - -var d = foo(h); // Should be number[] | string[] ->d : number[] | string[] ->foo(h) : number[] | string[] ->foo : (cb: (x: number, y: string) => T) => T ->h : (x: T, y: U) => T[] | U[] - -var d = bar(1, "one", h); // Should be number[] | string[] ->d : number[] | string[] ->bar(1, "one", h) : number[] | string[] ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->h : (x: T, y: U) => T[] | U[] - -var d = bar("one", 1, h); // Should be number[] | string[] ->d : number[] | string[] ->bar("one", 1, h) : number[] | string[] ->bar : (x: T, y: U, cb: (x: T, y: U) => V) => V ->h : (x: T, y: U) => T[] | U[] - -var d = baz(d, d, g); // Should be number[] | string[] ->d : number[] | string[] ->baz(d, d, g) : number[] | string[] ->baz : (x: T, y: T, cb: (x: T, y: T) => U) => U ->d : number[] | string[] ->d : number[] | string[] ->g : (x: T, y: T) => T - diff --git a/tests/baselines/reference/contextualSignatureInstantiation1.symbols b/tests/baselines/reference/contextualSignatureInstantiation1.symbols new file mode 100644 index 00000000000..e56e997cffc --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation1.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/contextualSignatureInstantiation1.ts === +declare function map(f: (x: S) => T): (a: S[]) => T[]; +>map : Symbol(map, Decl(contextualSignatureInstantiation1.ts, 0, 0)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 0, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 0, 23)) +>f : Symbol(f, Decl(contextualSignatureInstantiation1.ts, 0, 27)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 0, 31)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 0, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 0, 23)) +>a : Symbol(a, Decl(contextualSignatureInstantiation1.ts, 0, 45)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 0, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 0, 23)) + +var e = (x: string, y?: K) => x.length; +>e : Symbol(e, Decl(contextualSignatureInstantiation1.ts, 1, 3)) +>K : Symbol(K, Decl(contextualSignatureInstantiation1.ts, 1, 9)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 1, 12)) +>y : Symbol(y, Decl(contextualSignatureInstantiation1.ts, 1, 22)) +>K : Symbol(K, Decl(contextualSignatureInstantiation1.ts, 1, 9)) +>x.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 1, 12)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + +var r99 = map(e); // should be {}[] for S since a generic lambda is not inferentially typed +>r99 : Symbol(r99, Decl(contextualSignatureInstantiation1.ts, 2, 3)) +>map : Symbol(map, Decl(contextualSignatureInstantiation1.ts, 0, 0)) +>e : Symbol(e, Decl(contextualSignatureInstantiation1.ts, 1, 3)) + +declare function map2(f: (x: S) => T): (a: S[]) => T[]; +>map2 : Symbol(map2, Decl(contextualSignatureInstantiation1.ts, 2, 17)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 4, 22)) +>length : Symbol(length, Decl(contextualSignatureInstantiation1.ts, 4, 33)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 4, 51)) +>f : Symbol(f, Decl(contextualSignatureInstantiation1.ts, 4, 55)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 4, 59)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 4, 22)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 4, 51)) +>a : Symbol(a, Decl(contextualSignatureInstantiation1.ts, 4, 73)) +>S : Symbol(S, Decl(contextualSignatureInstantiation1.ts, 4, 22)) +>T : Symbol(T, Decl(contextualSignatureInstantiation1.ts, 4, 51)) + +var e2 = (x: string, y?: K) => x.length; +>e2 : Symbol(e2, Decl(contextualSignatureInstantiation1.ts, 5, 3)) +>K : Symbol(K, Decl(contextualSignatureInstantiation1.ts, 5, 10)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 5, 13)) +>y : Symbol(y, Decl(contextualSignatureInstantiation1.ts, 5, 23)) +>K : Symbol(K, Decl(contextualSignatureInstantiation1.ts, 5, 10)) +>x.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>x : Symbol(x, Decl(contextualSignatureInstantiation1.ts, 5, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + +var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number } +>r100 : Symbol(r100, Decl(contextualSignatureInstantiation1.ts, 6, 3)) +>map2 : Symbol(map2, Decl(contextualSignatureInstantiation1.ts, 2, 17)) +>e2 : Symbol(e2, Decl(contextualSignatureInstantiation1.ts, 5, 3)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiation2.symbols b/tests/baselines/reference/contextualSignatureInstantiation2.symbols new file mode 100644 index 00000000000..62808982eb5 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation2.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/contextualSignatureInstantiation2.ts === +// dot f g x = f(g(x)) +var dot: (f: (_: T) => S) => (g: (_: U) => T) => (_: U) => S; +>dot : Symbol(dot, Decl(contextualSignatureInstantiation2.ts, 1, 3)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 1, 10)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 1, 12)) +>f : Symbol(f, Decl(contextualSignatureInstantiation2.ts, 1, 16)) +>_ : Symbol(_, Decl(contextualSignatureInstantiation2.ts, 1, 20)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 1, 10)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 1, 12)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 1, 36)) +>g : Symbol(g, Decl(contextualSignatureInstantiation2.ts, 1, 39)) +>_ : Symbol(_, Decl(contextualSignatureInstantiation2.ts, 1, 43)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 1, 36)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 1, 10)) +>_ : Symbol(_, Decl(contextualSignatureInstantiation2.ts, 1, 59)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 1, 36)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 1, 12)) + +dot = (f: (_: T) => S) => (g: (_: U) => T): (r:U) => S => (x) => f(g(x)); +>dot : Symbol(dot, Decl(contextualSignatureInstantiation2.ts, 1, 3)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 2, 7)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 2, 9)) +>f : Symbol(f, Decl(contextualSignatureInstantiation2.ts, 2, 13)) +>_ : Symbol(_, Decl(contextualSignatureInstantiation2.ts, 2, 17)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 2, 7)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 2, 9)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 2, 33)) +>g : Symbol(g, Decl(contextualSignatureInstantiation2.ts, 2, 36)) +>_ : Symbol(_, Decl(contextualSignatureInstantiation2.ts, 2, 40)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 2, 33)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 2, 7)) +>r : Symbol(r, Decl(contextualSignatureInstantiation2.ts, 2, 54)) +>U : Symbol(U, Decl(contextualSignatureInstantiation2.ts, 2, 33)) +>S : Symbol(S, Decl(contextualSignatureInstantiation2.ts, 2, 9)) +>x : Symbol(x, Decl(contextualSignatureInstantiation2.ts, 2, 68)) +>f : Symbol(f, Decl(contextualSignatureInstantiation2.ts, 2, 13)) +>g : Symbol(g, Decl(contextualSignatureInstantiation2.ts, 2, 36)) +>x : Symbol(x, Decl(contextualSignatureInstantiation2.ts, 2, 68)) + +var id: (x:T) => T; +>id : Symbol(id, Decl(contextualSignatureInstantiation2.ts, 3, 3)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 3, 9)) +>x : Symbol(x, Decl(contextualSignatureInstantiation2.ts, 3, 12)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 3, 9)) +>T : Symbol(T, Decl(contextualSignatureInstantiation2.ts, 3, 9)) + +var r23 = dot(id)(id); +>r23 : Symbol(r23, Decl(contextualSignatureInstantiation2.ts, 4, 3)) +>dot : Symbol(dot, Decl(contextualSignatureInstantiation2.ts, 1, 3)) +>id : Symbol(id, Decl(contextualSignatureInstantiation2.ts, 3, 3)) +>id : Symbol(id, Decl(contextualSignatureInstantiation2.ts, 3, 3)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.symbols b/tests/baselines/reference/contextualSignatureInstantiation3.symbols new file mode 100644 index 00000000000..7e90c6390ca --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation3.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/contextualSignatureInstantiation3.ts === +function map(items: T[], f: (x: T) => U): U[]{ +>map : Symbol(map, Decl(contextualSignatureInstantiation3.ts, 0, 0)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 0, 13)) +>U : Symbol(U, Decl(contextualSignatureInstantiation3.ts, 0, 15)) +>items : Symbol(items, Decl(contextualSignatureInstantiation3.ts, 0, 19)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 0, 13)) +>f : Symbol(f, Decl(contextualSignatureInstantiation3.ts, 0, 30)) +>x : Symbol(x, Decl(contextualSignatureInstantiation3.ts, 0, 35)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 0, 13)) +>U : Symbol(U, Decl(contextualSignatureInstantiation3.ts, 0, 15)) +>U : Symbol(U, Decl(contextualSignatureInstantiation3.ts, 0, 15)) + + return items.map(f); +>items.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>items : Symbol(items, Decl(contextualSignatureInstantiation3.ts, 0, 19)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>f : Symbol(f, Decl(contextualSignatureInstantiation3.ts, 0, 30)) +} + +function identity(x: T) { +>identity : Symbol(identity, Decl(contextualSignatureInstantiation3.ts, 2, 1)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 4, 18)) +>x : Symbol(x, Decl(contextualSignatureInstantiation3.ts, 4, 21)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 4, 18)) + + return x; +>x : Symbol(x, Decl(contextualSignatureInstantiation3.ts, 4, 21)) +} + +function singleton(x: T) { +>singleton : Symbol(singleton, Decl(contextualSignatureInstantiation3.ts, 6, 1)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 8, 19)) +>x : Symbol(x, Decl(contextualSignatureInstantiation3.ts, 8, 22)) +>T : Symbol(T, Decl(contextualSignatureInstantiation3.ts, 8, 19)) + + return [x]; +>x : Symbol(x, Decl(contextualSignatureInstantiation3.ts, 8, 22)) +} + +var xs = [1, 2, 3]; +>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) + +// Have compiler check that we get the correct types +var v1: number[]; +>v1 : Symbol(v1, Decl(contextualSignatureInstantiation3.ts, 15, 3), Decl(contextualSignatureInstantiation3.ts, 16, 3), Decl(contextualSignatureInstantiation3.ts, 17, 3)) + +var v1 = xs.map(identity); // Error if not number[] +>v1 : Symbol(v1, Decl(contextualSignatureInstantiation3.ts, 15, 3), Decl(contextualSignatureInstantiation3.ts, 16, 3), Decl(contextualSignatureInstantiation3.ts, 17, 3)) +>xs.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>identity : Symbol(identity, Decl(contextualSignatureInstantiation3.ts, 2, 1)) + +var v1 = map(xs, identity); // Error if not number[] +>v1 : Symbol(v1, Decl(contextualSignatureInstantiation3.ts, 15, 3), Decl(contextualSignatureInstantiation3.ts, 16, 3), Decl(contextualSignatureInstantiation3.ts, 17, 3)) +>map : Symbol(map, Decl(contextualSignatureInstantiation3.ts, 0, 0)) +>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) +>identity : Symbol(identity, Decl(contextualSignatureInstantiation3.ts, 2, 1)) + +var v2: number[][]; +>v2 : Symbol(v2, Decl(contextualSignatureInstantiation3.ts, 19, 3), Decl(contextualSignatureInstantiation3.ts, 20, 3), Decl(contextualSignatureInstantiation3.ts, 21, 3)) + +var v2 = xs.map(singleton); // Error if not number[][] +>v2 : Symbol(v2, Decl(contextualSignatureInstantiation3.ts, 19, 3), Decl(contextualSignatureInstantiation3.ts, 20, 3), Decl(contextualSignatureInstantiation3.ts, 21, 3)) +>xs.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>singleton : Symbol(singleton, Decl(contextualSignatureInstantiation3.ts, 6, 1)) + +var v2 = map(xs, singleton); // Error if not number[][] +>v2 : Symbol(v2, Decl(contextualSignatureInstantiation3.ts, 19, 3), Decl(contextualSignatureInstantiation3.ts, 20, 3), Decl(contextualSignatureInstantiation3.ts, 21, 3)) +>map : Symbol(map, Decl(contextualSignatureInstantiation3.ts, 0, 0)) +>xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) +>singleton : Symbol(singleton, Decl(contextualSignatureInstantiation3.ts, 6, 1)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.types b/tests/baselines/reference/contextualSignatureInstantiation3.types index c6ed5a7e97d..d01b2b1f8e4 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation3.types +++ b/tests/baselines/reference/contextualSignatureInstantiation3.types @@ -43,6 +43,9 @@ function singleton(x: T) { var xs = [1, 2, 3]; >xs : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number // Have compiler check that we get the correct types var v1: number[]; diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.symbols b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.symbols new file mode 100644 index 00000000000..db6f205b152 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts === +function f() { +>f : Symbol(f, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 11)) + + function g(u: U): U { return null } +>g : Symbol(g, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 17)) +>U : Symbol(U, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 15)) +>T : Symbol(T, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 11)) +>u : Symbol(u, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 28)) +>U : Symbol(U, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 15)) +>U : Symbol(U, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 15)) + + return g; +>g : Symbol(g, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 17)) +} +var h: (v: V, func: (v: V) => W) => W; +>h : Symbol(h, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 3)) +>V : Symbol(V, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 8)) +>W : Symbol(W, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 10)) +>v : Symbol(v, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 14)) +>V : Symbol(V, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 8)) +>func : Symbol(func, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 19)) +>v : Symbol(v, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 27)) +>V : Symbol(V, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 8)) +>W : Symbol(W, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 10)) +>W : Symbol(W, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 10)) + +var x = h("", f()); // Call should succeed and x should be string. All type parameters should be instantiated to string +>x : Symbol(x, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 5, 3)) +>h : Symbol(h, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 3)) +>f : Symbol(f, Decl(contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types index 89ea3028d94..d0a6d49487b 100644 --- a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types @@ -10,6 +10,7 @@ function f() { >u : U >U : U >U : U +>null : null return g; >g : (u: U) => U @@ -30,6 +31,7 @@ var x = h("", f()); // Call should succeed and x should be string. All t >x : string >h("", f()) : string >h : (v: V, func: (v: V) => W) => W +>"" : string >f() : (u: U) => U >f : () => (u: U) => U diff --git a/tests/baselines/reference/contextualSignatureInstatiationContravariance.symbols b/tests/baselines/reference/contextualSignatureInstatiationContravariance.symbols new file mode 100644 index 00000000000..c19c61cdbb0 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstatiationContravariance.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/contextualSignatureInstatiationContravariance.ts === +interface Animal { x } +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationContravariance.ts, 0, 0)) +>x : Symbol(x, Decl(contextualSignatureInstatiationContravariance.ts, 0, 18)) + +interface Giraffe extends Animal { y } +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationContravariance.ts, 0, 22)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationContravariance.ts, 0, 0)) +>y : Symbol(y, Decl(contextualSignatureInstatiationContravariance.ts, 1, 34)) + +interface Elephant extends Animal { y2 } +>Elephant : Symbol(Elephant, Decl(contextualSignatureInstatiationContravariance.ts, 1, 38)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationContravariance.ts, 0, 0)) +>y2 : Symbol(y2, Decl(contextualSignatureInstatiationContravariance.ts, 2, 35)) + +var f2: (x: T, y: T) => void; +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationContravariance.ts, 4, 3)) +>T : Symbol(T, Decl(contextualSignatureInstatiationContravariance.ts, 4, 9)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationContravariance.ts, 0, 0)) +>x : Symbol(x, Decl(contextualSignatureInstatiationContravariance.ts, 4, 27)) +>T : Symbol(T, Decl(contextualSignatureInstatiationContravariance.ts, 4, 9)) +>y : Symbol(y, Decl(contextualSignatureInstatiationContravariance.ts, 4, 32)) +>T : Symbol(T, Decl(contextualSignatureInstatiationContravariance.ts, 4, 9)) + +var g2: (g: Giraffe, e: Elephant) => void; +>g2 : Symbol(g2, Decl(contextualSignatureInstatiationContravariance.ts, 6, 3)) +>g : Symbol(g, Decl(contextualSignatureInstatiationContravariance.ts, 6, 9)) +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationContravariance.ts, 0, 22)) +>e : Symbol(e, Decl(contextualSignatureInstatiationContravariance.ts, 6, 20)) +>Elephant : Symbol(Elephant, Decl(contextualSignatureInstatiationContravariance.ts, 1, 38)) + +g2 = f2; // valid because both Giraffe and Elephant satisfy the constraint. T is Animal +>g2 : Symbol(g2, Decl(contextualSignatureInstatiationContravariance.ts, 6, 3)) +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationContravariance.ts, 4, 3)) + +var h2: (g1: Giraffe, g2: Giraffe) => void; +>h2 : Symbol(h2, Decl(contextualSignatureInstatiationContravariance.ts, 9, 3)) +>g1 : Symbol(g1, Decl(contextualSignatureInstatiationContravariance.ts, 9, 9)) +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationContravariance.ts, 0, 22)) +>g2 : Symbol(g2, Decl(contextualSignatureInstatiationContravariance.ts, 9, 21)) +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationContravariance.ts, 0, 22)) + +h2 = f2; // valid because Giraffe satisfies the constraint. It is safe in the traditional contravariant fashion. +>h2 : Symbol(h2, Decl(contextualSignatureInstatiationContravariance.ts, 9, 3)) +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationContravariance.ts, 4, 3)) + diff --git a/tests/baselines/reference/contextualSignatureInstatiationCovariance.symbols b/tests/baselines/reference/contextualSignatureInstatiationCovariance.symbols new file mode 100644 index 00000000000..9b1b4c0c5f0 --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstatiationCovariance.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/contextualSignatureInstatiationCovariance.ts === +interface Animal { x } +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationCovariance.ts, 0, 0)) +>x : Symbol(x, Decl(contextualSignatureInstatiationCovariance.ts, 0, 18)) + +interface TallThing { x2 } +>TallThing : Symbol(TallThing, Decl(contextualSignatureInstatiationCovariance.ts, 0, 22)) +>x2 : Symbol(x2, Decl(contextualSignatureInstatiationCovariance.ts, 1, 21)) + +interface Giraffe extends Animal, TallThing { y } +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationCovariance.ts, 1, 26)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationCovariance.ts, 0, 0)) +>TallThing : Symbol(TallThing, Decl(contextualSignatureInstatiationCovariance.ts, 0, 22)) +>y : Symbol(y, Decl(contextualSignatureInstatiationCovariance.ts, 2, 45)) + +var f2: (x: T, y: T) => void; +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationCovariance.ts, 4, 3)) +>T : Symbol(T, Decl(contextualSignatureInstatiationCovariance.ts, 4, 9)) +>Giraffe : Symbol(Giraffe, Decl(contextualSignatureInstatiationCovariance.ts, 1, 26)) +>x : Symbol(x, Decl(contextualSignatureInstatiationCovariance.ts, 4, 28)) +>T : Symbol(T, Decl(contextualSignatureInstatiationCovariance.ts, 4, 9)) +>y : Symbol(y, Decl(contextualSignatureInstatiationCovariance.ts, 4, 33)) +>T : Symbol(T, Decl(contextualSignatureInstatiationCovariance.ts, 4, 9)) + +var g2: (a: Animal, t: TallThing) => void; +>g2 : Symbol(g2, Decl(contextualSignatureInstatiationCovariance.ts, 6, 3)) +>a : Symbol(a, Decl(contextualSignatureInstatiationCovariance.ts, 6, 9)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationCovariance.ts, 0, 0)) +>t : Symbol(t, Decl(contextualSignatureInstatiationCovariance.ts, 6, 19)) +>TallThing : Symbol(TallThing, Decl(contextualSignatureInstatiationCovariance.ts, 0, 22)) + +g2 = f2; // While neither Animal nor TallThing satisfy the constraint, T is at worst a Giraffe and compatible with both via covariance. +>g2 : Symbol(g2, Decl(contextualSignatureInstatiationCovariance.ts, 6, 3)) +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationCovariance.ts, 4, 3)) + +var h2: (a1: Animal, a2: Animal) => void; +>h2 : Symbol(h2, Decl(contextualSignatureInstatiationCovariance.ts, 9, 3)) +>a1 : Symbol(a1, Decl(contextualSignatureInstatiationCovariance.ts, 9, 9)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationCovariance.ts, 0, 0)) +>a2 : Symbol(a2, Decl(contextualSignatureInstatiationCovariance.ts, 9, 20)) +>Animal : Symbol(Animal, Decl(contextualSignatureInstatiationCovariance.ts, 0, 0)) + +h2 = f2; // Animal does not satisfy the constraint, but T is at worst a Giraffe and compatible with Animal via covariance. +>h2 : Symbol(h2, Decl(contextualSignatureInstatiationCovariance.ts, 9, 3)) +>f2 : Symbol(f2, Decl(contextualSignatureInstatiationCovariance.ts, 4, 3)) + diff --git a/tests/baselines/reference/contextualTypeAny.symbols b/tests/baselines/reference/contextualTypeAny.symbols new file mode 100644 index 00000000000..5132c948a2e --- /dev/null +++ b/tests/baselines/reference/contextualTypeAny.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/contextualTypeAny.ts === +var x: any; +>x : Symbol(x, Decl(contextualTypeAny.ts, 0, 3)) + +var obj: { [s: string]: number } = { p: "", q: x }; +>obj : Symbol(obj, Decl(contextualTypeAny.ts, 2, 3)) +>s : Symbol(s, Decl(contextualTypeAny.ts, 2, 12)) +>p : Symbol(p, Decl(contextualTypeAny.ts, 2, 36)) +>q : Symbol(q, Decl(contextualTypeAny.ts, 2, 43)) +>x : Symbol(x, Decl(contextualTypeAny.ts, 0, 3)) + +var arr: number[] = ["", x]; +>arr : Symbol(arr, Decl(contextualTypeAny.ts, 4, 3)) +>x : Symbol(x, Decl(contextualTypeAny.ts, 0, 3)) + diff --git a/tests/baselines/reference/contextualTypeAny.types b/tests/baselines/reference/contextualTypeAny.types index b21c3748eda..cace92d6567 100644 --- a/tests/baselines/reference/contextualTypeAny.types +++ b/tests/baselines/reference/contextualTypeAny.types @@ -7,11 +7,13 @@ var obj: { [s: string]: number } = { p: "", q: x }; >s : string >{ p: "", q: x } : { [x: string]: any; p: string; q: any; } >p : string +>"" : string >q : any >x : any var arr: number[] = ["", x]; >arr : number[] >["", x] : any[] +>"" : string >x : any diff --git a/tests/baselines/reference/contextualTypeAppliedToVarArgs.symbols b/tests/baselines/reference/contextualTypeAppliedToVarArgs.symbols new file mode 100644 index 00000000000..bf8774cc7f0 --- /dev/null +++ b/tests/baselines/reference/contextualTypeAppliedToVarArgs.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/contextualTypeAppliedToVarArgs.ts === +function delegate(instance: any, method: (...args: any[]) => any, data?: any): (...args: any[]) => any { +>delegate : Symbol(delegate, Decl(contextualTypeAppliedToVarArgs.ts, 0, 0)) +>instance : Symbol(instance, Decl(contextualTypeAppliedToVarArgs.ts, 0, 18)) +>method : Symbol(method, Decl(contextualTypeAppliedToVarArgs.ts, 0, 32)) +>args : Symbol(args, Decl(contextualTypeAppliedToVarArgs.ts, 0, 42)) +>data : Symbol(data, Decl(contextualTypeAppliedToVarArgs.ts, 0, 65)) +>args : Symbol(args, Decl(contextualTypeAppliedToVarArgs.ts, 0, 80)) + + return function () { }; +} + +class Foo{ +>Foo : Symbol(Foo, Decl(contextualTypeAppliedToVarArgs.ts, 2, 1)) + + + Bar() { +>Bar : Symbol(Bar, Decl(contextualTypeAppliedToVarArgs.ts, 4, 10)) + + delegate(this, function (source, args2) +>delegate : Symbol(delegate, Decl(contextualTypeAppliedToVarArgs.ts, 0, 0)) +>this : Symbol(Foo, Decl(contextualTypeAppliedToVarArgs.ts, 2, 1)) +>source : Symbol(source, Decl(contextualTypeAppliedToVarArgs.ts, 8, 33)) +>args2 : Symbol(args2, Decl(contextualTypeAppliedToVarArgs.ts, 8, 40)) + { + var a = source.node; +>a : Symbol(a, Decl(contextualTypeAppliedToVarArgs.ts, 10, 15)) +>source : Symbol(source, Decl(contextualTypeAppliedToVarArgs.ts, 8, 33)) + + var b = args2.node; +>b : Symbol(b, Decl(contextualTypeAppliedToVarArgs.ts, 11, 15)) +>args2 : Symbol(args2, Decl(contextualTypeAppliedToVarArgs.ts, 8, 40)) + + } ); + } +} + diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.symbols b/tests/baselines/reference/contextualTypeArrayReturnType.symbols new file mode 100644 index 00000000000..ed0e22d698c --- /dev/null +++ b/tests/baselines/reference/contextualTypeArrayReturnType.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/contextualTypeArrayReturnType.ts === +interface IBookStyle { +>IBookStyle : Symbol(IBookStyle, Decl(contextualTypeArrayReturnType.ts, 0, 0)) + + initialLeftPageTransforms?: (width: number) => NamedTransform[]; +>initialLeftPageTransforms : Symbol(initialLeftPageTransforms, Decl(contextualTypeArrayReturnType.ts, 0, 22)) +>width : Symbol(width, Decl(contextualTypeArrayReturnType.ts, 1, 33)) +>NamedTransform : Symbol(NamedTransform, Decl(contextualTypeArrayReturnType.ts, 2, 1)) +} + +interface NamedTransform { +>NamedTransform : Symbol(NamedTransform, Decl(contextualTypeArrayReturnType.ts, 2, 1)) + + [name: string]: Transform3D; +>name : Symbol(name, Decl(contextualTypeArrayReturnType.ts, 5, 5)) +>Transform3D : Symbol(Transform3D, Decl(contextualTypeArrayReturnType.ts, 6, 1)) +} + +interface Transform3D { +>Transform3D : Symbol(Transform3D, Decl(contextualTypeArrayReturnType.ts, 6, 1)) + + cachedCss: string; +>cachedCss : Symbol(cachedCss, Decl(contextualTypeArrayReturnType.ts, 8, 23)) +} + +var style: IBookStyle = { +>style : Symbol(style, Decl(contextualTypeArrayReturnType.ts, 12, 3)) +>IBookStyle : Symbol(IBookStyle, Decl(contextualTypeArrayReturnType.ts, 0, 0)) + + initialLeftPageTransforms: (width: number) => { +>initialLeftPageTransforms : Symbol(initialLeftPageTransforms, Decl(contextualTypeArrayReturnType.ts, 12, 25)) +>width : Symbol(width, Decl(contextualTypeArrayReturnType.ts, 13, 32)) + + return [ + {'ry': null } + ]; + } +} + diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.types b/tests/baselines/reference/contextualTypeArrayReturnType.types index ceb7aa53f67..f270b33f568 100644 --- a/tests/baselines/reference/contextualTypeArrayReturnType.types +++ b/tests/baselines/reference/contextualTypeArrayReturnType.types @@ -38,6 +38,7 @@ var style: IBookStyle = { {'ry': null } >{'ry': null } : { [x: string]: null; 'ry': null; } +>null : null ]; } diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols new file mode 100644 index 00000000000..172336603ab --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols @@ -0,0 +1,86 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeCallSignatures.ts === +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. + +// Let S be the set of types in U that have call signatures. +// If S is not empty and the sets of call signatures of the types in S are identical ignoring return types, +// U has the same set of call signatures, but with return types that are unions of the return types of the respective call signatures from each type in S. + +interface IWithNoCallSignatures { +>IWithNoCallSignatures : Symbol(IWithNoCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 7, 33)) +} +interface IWithCallSignatures { +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) + + (a: number): string; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 11, 5)) +} +interface IWithCallSignatures2 { +>IWithCallSignatures2 : Symbol(IWithCallSignatures2, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 12, 1)) + + (a: number): number; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 14, 5)) +} +interface IWithCallSignatures3 { +>IWithCallSignatures3 : Symbol(IWithCallSignatures3, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 15, 1)) + + (b: string): number; +>b : Symbol(b, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 17, 5)) +} +interface IWithCallSignatures4 { +>IWithCallSignatures4 : Symbol(IWithCallSignatures4, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 18, 1)) + + (a: number): string; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 20, 5)) + + (a: string, b: number): number; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 21, 5)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 21, 15)) +} + +// With no call signature | callSignatures +var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString(); +>x : Symbol(x, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 25, 3)) +>IWithNoCallSignatures : Symbol(IWithNoCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 0, 0)) +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 25, 52)) +>a.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 25, 52)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +// With call signatures with different return type +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures +>x2 : Symbol(x2, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 28, 3), Decl(contextualTypeWithUnionTypeCallSignatures.ts, 29, 3)) +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) +>IWithCallSignatures2 : Symbol(IWithCallSignatures2, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 12, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 28, 52)) +>a.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 28, 52)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2 +>x2 : Symbol(x2, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 28, 3), Decl(contextualTypeWithUnionTypeCallSignatures.ts, 29, 3)) +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) +>IWithCallSignatures2 : Symbol(IWithCallSignatures2, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 12, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 29, 52)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 29, 52)) + +// With call signatures of mismatching parameter type +var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString(); +>x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 32, 3)) +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) +>IWithCallSignatures3 : Symbol(IWithCallSignatures3, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 15, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 32, 52)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 32, 52)) + +// With call signature count mismatch +var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString(); +>x4 : Symbol(x4, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 3)) +>IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) +>IWithCallSignatures4 : Symbol(IWithCallSignatures4, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 18, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52)) + diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.symbols b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.symbols new file mode 100644 index 00000000000..c381377e523 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.symbols @@ -0,0 +1,146 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeIndexSignatures.ts === +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface SomeType { +>SomeType : Symbol(SomeType, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 0, 0)) + + (a: number): number; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 3, 5)) +} +interface SomeType2 { +>SomeType2 : Symbol(SomeType2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 4, 1)) + + (a: number): string; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 6, 5)) +} + +interface IWithNoStringIndexSignature { +>IWithNoStringIndexSignature : Symbol(IWithNoStringIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 7, 1)) + + foo: string; +>foo : Symbol(foo, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 9, 39)) +} +interface IWithNoNumberIndexSignature { +>IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) + + 0: string; +} +interface IWithStringIndexSignature1 { +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) + + [a: string]: SomeType; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 16, 5)) +>SomeType : Symbol(SomeType, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 0, 0)) +} +interface IWithStringIndexSignature2 { +>IWithStringIndexSignature2 : Symbol(IWithStringIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 17, 1)) + + [a: string]: SomeType2; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 19, 5)) +>SomeType2 : Symbol(SomeType2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 4, 1)) +} +interface IWithNumberIndexSignature1 { +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) + + [a: number]: SomeType; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 22, 5)) +>SomeType : Symbol(SomeType, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 0, 0)) +} +interface IWithNumberIndexSignature2 { +>IWithNumberIndexSignature2 : Symbol(IWithNumberIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 23, 1)) + + [a: number]: SomeType2; +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 25, 5)) +>SomeType2 : Symbol(SomeType2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 4, 1)) +} + +// When an object literal is contextually typed by a type that includes a string index signature, +// the resulting type of the object literal includes a string index signature with the union type of +// the types of the properties declared in the object literal, or the Undefined type if the object literal +// is empty.Likewise, when an object literal is contextually typed by a type that includes a numeric index +// signature, the resulting type of the object literal includes a numeric index signature with the union type +// of the types of the numerically named properties(section 3.7.4) declared in the object literal, +// or the Undefined type if the object literal declares no numerically named properties. + +// Let S be the set of types in U that has a string index signature. +// If S is not empty, U has a string index signature of a union type of +// the types of the string index signatures from each type in S. +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { z: a => a }; // a should be number +>x : Symbol(x, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 41, 3)) +>IWithNoStringIndexSignature : Symbol(IWithNoStringIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 7, 1)) +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) +>z : Symbol(z, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 67)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 70)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 70)) + +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: a => a }; // a should be any +>x : Symbol(x, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 41, 3)) +>IWithNoStringIndexSignature : Symbol(IWithNoStringIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 7, 1)) +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) +>foo : Symbol(foo, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 67)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 72)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 72)) + +var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" }; +>x : Symbol(x, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 39, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 40, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 41, 3)) +>IWithNoStringIndexSignature : Symbol(IWithNoStringIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 7, 1)) +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) +>foo : Symbol(foo, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 41, 67)) + +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number +>x2 : Symbol(x2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 42, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 43, 3)) +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) +>IWithStringIndexSignature2 : Symbol(IWithStringIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 17, 1)) +>z : Symbol(z, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 42, 67)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 42, 70)) +>a.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 42, 70)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a }; // a should be number +>x2 : Symbol(x2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 42, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 43, 3)) +>IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) +>IWithStringIndexSignature2 : Symbol(IWithStringIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 17, 1)) +>z : Symbol(z, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 43, 67)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 43, 70)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 43, 70)) + + +// Let S be the set of types in U that has a numeric index signature. +// If S is not empty, U has a numeric index signature of a union type of +// the types of the numeric index signatures from each type in S. +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 1: a => a }; // a should be number +>x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 51, 3)) +>IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 71)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 71)) + +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: a => a }; // a should be any +>x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 51, 3)) +>IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 71)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 71)) + +var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" }; +>x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 51, 3)) +>IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) + +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number +>x4 : Symbol(x4, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 3)) +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>IWithNumberIndexSignature2 : Symbol(IWithNumberIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 23, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 70)) +>a.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 70)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; // a should be number +>x4 : Symbol(x4, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 3)) +>IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>IWithNumberIndexSignature2 : Symbol(IWithNumberIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 23, 1)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 70)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 70)) + diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types index 8a91fe18698..2f24ad08227 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types @@ -91,6 +91,7 @@ var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" >IWithStringIndexSignature1 : IWithStringIndexSignature1 >{ foo: "hello" } : { [x: string]: string; foo: string; } >foo : string +>"hello" : string var x2: IWithStringIndexSignature1 | IWithStringIndexSignature2 = { z: a => a.toString() }; // a should be number >x2 : IWithStringIndexSignature1 | IWithStringIndexSignature2 @@ -142,6 +143,7 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" >IWithNoNumberIndexSignature : IWithNoNumberIndexSignature >IWithNumberIndexSignature1 : IWithNumberIndexSignature1 >{ 0: "hello" } : { [x: number]: string; 0: string; } +>"hello" : string var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number >x4 : IWithNumberIndexSignature1 | IWithNumberIndexSignature2 diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.symbols b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.symbols new file mode 100644 index 00000000000..3d7b8bf5a18 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.symbols @@ -0,0 +1,394 @@ +=== tests/cases/conformance/types/union/contextualTypeWithUnionTypeMembers.ts === +//When used as a contextual type, a union type U has those members that are present in any of +// its constituent types, with types that are unions of the respective members in the constituent types. +interface I1 { +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 2, 13)) + + commonMethodType(a: string): string; +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 2, 17)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 3, 21)) + + commonPropertyType: string; +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 3, 40)) + + commonMethodWithTypeParameter(a: T): T; +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 4, 31)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 5, 34)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 2, 13)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 2, 13)) + + methodOnlyInI1(a: string): string; +>methodOnlyInI1 : Symbol(methodOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 5, 43)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 7, 19)) + + propertyOnlyInI1: string; +>propertyOnlyInI1 : Symbol(propertyOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 7, 38)) +} +interface I2 { +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 10, 13)) + + commonMethodType(a: string): string; +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 10, 17)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 11, 21)) + + commonPropertyType: string; +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 11, 40)) + + commonMethodWithTypeParameter(a: T): T; +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 12, 31)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 13, 34)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 10, 13)) +>T : Symbol(T, Decl(contextualTypeWithUnionTypeMembers.ts, 10, 13)) + + methodOnlyInI2(a: string): string; +>methodOnlyInI2 : Symbol(methodOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 13, 43)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 15, 19)) + + propertyOnlyInI2: string; +>propertyOnlyInI2 : Symbol(propertyOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 15, 38)) +} + +// Let S be the set of types in U that has a property P. +// If S is not empty, U has a property P of a union type of the types of P from each type in S. +var i1: I1; +>i1 : Symbol(i1, Decl(contextualTypeWithUnionTypeMembers.ts, 21, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) + +var i2: I2; +>i2 : Symbol(i2, Decl(contextualTypeWithUnionTypeMembers.ts, 22, 3)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) + +var i1Ori2: I1 | I2 = i1; +>i1Ori2 : Symbol(i1Ori2, Decl(contextualTypeWithUnionTypeMembers.ts, 23, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 24, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 25, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 33, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 41, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) +>i1 : Symbol(i1, Decl(contextualTypeWithUnionTypeMembers.ts, 21, 3)) + +var i1Ori2: I1 | I2 = i2; +>i1Ori2 : Symbol(i1Ori2, Decl(contextualTypeWithUnionTypeMembers.ts, 23, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 24, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 25, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 33, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 41, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) +>i2 : Symbol(i2, Decl(contextualTypeWithUnionTypeMembers.ts, 22, 3)) + +var i1Ori2: I1 | I2 = { // Like i1 +>i1Ori2 : Symbol(i1Ori2, Decl(contextualTypeWithUnionTypeMembers.ts, 23, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 24, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 25, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 33, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 41, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) + + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 25, 39)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 26, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 27, 21)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 27, 21)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 27, 28)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 28, 34)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 28, 34)) + + methodOnlyInI1: a => a, +>methodOnlyInI1 : Symbol(methodOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 28, 42)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 30, 19)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 30, 19)) + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : Symbol(propertyOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 30, 27)) + +}; +var i1Ori2: I1 | I2 = { // Like i2 +>i1Ori2 : Symbol(i1Ori2, Decl(contextualTypeWithUnionTypeMembers.ts, 23, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 24, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 25, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 33, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 41, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) + + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 33, 39)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 34, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 35, 21)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 35, 21)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 35, 28)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 36, 34)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 36, 34)) + + methodOnlyInI2: a => a, +>methodOnlyInI2 : Symbol(methodOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 36, 42)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 38, 19)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 38, 19)) + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : Symbol(propertyOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 38, 27)) + +}; +var i1Ori2: I1 | I2 = { // Like i1 and i2 both +>i1Ori2 : Symbol(i1Ori2, Decl(contextualTypeWithUnionTypeMembers.ts, 23, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 24, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 25, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 33, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 41, 3)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) + + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 41, 39)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 42, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 43, 21)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 43, 21)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 43, 28)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 44, 34)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 44, 34)) + + methodOnlyInI1: a => a, +>methodOnlyInI1 : Symbol(methodOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 44, 42)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 45, 19)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 45, 19)) + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : Symbol(propertyOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 45, 27)) + + methodOnlyInI2: a => a, +>methodOnlyInI2 : Symbol(methodOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 46, 30)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 47, 19)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 47, 19)) + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : Symbol(propertyOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 47, 27)) + +}; + +var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 +>arrayI1OrI2 : Symbol(arrayI1OrI2, Decl(contextualTypeWithUnionTypeMembers.ts, 51, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>I1 : Symbol(I1, Decl(contextualTypeWithUnionTypeMembers.ts, 0, 0)) +>I2 : Symbol(I2, Decl(contextualTypeWithUnionTypeMembers.ts, 9, 1)) +>i1 : Symbol(i1, Decl(contextualTypeWithUnionTypeMembers.ts, 21, 3)) +>i2 : Symbol(i2, Decl(contextualTypeWithUnionTypeMembers.ts, 22, 3)) + + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 51, 60)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 52, 36)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 53, 25)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 53, 25)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 53, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 54, 38)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 54, 38)) + + methodOnlyInI1: a => a, +>methodOnlyInI1 : Symbol(methodOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 54, 46)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 56, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 56, 23)) + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : Symbol(propertyOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 56, 31)) + + }, + { // Like i2 + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 59, 5)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 60, 36)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 61, 25)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 61, 25)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 61, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 62, 38)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 62, 38)) + + methodOnlyInI2: a => a, +>methodOnlyInI2 : Symbol(methodOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 62, 46)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 64, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 64, 23)) + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : Symbol(propertyOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 64, 31)) + + }, { // Like i1 and i2 both + commonPropertyType: "hello", +>commonPropertyType : Symbol(commonPropertyType, Decl(contextualTypeWithUnionTypeMembers.ts, 66, 8)) + + commonMethodType: a=> a, +>commonMethodType : Symbol(commonMethodType, Decl(contextualTypeWithUnionTypeMembers.ts, 67, 36)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 68, 25)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 68, 25)) + + commonMethodWithTypeParameter: a => a, +>commonMethodWithTypeParameter : Symbol(commonMethodWithTypeParameter, Decl(contextualTypeWithUnionTypeMembers.ts, 68, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 69, 38)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 69, 38)) + + methodOnlyInI1: a => a, +>methodOnlyInI1 : Symbol(methodOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 69, 46)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 70, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 70, 23)) + + propertyOnlyInI1: "Hello", +>propertyOnlyInI1 : Symbol(propertyOnlyInI1, Decl(contextualTypeWithUnionTypeMembers.ts, 70, 31)) + + methodOnlyInI2: a => a, +>methodOnlyInI2 : Symbol(methodOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 71, 34)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 72, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 72, 23)) + + propertyOnlyInI2: "Hello", +>propertyOnlyInI2 : Symbol(propertyOnlyInI2, Decl(contextualTypeWithUnionTypeMembers.ts, 72, 31)) + + }]; + +interface I11 { +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) + + commonMethodDifferentReturnType(a: string, b: number): string; +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 76, 15)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 77, 36)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 77, 46)) + + commonPropertyDifferentType: string; +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 77, 66)) +} +interface I21 { +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) + + commonMethodDifferentReturnType(a: string, b: number): number; +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 80, 15)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 81, 36)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 81, 46)) + + commonPropertyDifferentType: number; +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 81, 66)) +} +var i11: I11; +>i11 : Symbol(i11, Decl(contextualTypeWithUnionTypeMembers.ts, 84, 3)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) + +var i21: I21; +>i21 : Symbol(i21, Decl(contextualTypeWithUnionTypeMembers.ts, 85, 3)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) + +var i11Ori21: I11 | I21 = i11; +>i11Ori21 : Symbol(i11Ori21, Decl(contextualTypeWithUnionTypeMembers.ts, 86, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 87, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 88, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 96, 3)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) +>i11 : Symbol(i11, Decl(contextualTypeWithUnionTypeMembers.ts, 84, 3)) + +var i11Ori21: I11 | I21 = i21; +>i11Ori21 : Symbol(i11Ori21, Decl(contextualTypeWithUnionTypeMembers.ts, 86, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 87, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 88, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 96, 3)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) +>i21 : Symbol(i21, Decl(contextualTypeWithUnionTypeMembers.ts, 85, 3)) + +var i11Ori21: I11 | I21 = { +>i11Ori21 : Symbol(i11Ori21, Decl(contextualTypeWithUnionTypeMembers.ts, 86, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 87, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 88, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 96, 3)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) + + // Like i1 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 88, 27)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 90, 38)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 90, 40)) + + var z = a.charAt(b); +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 91, 11)) +>a.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 90, 38)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 90, 40)) + + return z; +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 91, 11)) + + }, + commonPropertyDifferentType: "hello", +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 93, 6)) + +}; +var i11Ori21: I11 | I21 = { +>i11Ori21 : Symbol(i11Ori21, Decl(contextualTypeWithUnionTypeMembers.ts, 86, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 87, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 88, 3), Decl(contextualTypeWithUnionTypeMembers.ts, 96, 3)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) + + // Like i2 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 96, 27)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 98, 38)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 98, 40)) + + var z = a.charCodeAt(b); +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 99, 11)) +>a.charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, 285, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 98, 38)) +>charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, 285, 32)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 98, 40)) + + return z; +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 99, 11)) + + }, + commonPropertyDifferentType: 10, +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 101, 6)) + +}; +var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { +>arrayOrI11OrI21 : Symbol(arrayOrI11OrI21, Decl(contextualTypeWithUnionTypeMembers.ts, 104, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>I11 : Symbol(I11, Decl(contextualTypeWithUnionTypeMembers.ts, 74, 7)) +>I21 : Symbol(I21, Decl(contextualTypeWithUnionTypeMembers.ts, 79, 1)) +>i11 : Symbol(i11, Decl(contextualTypeWithUnionTypeMembers.ts, 84, 3)) +>i21 : Symbol(i21, Decl(contextualTypeWithUnionTypeMembers.ts, 85, 3)) +>i11 : Symbol(i11, Decl(contextualTypeWithUnionTypeMembers.ts, 84, 3)) +>i21 : Symbol(i21, Decl(contextualTypeWithUnionTypeMembers.ts, 85, 3)) + + // Like i1 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 104, 64)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 106, 42)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 106, 44)) + + var z = a.charAt(b); +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 107, 15)) +>a.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 106, 42)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 106, 44)) + + return z; +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 107, 15)) + + }, + commonPropertyDifferentType: "hello", +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 109, 10)) + + }, { + // Like i2 + commonMethodDifferentReturnType: (a, b) => { +>commonMethodDifferentReturnType : Symbol(commonMethodDifferentReturnType, Decl(contextualTypeWithUnionTypeMembers.ts, 111, 8)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 113, 42)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 113, 44)) + + var z = a.charCodeAt(b); +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 114, 15)) +>a.charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, 285, 32)) +>a : Symbol(a, Decl(contextualTypeWithUnionTypeMembers.ts, 113, 42)) +>charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, 285, 32)) +>b : Symbol(b, Decl(contextualTypeWithUnionTypeMembers.ts, 113, 44)) + + return z; +>z : Symbol(z, Decl(contextualTypeWithUnionTypeMembers.ts, 114, 15)) + + }, + commonPropertyDifferentType: 10, +>commonPropertyDifferentType : Symbol(commonPropertyDifferentType, Decl(contextualTypeWithUnionTypeMembers.ts, 116, 10)) + + }]; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types index 522d4a4a555..c51227fd13a 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types @@ -80,6 +80,7 @@ var i1Ori2: I1 | I2 = { // Like i1 commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -101,6 +102,7 @@ var i1Ori2: I1 | I2 = { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string +>"Hello" : string }; var i1Ori2: I1 | I2 = { // Like i2 @@ -111,6 +113,7 @@ var i1Ori2: I1 | I2 = { // Like i2 commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -132,6 +135,7 @@ var i1Ori2: I1 | I2 = { // Like i2 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string +>"Hello" : string }; var i1Ori2: I1 | I2 = { // Like i1 and i2 both @@ -142,6 +146,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -163,6 +168,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string +>"Hello" : string methodOnlyInI2: a => a, >methodOnlyInI2 : (a: string) => string @@ -172,6 +178,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string +>"Hello" : string }; @@ -187,6 +194,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -208,6 +216,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string +>"Hello" : string }, { // Like i2 @@ -215,6 +224,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -236,12 +246,14 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string +>"Hello" : string }, { // Like i1 and i2 both >{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } commonPropertyType: "hello", >commonPropertyType : string +>"hello" : string commonMethodType: a=> a, >commonMethodType : (a: string) => string @@ -263,6 +275,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI1: "Hello", >propertyOnlyInI1 : string +>"Hello" : string methodOnlyInI2: a => a, >methodOnlyInI2 : (a: string) => string @@ -272,6 +285,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 propertyOnlyInI2: "Hello", >propertyOnlyInI2 : string +>"Hello" : string }]; @@ -344,6 +358,7 @@ var i11Ori21: I11 | I21 = { }, commonPropertyDifferentType: "hello", >commonPropertyDifferentType : string +>"hello" : string }; var i11Ori21: I11 | I21 = { @@ -373,6 +388,7 @@ var i11Ori21: I11 | I21 = { }, commonPropertyDifferentType: 10, >commonPropertyDifferentType : number +>10 : number }; var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { @@ -409,6 +425,7 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { }, commonPropertyDifferentType: "hello", >commonPropertyDifferentType : string +>"hello" : string }, { >{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, } : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; } @@ -434,5 +451,6 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { }, commonPropertyDifferentType: 10, >commonPropertyDifferentType : number +>10 : number }]; diff --git a/tests/baselines/reference/contextualTyping1.symbols b/tests/baselines/reference/contextualTyping1.symbols new file mode 100644 index 00000000000..00c6fd57f2a --- /dev/null +++ b/tests/baselines/reference/contextualTyping1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping1.ts === +var foo: {id:number;} = {id:4}; +>foo : Symbol(foo, Decl(contextualTyping1.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping1.ts, 0, 10)) +>id : Symbol(id, Decl(contextualTyping1.ts, 0, 25)) + diff --git a/tests/baselines/reference/contextualTyping1.types b/tests/baselines/reference/contextualTyping1.types index a9d2f982569..6b2a794f987 100644 --- a/tests/baselines/reference/contextualTyping1.types +++ b/tests/baselines/reference/contextualTyping1.types @@ -4,4 +4,5 @@ var foo: {id:number;} = {id:4}; >id : number >{id:4} : { id: number; } >id : number +>4 : number diff --git a/tests/baselines/reference/contextualTyping10.symbols b/tests/baselines/reference/contextualTyping10.symbols new file mode 100644 index 00000000000..130116264e0 --- /dev/null +++ b/tests/baselines/reference/contextualTyping10.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping10.ts === +class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } +>foo : Symbol(foo, Decl(contextualTyping10.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping10.ts, 0, 11)) +>id : Symbol(id, Decl(contextualTyping10.ts, 0, 24)) +>id : Symbol(id, Decl(contextualTyping10.ts, 0, 42)) +>id : Symbol(id, Decl(contextualTyping10.ts, 0, 50)) + diff --git a/tests/baselines/reference/contextualTyping10.types b/tests/baselines/reference/contextualTyping10.types index e3a6c2bcf4a..938f2731a30 100644 --- a/tests/baselines/reference/contextualTyping10.types +++ b/tests/baselines/reference/contextualTyping10.types @@ -6,6 +6,8 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2} : { id: number; } >id : number +>2 : number diff --git a/tests/baselines/reference/contextualTyping12.symbols b/tests/baselines/reference/contextualTyping12.symbols new file mode 100644 index 00000000000..bafef4c8e0a --- /dev/null +++ b/tests/baselines/reference/contextualTyping12.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/contextualTyping12.ts === +class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } +>foo : Symbol(foo, Decl(contextualTyping12.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping12.ts, 0, 11)) +>id : Symbol(id, Decl(contextualTyping12.ts, 0, 24)) +>id : Symbol(id, Decl(contextualTyping12.ts, 0, 42)) +>id : Symbol(id, Decl(contextualTyping12.ts, 0, 50)) +>name : Symbol(name, Decl(contextualTyping12.ts, 0, 55)) + diff --git a/tests/baselines/reference/contextualTyping12.types b/tests/baselines/reference/contextualTyping12.types index 31d4e990938..68e2663fb6a 100644 --- a/tests/baselines/reference/contextualTyping12.types +++ b/tests/baselines/reference/contextualTyping12.types @@ -6,7 +6,10 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } >[{id:1}, {id:2, name:"foo"}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2, name:"foo"} : { id: number; name: string; } >id : number +>2 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTyping13.symbols b/tests/baselines/reference/contextualTyping13.symbols new file mode 100644 index 00000000000..e60131e8433 --- /dev/null +++ b/tests/baselines/reference/contextualTyping13.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping13.ts === +var foo:(a:number)=>number = function(a){return a}; +>foo : Symbol(foo, Decl(contextualTyping13.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTyping13.ts, 0, 9)) +>a : Symbol(a, Decl(contextualTyping13.ts, 0, 38)) +>a : Symbol(a, Decl(contextualTyping13.ts, 0, 38)) + diff --git a/tests/baselines/reference/contextualTyping14.symbols b/tests/baselines/reference/contextualTyping14.symbols new file mode 100644 index 00000000000..7de67445ca8 --- /dev/null +++ b/tests/baselines/reference/contextualTyping14.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping14.ts === +class foo { public bar:(a:number)=>number = function(a){return a}; } +>foo : Symbol(foo, Decl(contextualTyping14.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping14.ts, 0, 11)) +>a : Symbol(a, Decl(contextualTyping14.ts, 0, 24)) +>a : Symbol(a, Decl(contextualTyping14.ts, 0, 53)) +>a : Symbol(a, Decl(contextualTyping14.ts, 0, 53)) + diff --git a/tests/baselines/reference/contextualTyping15.symbols b/tests/baselines/reference/contextualTyping15.symbols new file mode 100644 index 00000000000..902fb03dc70 --- /dev/null +++ b/tests/baselines/reference/contextualTyping15.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping15.ts === +class foo { public bar: { (): number; (i: number): number; } = function() { return 1 }; } +>foo : Symbol(foo, Decl(contextualTyping15.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping15.ts, 0, 11)) +>i : Symbol(i, Decl(contextualTyping15.ts, 0, 39)) + diff --git a/tests/baselines/reference/contextualTyping15.types b/tests/baselines/reference/contextualTyping15.types index c039504efbe..ed4fdad3bfc 100644 --- a/tests/baselines/reference/contextualTyping15.types +++ b/tests/baselines/reference/contextualTyping15.types @@ -4,4 +4,5 @@ class foo { public bar: { (): number; (i: number): number; } = function() { retu >bar : { (): number; (i: number): number; } >i : number >function() { return 1 } : () => number +>1 : number diff --git a/tests/baselines/reference/contextualTyping16.symbols b/tests/baselines/reference/contextualTyping16.symbols new file mode 100644 index 00000000000..9f88ce4c151 --- /dev/null +++ b/tests/baselines/reference/contextualTyping16.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping16.ts === +var foo: {id:number;} = {id:4}; foo = {id:5}; +>foo : Symbol(foo, Decl(contextualTyping16.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping16.ts, 0, 10)) +>id : Symbol(id, Decl(contextualTyping16.ts, 0, 25)) +>foo : Symbol(foo, Decl(contextualTyping16.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping16.ts, 0, 39)) + diff --git a/tests/baselines/reference/contextualTyping16.types b/tests/baselines/reference/contextualTyping16.types index 9e11cd5bf3b..63f93649208 100644 --- a/tests/baselines/reference/contextualTyping16.types +++ b/tests/baselines/reference/contextualTyping16.types @@ -4,8 +4,10 @@ var foo: {id:number;} = {id:4}; foo = {id:5}; >id : number >{id:4} : { id: number; } >id : number +>4 : number >foo = {id:5} : { id: number; } >foo : { id: number; } >{id:5} : { id: number; } >id : number +>5 : number diff --git a/tests/baselines/reference/contextualTyping17.symbols b/tests/baselines/reference/contextualTyping17.symbols new file mode 100644 index 00000000000..55631494105 --- /dev/null +++ b/tests/baselines/reference/contextualTyping17.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/contextualTyping17.ts === +var foo: {id:number;} = {id:4}; foo = {id: 5, name:"foo"}; +>foo : Symbol(foo, Decl(contextualTyping17.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping17.ts, 0, 10)) +>id : Symbol(id, Decl(contextualTyping17.ts, 0, 25)) +>foo : Symbol(foo, Decl(contextualTyping17.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping17.ts, 0, 39)) +>name : Symbol(name, Decl(contextualTyping17.ts, 0, 45)) + diff --git a/tests/baselines/reference/contextualTyping17.types b/tests/baselines/reference/contextualTyping17.types index 63b18af94ab..649bc339ba1 100644 --- a/tests/baselines/reference/contextualTyping17.types +++ b/tests/baselines/reference/contextualTyping17.types @@ -4,9 +4,12 @@ var foo: {id:number;} = {id:4}; foo = {id: 5, name:"foo"}; >id : number >{id:4} : { id: number; } >id : number +>4 : number >foo = {id: 5, name:"foo"} : { id: number; name: string; } >foo : { id: number; } >{id: 5, name:"foo"} : { id: number; name: string; } >id : number +>5 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTyping18.symbols b/tests/baselines/reference/contextualTyping18.symbols new file mode 100644 index 00000000000..a5506cfe900 --- /dev/null +++ b/tests/baselines/reference/contextualTyping18.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping18.ts === +var foo: {id:number;} = <{id:number;}>({ }); foo = {id: 5}; +>foo : Symbol(foo, Decl(contextualTyping18.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping18.ts, 0, 10)) +>id : Symbol(id, Decl(contextualTyping18.ts, 0, 26)) +>foo : Symbol(foo, Decl(contextualTyping18.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping18.ts, 0, 52)) + diff --git a/tests/baselines/reference/contextualTyping18.types b/tests/baselines/reference/contextualTyping18.types index 0c3cd5fd963..0bef546022d 100644 --- a/tests/baselines/reference/contextualTyping18.types +++ b/tests/baselines/reference/contextualTyping18.types @@ -10,4 +10,5 @@ var foo: {id:number;} = <{id:number;}>({ }); foo = {id: 5}; >foo : { id: number; } >{id: 5} : { id: number; } >id : number +>5 : number diff --git a/tests/baselines/reference/contextualTyping19.symbols b/tests/baselines/reference/contextualTyping19.symbols new file mode 100644 index 00000000000..cee3a6e7d24 --- /dev/null +++ b/tests/baselines/reference/contextualTyping19.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/contextualTyping19.ts === +var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}]; +>foo : Symbol(foo, Decl(contextualTyping19.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping19.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping19.ts, 0, 27)) +>foo : Symbol(foo, Decl(contextualTyping19.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping19.ts, 0, 43)) +>id : Symbol(id, Decl(contextualTyping19.ts, 0, 51)) + diff --git a/tests/baselines/reference/contextualTyping19.types b/tests/baselines/reference/contextualTyping19.types index 6b07986e6e6..d384a68749a 100644 --- a/tests/baselines/reference/contextualTyping19.types +++ b/tests/baselines/reference/contextualTyping19.types @@ -5,11 +5,14 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}]; >[{id:1}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >foo = [{id:1}, {id:2}] : { id: number; }[] >foo : { id: number; }[] >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2} : { id: number; } >id : number +>2 : number diff --git a/tests/baselines/reference/contextualTyping2.symbols b/tests/baselines/reference/contextualTyping2.symbols new file mode 100644 index 00000000000..9c102092979 --- /dev/null +++ b/tests/baselines/reference/contextualTyping2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping2.ts === +var foo: {id:number;} = {id:4, name:"foo"}; +>foo : Symbol(foo, Decl(contextualTyping2.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping2.ts, 0, 10)) +>id : Symbol(id, Decl(contextualTyping2.ts, 0, 25)) +>name : Symbol(name, Decl(contextualTyping2.ts, 0, 30)) + diff --git a/tests/baselines/reference/contextualTyping2.types b/tests/baselines/reference/contextualTyping2.types index 3474a284982..0658247c089 100644 --- a/tests/baselines/reference/contextualTyping2.types +++ b/tests/baselines/reference/contextualTyping2.types @@ -4,5 +4,7 @@ var foo: {id:number;} = {id:4, name:"foo"}; >id : number >{id:4, name:"foo"} : { id: number; name: string; } >id : number +>4 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTyping20.symbols b/tests/baselines/reference/contextualTyping20.symbols new file mode 100644 index 00000000000..505c6a04a59 --- /dev/null +++ b/tests/baselines/reference/contextualTyping20.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/contextualTyping20.ts === +var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2, name:"foo"}]; +>foo : Symbol(foo, Decl(contextualTyping20.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping20.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping20.ts, 0, 27)) +>foo : Symbol(foo, Decl(contextualTyping20.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping20.ts, 0, 43)) +>id : Symbol(id, Decl(contextualTyping20.ts, 0, 51)) +>name : Symbol(name, Decl(contextualTyping20.ts, 0, 56)) + diff --git a/tests/baselines/reference/contextualTyping20.types b/tests/baselines/reference/contextualTyping20.types index e233e745cc6..be863db836b 100644 --- a/tests/baselines/reference/contextualTyping20.types +++ b/tests/baselines/reference/contextualTyping20.types @@ -5,12 +5,16 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2, name:"foo"}]; >[{id:1}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >foo = [{id:1}, {id:2, name:"foo"}] : { id: number; }[] >foo : { id: number; }[] >[{id:1}, {id:2, name:"foo"}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2, name:"foo"} : { id: number; name: string; } >id : number +>2 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTyping22.symbols b/tests/baselines/reference/contextualTyping22.symbols new file mode 100644 index 00000000000..9a7817a8260 --- /dev/null +++ b/tests/baselines/reference/contextualTyping22.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/contextualTyping22.ts === +var foo:(a:number)=>number = function(a){return a}; foo = function(b){return b}; +>foo : Symbol(foo, Decl(contextualTyping22.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTyping22.ts, 0, 9)) +>a : Symbol(a, Decl(contextualTyping22.ts, 0, 38)) +>a : Symbol(a, Decl(contextualTyping22.ts, 0, 38)) +>foo : Symbol(foo, Decl(contextualTyping22.ts, 0, 3)) +>b : Symbol(b, Decl(contextualTyping22.ts, 0, 67)) +>b : Symbol(b, Decl(contextualTyping22.ts, 0, 67)) + diff --git a/tests/baselines/reference/contextualTyping23.symbols b/tests/baselines/reference/contextualTyping23.symbols new file mode 100644 index 00000000000..bb0daeeee18 --- /dev/null +++ b/tests/baselines/reference/contextualTyping23.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping23.ts === +var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5}; +>foo : Symbol(foo, Decl(contextualTyping23.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTyping23.ts, 0, 9)) +>i : Symbol(i, Decl(contextualTyping23.ts, 0, 24)) +>foo : Symbol(foo, Decl(contextualTyping23.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTyping23.ts, 0, 69)) + diff --git a/tests/baselines/reference/contextualTyping23.types b/tests/baselines/reference/contextualTyping23.types index 7e0d86920ea..0bb8b7a58e7 100644 --- a/tests/baselines/reference/contextualTyping23.types +++ b/tests/baselines/reference/contextualTyping23.types @@ -7,4 +7,5 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5 >foo : (a: { (): number; (i: number): number; }) => number >function(a){return 5} : (a: { (): number; (i: number): number; }) => number >a : { (): number; (i: number): number; } +>5 : number diff --git a/tests/baselines/reference/contextualTyping25.symbols b/tests/baselines/reference/contextualTyping25.symbols new file mode 100644 index 00000000000..5446a3c7515 --- /dev/null +++ b/tests/baselines/reference/contextualTyping25.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping25.ts === +function foo(param:{id:number;}){}; foo(<{id:number;}>({})); +>foo : Symbol(foo, Decl(contextualTyping25.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping25.ts, 0, 13)) +>id : Symbol(id, Decl(contextualTyping25.ts, 0, 20)) +>foo : Symbol(foo, Decl(contextualTyping25.ts, 0, 0)) +>id : Symbol(id, Decl(contextualTyping25.ts, 0, 42)) + diff --git a/tests/baselines/reference/contextualTyping26.symbols b/tests/baselines/reference/contextualTyping26.symbols new file mode 100644 index 00000000000..ccecd501837 --- /dev/null +++ b/tests/baselines/reference/contextualTyping26.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping26.ts === +function foo(param:{id:number;}){}; foo(<{id:number;}>({})); +>foo : Symbol(foo, Decl(contextualTyping26.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping26.ts, 0, 13)) +>id : Symbol(id, Decl(contextualTyping26.ts, 0, 20)) +>foo : Symbol(foo, Decl(contextualTyping26.ts, 0, 0)) +>id : Symbol(id, Decl(contextualTyping26.ts, 0, 42)) + diff --git a/tests/baselines/reference/contextualTyping27.symbols b/tests/baselines/reference/contextualTyping27.symbols new file mode 100644 index 00000000000..0ff8486c1d9 --- /dev/null +++ b/tests/baselines/reference/contextualTyping27.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping27.ts === +function foo(param:{id:number;}){}; foo(<{id:number;}>({})); +>foo : Symbol(foo, Decl(contextualTyping27.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping27.ts, 0, 13)) +>id : Symbol(id, Decl(contextualTyping27.ts, 0, 20)) +>foo : Symbol(foo, Decl(contextualTyping27.ts, 0, 0)) +>id : Symbol(id, Decl(contextualTyping27.ts, 0, 42)) + diff --git a/tests/baselines/reference/contextualTyping28.symbols b/tests/baselines/reference/contextualTyping28.symbols new file mode 100644 index 00000000000..5824da20a03 --- /dev/null +++ b/tests/baselines/reference/contextualTyping28.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping28.ts === +function foo(param:number[]){}; foo([1]); +>foo : Symbol(foo, Decl(contextualTyping28.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping28.ts, 0, 13)) +>foo : Symbol(foo, Decl(contextualTyping28.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualTyping28.types b/tests/baselines/reference/contextualTyping28.types index 6019fde4a6b..e4833fd8838 100644 --- a/tests/baselines/reference/contextualTyping28.types +++ b/tests/baselines/reference/contextualTyping28.types @@ -5,4 +5,5 @@ function foo(param:number[]){}; foo([1]); >foo([1]) : void >foo : (param: number[]) => void >[1] : number[] +>1 : number diff --git a/tests/baselines/reference/contextualTyping29.symbols b/tests/baselines/reference/contextualTyping29.symbols new file mode 100644 index 00000000000..eb255bfd76b --- /dev/null +++ b/tests/baselines/reference/contextualTyping29.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping29.ts === +function foo(param:number[]){}; foo([1, 3]); +>foo : Symbol(foo, Decl(contextualTyping29.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping29.ts, 0, 13)) +>foo : Symbol(foo, Decl(contextualTyping29.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualTyping29.types b/tests/baselines/reference/contextualTyping29.types index 9666e60e959..96695a6d0ba 100644 --- a/tests/baselines/reference/contextualTyping29.types +++ b/tests/baselines/reference/contextualTyping29.types @@ -5,4 +5,6 @@ function foo(param:number[]){}; foo([1, 3]); >foo([1, 3]) : void >foo : (param: number[]) => void >[1, 3] : number[] +>1 : number +>3 : number diff --git a/tests/baselines/reference/contextualTyping3.symbols b/tests/baselines/reference/contextualTyping3.symbols new file mode 100644 index 00000000000..584c399e4da --- /dev/null +++ b/tests/baselines/reference/contextualTyping3.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping3.ts === +class foo { public bar:{id:number;} = {id:5}; } +>foo : Symbol(foo, Decl(contextualTyping3.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping3.ts, 0, 11)) +>id : Symbol(id, Decl(contextualTyping3.ts, 0, 24)) +>id : Symbol(id, Decl(contextualTyping3.ts, 0, 39)) + diff --git a/tests/baselines/reference/contextualTyping3.types b/tests/baselines/reference/contextualTyping3.types index ef00a78f5b4..81c201ee572 100644 --- a/tests/baselines/reference/contextualTyping3.types +++ b/tests/baselines/reference/contextualTyping3.types @@ -5,4 +5,5 @@ class foo { public bar:{id:number;} = {id:5}; } >id : number >{id:5} : { id: number; } >id : number +>5 : number diff --git a/tests/baselines/reference/contextualTyping31.symbols b/tests/baselines/reference/contextualTyping31.symbols new file mode 100644 index 00000000000..6891de8b49f --- /dev/null +++ b/tests/baselines/reference/contextualTyping31.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping31.ts === +function foo(param:number[]){}; foo([1]); +>foo : Symbol(foo, Decl(contextualTyping31.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping31.ts, 0, 13)) +>foo : Symbol(foo, Decl(contextualTyping31.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualTyping31.types b/tests/baselines/reference/contextualTyping31.types index e37bacd33f3..22a8f08cf90 100644 --- a/tests/baselines/reference/contextualTyping31.types +++ b/tests/baselines/reference/contextualTyping31.types @@ -5,4 +5,5 @@ function foo(param:number[]){}; foo([1]); >foo([1]) : void >foo : (param: number[]) => void >[1] : number[] +>1 : number diff --git a/tests/baselines/reference/contextualTyping32.symbols b/tests/baselines/reference/contextualTyping32.symbols new file mode 100644 index 00000000000..f4ceeb93491 --- /dev/null +++ b/tests/baselines/reference/contextualTyping32.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping32.ts === +function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return 4}]); +>foo : Symbol(foo, Decl(contextualTyping32.ts, 0, 0)) +>param : Symbol(param, Decl(contextualTyping32.ts, 0, 13)) +>i : Symbol(i, Decl(contextualTyping32.ts, 0, 33)) +>foo : Symbol(foo, Decl(contextualTyping32.ts, 0, 0)) + diff --git a/tests/baselines/reference/contextualTyping32.types b/tests/baselines/reference/contextualTyping32.types index c273be967e3..59f6040cf7f 100644 --- a/tests/baselines/reference/contextualTyping32.types +++ b/tests/baselines/reference/contextualTyping32.types @@ -7,5 +7,7 @@ function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){ret >foo : (param: { (): number; (i: number): number; }[]) => void >[function(){return 1;}, function(){return 4}] : (() => number)[] >function(){return 1;} : () => number +>1 : number >function(){return 4} : () => number +>4 : number diff --git a/tests/baselines/reference/contextualTyping34.symbols b/tests/baselines/reference/contextualTyping34.symbols new file mode 100644 index 00000000000..6ea9f09f94b --- /dev/null +++ b/tests/baselines/reference/contextualTyping34.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping34.ts === +var foo = <{ id: number;}> ({id:4}); +>foo : Symbol(foo, Decl(contextualTyping34.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping34.ts, 0, 12)) +>id : Symbol(id, Decl(contextualTyping34.ts, 0, 29)) + diff --git a/tests/baselines/reference/contextualTyping34.types b/tests/baselines/reference/contextualTyping34.types index dde11b7d4b1..6bc6b622fc8 100644 --- a/tests/baselines/reference/contextualTyping34.types +++ b/tests/baselines/reference/contextualTyping34.types @@ -6,4 +6,5 @@ var foo = <{ id: number;}> ({id:4}); >({id:4}) : { id: number; } >{id:4} : { id: number; } >id : number +>4 : number diff --git a/tests/baselines/reference/contextualTyping35.symbols b/tests/baselines/reference/contextualTyping35.symbols new file mode 100644 index 00000000000..cb985100891 --- /dev/null +++ b/tests/baselines/reference/contextualTyping35.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping35.ts === +var foo = <{ id: number;}> {id:4, name: "as"}; +>foo : Symbol(foo, Decl(contextualTyping35.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping35.ts, 0, 12)) +>id : Symbol(id, Decl(contextualTyping35.ts, 0, 28)) +>name : Symbol(name, Decl(contextualTyping35.ts, 0, 33)) + diff --git a/tests/baselines/reference/contextualTyping35.types b/tests/baselines/reference/contextualTyping35.types index ea07f429176..08bb6b27b8e 100644 --- a/tests/baselines/reference/contextualTyping35.types +++ b/tests/baselines/reference/contextualTyping35.types @@ -5,5 +5,7 @@ var foo = <{ id: number;}> {id:4, name: "as"}; >id : number >{id:4, name: "as"} : { id: number; name: string; } >id : number +>4 : number >name : string +>"as" : string diff --git a/tests/baselines/reference/contextualTyping36.symbols b/tests/baselines/reference/contextualTyping36.symbols new file mode 100644 index 00000000000..28ceac9738c --- /dev/null +++ b/tests/baselines/reference/contextualTyping36.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping36.ts === +var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })]; +>foo : Symbol(foo, Decl(contextualTyping36.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping36.ts, 0, 12)) +>id : Symbol(id, Decl(contextualTyping36.ts, 0, 31)) +>id : Symbol(id, Decl(contextualTyping36.ts, 0, 43)) + diff --git a/tests/baselines/reference/contextualTyping36.types b/tests/baselines/reference/contextualTyping36.types index 8fb3f147f0a..6c93ed30a9f 100644 --- a/tests/baselines/reference/contextualTyping36.types +++ b/tests/baselines/reference/contextualTyping36.types @@ -6,6 +6,7 @@ var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })]; >[{ id: 4 }, <{ id: number; }>({ })] : { id: number; }[] >{ id: 4 } : { id: number; } >id : number +>4 : number ><{ id: number; }>({ }) : { id: number; } >id : number >({ }) : {} diff --git a/tests/baselines/reference/contextualTyping37.symbols b/tests/baselines/reference/contextualTyping37.symbols new file mode 100644 index 00000000000..083704750cb --- /dev/null +++ b/tests/baselines/reference/contextualTyping37.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping37.ts === +var foo = <{ id: number; }[]>[{ foo: "s" }, { }]; +>foo : Symbol(foo, Decl(contextualTyping37.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping37.ts, 0, 12)) +>foo : Symbol(foo, Decl(contextualTyping37.ts, 0, 31)) + diff --git a/tests/baselines/reference/contextualTyping37.types b/tests/baselines/reference/contextualTyping37.types index 2180e74b5a1..299b4400137 100644 --- a/tests/baselines/reference/contextualTyping37.types +++ b/tests/baselines/reference/contextualTyping37.types @@ -6,5 +6,6 @@ var foo = <{ id: number; }[]>[{ foo: "s" }, { }]; >[{ foo: "s" }, { }] : {}[] >{ foo: "s" } : { foo: string; } >foo : string +>"s" : string >{ } : {} diff --git a/tests/baselines/reference/contextualTyping38.symbols b/tests/baselines/reference/contextualTyping38.symbols new file mode 100644 index 00000000000..f208cad698a --- /dev/null +++ b/tests/baselines/reference/contextualTyping38.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping38.ts === +var foo = <{ (): number; }> function(a) { return a }; +>foo : Symbol(foo, Decl(contextualTyping38.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTyping38.ts, 0, 37)) +>a : Symbol(a, Decl(contextualTyping38.ts, 0, 37)) + diff --git a/tests/baselines/reference/contextualTyping4.symbols b/tests/baselines/reference/contextualTyping4.symbols new file mode 100644 index 00000000000..c5dcd4f1577 --- /dev/null +++ b/tests/baselines/reference/contextualTyping4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping4.ts === +class foo { public bar:{id:number;} = {id:5, name:"foo"}; } +>foo : Symbol(foo, Decl(contextualTyping4.ts, 0, 0)) +>bar : Symbol(bar, Decl(contextualTyping4.ts, 0, 11)) +>id : Symbol(id, Decl(contextualTyping4.ts, 0, 24)) +>id : Symbol(id, Decl(contextualTyping4.ts, 0, 39)) +>name : Symbol(name, Decl(contextualTyping4.ts, 0, 44)) + diff --git a/tests/baselines/reference/contextualTyping4.types b/tests/baselines/reference/contextualTyping4.types index 6af7adb86f3..757c67745f1 100644 --- a/tests/baselines/reference/contextualTyping4.types +++ b/tests/baselines/reference/contextualTyping4.types @@ -5,5 +5,7 @@ class foo { public bar:{id:number;} = {id:5, name:"foo"}; } >id : number >{id:5, name:"foo"} : { id: number; name: string; } >id : number +>5 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTyping40.symbols b/tests/baselines/reference/contextualTyping40.symbols new file mode 100644 index 00000000000..8606cdd4c41 --- /dev/null +++ b/tests/baselines/reference/contextualTyping40.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/contextualTyping40.ts === +var foo = <{():number; (i:number):number; }> function(){return 1;}; +>foo : Symbol(foo, Decl(contextualTyping40.ts, 0, 3)) +>i : Symbol(i, Decl(contextualTyping40.ts, 0, 24)) + diff --git a/tests/baselines/reference/contextualTyping40.types b/tests/baselines/reference/contextualTyping40.types index f659cdc8c92..1889d79f139 100644 --- a/tests/baselines/reference/contextualTyping40.types +++ b/tests/baselines/reference/contextualTyping40.types @@ -4,4 +4,5 @@ var foo = <{():number; (i:number):number; }> function(){return 1;}; ><{():number; (i:number):number; }> function(){return 1;} : { (): number; (i: number): number; } >i : number >function(){return 1;} : () => number +>1 : number diff --git a/tests/baselines/reference/contextualTyping6.symbols b/tests/baselines/reference/contextualTyping6.symbols new file mode 100644 index 00000000000..23af71d7dba --- /dev/null +++ b/tests/baselines/reference/contextualTyping6.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/contextualTyping6.ts === +var foo:{id:number;}[] = [{id:1}, {id:2}]; +>foo : Symbol(foo, Decl(contextualTyping6.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping6.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping6.ts, 0, 27)) +>id : Symbol(id, Decl(contextualTyping6.ts, 0, 35)) + diff --git a/tests/baselines/reference/contextualTyping6.types b/tests/baselines/reference/contextualTyping6.types index ab63159924f..b79811a948a 100644 --- a/tests/baselines/reference/contextualTyping6.types +++ b/tests/baselines/reference/contextualTyping6.types @@ -5,6 +5,8 @@ var foo:{id:number;}[] = [{id:1}, {id:2}]; >[{id:1}, {id:2}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2} : { id: number; } >id : number +>2 : number diff --git a/tests/baselines/reference/contextualTyping7.symbols b/tests/baselines/reference/contextualTyping7.symbols new file mode 100644 index 00000000000..679c1945f33 --- /dev/null +++ b/tests/baselines/reference/contextualTyping7.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping7.ts === +var foo:{id:number;}[] = [<{id:number;}>({})]; +>foo : Symbol(foo, Decl(contextualTyping7.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping7.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping7.ts, 0, 28)) + diff --git a/tests/baselines/reference/contextualTyping8.symbols b/tests/baselines/reference/contextualTyping8.symbols new file mode 100644 index 00000000000..7dadb937ea1 --- /dev/null +++ b/tests/baselines/reference/contextualTyping8.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/contextualTyping8.ts === +var foo:{id:number;}[] = [<{id:number;}>({})]; +>foo : Symbol(foo, Decl(contextualTyping8.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping8.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping8.ts, 0, 28)) + diff --git a/tests/baselines/reference/contextualTyping9.symbols b/tests/baselines/reference/contextualTyping9.symbols new file mode 100644 index 00000000000..f9ef2220c20 --- /dev/null +++ b/tests/baselines/reference/contextualTyping9.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/contextualTyping9.ts === +var foo:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; +>foo : Symbol(foo, Decl(contextualTyping9.ts, 0, 3)) +>id : Symbol(id, Decl(contextualTyping9.ts, 0, 9)) +>id : Symbol(id, Decl(contextualTyping9.ts, 0, 27)) +>id : Symbol(id, Decl(contextualTyping9.ts, 0, 35)) +>name : Symbol(name, Decl(contextualTyping9.ts, 0, 40)) + diff --git a/tests/baselines/reference/contextualTyping9.types b/tests/baselines/reference/contextualTyping9.types index 9d63203583d..46480d64b30 100644 --- a/tests/baselines/reference/contextualTyping9.types +++ b/tests/baselines/reference/contextualTyping9.types @@ -5,7 +5,10 @@ var foo:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; >[{id:1}, {id:2, name:"foo"}] : { id: number; }[] >{id:1} : { id: number; } >id : number +>1 : number >{id:2, name:"foo"} : { id: number; name: string; } >id : number +>2 : number >name : string +>"foo" : string diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.symbols b/tests/baselines/reference/contextualTypingArrayOfLambdas.symbols new file mode 100644 index 00000000000..79355e0a7c6 --- /dev/null +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/contextualTypingArrayOfLambdas.ts === +class A { +>A : Symbol(A, Decl(contextualTypingArrayOfLambdas.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(contextualTypingArrayOfLambdas.ts, 0, 9)) +} + +class B extends A { +>B : Symbol(B, Decl(contextualTypingArrayOfLambdas.ts, 2, 1)) +>A : Symbol(A, Decl(contextualTypingArrayOfLambdas.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(contextualTypingArrayOfLambdas.ts, 4, 19)) +} + +class C extends A { +>C : Symbol(C, Decl(contextualTypingArrayOfLambdas.ts, 6, 1)) +>A : Symbol(A, Decl(contextualTypingArrayOfLambdas.ts, 0, 0)) + + baz: string; +>baz : Symbol(baz, Decl(contextualTypingArrayOfLambdas.ts, 8, 19)) +} + +var xs = [(x: A) => { }, (x: B) => { }, (x: C) => { }]; +>xs : Symbol(xs, Decl(contextualTypingArrayOfLambdas.ts, 12, 3)) +>x : Symbol(x, Decl(contextualTypingArrayOfLambdas.ts, 12, 11)) +>A : Symbol(A, Decl(contextualTypingArrayOfLambdas.ts, 0, 0)) +>x : Symbol(x, Decl(contextualTypingArrayOfLambdas.ts, 12, 26)) +>B : Symbol(B, Decl(contextualTypingArrayOfLambdas.ts, 2, 1)) +>x : Symbol(x, Decl(contextualTypingArrayOfLambdas.ts, 12, 41)) +>C : Symbol(C, Decl(contextualTypingArrayOfLambdas.ts, 6, 1)) + diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.symbols b/tests/baselines/reference/contextualTypingOfConditionalExpression.symbols new file mode 100644 index 00000000000..56c3abe0627 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/contextualTypingOfConditionalExpression.ts === +var x: (a: number) => void = true ? (a) => a.toExponential() : (b) => b.toFixed(); +>x : Symbol(x, Decl(contextualTypingOfConditionalExpression.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 0, 8)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 0, 37)) +>a.toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 0, 37)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>b : Symbol(b, Decl(contextualTypingOfConditionalExpression.ts, 0, 64)) +>b.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>b : Symbol(b, Decl(contextualTypingOfConditionalExpression.ts, 0, 64)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + +class A { +>A : Symbol(A, Decl(contextualTypingOfConditionalExpression.ts, 0, 82)) + + foo: number; +>foo : Symbol(foo, Decl(contextualTypingOfConditionalExpression.ts, 2, 9)) +} +class B extends A { +>B : Symbol(B, Decl(contextualTypingOfConditionalExpression.ts, 4, 1)) +>A : Symbol(A, Decl(contextualTypingOfConditionalExpression.ts, 0, 82)) + + bar: number; +>bar : Symbol(bar, Decl(contextualTypingOfConditionalExpression.ts, 5, 19)) +} +class C extends A { +>C : Symbol(C, Decl(contextualTypingOfConditionalExpression.ts, 7, 1)) +>A : Symbol(A, Decl(contextualTypingOfConditionalExpression.ts, 0, 82)) + + baz: number; +>baz : Symbol(baz, Decl(contextualTypingOfConditionalExpression.ts, 8, 19)) +} + +var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; +>x2 : Symbol(x2, Decl(contextualTypingOfConditionalExpression.ts, 12, 3)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 12, 9)) +>A : Symbol(A, Decl(contextualTypingOfConditionalExpression.ts, 0, 82)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 12, 33)) +>a.foo : Symbol(A.foo, Decl(contextualTypingOfConditionalExpression.ts, 2, 9)) +>a : Symbol(a, Decl(contextualTypingOfConditionalExpression.ts, 12, 33)) +>foo : Symbol(A.foo, Decl(contextualTypingOfConditionalExpression.ts, 2, 9)) +>b : Symbol(b, Decl(contextualTypingOfConditionalExpression.ts, 12, 48)) +>b.foo : Symbol(A.foo, Decl(contextualTypingOfConditionalExpression.ts, 2, 9)) +>b : Symbol(b, Decl(contextualTypingOfConditionalExpression.ts, 12, 48)) +>foo : Symbol(A.foo, Decl(contextualTypingOfConditionalExpression.ts, 2, 9)) + diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.types b/tests/baselines/reference/contextualTypingOfConditionalExpression.types index 2cd2b671b40..a2e29a0e66b 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.types +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.types @@ -3,6 +3,7 @@ var x: (a: number) => void = true ? (a) => a.toExponential() : (b) => b.toFixed( >x : (a: number) => void >a : number >true ? (a) => a.toExponential() : (b) => b.toFixed() : (a: number) => string +>true : boolean >(a) => a.toExponential() : (a: number) => string >a : number >a.toExponential() : string @@ -42,6 +43,7 @@ var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; >a : A >A : A >true ? (a) => a.foo : (b) => b.foo : (a: A) => number +>true : boolean >(a) => a.foo : (a: A) => number >a : A >a.foo : number diff --git a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.symbols b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.symbols new file mode 100644 index 00000000000..3a0c8e5db97 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/contextualTypingOfLambdaWithMultipleSignatures.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 0)) + + getFoo(n: number): void; +>getFoo : Symbol(getFoo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 15), Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 1, 28)) +>n : Symbol(n, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 1, 11)) + + getFoo(s: string): void; +>getFoo : Symbol(getFoo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 15), Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 1, 28)) +>s : Symbol(s, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 2, 11)) +} + +var foo: Foo; +>foo : Symbol(foo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 5, 3)) +>Foo : Symbol(Foo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 0)) + +foo.getFoo = bar => { }; +>foo.getFoo : Symbol(Foo.getFoo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 15), Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 1, 28)) +>foo : Symbol(foo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 5, 3)) +>getFoo : Symbol(Foo.getFoo, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 0, 15), Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 1, 28)) +>bar : Symbol(bar, Decl(contextualTypingOfLambdaWithMultipleSignatures.ts, 6, 12)) + diff --git a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.symbols b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.symbols new file mode 100644 index 00000000000..f44d33e1ba8 --- /dev/null +++ b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/contextualTypingOfLambdaWithMultipleSignatures2.ts === +var f: { +>f : Symbol(f, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 0, 3)) + + (x: string): string; +>x : Symbol(x, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 1, 5)) + + (x: number): string +>x : Symbol(x, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 2, 5)) + +}; + +f = (a) => { return a.asdf } +>f : Symbol(f, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 0, 3)) +>a : Symbol(a, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 5, 5)) +>a : Symbol(a, Decl(contextualTypingOfLambdaWithMultipleSignatures2.ts, 5, 5)) + diff --git a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.symbols b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.symbols new file mode 100644 index 00000000000..62870f575c7 --- /dev/null +++ b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/contextualTypingTwoInstancesOfSameTypeParameter.ts === +function f6(x: (a: T) => T) { +>f6 : Symbol(f6, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 12)) +>x : Symbol(x, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 15)) +>a : Symbol(a, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 19)) +>T : Symbol(T, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 12)) +>T : Symbol(T, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 12)) + + return null; +} +f6(x => f6(y => x = y)); +>f6 : Symbol(f6, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 0)) +>x : Symbol(x, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 3, 3)) +>f6 : Symbol(f6, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 0, 0)) +>y : Symbol(y, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 3, 11)) +>x : Symbol(x, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 3, 3)) +>y : Symbol(y, Decl(contextualTypingTwoInstancesOfSameTypeParameter.ts, 3, 11)) + diff --git a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types index 0e5c25a9282..264735a995a 100644 --- a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types +++ b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types @@ -8,6 +8,7 @@ function f6(x: (a: T) => T) { >T : T return null; +>null : null } f6(x => f6(y => x = y)); >f6(x => f6(y => x = y)) : any diff --git a/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.symbols b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.symbols new file mode 100644 index 00000000000..d7ba6f0ddc3 --- /dev/null +++ b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/contextualTypingWithGenericAndNonGenericSignature.ts === +//• If e is a FunctionExpression or ArrowFunctionExpression with no type parameters and no parameter or return type annotations, and T is a function type with EXACTLY ONE non - generic call signature, then any inferences made for type parameters referenced by the parameters of T’s call signature are fixed(section 4.12.2) and e is processed with the contextual type T, as described in section 4.9.3. + +var f2: { +>f2 : Symbol(f2, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 2, 3)) + + (x: string, y: number): string; +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 3, 5)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 3, 15)) + + (x: T, y: U): T +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 5)) +>U : Symbol(U, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 7)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 11)) +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 5)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 16)) +>U : Symbol(U, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 7)) +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 4, 5)) + +}; + +f2 = (x, y) => { return x } +>f2 : Symbol(f2, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 2, 3)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 7, 6)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 7, 8)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 7, 6)) + +var f3: { +>f3 : Symbol(f3, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 9, 3)) + + (x: T, y: U): T +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 5)) +>U : Symbol(U, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 7)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 11)) +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 5)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 16)) +>U : Symbol(U, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 7)) +>T : Symbol(T, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 10, 5)) + + (x: string, y: number): string; +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 11, 5)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 11, 15)) + +}; + +f3 = (x, y) => { return x } +>f3 : Symbol(f3, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 9, 3)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 14, 6)) +>y : Symbol(y, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 14, 8)) +>x : Symbol(x, Decl(contextualTypingWithGenericAndNonGenericSignature.ts, 14, 6)) + diff --git a/tests/baselines/reference/contextualTypingWithGenericSignature.symbols b/tests/baselines/reference/contextualTypingWithGenericSignature.symbols new file mode 100644 index 00000000000..c416a5ca19f --- /dev/null +++ b/tests/baselines/reference/contextualTypingWithGenericSignature.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/contextualTypingWithGenericSignature.ts === +// If e is a FunctionExpression or ArrowFunctionExpression with no type parameters and no parameter or return type annotations, and T is a function type with EXACTLY ONE non - generic call signature, then any inferences made for type parameters referenced by the parameters of T’s call signature are fixed(section 4.12.2) and e is processed with the contextual type T, as described in section 4.9.3. + +var f2: { +>f2 : Symbol(f2, Decl(contextualTypingWithGenericSignature.ts, 2, 3)) + + (x: T, y: U): T +>T : Symbol(T, Decl(contextualTypingWithGenericSignature.ts, 3, 5)) +>U : Symbol(U, Decl(contextualTypingWithGenericSignature.ts, 3, 7)) +>x : Symbol(x, Decl(contextualTypingWithGenericSignature.ts, 3, 11)) +>T : Symbol(T, Decl(contextualTypingWithGenericSignature.ts, 3, 5)) +>y : Symbol(y, Decl(contextualTypingWithGenericSignature.ts, 3, 16)) +>U : Symbol(U, Decl(contextualTypingWithGenericSignature.ts, 3, 7)) +>T : Symbol(T, Decl(contextualTypingWithGenericSignature.ts, 3, 5)) + +}; + +f2 = (x, y) => { return x } +>f2 : Symbol(f2, Decl(contextualTypingWithGenericSignature.ts, 2, 3)) +>x : Symbol(x, Decl(contextualTypingWithGenericSignature.ts, 6, 6)) +>y : Symbol(y, Decl(contextualTypingWithGenericSignature.ts, 6, 8)) +>x : Symbol(x, Decl(contextualTypingWithGenericSignature.ts, 6, 6)) + diff --git a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.symbols b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.symbols new file mode 100644 index 00000000000..810f407e1b2 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/expressions/functions/contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts === +declare function foo(x: (y: string) => (y2: number) => void); +>foo : Symbol(foo, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 0)) +>x : Symbol(x, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 21)) +>y : Symbol(y, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 25)) +>y2 : Symbol(y2, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 40)) + +// Contextually type the parameter even if there is a return annotation +foo((y): (y2: number) => void => { +>foo : Symbol(foo, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 0)) +>y : Symbol(y, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 3, 5)) +>y2 : Symbol(y2, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 3, 10)) + + var z = y.charAt(0); // Should be string +>z : Symbol(z, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 4, 7)) +>y.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>y : Symbol(y, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 3, 5)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + + return null; +}); + +foo((y: string) => { +>foo : Symbol(foo, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 0, 0)) +>y : Symbol(y, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 8, 5)) + + return y2 => { +>y2 : Symbol(y2, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 9, 10)) + + var z = y2.toFixed(); // Should be string +>z : Symbol(z, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 10, 11)) +>y2.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>y2 : Symbol(y2, Decl(contextuallyTypedFunctionExpressionsAndReturnAnnotations.ts, 9, 10)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + + return 0; + }; +}); diff --git a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types index 09c317c64a0..94b184f65da 100644 --- a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types +++ b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.types @@ -19,8 +19,11 @@ foo((y): (y2: number) => void => { >y.charAt : (pos: number) => string >y : string >charAt : (pos: number) => string +>0 : number return null; +>null : null + }); foo((y: string) => { @@ -41,5 +44,7 @@ foo((y: string) => { >toFixed : (fractionDigits?: number) => string return 0; +>0 : number + }; }); diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.symbols b/tests/baselines/reference/contextuallyTypingOrOperator.symbols new file mode 100644 index 00000000000..18019aea7cb --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingOrOperator.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/contextuallyTypingOrOperator.ts === +var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; +>v : Symbol(v, Decl(contextuallyTypingOrOperator.ts, 0, 3)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator.ts, 0, 8)) +>_ : Symbol(_, Decl(contextuallyTypingOrOperator.ts, 0, 13)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator.ts, 0, 39)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 0, 42)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 0, 42)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator.ts, 0, 63)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 0, 66)) + +var v2 = (s: string) => s.length || function (s) { s.length }; +>v2 : Symbol(v2, Decl(contextuallyTypingOrOperator.ts, 2, 3)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 2, 10)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 2, 10)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 2, 46)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 2, 46)) + +var v3 = (s: string) => s.length || function (s: number) { return 1 }; +>v3 : Symbol(v3, Decl(contextuallyTypingOrOperator.ts, 4, 3)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 4, 10)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 4, 10)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 4, 46)) + +var v4 = (s: number) => 1 || function (s: string) { return s.length }; +>v4 : Symbol(v4, Decl(contextuallyTypingOrOperator.ts, 5, 3)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 5, 10)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 5, 39)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator.ts, 5, 39)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.types b/tests/baselines/reference/contextuallyTypingOrOperator.types index 47b78f5691d..676ad04bfa9 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator.types @@ -15,6 +15,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >a : (s: string) => number >s => 1 : (s: string) => number >s : string +>1 : number var v2 = (s: string) => s.length || function (s) { s.length }; >v2 : (s: string) => number | ((s: any) => void) @@ -40,12 +41,14 @@ var v3 = (s: string) => s.length || function (s: number) { return 1 }; >length : number >function (s: number) { return 1 } : (s: number) => number >s : number +>1 : number var v4 = (s: number) => 1 || function (s: string) { return s.length }; >v4 : (s: number) => number | ((s: string) => number) >(s: number) => 1 || function (s: string) { return s.length } : (s: number) => number | ((s: string) => number) >s : number >1 || function (s: string) { return s.length } : number | ((s: string) => number) +>1 : number >function (s: string) { return s.length } : (s: string) => number >s : string >s.length : number diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.symbols b/tests/baselines/reference/contextuallyTypingOrOperator2.symbols new file mode 100644 index 00000000000..99e328fd64a --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/contextuallyTypingOrOperator2.ts === +var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; +>v : Symbol(v, Decl(contextuallyTypingOrOperator2.ts, 0, 3)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator2.ts, 0, 8)) +>_ : Symbol(_, Decl(contextuallyTypingOrOperator2.ts, 0, 13)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator2.ts, 0, 39)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 0, 42)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 0, 42)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(contextuallyTypingOrOperator2.ts, 0, 63)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 0, 66)) + +var v2 = (s: string) => s.length || function (s) { s.aaa }; +>v2 : Symbol(v2, Decl(contextuallyTypingOrOperator2.ts, 2, 3)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 2, 10)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 2, 10)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 2, 46)) +>s : Symbol(s, Decl(contextuallyTypingOrOperator2.ts, 2, 46)) + diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.types b/tests/baselines/reference/contextuallyTypingOrOperator2.types index 65ed442d5e9..2a73ccc9c9d 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator2.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.types @@ -15,6 +15,7 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >a : (s: string) => number >s => 1 : (s: string) => number >s : string +>1 : number var v2 = (s: string) => s.length || function (s) { s.aaa }; >v2 : (s: string) => number | ((s: any) => void) diff --git a/tests/baselines/reference/continueInIterationStatement1.symbols b/tests/baselines/reference/continueInIterationStatement1.symbols new file mode 100644 index 00000000000..210de69f6bb --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/continueInIterationStatement1.ts === +while (true) { +No type information for this code. continue; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueInIterationStatement1.types b/tests/baselines/reference/continueInIterationStatement1.types index 210de69f6bb..4fcf3794844 100644 --- a/tests/baselines/reference/continueInIterationStatement1.types +++ b/tests/baselines/reference/continueInIterationStatement1.types @@ -1,5 +1,6 @@ === tests/cases/compiler/continueInIterationStatement1.ts === while (true) { -No type information for this code. continue; -No type information for this code.} -No type information for this code. \ No newline at end of file +>true : boolean + + continue; +} diff --git a/tests/baselines/reference/continueInIterationStatement2.symbols b/tests/baselines/reference/continueInIterationStatement2.symbols new file mode 100644 index 00000000000..5cb4b62f39a --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/continueInIterationStatement2.ts === +do { +No type information for this code. continue; +No type information for this code.} +No type information for this code.while (true); +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueInIterationStatement2.types b/tests/baselines/reference/continueInIterationStatement2.types index 5cb4b62f39a..4a3d50c7501 100644 --- a/tests/baselines/reference/continueInIterationStatement2.types +++ b/tests/baselines/reference/continueInIterationStatement2.types @@ -1,6 +1,7 @@ === tests/cases/compiler/continueInIterationStatement2.ts === do { -No type information for this code. continue; -No type information for this code.} -No type information for this code.while (true); -No type information for this code. \ No newline at end of file + continue; +} +while (true); +>true : boolean + diff --git a/tests/baselines/reference/continueInIterationStatement3.symbols b/tests/baselines/reference/continueInIterationStatement3.symbols new file mode 100644 index 00000000000..f4df3a295fb --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement3.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/continueInIterationStatement3.ts === +for (;;) { +No type information for this code. continue; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueLabel.symbols b/tests/baselines/reference/continueLabel.symbols new file mode 100644 index 00000000000..d6bf335185a --- /dev/null +++ b/tests/baselines/reference/continueLabel.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/continueLabel.ts === +label1: for(var i = 0; i < 1; i++) { +>i : Symbol(i, Decl(continueLabel.ts, 0, 15)) +>i : Symbol(i, Decl(continueLabel.ts, 0, 15)) +>i : Symbol(i, Decl(continueLabel.ts, 0, 15)) + + continue label1; +} diff --git a/tests/baselines/reference/continueLabel.types b/tests/baselines/reference/continueLabel.types index 79c5381f08a..a25f3311607 100644 --- a/tests/baselines/reference/continueLabel.types +++ b/tests/baselines/reference/continueLabel.types @@ -1,10 +1,14 @@ === tests/cases/compiler/continueLabel.ts === label1: for(var i = 0; i < 1; i++) { +>label1 : any >i : number +>0 : number >i < 1 : boolean >i : number +>1 : number >i++ : number >i : number continue label1; +>label1 : any } diff --git a/tests/baselines/reference/continueTarget2.symbols b/tests/baselines/reference/continueTarget2.symbols new file mode 100644 index 00000000000..16f45c402cd --- /dev/null +++ b/tests/baselines/reference/continueTarget2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/continueTarget2.ts === +target: +No type information for this code.while (true) { +No type information for this code. continue target; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget2.types b/tests/baselines/reference/continueTarget2.types index 16f45c402cd..1e9a2325642 100644 --- a/tests/baselines/reference/continueTarget2.types +++ b/tests/baselines/reference/continueTarget2.types @@ -1,6 +1,10 @@ === tests/cases/compiler/continueTarget2.ts === target: -No type information for this code.while (true) { -No type information for this code. continue target; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target : any + +while (true) { +>true : boolean + + continue target; +>target : any +} diff --git a/tests/baselines/reference/continueTarget3.symbols b/tests/baselines/reference/continueTarget3.symbols new file mode 100644 index 00000000000..a1b930f2f5a --- /dev/null +++ b/tests/baselines/reference/continueTarget3.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/continueTarget3.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget3.types b/tests/baselines/reference/continueTarget3.types index a1b930f2f5a..3336b47772c 100644 --- a/tests/baselines/reference/continueTarget3.types +++ b/tests/baselines/reference/continueTarget3.types @@ -1,7 +1,13 @@ === tests/cases/compiler/continueTarget3.ts === target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. continue target1; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + continue target1; +>target1 : any +} diff --git a/tests/baselines/reference/continueTarget4.symbols b/tests/baselines/reference/continueTarget4.symbols new file mode 100644 index 00000000000..ea1989a3e4d --- /dev/null +++ b/tests/baselines/reference/continueTarget4.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/continueTarget4.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget4.types b/tests/baselines/reference/continueTarget4.types index ea1989a3e4d..5d2b7c29bbe 100644 --- a/tests/baselines/reference/continueTarget4.types +++ b/tests/baselines/reference/continueTarget4.types @@ -1,7 +1,13 @@ === tests/cases/compiler/continueTarget4.ts === target1: -No type information for this code.target2: -No type information for this code.while (true) { -No type information for this code. continue target2; -No type information for this code.} -No type information for this code. \ No newline at end of file +>target1 : any + +target2: +>target2 : any + +while (true) { +>true : boolean + + continue target2; +>target2 : any +} diff --git a/tests/baselines/reference/convertKeywords.symbols b/tests/baselines/reference/convertKeywords.symbols new file mode 100644 index 00000000000..e2d5668bf1d --- /dev/null +++ b/tests/baselines/reference/convertKeywords.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/convertKeywords.ts === +var abstract; +>abstract : Symbol(abstract, Decl(convertKeywords.ts, 0, 3)) + + + diff --git a/tests/baselines/reference/covariance1.symbols b/tests/baselines/reference/covariance1.symbols new file mode 100644 index 00000000000..db055e20bc6 --- /dev/null +++ b/tests/baselines/reference/covariance1.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/covariance1.ts === +module M { +>M : Symbol(M, Decl(covariance1.ts, 0, 0)) + + interface X { m1:number; } +>X : Symbol(X, Decl(covariance1.ts, 0, 10)) +>m1 : Symbol(m1, Decl(covariance1.ts, 2, 17)) + + export class XX implements X { constructor(public m1:number) { } } +>XX : Symbol(XX, Decl(covariance1.ts, 2, 30)) +>X : Symbol(X, Decl(covariance1.ts, 0, 10)) +>m1 : Symbol(m1, Decl(covariance1.ts, 3, 47)) + + interface Y { x:X; } +>Y : Symbol(Y, Decl(covariance1.ts, 3, 70)) +>x : Symbol(x, Decl(covariance1.ts, 5, 17)) +>X : Symbol(X, Decl(covariance1.ts, 0, 10)) + + export function f(y:Y) { } +>f : Symbol(f, Decl(covariance1.ts, 5, 24)) +>y : Symbol(y, Decl(covariance1.ts, 7, 22)) +>Y : Symbol(Y, Decl(covariance1.ts, 3, 70)) + + var a:X; +>a : Symbol(a, Decl(covariance1.ts, 9, 7)) +>X : Symbol(X, Decl(covariance1.ts, 0, 10)) + + f({x:a}); // ok +>f : Symbol(f, Decl(covariance1.ts, 5, 24)) +>x : Symbol(x, Decl(covariance1.ts, 10, 7)) +>a : Symbol(a, Decl(covariance1.ts, 9, 7)) + + var b:XX; +>b : Symbol(b, Decl(covariance1.ts, 12, 7)) +>XX : Symbol(XX, Decl(covariance1.ts, 2, 30)) + + f({x:b}); // ok covariant subtype +>f : Symbol(f, Decl(covariance1.ts, 5, 24)) +>x : Symbol(x, Decl(covariance1.ts, 13, 7)) +>b : Symbol(b, Decl(covariance1.ts, 12, 7)) +} + + diff --git a/tests/baselines/reference/crashInResolveInterface.symbols b/tests/baselines/reference/crashInResolveInterface.symbols new file mode 100644 index 00000000000..c10bf0b26a8 --- /dev/null +++ b/tests/baselines/reference/crashInResolveInterface.symbols @@ -0,0 +1,50 @@ +=== tests/cases/compiler/file2.ts === +/// +declare var c: C; +>c : Symbol(c, Decl(file2.ts, 1, 11)) +>C : Symbol(C, Decl(file2.ts, 1, 17), Decl(file2.ts, 4, 1)) + +interface C { +>C : Symbol(C, Decl(file2.ts, 1, 17), Decl(file2.ts, 4, 1)) + + count(countTitle?: string): void; +>count : Symbol(count, Decl(file2.ts, 2, 13)) +>countTitle : Symbol(countTitle, Decl(file2.ts, 3, 10)) +} +interface C { +>C : Symbol(C, Decl(file2.ts, 1, 17), Decl(file2.ts, 4, 1)) + + log(message?: any, ...optionalParams: any[]): void; +>log : Symbol(log, Decl(file2.ts, 5, 13)) +>message : Symbol(message, Decl(file2.ts, 6, 8)) +>optionalParams : Symbol(optionalParams, Decl(file2.ts, 6, 22)) +} + +=== tests/cases/compiler/file1.ts === +interface Q { +>Q : Symbol(Q, Decl(file1.ts, 0, 0)) +>T : Symbol(T, Decl(file1.ts, 0, 12)) + + each(action: (item: T, index: number) => void): void; +>each : Symbol(each, Decl(file1.ts, 0, 16)) +>action : Symbol(action, Decl(file1.ts, 1, 9)) +>item : Symbol(item, Decl(file1.ts, 1, 18)) +>T : Symbol(T, Decl(file1.ts, 0, 12)) +>index : Symbol(index, Decl(file1.ts, 1, 26)) +} +var q1: Q<{ a: number; }>; +>q1 : Symbol(q1, Decl(file1.ts, 3, 3)) +>Q : Symbol(Q, Decl(file1.ts, 0, 0)) +>a : Symbol(a, Decl(file1.ts, 3, 11)) + +var x = q1.each(x => c.log(x)); +>x : Symbol(x, Decl(file1.ts, 4, 3)) +>q1.each : Symbol(Q.each, Decl(file1.ts, 0, 16)) +>q1 : Symbol(q1, Decl(file1.ts, 3, 3)) +>each : Symbol(Q.each, Decl(file1.ts, 0, 16)) +>x : Symbol(x, Decl(file1.ts, 4, 16)) +>c.log : Symbol(C.log, Decl(file2.ts, 5, 13)) +>c : Symbol(c, Decl(file2.ts, 1, 11)) +>log : Symbol(C.log, Decl(file2.ts, 5, 13)) +>x : Symbol(x, Decl(file1.ts, 4, 16)) + diff --git a/tests/baselines/reference/crashInresolveReturnStatement.symbols b/tests/baselines/reference/crashInresolveReturnStatement.symbols new file mode 100644 index 00000000000..359a62c7842 --- /dev/null +++ b/tests/baselines/reference/crashInresolveReturnStatement.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/crashInresolveReturnStatement.ts === +class WorkItemToolbar { +>WorkItemToolbar : Symbol(WorkItemToolbar, Decl(crashInresolveReturnStatement.ts, 0, 0)) + + public onToolbarItemClick() { +>onToolbarItemClick : Symbol(onToolbarItemClick, Decl(crashInresolveReturnStatement.ts, 0, 23)) + + WITDialogs.createCopyOfWorkItem(); +>WITDialogs.createCopyOfWorkItem : Symbol(WITDialogs.createCopyOfWorkItem, Decl(crashInresolveReturnStatement.ts, 12, 18)) +>WITDialogs : Symbol(WITDialogs, Decl(crashInresolveReturnStatement.ts, 11, 1)) +>createCopyOfWorkItem : Symbol(WITDialogs.createCopyOfWorkItem, Decl(crashInresolveReturnStatement.ts, 12, 18)) + } +} +class CreateCopyOfWorkItemDialog { +>CreateCopyOfWorkItemDialog : Symbol(CreateCopyOfWorkItemDialog, Decl(crashInresolveReturnStatement.ts, 4, 1)) + + public getDialogResult() { +>getDialogResult : Symbol(getDialogResult, Decl(crashInresolveReturnStatement.ts, 5, 34)) + + return null; + } +} +function createWorkItemDialog(dialogType: P0) { +>createWorkItemDialog : Symbol(createWorkItemDialog, Decl(crashInresolveReturnStatement.ts, 9, 1)) +>P0 : Symbol(P0, Decl(crashInresolveReturnStatement.ts, 10, 30)) +>dialogType : Symbol(dialogType, Decl(crashInresolveReturnStatement.ts, 10, 34)) +>P0 : Symbol(P0, Decl(crashInresolveReturnStatement.ts, 10, 30)) +} +class WITDialogs { +>WITDialogs : Symbol(WITDialogs, Decl(crashInresolveReturnStatement.ts, 11, 1)) + + public static createCopyOfWorkItem() { +>createCopyOfWorkItem : Symbol(WITDialogs.createCopyOfWorkItem, Decl(crashInresolveReturnStatement.ts, 12, 18)) + + createWorkItemDialog(CreateCopyOfWorkItemDialog); +>createWorkItemDialog : Symbol(createWorkItemDialog, Decl(crashInresolveReturnStatement.ts, 9, 1)) +>CreateCopyOfWorkItemDialog : Symbol(CreateCopyOfWorkItemDialog, Decl(crashInresolveReturnStatement.ts, 4, 1)) + } +} + diff --git a/tests/baselines/reference/crashInresolveReturnStatement.types b/tests/baselines/reference/crashInresolveReturnStatement.types index 6d31f15569b..5a43d916edc 100644 --- a/tests/baselines/reference/crashInresolveReturnStatement.types +++ b/tests/baselines/reference/crashInresolveReturnStatement.types @@ -19,6 +19,7 @@ class CreateCopyOfWorkItemDialog { >getDialogResult : () => any return null; +>null : null } } function createWorkItemDialog(dialogType: P0) { diff --git a/tests/baselines/reference/cyclicModuleImport.symbols b/tests/baselines/reference/cyclicModuleImport.symbols new file mode 100644 index 00000000000..86337812aad --- /dev/null +++ b/tests/baselines/reference/cyclicModuleImport.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/cyclicModuleImport.ts === +declare module "SubModule" { + import MainModule = require('MainModule'); +>MainModule : Symbol(MainModule, Decl(cyclicModuleImport.ts, 0, 28)) + + class SubModule { +>SubModule : Symbol(SubModule, Decl(cyclicModuleImport.ts, 1, 46)) + + public static StaticVar: number; +>StaticVar : Symbol(SubModule.StaticVar, Decl(cyclicModuleImport.ts, 2, 21)) + + public InstanceVar: number; +>InstanceVar : Symbol(InstanceVar, Decl(cyclicModuleImport.ts, 3, 40)) + + public main: MainModule; +>main : Symbol(main, Decl(cyclicModuleImport.ts, 4, 35)) +>MainModule : Symbol(MainModule, Decl(cyclicModuleImport.ts, 0, 28)) + + constructor(); + } + export = SubModule; +>SubModule : Symbol(SubModule, Decl(cyclicModuleImport.ts, 1, 46)) +} +declare module "MainModule" { + import SubModule = require('SubModule'); +>SubModule : Symbol(SubModule, Decl(cyclicModuleImport.ts, 10, 29)) + + class MainModule { +>MainModule : Symbol(MainModule, Decl(cyclicModuleImport.ts, 11, 44)) + + public SubModule: SubModule; +>SubModule : Symbol(SubModule, Decl(cyclicModuleImport.ts, 12, 22)) +>SubModule : Symbol(SubModule, Decl(cyclicModuleImport.ts, 10, 29)) + + constructor(); + } + export = MainModule; +>MainModule : Symbol(MainModule, Decl(cyclicModuleImport.ts, 11, 44)) +} + diff --git a/tests/baselines/reference/debugger.symbols b/tests/baselines/reference/debugger.symbols new file mode 100644 index 00000000000..9c11d0e2598 --- /dev/null +++ b/tests/baselines/reference/debugger.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/debugger.ts === +debugger; + +function foo() { +>foo : Symbol(foo, Decl(debugger.ts, 0, 9)) + + debugger; + +} diff --git a/tests/baselines/reference/debuggerEmit.symbols b/tests/baselines/reference/debuggerEmit.symbols new file mode 100644 index 00000000000..b8f6228a99d --- /dev/null +++ b/tests/baselines/reference/debuggerEmit.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/debuggerEmit.ts === +var x = function () { debugger; } +>x : Symbol(x, Decl(debuggerEmit.ts, 0, 3)) + +x(); +>x : Symbol(x, Decl(debuggerEmit.ts, 0, 3)) + diff --git a/tests/baselines/reference/declFileAccessors.symbols b/tests/baselines/reference/declFileAccessors.symbols new file mode 100644 index 00000000000..7275dd8c191 --- /dev/null +++ b/tests/baselines/reference/declFileAccessors.symbols @@ -0,0 +1,160 @@ +=== tests/cases/compiler/declFileAccessors_0.ts === + +/** This is comment for c1*/ +export class c1 { +>c1 : Symbol(c1, Decl(declFileAccessors_0.ts, 0, 0)) + + /** getter property*/ + public get p3() { +>p3 : Symbol(p3, Decl(declFileAccessors_0.ts, 2, 17), Decl(declFileAccessors_0.ts, 6, 5)) + + return 10; + } + /** setter property*/ + public set p3(/** this is value*/value: number) { +>p3 : Symbol(p3, Decl(declFileAccessors_0.ts, 2, 17), Decl(declFileAccessors_0.ts, 6, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 8, 18)) + } + /** private getter property*/ + private get pp3() { +>pp3 : Symbol(pp3, Decl(declFileAccessors_0.ts, 9, 5), Decl(declFileAccessors_0.ts, 13, 5)) + + return 10; + } + /** private setter property*/ + private set pp3(/** this is value*/value: number) { +>pp3 : Symbol(pp3, Decl(declFileAccessors_0.ts, 9, 5), Decl(declFileAccessors_0.ts, 13, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 15, 20)) + } + /** static getter property*/ + static get s3() { +>s3 : Symbol(c1.s3, Decl(declFileAccessors_0.ts, 16, 5), Decl(declFileAccessors_0.ts, 20, 5)) + + return 10; + } + /** setter property*/ + static set s3( /** this is value*/value: number) { +>s3 : Symbol(c1.s3, Decl(declFileAccessors_0.ts, 16, 5), Decl(declFileAccessors_0.ts, 20, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 22, 18)) + } + public get nc_p3() { +>nc_p3 : Symbol(nc_p3, Decl(declFileAccessors_0.ts, 23, 5), Decl(declFileAccessors_0.ts, 26, 5)) + + return 10; + } + public set nc_p3(value: number) { +>nc_p3 : Symbol(nc_p3, Decl(declFileAccessors_0.ts, 23, 5), Decl(declFileAccessors_0.ts, 26, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 27, 21)) + } + private get nc_pp3() { +>nc_pp3 : Symbol(nc_pp3, Decl(declFileAccessors_0.ts, 28, 5), Decl(declFileAccessors_0.ts, 31, 5)) + + return 10; + } + private set nc_pp3(value: number) { +>nc_pp3 : Symbol(nc_pp3, Decl(declFileAccessors_0.ts, 28, 5), Decl(declFileAccessors_0.ts, 31, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 32, 23)) + } + static get nc_s3() { +>nc_s3 : Symbol(c1.nc_s3, Decl(declFileAccessors_0.ts, 33, 5), Decl(declFileAccessors_0.ts, 36, 5)) + + return ""; + } + static set nc_s3(value: string) { +>nc_s3 : Symbol(c1.nc_s3, Decl(declFileAccessors_0.ts, 33, 5), Decl(declFileAccessors_0.ts, 36, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 37, 21)) + } + + // Only getter property + public get onlyGetter() { +>onlyGetter : Symbol(onlyGetter, Decl(declFileAccessors_0.ts, 38, 5)) + + return 10; + } + + // Only setter property + public set onlySetter(value: number) { +>onlySetter : Symbol(onlySetter, Decl(declFileAccessors_0.ts, 43, 5)) +>value : Symbol(value, Decl(declFileAccessors_0.ts, 46, 26)) + } +} + +=== tests/cases/compiler/declFileAccessors_1.ts === +/** This is comment for c2 - the global class*/ +class c2 { +>c2 : Symbol(c2, Decl(declFileAccessors_1.ts, 0, 0)) + + /** getter property*/ + public get p3() { +>p3 : Symbol(p3, Decl(declFileAccessors_1.ts, 1, 10), Decl(declFileAccessors_1.ts, 5, 5)) + + return 10; + } + /** setter property*/ + public set p3(/** this is value*/value: number) { +>p3 : Symbol(p3, Decl(declFileAccessors_1.ts, 1, 10), Decl(declFileAccessors_1.ts, 5, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 7, 18)) + } + /** private getter property*/ + private get pp3() { +>pp3 : Symbol(pp3, Decl(declFileAccessors_1.ts, 8, 5), Decl(declFileAccessors_1.ts, 12, 5)) + + return 10; + } + /** private setter property*/ + private set pp3(/** this is value*/value: number) { +>pp3 : Symbol(pp3, Decl(declFileAccessors_1.ts, 8, 5), Decl(declFileAccessors_1.ts, 12, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 14, 20)) + } + /** static getter property*/ + static get s3() { +>s3 : Symbol(c2.s3, Decl(declFileAccessors_1.ts, 15, 5), Decl(declFileAccessors_1.ts, 19, 5)) + + return 10; + } + /** setter property*/ + static set s3( /** this is value*/value: number) { +>s3 : Symbol(c2.s3, Decl(declFileAccessors_1.ts, 15, 5), Decl(declFileAccessors_1.ts, 19, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 21, 18)) + } + public get nc_p3() { +>nc_p3 : Symbol(nc_p3, Decl(declFileAccessors_1.ts, 22, 5), Decl(declFileAccessors_1.ts, 25, 5)) + + return 10; + } + public set nc_p3(value: number) { +>nc_p3 : Symbol(nc_p3, Decl(declFileAccessors_1.ts, 22, 5), Decl(declFileAccessors_1.ts, 25, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 26, 21)) + } + private get nc_pp3() { +>nc_pp3 : Symbol(nc_pp3, Decl(declFileAccessors_1.ts, 27, 5), Decl(declFileAccessors_1.ts, 30, 5)) + + return 10; + } + private set nc_pp3(value: number) { +>nc_pp3 : Symbol(nc_pp3, Decl(declFileAccessors_1.ts, 27, 5), Decl(declFileAccessors_1.ts, 30, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 31, 23)) + } + static get nc_s3() { +>nc_s3 : Symbol(c2.nc_s3, Decl(declFileAccessors_1.ts, 32, 5), Decl(declFileAccessors_1.ts, 35, 5)) + + return ""; + } + static set nc_s3(value: string) { +>nc_s3 : Symbol(c2.nc_s3, Decl(declFileAccessors_1.ts, 32, 5), Decl(declFileAccessors_1.ts, 35, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 36, 21)) + } + + // Only getter property + public get onlyGetter() { +>onlyGetter : Symbol(onlyGetter, Decl(declFileAccessors_1.ts, 37, 5)) + + return 10; + } + + // Only setter property + public set onlySetter(value: number) { +>onlySetter : Symbol(onlySetter, Decl(declFileAccessors_1.ts, 42, 5)) +>value : Symbol(value, Decl(declFileAccessors_1.ts, 45, 26)) + } +} diff --git a/tests/baselines/reference/declFileAccessors.types b/tests/baselines/reference/declFileAccessors.types index 2d8524a21c3..00b10f7bf40 100644 --- a/tests/baselines/reference/declFileAccessors.types +++ b/tests/baselines/reference/declFileAccessors.types @@ -9,6 +9,7 @@ export class c1 { >p3 : number return 10; +>10 : number } /** setter property*/ public set p3(/** this is value*/value: number) { @@ -20,6 +21,7 @@ export class c1 { >pp3 : number return 10; +>10 : number } /** private setter property*/ private set pp3(/** this is value*/value: number) { @@ -31,6 +33,7 @@ export class c1 { >s3 : number return 10; +>10 : number } /** setter property*/ static set s3( /** this is value*/value: number) { @@ -41,6 +44,7 @@ export class c1 { >nc_p3 : number return 10; +>10 : number } public set nc_p3(value: number) { >nc_p3 : number @@ -50,6 +54,7 @@ export class c1 { >nc_pp3 : number return 10; +>10 : number } private set nc_pp3(value: number) { >nc_pp3 : number @@ -59,6 +64,7 @@ export class c1 { >nc_s3 : string return ""; +>"" : string } static set nc_s3(value: string) { >nc_s3 : string @@ -70,6 +76,7 @@ export class c1 { >onlyGetter : number return 10; +>10 : number } // Only setter property @@ -89,6 +96,7 @@ class c2 { >p3 : number return 10; +>10 : number } /** setter property*/ public set p3(/** this is value*/value: number) { @@ -100,6 +108,7 @@ class c2 { >pp3 : number return 10; +>10 : number } /** private setter property*/ private set pp3(/** this is value*/value: number) { @@ -111,6 +120,7 @@ class c2 { >s3 : number return 10; +>10 : number } /** setter property*/ static set s3( /** this is value*/value: number) { @@ -121,6 +131,7 @@ class c2 { >nc_p3 : number return 10; +>10 : number } public set nc_p3(value: number) { >nc_p3 : number @@ -130,6 +141,7 @@ class c2 { >nc_pp3 : number return 10; +>10 : number } private set nc_pp3(value: number) { >nc_pp3 : number @@ -139,6 +151,7 @@ class c2 { >nc_s3 : string return ""; +>"" : string } static set nc_s3(value: string) { >nc_s3 : string @@ -150,6 +163,7 @@ class c2 { >onlyGetter : number return 10; +>10 : number } // Only setter property diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.symbols b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.symbols new file mode 100644 index 00000000000..ee7795ae455 --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration_test.ts === +export function bar(a: foo.Foo) { } +>bar : Symbol(bar, Decl(declFileAliasUseBeforeDeclaration_test.ts, 0, 0)) +>a : Symbol(a, Decl(declFileAliasUseBeforeDeclaration_test.ts, 0, 20)) +>foo : Symbol(foo, Decl(declFileAliasUseBeforeDeclaration_test.ts, 0, 35)) +>Foo : Symbol(foo.Foo, Decl(declFileAliasUseBeforeDeclaration_foo.ts, 0, 0)) + +import foo = require("declFileAliasUseBeforeDeclaration_foo"); +>foo : Symbol(foo, Decl(declFileAliasUseBeforeDeclaration_test.ts, 0, 35)) + +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration_foo.ts === + +export class Foo { } +>Foo : Symbol(Foo, Decl(declFileAliasUseBeforeDeclaration_foo.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types index 800df4ada49..c21d98d90d5 100644 --- a/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration.types @@ -2,7 +2,7 @@ export function bar(a: foo.Foo) { } >bar : (a: foo.Foo) => void >a : foo.Foo ->foo : unknown +>foo : any >Foo : foo.Foo import foo = require("declFileAliasUseBeforeDeclaration_foo"); diff --git a/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.symbols b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.symbols new file mode 100644 index 00000000000..c0ad98bbe3d --- /dev/null +++ b/tests/baselines/reference/declFileAliasUseBeforeDeclaration2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/declFileAliasUseBeforeDeclaration2.ts === + +declare module "test" { + module A { +>A : Symbol(A, Decl(declFileAliasUseBeforeDeclaration2.ts, 1, 23)) + + class C { +>C : Symbol(C, Decl(declFileAliasUseBeforeDeclaration2.ts, 2, 14)) + } + } + class B extends E { +>B : Symbol(B, Decl(declFileAliasUseBeforeDeclaration2.ts, 5, 5)) +>E : Symbol(E, Decl(declFileAliasUseBeforeDeclaration2.ts, 7, 5)) + } + import E = A.C; +>E : Symbol(E, Decl(declFileAliasUseBeforeDeclaration2.ts, 7, 5)) +>A : Symbol(A, Decl(declFileAliasUseBeforeDeclaration2.ts, 1, 23)) +>C : Symbol(E, Decl(declFileAliasUseBeforeDeclaration2.ts, 2, 14)) +} diff --git a/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.symbols b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.symbols new file mode 100644 index 00000000000..4a4077836cd --- /dev/null +++ b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/declFileAmbientExternalModuleWithSingleExportedModule_1.ts === +/// +import SubModule = require('SubModule'); +>SubModule : Symbol(SubModule, Decl(declFileAmbientExternalModuleWithSingleExportedModule_1.ts, 0, 0)) + +export var x: SubModule.m.m3.c; +>x : Symbol(x, Decl(declFileAmbientExternalModuleWithSingleExportedModule_1.ts, 2, 10)) +>SubModule : Symbol(SubModule, Decl(declFileAmbientExternalModuleWithSingleExportedModule_1.ts, 0, 0)) +>m : Symbol(SubModule.m, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 1, 28)) +>m3 : Symbol(SubModule.m.m3, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 2, 21)) +>c : Symbol(SubModule.m.m3.c, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 3, 26)) + + +=== tests/cases/compiler/declFileAmbientExternalModuleWithSingleExportedModule_0.ts === + +declare module "SubModule" { + export module m { +>m : Symbol(m, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 1, 28)) + + export module m3 { +>m3 : Symbol(m3, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 2, 21)) + + interface c { +>c : Symbol(c, Decl(declFileAmbientExternalModuleWithSingleExportedModule_0.ts, 3, 26)) + } + } + } +} + diff --git a/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.types b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.types index 420f1550d7a..792f1f0282f 100644 --- a/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.types +++ b/tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.types @@ -5,9 +5,9 @@ import SubModule = require('SubModule'); export var x: SubModule.m.m3.c; >x : SubModule.m.m3.c ->SubModule : unknown ->m : unknown ->m3 : unknown +>SubModule : any +>m : any +>m3 : any >c : SubModule.m.m3.c @@ -15,10 +15,10 @@ export var x: SubModule.m.m3.c; declare module "SubModule" { export module m { ->m : unknown +>m : any export module m3 { ->m3 : unknown +>m3 : any interface c { >c : c diff --git a/tests/baselines/reference/declFileCallSignatures.symbols b/tests/baselines/reference/declFileCallSignatures.symbols new file mode 100644 index 00000000000..cf1697dc4c0 --- /dev/null +++ b/tests/baselines/reference/declFileCallSignatures.symbols @@ -0,0 +1,117 @@ +=== tests/cases/compiler/declFileCallSignatures_0.ts === + +export interface ICallSignature { +>ICallSignature : Symbol(ICallSignature, Decl(declFileCallSignatures_0.ts, 0, 0)) + + /** This comment should appear for foo*/ + (): string; +} + +export interface ICallSignatureWithParameters { +>ICallSignatureWithParameters : Symbol(ICallSignatureWithParameters, Decl(declFileCallSignatures_0.ts, 4, 1)) + + /** This is comment for function signature*/ + (/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 8, 5)) + + /** this is comment for b*/ + b: number): void; +>b : Symbol(b, Decl(declFileCallSignatures_0.ts, 8, 44)) +} + +export interface ICallSignatureWithRestParameters { +>ICallSignatureWithRestParameters : Symbol(ICallSignatureWithRestParameters, Decl(declFileCallSignatures_0.ts, 11, 1)) + + (a: string, ...rests: string[]): string; +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 14, 5)) +>rests : Symbol(rests, Decl(declFileCallSignatures_0.ts, 14, 15)) +} + +export interface ICallSignatureWithOverloads { +>ICallSignatureWithOverloads : Symbol(ICallSignatureWithOverloads, Decl(declFileCallSignatures_0.ts, 15, 1)) + + (a: string): string; +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 18, 5)) + + (a: number): number; +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 19, 5)) +} + +export interface ICallSignatureWithTypeParameters { +>ICallSignatureWithTypeParameters : Symbol(ICallSignatureWithTypeParameters, Decl(declFileCallSignatures_0.ts, 20, 1)) +>T : Symbol(T, Decl(declFileCallSignatures_0.ts, 22, 50)) + + /** This comment should appear for foo*/ + (a: T): string; +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 24, 5)) +>T : Symbol(T, Decl(declFileCallSignatures_0.ts, 22, 50)) +} + +export interface ICallSignatureWithOwnTypeParametes { +>ICallSignatureWithOwnTypeParametes : Symbol(ICallSignatureWithOwnTypeParametes, Decl(declFileCallSignatures_0.ts, 25, 1)) + + (a: T): string; +>T : Symbol(T, Decl(declFileCallSignatures_0.ts, 28, 5)) +>ICallSignature : Symbol(ICallSignature, Decl(declFileCallSignatures_0.ts, 0, 0)) +>a : Symbol(a, Decl(declFileCallSignatures_0.ts, 28, 31)) +>T : Symbol(T, Decl(declFileCallSignatures_0.ts, 28, 5)) +} + +=== tests/cases/compiler/declFileCallSignatures_1.ts === +interface IGlobalCallSignature { +>IGlobalCallSignature : Symbol(IGlobalCallSignature, Decl(declFileCallSignatures_1.ts, 0, 0)) + + /** This comment should appear for foo*/ + (): string; +} + +interface IGlobalCallSignatureWithParameters { +>IGlobalCallSignatureWithParameters : Symbol(IGlobalCallSignatureWithParameters, Decl(declFileCallSignatures_1.ts, 3, 1)) + + /** This is comment for function signature*/ + (/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 7, 5)) + + /** this is comment for b*/ + b: number): void; +>b : Symbol(b, Decl(declFileCallSignatures_1.ts, 7, 44)) +} + +interface IGlobalCallSignatureWithRestParameters { +>IGlobalCallSignatureWithRestParameters : Symbol(IGlobalCallSignatureWithRestParameters, Decl(declFileCallSignatures_1.ts, 10, 1)) + + (a: string, ...rests: string[]): string; +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 14, 5)) +>rests : Symbol(rests, Decl(declFileCallSignatures_1.ts, 14, 15)) + +} + +interface IGlobalCallSignatureWithOverloads { +>IGlobalCallSignatureWithOverloads : Symbol(IGlobalCallSignatureWithOverloads, Decl(declFileCallSignatures_1.ts, 16, 1)) + + (a: string): string; +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 19, 5)) + + (a: number): number; +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 20, 5)) +} + +interface IGlobalCallSignatureWithTypeParameters { +>IGlobalCallSignatureWithTypeParameters : Symbol(IGlobalCallSignatureWithTypeParameters, Decl(declFileCallSignatures_1.ts, 21, 1)) +>T : Symbol(T, Decl(declFileCallSignatures_1.ts, 23, 49)) + + /** This comment should appear for foo*/ + (a: T): string; +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 25, 5)) +>T : Symbol(T, Decl(declFileCallSignatures_1.ts, 23, 49)) +} + +interface IGlobalCallSignatureWithOwnTypeParametes { +>IGlobalCallSignatureWithOwnTypeParametes : Symbol(IGlobalCallSignatureWithOwnTypeParametes, Decl(declFileCallSignatures_1.ts, 26, 1)) + + (a: T): string; +>T : Symbol(T, Decl(declFileCallSignatures_1.ts, 29, 5)) +>IGlobalCallSignature : Symbol(IGlobalCallSignature, Decl(declFileCallSignatures_1.ts, 0, 0)) +>a : Symbol(a, Decl(declFileCallSignatures_1.ts, 29, 37)) +>T : Symbol(T, Decl(declFileCallSignatures_1.ts, 29, 5)) +} diff --git a/tests/baselines/reference/declFileClassWithIndexSignature.symbols b/tests/baselines/reference/declFileClassWithIndexSignature.symbols new file mode 100644 index 00000000000..2487a2fae00 --- /dev/null +++ b/tests/baselines/reference/declFileClassWithIndexSignature.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/declFileClassWithIndexSignature.ts === + +class BlockIntrinsics { +>BlockIntrinsics : Symbol(BlockIntrinsics, Decl(declFileClassWithIndexSignature.ts, 0, 0)) + + [s: string]: string; +>s : Symbol(s, Decl(declFileClassWithIndexSignature.ts, 2, 5)) +} diff --git a/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.symbols b/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.symbols new file mode 100644 index 00000000000..af1f56642bc --- /dev/null +++ b/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/declFileClassWithStaticMethodReturningConstructor.ts === + +export class Enhancement { +>Enhancement : Symbol(Enhancement, Decl(declFileClassWithStaticMethodReturningConstructor.ts, 0, 0)) + + public static getType() { +>getType : Symbol(Enhancement.getType, Decl(declFileClassWithStaticMethodReturningConstructor.ts, 1, 26)) + + return this; +>this : Symbol(Enhancement, Decl(declFileClassWithStaticMethodReturningConstructor.ts, 0, 0)) + } +} diff --git a/tests/baselines/reference/declFileConstructSignatures.symbols b/tests/baselines/reference/declFileConstructSignatures.symbols new file mode 100644 index 00000000000..a6d98f6feca --- /dev/null +++ b/tests/baselines/reference/declFileConstructSignatures.symbols @@ -0,0 +1,121 @@ +=== tests/cases/compiler/declFileConstructSignatures_0.ts === + +export interface IConstructSignature { +>IConstructSignature : Symbol(IConstructSignature, Decl(declFileConstructSignatures_0.ts, 0, 0)) + + /** This comment should appear for foo*/ + new (): string; +} + +export interface IConstructSignatureWithParameters { +>IConstructSignatureWithParameters : Symbol(IConstructSignatureWithParameters, Decl(declFileConstructSignatures_0.ts, 4, 1)) + + /** This is comment for function signature*/ + new (/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 8, 9)) + + /** this is comment for b*/ + b: number); +>b : Symbol(b, Decl(declFileConstructSignatures_0.ts, 8, 48)) +} + +export interface IConstructSignatureWithRestParameters { +>IConstructSignatureWithRestParameters : Symbol(IConstructSignatureWithRestParameters, Decl(declFileConstructSignatures_0.ts, 11, 1)) + + new (a: string, ...rests: string[]): string; +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 14, 9)) +>rests : Symbol(rests, Decl(declFileConstructSignatures_0.ts, 14, 19)) +} + +export interface IConstructSignatureWithOverloads { +>IConstructSignatureWithOverloads : Symbol(IConstructSignatureWithOverloads, Decl(declFileConstructSignatures_0.ts, 15, 1)) + + new (a: string): string; +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 18, 9)) + + new (a: number): number; +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 19, 9)) +} + +export interface IConstructSignatureWithTypeParameters { +>IConstructSignatureWithTypeParameters : Symbol(IConstructSignatureWithTypeParameters, Decl(declFileConstructSignatures_0.ts, 20, 1)) +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 22, 55)) + + /** This comment should appear for foo*/ + new (a: T): T; +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 24, 9)) +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 22, 55)) +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 22, 55)) +} + +export interface IConstructSignatureWithOwnTypeParametes { +>IConstructSignatureWithOwnTypeParametes : Symbol(IConstructSignatureWithOwnTypeParametes, Decl(declFileConstructSignatures_0.ts, 25, 1)) + + new (a: T): T; +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 28, 9)) +>IConstructSignature : Symbol(IConstructSignature, Decl(declFileConstructSignatures_0.ts, 0, 0)) +>a : Symbol(a, Decl(declFileConstructSignatures_0.ts, 28, 40)) +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 28, 9)) +>T : Symbol(T, Decl(declFileConstructSignatures_0.ts, 28, 9)) +} + +=== tests/cases/compiler/declFileConstructSignatures_1.ts === +interface IGlobalConstructSignature { +>IGlobalConstructSignature : Symbol(IGlobalConstructSignature, Decl(declFileConstructSignatures_1.ts, 0, 0)) + + /** This comment should appear for foo*/ + new (): string; +} + +interface IGlobalConstructSignatureWithParameters { +>IGlobalConstructSignatureWithParameters : Symbol(IGlobalConstructSignatureWithParameters, Decl(declFileConstructSignatures_1.ts, 3, 1)) + + /** This is comment for function signature*/ + new (/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 7, 9)) + + /** this is comment for b*/ + b: number); +>b : Symbol(b, Decl(declFileConstructSignatures_1.ts, 7, 48)) +} + +interface IGlobalConstructSignatureWithRestParameters { +>IGlobalConstructSignatureWithRestParameters : Symbol(IGlobalConstructSignatureWithRestParameters, Decl(declFileConstructSignatures_1.ts, 10, 1)) + + new (a: string, ...rests: string[]): string; +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 14, 9)) +>rests : Symbol(rests, Decl(declFileConstructSignatures_1.ts, 14, 19)) + +} + +interface IGlobalConstructSignatureWithOverloads { +>IGlobalConstructSignatureWithOverloads : Symbol(IGlobalConstructSignatureWithOverloads, Decl(declFileConstructSignatures_1.ts, 16, 1)) + + new (a: string): string; +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 19, 9)) + + new (a: number): number; +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 20, 9)) +} + +interface IGlobalConstructSignatureWithTypeParameters { +>IGlobalConstructSignatureWithTypeParameters : Symbol(IGlobalConstructSignatureWithTypeParameters, Decl(declFileConstructSignatures_1.ts, 21, 1)) +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 23, 54)) + + /** This comment should appear for foo*/ + new (a: T): T; +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 25, 9)) +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 23, 54)) +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 23, 54)) +} + +interface IGlobalConstructSignatureWithOwnTypeParametes { +>IGlobalConstructSignatureWithOwnTypeParametes : Symbol(IGlobalConstructSignatureWithOwnTypeParametes, Decl(declFileConstructSignatures_1.ts, 26, 1)) + + new (a: T): T; +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 29, 9)) +>IGlobalConstructSignature : Symbol(IGlobalConstructSignature, Decl(declFileConstructSignatures_1.ts, 0, 0)) +>a : Symbol(a, Decl(declFileConstructSignatures_1.ts, 29, 46)) +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 29, 9)) +>T : Symbol(T, Decl(declFileConstructSignatures_1.ts, 29, 9)) +} diff --git a/tests/baselines/reference/declFileConstructors.symbols b/tests/baselines/reference/declFileConstructors.symbols new file mode 100644 index 00000000000..bc8f349bb82 --- /dev/null +++ b/tests/baselines/reference/declFileConstructors.symbols @@ -0,0 +1,172 @@ +=== tests/cases/compiler/declFileConstructors_0.ts === + +export class SimpleConstructor { +>SimpleConstructor : Symbol(SimpleConstructor, Decl(declFileConstructors_0.ts, 0, 0)) + + /** This comment should appear for foo*/ + constructor() { + } +} +export class ConstructorWithParameters { +>ConstructorWithParameters : Symbol(ConstructorWithParameters, Decl(declFileConstructors_0.ts, 5, 1)) + + /** This is comment for function signature*/ + constructor(/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileConstructors_0.ts, 8, 16)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileConstructors_0.ts, 8, 55)) + + var d = a; +>d : Symbol(d, Decl(declFileConstructors_0.ts, 11, 11)) +>a : Symbol(a, Decl(declFileConstructors_0.ts, 8, 16)) + } +} + +export class ConstructorWithRestParamters { +>ConstructorWithRestParamters : Symbol(ConstructorWithRestParamters, Decl(declFileConstructors_0.ts, 13, 1)) + + constructor(a: string, ...rests: string[]) { +>a : Symbol(a, Decl(declFileConstructors_0.ts, 16, 16)) +>rests : Symbol(rests, Decl(declFileConstructors_0.ts, 16, 26)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileConstructors_0.ts, 16, 16)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileConstructors_0.ts, 16, 26)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } +} + +export class ConstructorWithOverloads { +>ConstructorWithOverloads : Symbol(ConstructorWithOverloads, Decl(declFileConstructors_0.ts, 19, 1)) + + constructor(a: string); +>a : Symbol(a, Decl(declFileConstructors_0.ts, 22, 16)) + + constructor(a: number); +>a : Symbol(a, Decl(declFileConstructors_0.ts, 23, 16)) + + constructor(a: any) { +>a : Symbol(a, Decl(declFileConstructors_0.ts, 24, 16)) + } +} + +export class ConstructorWithPublicParameterProperty { +>ConstructorWithPublicParameterProperty : Symbol(ConstructorWithPublicParameterProperty, Decl(declFileConstructors_0.ts, 26, 1)) + + constructor(public x: string) { +>x : Symbol(x, Decl(declFileConstructors_0.ts, 29, 16)) + } +} + +export class ConstructorWithPrivateParameterProperty { +>ConstructorWithPrivateParameterProperty : Symbol(ConstructorWithPrivateParameterProperty, Decl(declFileConstructors_0.ts, 31, 1)) + + constructor(private x: string) { +>x : Symbol(x, Decl(declFileConstructors_0.ts, 34, 16)) + } +} + +export class ConstructorWithOptionalParameterProperty { +>ConstructorWithOptionalParameterProperty : Symbol(ConstructorWithOptionalParameterProperty, Decl(declFileConstructors_0.ts, 36, 1)) + + constructor(public x?: string) { +>x : Symbol(x, Decl(declFileConstructors_0.ts, 39, 16)) + } +} + +export class ConstructorWithParameterInitializer { +>ConstructorWithParameterInitializer : Symbol(ConstructorWithParameterInitializer, Decl(declFileConstructors_0.ts, 41, 1)) + + constructor(public x = "hello") { +>x : Symbol(x, Decl(declFileConstructors_0.ts, 44, 16)) + } +} + +=== tests/cases/compiler/declFileConstructors_1.ts === +class GlobalSimpleConstructor { +>GlobalSimpleConstructor : Symbol(GlobalSimpleConstructor, Decl(declFileConstructors_1.ts, 0, 0)) + + /** This comment should appear for foo*/ + constructor() { + } +} +class GlobalConstructorWithParameters { +>GlobalConstructorWithParameters : Symbol(GlobalConstructorWithParameters, Decl(declFileConstructors_1.ts, 4, 1)) + + /** This is comment for function signature*/ + constructor(/** this is comment about a*/a: string, +>a : Symbol(a, Decl(declFileConstructors_1.ts, 7, 16)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileConstructors_1.ts, 7, 55)) + + var d = a; +>d : Symbol(d, Decl(declFileConstructors_1.ts, 10, 11)) +>a : Symbol(a, Decl(declFileConstructors_1.ts, 7, 16)) + } +} + +class GlobalConstructorWithRestParamters { +>GlobalConstructorWithRestParamters : Symbol(GlobalConstructorWithRestParamters, Decl(declFileConstructors_1.ts, 12, 1)) + + constructor(a: string, ...rests: string[]) { +>a : Symbol(a, Decl(declFileConstructors_1.ts, 15, 16)) +>rests : Symbol(rests, Decl(declFileConstructors_1.ts, 15, 26)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileConstructors_1.ts, 15, 16)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileConstructors_1.ts, 15, 26)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } +} + +class GlobalConstructorWithOverloads { +>GlobalConstructorWithOverloads : Symbol(GlobalConstructorWithOverloads, Decl(declFileConstructors_1.ts, 18, 1)) + + constructor(a: string); +>a : Symbol(a, Decl(declFileConstructors_1.ts, 21, 16)) + + constructor(a: number); +>a : Symbol(a, Decl(declFileConstructors_1.ts, 22, 16)) + + constructor(a: any) { +>a : Symbol(a, Decl(declFileConstructors_1.ts, 23, 16)) + } +} + +class GlobalConstructorWithPublicParameterProperty { +>GlobalConstructorWithPublicParameterProperty : Symbol(GlobalConstructorWithPublicParameterProperty, Decl(declFileConstructors_1.ts, 25, 1)) + + constructor(public x: string) { +>x : Symbol(x, Decl(declFileConstructors_1.ts, 28, 16)) + } +} + +class GlobalConstructorWithPrivateParameterProperty { +>GlobalConstructorWithPrivateParameterProperty : Symbol(GlobalConstructorWithPrivateParameterProperty, Decl(declFileConstructors_1.ts, 30, 1)) + + constructor(private x: string) { +>x : Symbol(x, Decl(declFileConstructors_1.ts, 33, 16)) + } +} + +class GlobalConstructorWithOptionalParameterProperty { +>GlobalConstructorWithOptionalParameterProperty : Symbol(GlobalConstructorWithOptionalParameterProperty, Decl(declFileConstructors_1.ts, 35, 1)) + + constructor(public x?: string) { +>x : Symbol(x, Decl(declFileConstructors_1.ts, 38, 16)) + } +} + +class GlobalConstructorWithParameterInitializer { +>GlobalConstructorWithParameterInitializer : Symbol(GlobalConstructorWithParameterInitializer, Decl(declFileConstructors_1.ts, 40, 1)) + + constructor(public x = "hello") { +>x : Symbol(x, Decl(declFileConstructors_1.ts, 43, 16)) + } +} diff --git a/tests/baselines/reference/declFileConstructors.types b/tests/baselines/reference/declFileConstructors.types index 723830bdeea..68782eb3617 100644 --- a/tests/baselines/reference/declFileConstructors.types +++ b/tests/baselines/reference/declFileConstructors.types @@ -38,6 +38,7 @@ export class ConstructorWithRestParamters { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } } @@ -84,6 +85,7 @@ export class ConstructorWithParameterInitializer { constructor(public x = "hello") { >x : string +>"hello" : string } } @@ -126,6 +128,7 @@ class GlobalConstructorWithRestParamters { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } } @@ -172,5 +175,6 @@ class GlobalConstructorWithParameterInitializer { constructor(public x = "hello") { >x : string +>"hello" : string } } diff --git a/tests/baselines/reference/declFileEnumUsedAsValue.symbols b/tests/baselines/reference/declFileEnumUsedAsValue.symbols new file mode 100644 index 00000000000..d24852c6260 --- /dev/null +++ b/tests/baselines/reference/declFileEnumUsedAsValue.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/declFileEnumUsedAsValue.ts === + +enum e { +>e : Symbol(e, Decl(declFileEnumUsedAsValue.ts, 0, 0)) + + a, +>a : Symbol(e.a, Decl(declFileEnumUsedAsValue.ts, 1, 8)) + + b, +>b : Symbol(e.b, Decl(declFileEnumUsedAsValue.ts, 2, 6)) + + c +>c : Symbol(e.c, Decl(declFileEnumUsedAsValue.ts, 3, 6)) +} +var x = e; +>x : Symbol(x, Decl(declFileEnumUsedAsValue.ts, 6, 3)) +>e : Symbol(e, Decl(declFileEnumUsedAsValue.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileEnums.symbols b/tests/baselines/reference/declFileEnums.symbols new file mode 100644 index 00000000000..22d5ee6bb63 --- /dev/null +++ b/tests/baselines/reference/declFileEnums.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/declFileEnums.ts === + +enum e1 { +>e1 : Symbol(e1, Decl(declFileEnums.ts, 0, 0)) + + a, +>a : Symbol(e1.a, Decl(declFileEnums.ts, 1, 9)) + + b, +>b : Symbol(e1.b, Decl(declFileEnums.ts, 2, 6)) + + c +>c : Symbol(e1.c, Decl(declFileEnums.ts, 3, 6)) +} + +enum e2 { +>e2 : Symbol(e2, Decl(declFileEnums.ts, 5, 1)) + + a = 10, +>a : Symbol(e2.a, Decl(declFileEnums.ts, 7, 9)) + + b = a + 2, +>b : Symbol(e2.b, Decl(declFileEnums.ts, 8, 11)) +>a : Symbol(e2.a, Decl(declFileEnums.ts, 7, 9)) + + c = 10, +>c : Symbol(e2.c, Decl(declFileEnums.ts, 9, 14)) +} + +enum e3 { +>e3 : Symbol(e3, Decl(declFileEnums.ts, 11, 1)) + + a = 10, +>a : Symbol(e3.a, Decl(declFileEnums.ts, 13, 9)) + + b = Math.PI, +>b : Symbol(e3.b, Decl(declFileEnums.ts, 14, 11)) +>Math.PI : Symbol(Math.PI, Decl(lib.d.ts, 534, 19)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>PI : Symbol(Math.PI, Decl(lib.d.ts, 534, 19)) + + c = a + 3 +>c : Symbol(e3.c, Decl(declFileEnums.ts, 15, 16)) +>a : Symbol(e3.a, Decl(declFileEnums.ts, 13, 9)) +} + +enum e4 { +>e4 : Symbol(e4, Decl(declFileEnums.ts, 17, 1)) + + a, +>a : Symbol(e4.a, Decl(declFileEnums.ts, 19, 9)) + + b, +>b : Symbol(e4.b, Decl(declFileEnums.ts, 20, 6)) + + c, +>c : Symbol(e4.c, Decl(declFileEnums.ts, 21, 6)) + + d = 10, +>d : Symbol(e4.d, Decl(declFileEnums.ts, 22, 6)) + + e +>e : Symbol(e4.e, Decl(declFileEnums.ts, 23, 11)) +} + +enum e5 { +>e5 : Symbol(e5, Decl(declFileEnums.ts, 25, 1)) + + "Friday", + "Saturday", + "Sunday", + "Weekend days" +} + + + diff --git a/tests/baselines/reference/declFileEnums.types b/tests/baselines/reference/declFileEnums.types index d4d7230e930..5fb0d0736be 100644 --- a/tests/baselines/reference/declFileEnums.types +++ b/tests/baselines/reference/declFileEnums.types @@ -18,14 +18,17 @@ enum e2 { a = 10, >a : e2 +>10 : number b = a + 2, >b : e2 >a + 2 : number >a : e2 +>2 : number c = 10, >c : e2 +>10 : number } enum e3 { @@ -33,6 +36,7 @@ enum e3 { a = 10, >a : e3 +>10 : number b = Math.PI, >b : e3 @@ -44,6 +48,7 @@ enum e3 { >c : e3 >a + 3 : number >a : e3 +>3 : number } enum e4 { @@ -60,6 +65,7 @@ enum e4 { d = 10, >d : e4 +>10 : number e >e : e4 diff --git a/tests/baselines/reference/declFileExportAssignmentImportInternalModule.symbols b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.symbols new file mode 100644 index 00000000000..5953d446478 --- /dev/null +++ b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.symbols @@ -0,0 +1,58 @@ +=== tests/cases/compiler/declFileExportAssignmentImportInternalModule.ts === +module m3 { +>m3 : Symbol(m3, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 0)) + + export module m2 { +>m2 : Symbol(m2, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 11)) + + export interface connectModule { +>connectModule : Symbol(connectModule, Decl(declFileExportAssignmentImportInternalModule.ts, 1, 22)) + + (res, req, next): void; +>res : Symbol(res, Decl(declFileExportAssignmentImportInternalModule.ts, 3, 13)) +>req : Symbol(req, Decl(declFileExportAssignmentImportInternalModule.ts, 3, 17)) +>next : Symbol(next, Decl(declFileExportAssignmentImportInternalModule.ts, 3, 22)) + } + export interface connectExport { +>connectExport : Symbol(connectExport, Decl(declFileExportAssignmentImportInternalModule.ts, 4, 9)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declFileExportAssignmentImportInternalModule.ts, 5, 40)) +>mod : Symbol(mod, Decl(declFileExportAssignmentImportInternalModule.ts, 6, 18)) +>connectModule : Symbol(connectModule, Decl(declFileExportAssignmentImportInternalModule.ts, 1, 22)) +>connectExport : Symbol(connectExport, Decl(declFileExportAssignmentImportInternalModule.ts, 4, 9)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declFileExportAssignmentImportInternalModule.ts, 6, 55)) +>port : Symbol(port, Decl(declFileExportAssignmentImportInternalModule.ts, 7, 21)) + } + + } + + export var server: { +>server : Symbol(server, Decl(declFileExportAssignmentImportInternalModule.ts, 12, 14)) + + (): m2.connectExport; +>m2 : Symbol(m2, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 11)) +>connectExport : Symbol(m2.connectExport, Decl(declFileExportAssignmentImportInternalModule.ts, 4, 9)) + + test1: m2.connectModule; +>test1 : Symbol(test1, Decl(declFileExportAssignmentImportInternalModule.ts, 13, 29)) +>m2 : Symbol(m2, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 11)) +>connectModule : Symbol(m2.connectModule, Decl(declFileExportAssignmentImportInternalModule.ts, 1, 22)) + + test2(): m2.connectModule; +>test2 : Symbol(test2, Decl(declFileExportAssignmentImportInternalModule.ts, 14, 32)) +>m2 : Symbol(m2, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 11)) +>connectModule : Symbol(m2.connectModule, Decl(declFileExportAssignmentImportInternalModule.ts, 1, 22)) + + }; +} + +import m = m3 +>m : Symbol(m, Decl(declFileExportAssignmentImportInternalModule.ts, 17, 1)) +>m3 : Symbol(m3, Decl(declFileExportAssignmentImportInternalModule.ts, 0, 0)) + +export = m; +>m : Symbol(m, Decl(declFileExportAssignmentImportInternalModule.ts, 17, 1)) + diff --git a/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types index e0bf172e584..6c3b7d82664 100644 --- a/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types +++ b/tests/baselines/reference/declFileExportAssignmentImportInternalModule.types @@ -3,7 +3,7 @@ module m3 { >m3 : typeof m3 export module m2 { ->m2 : unknown +>m2 : any export interface connectModule { >connectModule : connectModule @@ -33,17 +33,17 @@ module m3 { >server : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; ->m2 : unknown +>m2 : any >connectExport : m2.connectExport test1: m2.connectModule; >test1 : m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule test2(): m2.connectModule; >test2 : () => m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule }; diff --git a/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.symbols b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.symbols new file mode 100644 index 00000000000..d8801ff3fe3 --- /dev/null +++ b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/declFileExportAssignmentOfGenericInterface_1.ts === +import a = require('declFileExportAssignmentOfGenericInterface_0'); +>a : Symbol(a, Decl(declFileExportAssignmentOfGenericInterface_1.ts, 0, 0)) + +export var x: a>; +>x : Symbol(x, Decl(declFileExportAssignmentOfGenericInterface_1.ts, 1, 10)) +>a : Symbol(a, Decl(declFileExportAssignmentOfGenericInterface_1.ts, 0, 0)) +>a : Symbol(a, Decl(declFileExportAssignmentOfGenericInterface_1.ts, 0, 0)) + +x.a; +>x.a : Symbol(a.a, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 1, 18)) +>x : Symbol(x, Decl(declFileExportAssignmentOfGenericInterface_1.ts, 1, 10)) +>a : Symbol(a.a, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 1, 18)) + +=== tests/cases/compiler/declFileExportAssignmentOfGenericInterface_0.ts === + +interface Foo { +>Foo : Symbol(Foo, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 0, 0)) +>T : Symbol(T, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 1, 14)) + + a: string; +>a : Symbol(a, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 1, 18)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(declFileExportAssignmentOfGenericInterface_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.types b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.types index 1d77f8ee7a3..59c604540b9 100644 --- a/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.types +++ b/tests/baselines/reference/declFileExportAssignmentOfGenericInterface.types @@ -1,6 +1,6 @@ === tests/cases/compiler/declFileExportAssignmentOfGenericInterface_1.ts === import a = require('declFileExportAssignmentOfGenericInterface_0'); ->a : unknown +>a : any export var x: a>; >x : a> diff --git a/tests/baselines/reference/declFileExportImportChain.symbols b/tests/baselines/reference/declFileExportImportChain.symbols new file mode 100644 index 00000000000..6e59fa2c167 --- /dev/null +++ b/tests/baselines/reference/declFileExportImportChain.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/declFileExportImportChain_d.ts === +import c = require("declFileExportImportChain_c"); +>c : Symbol(c, Decl(declFileExportImportChain_d.ts, 0, 0)) + +export var x: c.b1.a.m2.c1; +>x : Symbol(x, Decl(declFileExportImportChain_d.ts, 1, 10)) +>c : Symbol(c, Decl(declFileExportImportChain_d.ts, 0, 0)) +>b1 : Symbol(c.b1, Decl(declFileExportImportChain_c.ts, 0, 0)) +>a : Symbol(c.b1.a, Decl(declFileExportImportChain_b.ts, 0, 0)) +>m2 : Symbol(c.b1.a.m2, Decl(declFileExportImportChain_a.ts, 1, 11)) +>c1 : Symbol(c.b1.a.m2.c1, Decl(declFileExportImportChain_a.ts, 2, 22)) + +=== tests/cases/compiler/declFileExportImportChain_a.ts === + +module m1 { +>m1 : Symbol(m1, Decl(declFileExportImportChain_a.ts, 0, 0)) + + export module m2 { +>m2 : Symbol(m2, Decl(declFileExportImportChain_a.ts, 1, 11)) + + export class c1 { +>c1 : Symbol(c1, Decl(declFileExportImportChain_a.ts, 2, 22)) + } + } +} +export = m1; +>m1 : Symbol(m1, Decl(declFileExportImportChain_a.ts, 0, 0)) + +=== tests/cases/compiler/declFileExportImportChain_b.ts === +export import a = require("declFileExportImportChain_a"); +>a : Symbol(a, Decl(declFileExportImportChain_b.ts, 0, 0)) + +=== tests/cases/compiler/declFileExportImportChain_b1.ts === +import b = require("declFileExportImportChain_b"); +>b : Symbol(b, Decl(declFileExportImportChain_b1.ts, 0, 0)) + +export = b; +>b : Symbol(b, Decl(declFileExportImportChain_b1.ts, 0, 0)) + +=== tests/cases/compiler/declFileExportImportChain_c.ts === +export import b1 = require("declFileExportImportChain_b1"); +>b1 : Symbol(b1, Decl(declFileExportImportChain_c.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileExportImportChain.types b/tests/baselines/reference/declFileExportImportChain.types index df71d32d4d9..f9601adb147 100644 --- a/tests/baselines/reference/declFileExportImportChain.types +++ b/tests/baselines/reference/declFileExportImportChain.types @@ -4,10 +4,10 @@ import c = require("declFileExportImportChain_c"); export var x: c.b1.a.m2.c1; >x : c.b1.a.m2.c1 ->c : unknown ->b1 : unknown ->a : unknown ->m2 : unknown +>c : any +>b1 : any +>a : any +>m2 : any >c1 : c.b1.a.m2.c1 === tests/cases/compiler/declFileExportImportChain_a.ts === diff --git a/tests/baselines/reference/declFileExportImportChain2.symbols b/tests/baselines/reference/declFileExportImportChain2.symbols new file mode 100644 index 00000000000..e5a80c87f9e --- /dev/null +++ b/tests/baselines/reference/declFileExportImportChain2.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/declFileExportImportChain2_d.ts === +import c = require("declFileExportImportChain2_c"); +>c : Symbol(c, Decl(declFileExportImportChain2_d.ts, 0, 0)) + +export var x: c.b.m2.c1; +>x : Symbol(x, Decl(declFileExportImportChain2_d.ts, 1, 10)) +>c : Symbol(c, Decl(declFileExportImportChain2_d.ts, 0, 0)) +>b : Symbol(c.b, Decl(declFileExportImportChain2_c.ts, 0, 0)) +>m2 : Symbol(c.b.m2, Decl(declFileExportImportChain2_a.ts, 1, 11)) +>c1 : Symbol(c.b.m2.c1, Decl(declFileExportImportChain2_a.ts, 2, 22)) + +=== tests/cases/compiler/declFileExportImportChain2_a.ts === + +module m1 { +>m1 : Symbol(m1, Decl(declFileExportImportChain2_a.ts, 0, 0)) + + export module m2 { +>m2 : Symbol(m2, Decl(declFileExportImportChain2_a.ts, 1, 11)) + + export class c1 { +>c1 : Symbol(c1, Decl(declFileExportImportChain2_a.ts, 2, 22)) + } + } +} +export = m1; +>m1 : Symbol(m1, Decl(declFileExportImportChain2_a.ts, 0, 0)) + +=== tests/cases/compiler/declFileExportImportChain2_b.ts === +import a = require("declFileExportImportChain2_a"); +>a : Symbol(a, Decl(declFileExportImportChain2_b.ts, 0, 0)) + +export = a; +>a : Symbol(a, Decl(declFileExportImportChain2_b.ts, 0, 0)) + +=== tests/cases/compiler/declFileExportImportChain2_c.ts === +export import b = require("declFileExportImportChain2_b"); +>b : Symbol(b, Decl(declFileExportImportChain2_c.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileExportImportChain2.types b/tests/baselines/reference/declFileExportImportChain2.types index a0e3f1c31a1..9c583180404 100644 --- a/tests/baselines/reference/declFileExportImportChain2.types +++ b/tests/baselines/reference/declFileExportImportChain2.types @@ -4,9 +4,9 @@ import c = require("declFileExportImportChain2_c"); export var x: c.b.m2.c1; >x : c.b.m2.c1 ->c : unknown ->b : unknown ->m2 : unknown +>c : any +>b : any +>m2 : any >c1 : c.b.m2.c1 === tests/cases/compiler/declFileExportImportChain2_a.ts === diff --git a/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.symbols b/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.symbols new file mode 100644 index 00000000000..e20542996b2 --- /dev/null +++ b/tests/baselines/reference/declFileForClassWithMultipleBaseClasses.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/declFileForClassWithMultipleBaseClasses.ts === + +class A { +>A : Symbol(A, Decl(declFileForClassWithMultipleBaseClasses.ts, 0, 0)) + + foo() { } +>foo : Symbol(foo, Decl(declFileForClassWithMultipleBaseClasses.ts, 1, 9)) +} + +class B { +>B : Symbol(B, Decl(declFileForClassWithMultipleBaseClasses.ts, 3, 1)) + + bar() { } +>bar : Symbol(bar, Decl(declFileForClassWithMultipleBaseClasses.ts, 5, 9)) +} + +interface I { +>I : Symbol(I, Decl(declFileForClassWithMultipleBaseClasses.ts, 7, 1), Decl(declFileForClassWithMultipleBaseClasses.ts, 23, 1)) + + baz(); +>baz : Symbol(baz, Decl(declFileForClassWithMultipleBaseClasses.ts, 9, 13)) +} + +interface J { +>J : Symbol(J, Decl(declFileForClassWithMultipleBaseClasses.ts, 11, 1)) + + bat(); +>bat : Symbol(bat, Decl(declFileForClassWithMultipleBaseClasses.ts, 13, 13)) +} + + +class D implements I, J { +>D : Symbol(D, Decl(declFileForClassWithMultipleBaseClasses.ts, 15, 1)) +>I : Symbol(I, Decl(declFileForClassWithMultipleBaseClasses.ts, 7, 1), Decl(declFileForClassWithMultipleBaseClasses.ts, 23, 1)) +>J : Symbol(J, Decl(declFileForClassWithMultipleBaseClasses.ts, 11, 1)) + + baz() { } +>baz : Symbol(baz, Decl(declFileForClassWithMultipleBaseClasses.ts, 18, 25)) + + bat() { } +>bat : Symbol(bat, Decl(declFileForClassWithMultipleBaseClasses.ts, 19, 13)) + + foo() { } +>foo : Symbol(foo, Decl(declFileForClassWithMultipleBaseClasses.ts, 20, 13)) + + bar() { } +>bar : Symbol(bar, Decl(declFileForClassWithMultipleBaseClasses.ts, 21, 13)) +} + +interface I extends A, B { +>I : Symbol(I, Decl(declFileForClassWithMultipleBaseClasses.ts, 7, 1), Decl(declFileForClassWithMultipleBaseClasses.ts, 23, 1)) +>A : Symbol(A, Decl(declFileForClassWithMultipleBaseClasses.ts, 0, 0)) +>B : Symbol(B, Decl(declFileForClassWithMultipleBaseClasses.ts, 3, 1)) +} diff --git a/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.symbols b/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.symbols new file mode 100644 index 00000000000..f28a8c2bfc7 --- /dev/null +++ b/tests/baselines/reference/declFileForClassWithPrivateOverloadedFunction.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/declFileForClassWithPrivateOverloadedFunction.ts === + +class C { +>C : Symbol(C, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 0, 0)) + + private foo(x: number); +>foo : Symbol(foo, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 1, 9), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 2, 27), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 3, 27)) +>x : Symbol(x, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 2, 16)) + + private foo(x: string); +>foo : Symbol(foo, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 1, 9), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 2, 27), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 3, 27)) +>x : Symbol(x, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 3, 16)) + + private foo(x: any) { } +>foo : Symbol(foo, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 1, 9), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 2, 27), Decl(declFileForClassWithPrivateOverloadedFunction.ts, 3, 27)) +>x : Symbol(x, Decl(declFileForClassWithPrivateOverloadedFunction.ts, 4, 16)) +} diff --git a/tests/baselines/reference/declFileForExportedImport.symbols b/tests/baselines/reference/declFileForExportedImport.symbols new file mode 100644 index 00000000000..fb7b7cd343f --- /dev/null +++ b/tests/baselines/reference/declFileForExportedImport.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/declFileForExportedImport_1.ts === +/// +export import a = require('declFileForExportedImport_0'); +>a : Symbol(a, Decl(declFileForExportedImport_1.ts, 0, 0)) + +var y = a.x; +>y : Symbol(y, Decl(declFileForExportedImport_1.ts, 2, 3)) +>a.x : Symbol(a.x, Decl(declFileForExportedImport_0.ts, 0, 10)) +>a : Symbol(a, Decl(declFileForExportedImport_1.ts, 0, 0)) +>x : Symbol(a.x, Decl(declFileForExportedImport_0.ts, 0, 10)) + +export import b = a; +>b : Symbol(b, Decl(declFileForExportedImport_1.ts, 2, 12)) +>a : Symbol(a, Decl(declFileForExportedImport_0.ts, 0, 0)) + +var z = b.x; +>z : Symbol(z, Decl(declFileForExportedImport_1.ts, 5, 3)) +>b.x : Symbol(a.x, Decl(declFileForExportedImport_0.ts, 0, 10)) +>b : Symbol(b, Decl(declFileForExportedImport_1.ts, 2, 12)) +>x : Symbol(a.x, Decl(declFileForExportedImport_0.ts, 0, 10)) + +=== tests/cases/compiler/declFileForExportedImport_0.ts === +export var x: number; +>x : Symbol(x, Decl(declFileForExportedImport_0.ts, 0, 10)) + diff --git a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.symbols b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.symbols new file mode 100644 index 00000000000..329363ec364 --- /dev/null +++ b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/declFileForFunctionTypeAsTypeParameter.ts === + +class X { +>X : Symbol(X, Decl(declFileForFunctionTypeAsTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(declFileForFunctionTypeAsTypeParameter.ts, 1, 8)) +} +class C extends X<() => number> { +>C : Symbol(C, Decl(declFileForFunctionTypeAsTypeParameter.ts, 2, 1)) +>X : Symbol(X, Decl(declFileForFunctionTypeAsTypeParameter.ts, 0, 0)) +} +interface I extends X<() => number> { +>I : Symbol(I, Decl(declFileForFunctionTypeAsTypeParameter.ts, 4, 1)) +>X : Symbol(X, Decl(declFileForFunctionTypeAsTypeParameter.ts, 0, 0)) +} + + diff --git a/tests/baselines/reference/declFileForInterfaceWithOptionalFunction.symbols b/tests/baselines/reference/declFileForInterfaceWithOptionalFunction.symbols new file mode 100644 index 00000000000..bcec395c80d --- /dev/null +++ b/tests/baselines/reference/declFileForInterfaceWithOptionalFunction.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/declFileForInterfaceWithOptionalFunction.ts === + +interface I { +>I : Symbol(I, Decl(declFileForInterfaceWithOptionalFunction.ts, 0, 0)) + + foo? (x?); +>foo : Symbol(foo, Decl(declFileForInterfaceWithOptionalFunction.ts, 1, 13)) +>x : Symbol(x, Decl(declFileForInterfaceWithOptionalFunction.ts, 2, 10)) + + foo2? (x?: number): number; +>foo2 : Symbol(foo2, Decl(declFileForInterfaceWithOptionalFunction.ts, 2, 14)) +>x : Symbol(x, Decl(declFileForInterfaceWithOptionalFunction.ts, 3, 11)) +} diff --git a/tests/baselines/reference/declFileForInterfaceWithRestParams.symbols b/tests/baselines/reference/declFileForInterfaceWithRestParams.symbols new file mode 100644 index 00000000000..9a0fb4a71da --- /dev/null +++ b/tests/baselines/reference/declFileForInterfaceWithRestParams.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/declFileForInterfaceWithRestParams.ts === + +interface I { +>I : Symbol(I, Decl(declFileForInterfaceWithRestParams.ts, 0, 0)) + + foo(...x): typeof x; +>foo : Symbol(foo, Decl(declFileForInterfaceWithRestParams.ts, 1, 13)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 2, 8)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 2, 8)) + + foo2(a: number, ...x): typeof x; +>foo2 : Symbol(foo2, Decl(declFileForInterfaceWithRestParams.ts, 2, 24)) +>a : Symbol(a, Decl(declFileForInterfaceWithRestParams.ts, 3, 9)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 3, 19)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 3, 19)) + + foo3(b: string, ...x: string[]): typeof x; +>foo3 : Symbol(foo3, Decl(declFileForInterfaceWithRestParams.ts, 3, 36)) +>b : Symbol(b, Decl(declFileForInterfaceWithRestParams.ts, 4, 9)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 4, 19)) +>x : Symbol(x, Decl(declFileForInterfaceWithRestParams.ts, 4, 19)) +} diff --git a/tests/baselines/reference/declFileForTypeParameters.symbols b/tests/baselines/reference/declFileForTypeParameters.symbols new file mode 100644 index 00000000000..41c567d89df --- /dev/null +++ b/tests/baselines/reference/declFileForTypeParameters.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/declFileForTypeParameters.ts === + +class C { +>C : Symbol(C, Decl(declFileForTypeParameters.ts, 0, 0)) +>T : Symbol(T, Decl(declFileForTypeParameters.ts, 1, 8)) + + x: T; +>x : Symbol(x, Decl(declFileForTypeParameters.ts, 1, 12)) +>T : Symbol(T, Decl(declFileForTypeParameters.ts, 1, 8)) + + foo(a: T): T { +>foo : Symbol(foo, Decl(declFileForTypeParameters.ts, 2, 9)) +>a : Symbol(a, Decl(declFileForTypeParameters.ts, 3, 8)) +>T : Symbol(T, Decl(declFileForTypeParameters.ts, 1, 8)) +>T : Symbol(T, Decl(declFileForTypeParameters.ts, 1, 8)) + + return this.x; +>this.x : Symbol(x, Decl(declFileForTypeParameters.ts, 1, 12)) +>this : Symbol(C, Decl(declFileForTypeParameters.ts, 0, 0)) +>x : Symbol(x, Decl(declFileForTypeParameters.ts, 1, 12)) + } +} diff --git a/tests/baselines/reference/declFileForVarList.symbols b/tests/baselines/reference/declFileForVarList.symbols new file mode 100644 index 00000000000..9e2fdd3ac6b --- /dev/null +++ b/tests/baselines/reference/declFileForVarList.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/declFileForVarList.ts === + +var x, y, z = 1; +>x : Symbol(x, Decl(declFileForVarList.ts, 1, 3)) +>y : Symbol(y, Decl(declFileForVarList.ts, 1, 6)) +>z : Symbol(z, Decl(declFileForVarList.ts, 1, 9)) + +var x1 = 1, y2 = 2, z2 = 3; +>x1 : Symbol(x1, Decl(declFileForVarList.ts, 2, 3)) +>y2 : Symbol(y2, Decl(declFileForVarList.ts, 2, 11)) +>z2 : Symbol(z2, Decl(declFileForVarList.ts, 2, 19)) + diff --git a/tests/baselines/reference/declFileForVarList.types b/tests/baselines/reference/declFileForVarList.types index 6e148efa1c2..5e55104666b 100644 --- a/tests/baselines/reference/declFileForVarList.types +++ b/tests/baselines/reference/declFileForVarList.types @@ -4,9 +4,13 @@ var x, y, z = 1; >x : any >y : any >z : number +>1 : number var x1 = 1, y2 = 2, z2 = 3; >x1 : number +>1 : number >y2 : number +>2 : number >z2 : number +>3 : number diff --git a/tests/baselines/reference/declFileFunctions.symbols b/tests/baselines/reference/declFileFunctions.symbols new file mode 100644 index 00000000000..ff04d211557 --- /dev/null +++ b/tests/baselines/reference/declFileFunctions.symbols @@ -0,0 +1,148 @@ +=== tests/cases/compiler/declFileFunctions_0.ts === + +/** This comment should appear for foo*/ +export function foo() { +>foo : Symbol(foo, Decl(declFileFunctions_0.ts, 0, 0)) +} +/** This is comment for function signature*/ +export function fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(declFileFunctions_0.ts, 3, 1)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 5, 34)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileFunctions_0.ts, 5, 73)) + + var d = a; +>d : Symbol(d, Decl(declFileFunctions_0.ts, 8, 7)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 5, 34)) +} +export function fooWithRestParameters(a: string, ...rests: string[]) { +>fooWithRestParameters : Symbol(fooWithRestParameters, Decl(declFileFunctions_0.ts, 9, 1)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 10, 38)) +>rests : Symbol(rests, Decl(declFileFunctions_0.ts, 10, 48)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileFunctions_0.ts, 10, 38)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileFunctions_0.ts, 10, 48)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +} + +export function fooWithOverloads(a: string): string; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileFunctions_0.ts, 12, 1), Decl(declFileFunctions_0.ts, 14, 52), Decl(declFileFunctions_0.ts, 15, 52)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 14, 33)) + +export function fooWithOverloads(a: number): number; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileFunctions_0.ts, 12, 1), Decl(declFileFunctions_0.ts, 14, 52), Decl(declFileFunctions_0.ts, 15, 52)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 15, 33)) + +export function fooWithOverloads(a: any): any { +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileFunctions_0.ts, 12, 1), Decl(declFileFunctions_0.ts, 14, 52), Decl(declFileFunctions_0.ts, 15, 52)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 16, 33)) + + return a; +>a : Symbol(a, Decl(declFileFunctions_0.ts, 16, 33)) +} + +export function fooWithSingleOverload(a: string): string; +>fooWithSingleOverload : Symbol(fooWithSingleOverload, Decl(declFileFunctions_0.ts, 18, 1), Decl(declFileFunctions_0.ts, 20, 57)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 20, 38)) + +export function fooWithSingleOverload(a: any) { +>fooWithSingleOverload : Symbol(fooWithSingleOverload, Decl(declFileFunctions_0.ts, 18, 1), Decl(declFileFunctions_0.ts, 20, 57)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 21, 38)) + + return a; +>a : Symbol(a, Decl(declFileFunctions_0.ts, 21, 38)) +} + +/** This comment should appear for nonExportedFoo*/ +function nonExportedFoo() { +>nonExportedFoo : Symbol(nonExportedFoo, Decl(declFileFunctions_0.ts, 23, 1)) +} +/** This is comment for function signature*/ +function nonExportedFooWithParameters(/** this is comment about a*/a: string, +>nonExportedFooWithParameters : Symbol(nonExportedFooWithParameters, Decl(declFileFunctions_0.ts, 27, 1)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 29, 38)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileFunctions_0.ts, 29, 77)) + + var d = a; +>d : Symbol(d, Decl(declFileFunctions_0.ts, 32, 7)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 29, 38)) +} +function nonExportedFooWithRestParameters(a: string, ...rests: string[]) { +>nonExportedFooWithRestParameters : Symbol(nonExportedFooWithRestParameters, Decl(declFileFunctions_0.ts, 33, 1)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 34, 42)) +>rests : Symbol(rests, Decl(declFileFunctions_0.ts, 34, 52)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileFunctions_0.ts, 34, 42)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileFunctions_0.ts, 34, 52)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +} + +function nonExportedFooWithOverloads(a: string): string; +>nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 36, 1), Decl(declFileFunctions_0.ts, 38, 56), Decl(declFileFunctions_0.ts, 39, 56)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 38, 37)) + +function nonExportedFooWithOverloads(a: number): number; +>nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 36, 1), Decl(declFileFunctions_0.ts, 38, 56), Decl(declFileFunctions_0.ts, 39, 56)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 39, 37)) + +function nonExportedFooWithOverloads(a: any): any { +>nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 36, 1), Decl(declFileFunctions_0.ts, 38, 56), Decl(declFileFunctions_0.ts, 39, 56)) +>a : Symbol(a, Decl(declFileFunctions_0.ts, 40, 37)) + + return a; +>a : Symbol(a, Decl(declFileFunctions_0.ts, 40, 37)) +} + +=== tests/cases/compiler/declFileFunctions_1.ts === +/** This comment should appear for foo*/ +function globalfoo() { +>globalfoo : Symbol(globalfoo, Decl(declFileFunctions_1.ts, 0, 0)) +} +/** This is comment for function signature*/ +function globalfooWithParameters(/** this is comment about a*/a: string, +>globalfooWithParameters : Symbol(globalfooWithParameters, Decl(declFileFunctions_1.ts, 2, 1)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 4, 33)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileFunctions_1.ts, 4, 72)) + + var d = a; +>d : Symbol(d, Decl(declFileFunctions_1.ts, 7, 7)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 4, 33)) +} +function globalfooWithRestParameters(a: string, ...rests: string[]) { +>globalfooWithRestParameters : Symbol(globalfooWithRestParameters, Decl(declFileFunctions_1.ts, 8, 1)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 9, 37)) +>rests : Symbol(rests, Decl(declFileFunctions_1.ts, 9, 47)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileFunctions_1.ts, 9, 37)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileFunctions_1.ts, 9, 47)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +} +function globalfooWithOverloads(a: string): string; +>globalfooWithOverloads : Symbol(globalfooWithOverloads, Decl(declFileFunctions_1.ts, 11, 1), Decl(declFileFunctions_1.ts, 12, 51), Decl(declFileFunctions_1.ts, 13, 51)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 12, 32)) + +function globalfooWithOverloads(a: number): number; +>globalfooWithOverloads : Symbol(globalfooWithOverloads, Decl(declFileFunctions_1.ts, 11, 1), Decl(declFileFunctions_1.ts, 12, 51), Decl(declFileFunctions_1.ts, 13, 51)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 13, 32)) + +function globalfooWithOverloads(a: any): any { +>globalfooWithOverloads : Symbol(globalfooWithOverloads, Decl(declFileFunctions_1.ts, 11, 1), Decl(declFileFunctions_1.ts, 12, 51), Decl(declFileFunctions_1.ts, 13, 51)) +>a : Symbol(a, Decl(declFileFunctions_1.ts, 14, 32)) + + return a; +>a : Symbol(a, Decl(declFileFunctions_1.ts, 14, 32)) +} diff --git a/tests/baselines/reference/declFileFunctions.types b/tests/baselines/reference/declFileFunctions.types index bfbe658a758..b9e94f7ffcd 100644 --- a/tests/baselines/reference/declFileFunctions.types +++ b/tests/baselines/reference/declFileFunctions.types @@ -29,6 +29,7 @@ export function fooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } export function fooWithOverloads(a: string): string; @@ -88,6 +89,7 @@ function nonExportedFooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } function nonExportedFooWithOverloads(a: string): string; @@ -136,6 +138,7 @@ function globalfooWithRestParameters(a: string, ...rests: string[]) { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } function globalfooWithOverloads(a: string): string; >globalfooWithOverloads : { (a: string): string; (a: number): number; } diff --git a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.symbols b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.symbols new file mode 100644 index 00000000000..c732a6ad233 --- /dev/null +++ b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/declFileGenericClassWithGenericExtendedClass.ts === +interface IFoo { +>IFoo : Symbol(IFoo, Decl(declFileGenericClassWithGenericExtendedClass.ts, 0, 0)) + + baz: Baz; +>baz : Symbol(baz, Decl(declFileGenericClassWithGenericExtendedClass.ts, 0, 16)) +>Baz : Symbol(Baz, Decl(declFileGenericClassWithGenericExtendedClass.ts, 7, 1)) +} +class Base { } +>Base : Symbol(Base, Decl(declFileGenericClassWithGenericExtendedClass.ts, 2, 1)) +>T : Symbol(T, Decl(declFileGenericClassWithGenericExtendedClass.ts, 3, 11)) + +class Derived extends Base { } +>Derived : Symbol(Derived, Decl(declFileGenericClassWithGenericExtendedClass.ts, 3, 17)) +>T : Symbol(T, Decl(declFileGenericClassWithGenericExtendedClass.ts, 4, 14)) +>Base : Symbol(Base, Decl(declFileGenericClassWithGenericExtendedClass.ts, 2, 1)) +>T : Symbol(T, Decl(declFileGenericClassWithGenericExtendedClass.ts, 4, 14)) + +interface IBar { +>IBar : Symbol(IBar, Decl(declFileGenericClassWithGenericExtendedClass.ts, 4, 36)) +>T : Symbol(T, Decl(declFileGenericClassWithGenericExtendedClass.ts, 5, 15)) + + derived: Derived; +>derived : Symbol(derived, Decl(declFileGenericClassWithGenericExtendedClass.ts, 5, 19)) +>Derived : Symbol(Derived, Decl(declFileGenericClassWithGenericExtendedClass.ts, 3, 17)) +>T : Symbol(T, Decl(declFileGenericClassWithGenericExtendedClass.ts, 5, 15)) +} +class Baz implements IBar { +>Baz : Symbol(Baz, Decl(declFileGenericClassWithGenericExtendedClass.ts, 7, 1)) +>IBar : Symbol(IBar, Decl(declFileGenericClassWithGenericExtendedClass.ts, 4, 36)) +>Baz : Symbol(Baz, Decl(declFileGenericClassWithGenericExtendedClass.ts, 7, 1)) + + derived: Derived; +>derived : Symbol(derived, Decl(declFileGenericClassWithGenericExtendedClass.ts, 8, 32)) +>Derived : Symbol(Derived, Decl(declFileGenericClassWithGenericExtendedClass.ts, 3, 17)) +>Baz : Symbol(Baz, Decl(declFileGenericClassWithGenericExtendedClass.ts, 7, 1)) +} + diff --git a/tests/baselines/reference/declFileGenericType.symbols b/tests/baselines/reference/declFileGenericType.symbols new file mode 100644 index 00000000000..38460fcb143 --- /dev/null +++ b/tests/baselines/reference/declFileGenericType.symbols @@ -0,0 +1,165 @@ +=== tests/cases/compiler/declFileGenericType.ts === +export module C { +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) + + export class A{ } +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>T : Symbol(T, Decl(declFileGenericType.ts, 1, 19)) + + export class B { } +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) + + export function F(x: T): A { return null; } +>F : Symbol(F, Decl(declFileGenericType.ts, 2, 22)) +>T : Symbol(T, Decl(declFileGenericType.ts, 4, 22)) +>x : Symbol(x, Decl(declFileGenericType.ts, 4, 25)) +>T : Symbol(T, Decl(declFileGenericType.ts, 4, 22)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) + + export function F2(x: T): C.A { return null; } +>F2 : Symbol(F2, Decl(declFileGenericType.ts, 4, 53)) +>T : Symbol(T, Decl(declFileGenericType.ts, 5, 23)) +>x : Symbol(x, Decl(declFileGenericType.ts, 5, 26)) +>T : Symbol(T, Decl(declFileGenericType.ts, 5, 23)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) + + export function F3(x: T): C.A[] { return null; } +>F3 : Symbol(F3, Decl(declFileGenericType.ts, 5, 58)) +>T : Symbol(T, Decl(declFileGenericType.ts, 6, 23)) +>x : Symbol(x, Decl(declFileGenericType.ts, 6, 26)) +>T : Symbol(T, Decl(declFileGenericType.ts, 6, 23)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) + + export function F4>(x: T): Array> { return null; } +>F4 : Symbol(F4, Decl(declFileGenericType.ts, 6, 60)) +>T : Symbol(T, Decl(declFileGenericType.ts, 7, 23)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) +>x : Symbol(x, Decl(declFileGenericType.ts, 7, 39)) +>T : Symbol(T, Decl(declFileGenericType.ts, 7, 23)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) + + export function F5(): T { return null; } +>F5 : Symbol(F5, Decl(declFileGenericType.ts, 7, 78)) +>T : Symbol(T, Decl(declFileGenericType.ts, 9, 23)) +>T : Symbol(T, Decl(declFileGenericType.ts, 9, 23)) + + export function F6>(x: T): T { return null; } +>F6 : Symbol(F6, Decl(declFileGenericType.ts, 9, 47)) +>T : Symbol(T, Decl(declFileGenericType.ts, 11, 23)) +>A : Symbol(A, Decl(declFileGenericType.ts, 0, 17)) +>B : Symbol(B, Decl(declFileGenericType.ts, 1, 24)) +>x : Symbol(x, Decl(declFileGenericType.ts, 11, 39)) +>T : Symbol(T, Decl(declFileGenericType.ts, 11, 23)) +>T : Symbol(T, Decl(declFileGenericType.ts, 11, 23)) + + export class D{ +>D : Symbol(D, Decl(declFileGenericType.ts, 11, 64)) +>T : Symbol(T, Decl(declFileGenericType.ts, 13, 19)) + + constructor(public val: T) { } +>val : Symbol(val, Decl(declFileGenericType.ts, 15, 20)) +>T : Symbol(T, Decl(declFileGenericType.ts, 13, 19)) + + } +} + +export var a: C.A; +>a : Symbol(a, Decl(declFileGenericType.ts, 20, 10)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) + +export var b = C.F; +>b : Symbol(b, Decl(declFileGenericType.ts, 22, 10)) +>C.F : Symbol(C.F, Decl(declFileGenericType.ts, 2, 22)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F : Symbol(C.F, Decl(declFileGenericType.ts, 2, 22)) + +export var c = C.F2; +>c : Symbol(c, Decl(declFileGenericType.ts, 23, 10)) +>C.F2 : Symbol(C.F2, Decl(declFileGenericType.ts, 4, 53)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F2 : Symbol(C.F2, Decl(declFileGenericType.ts, 4, 53)) + +export var d = C.F3; +>d : Symbol(d, Decl(declFileGenericType.ts, 24, 10)) +>C.F3 : Symbol(C.F3, Decl(declFileGenericType.ts, 5, 58)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F3 : Symbol(C.F3, Decl(declFileGenericType.ts, 5, 58)) + +export var e = C.F4; +>e : Symbol(e, Decl(declFileGenericType.ts, 25, 10)) +>C.F4 : Symbol(C.F4, Decl(declFileGenericType.ts, 6, 60)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F4 : Symbol(C.F4, Decl(declFileGenericType.ts, 6, 60)) + +export var x = (new C.D>(new C.A())).val; +>x : Symbol(x, Decl(declFileGenericType.ts, 27, 10)) +>(new C.D>(new C.A())).val : Symbol(C.D.val, Decl(declFileGenericType.ts, 15, 20)) +>C.D : Symbol(C.D, Decl(declFileGenericType.ts, 11, 64)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>D : Symbol(C.D, Decl(declFileGenericType.ts, 11, 64)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) +>C.A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) +>val : Symbol(C.D.val, Decl(declFileGenericType.ts, 15, 20)) + +export function f>() { } +>f : Symbol(f, Decl(declFileGenericType.ts, 27, 55)) +>T : Symbol(T, Decl(declFileGenericType.ts, 29, 18)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) + +export var g = C.F5>(); +>g : Symbol(g, Decl(declFileGenericType.ts, 31, 10)) +>C.F5 : Symbol(C.F5, Decl(declFileGenericType.ts, 7, 78)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F5 : Symbol(C.F5, Decl(declFileGenericType.ts, 7, 78)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) + +export class h extends C.A{ } +>h : Symbol(h, Decl(declFileGenericType.ts, 31, 32)) +>C.A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) + +export interface i extends C.A { } +>i : Symbol(i, Decl(declFileGenericType.ts, 33, 34)) +>C.A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>A : Symbol(C.A, Decl(declFileGenericType.ts, 0, 17)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>B : Symbol(C.B, Decl(declFileGenericType.ts, 1, 24)) + +export var j = C.F6; +>j : Symbol(j, Decl(declFileGenericType.ts, 37, 10)) +>C.F6 : Symbol(C.F6, Decl(declFileGenericType.ts, 9, 47)) +>C : Symbol(C, Decl(declFileGenericType.ts, 0, 0)) +>F6 : Symbol(C.F6, Decl(declFileGenericType.ts, 9, 47)) + diff --git a/tests/baselines/reference/declFileGenericType.types b/tests/baselines/reference/declFileGenericType.types index 50026cc3aeb..7aa20187890 100644 --- a/tests/baselines/reference/declFileGenericType.types +++ b/tests/baselines/reference/declFileGenericType.types @@ -16,26 +16,29 @@ export module C { >T : T >A : A >B : B +>null : null export function F2(x: T): C.A { return null; } >F2 : (x: T) => A >T : T >x : T >T : T ->C : unknown +>C : any >A : A ->C : unknown +>C : any >B : B +>null : null export function F3(x: T): C.A[] { return null; } >F3 : (x: T) => A[] >T : T >x : T >T : T ->C : unknown +>C : any >A : A ->C : unknown +>C : any >B : B +>null : null export function F4>(x: T): Array> { return null; } >F4 : >(x: T) => A[] @@ -45,15 +48,17 @@ export module C { >x : T >T : T >Array : T[] ->C : unknown +>C : any >A : A ->C : unknown +>C : any >B : B +>null : null export function F5(): T { return null; } >F5 : () => T >T : T >T : T +>null : null export function F6>(x: T): T { return null; } >F6 : >(x: T) => T @@ -63,6 +68,7 @@ export module C { >x : T >T : T >T : T +>null : null export class D{ >D : D @@ -77,9 +83,9 @@ export module C { export var a: C.A; >a : C.A ->C : unknown +>C : any >A : C.A ->C : unknown +>C : any >B : C.B export var b = C.F; @@ -114,24 +120,24 @@ export var x = (new C.D>(new C.A())).val; >C.D : typeof C.D >C : typeof C >D : typeof C.D ->C : unknown +>C : any >A : C.A ->C : unknown +>C : any >B : C.B >new C.A() : C.A >C.A : typeof C.A >C : typeof C >A : typeof C.A ->C : unknown +>C : any >B : C.B >val : C.A export function f>() { } >f : >() => void >T : T ->C : unknown +>C : any >A : C.A ->C : unknown +>C : any >B : C.B export var g = C.F5>(); @@ -140,23 +146,25 @@ export var g = C.F5>(); >C.F5 : () => T >C : typeof C >F5 : () => T ->C : unknown +>C : any >A : C.A ->C : unknown +>C : any >B : C.B export class h extends C.A{ } >h : h +>C.A : any >C : typeof C >A : C.A ->C : unknown +>C : any >B : C.B export interface i extends C.A { } >i : i +>C.A : any >C : typeof C >A : C.A ->C : unknown +>C : any >B : C.B export var j = C.F6; diff --git a/tests/baselines/reference/declFileGenericType2.symbols b/tests/baselines/reference/declFileGenericType2.symbols new file mode 100644 index 00000000000..fa1b63a2ac4 --- /dev/null +++ b/tests/baselines/reference/declFileGenericType2.symbols @@ -0,0 +1,147 @@ +=== tests/cases/compiler/declFileGenericType2.ts === + +declare module templa.mvc { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) + + interface IModel { +>IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) + } +} +declare module templa.mvc { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) + + interface IController { +>IController : Symbol(IController, Decl(declFileGenericType2.ts, 5, 27)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 6, 26)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) + } +} +declare module templa.mvc { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) + + class AbstractController implements mvc.IController { +>AbstractController : Symbol(AbstractController, Decl(declFileGenericType2.ts, 9, 27)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 10, 29)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) +>mvc.IController : Symbol(IController, Decl(declFileGenericType2.ts, 5, 27)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IController : Symbol(IController, Decl(declFileGenericType2.ts, 5, 27)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 10, 29)) + } +} +declare module templa.mvc.composite { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>composite : Symbol(composite, Decl(declFileGenericType2.ts, 13, 26)) + + interface ICompositeControllerModel extends mvc.IModel { +>ICompositeControllerModel : Symbol(ICompositeControllerModel, Decl(declFileGenericType2.ts, 13, 37)) +>mvc.IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) + + getControllers(): mvc.IController[]; +>getControllers : Symbol(getControllers, Decl(declFileGenericType2.ts, 14, 60)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IController : Symbol(IController, Decl(declFileGenericType2.ts, 5, 27)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(IModel, Decl(declFileGenericType2.ts, 1, 27)) + } +} +module templa.dom.mvc { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>dom : Symbol(dom, Decl(declFileGenericType2.ts, 18, 14), Decl(declFileGenericType2.ts, 23, 14), Decl(declFileGenericType2.ts, 32, 14)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 18, 18), Decl(declFileGenericType2.ts, 23, 18), Decl(declFileGenericType2.ts, 32, 18)) + + export interface IElementController extends templa.mvc.IController { +>IElementController : Symbol(IElementController, Decl(declFileGenericType2.ts, 18, 23)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 19, 40)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(templa.mvc.IModel, Decl(declFileGenericType2.ts, 1, 27)) +>templa.mvc.IController : Symbol(templa.mvc.IController, Decl(declFileGenericType2.ts, 5, 27)) +>templa.mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IController : Symbol(templa.mvc.IController, Decl(declFileGenericType2.ts, 5, 27)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 19, 40)) + } +} +// Module +module templa.dom.mvc { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>dom : Symbol(dom, Decl(declFileGenericType2.ts, 18, 14), Decl(declFileGenericType2.ts, 23, 14), Decl(declFileGenericType2.ts, 32, 14)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 18, 18), Decl(declFileGenericType2.ts, 23, 18), Decl(declFileGenericType2.ts, 32, 18)) + + export class AbstractElementController extends templa.mvc.AbstractController implements IElementController { +>AbstractElementController : Symbol(AbstractElementController, Decl(declFileGenericType2.ts, 23, 23)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 25, 43)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(templa.mvc.IModel, Decl(declFileGenericType2.ts, 1, 27)) +>templa.mvc.AbstractController : Symbol(templa.mvc.AbstractController, Decl(declFileGenericType2.ts, 9, 27)) +>templa.mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>AbstractController : Symbol(templa.mvc.AbstractController, Decl(declFileGenericType2.ts, 9, 27)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 25, 43)) +>IElementController : Symbol(IElementController, Decl(declFileGenericType2.ts, 18, 23)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 25, 43)) + + constructor() { + super(); +>super : Symbol(templa.mvc.AbstractController, Decl(declFileGenericType2.ts, 9, 27)) + } + } +} +// Module +module templa.dom.mvc.composite { +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>dom : Symbol(dom, Decl(declFileGenericType2.ts, 18, 14), Decl(declFileGenericType2.ts, 23, 14), Decl(declFileGenericType2.ts, 32, 14)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 18, 18), Decl(declFileGenericType2.ts, 23, 18), Decl(declFileGenericType2.ts, 32, 18)) +>composite : Symbol(composite, Decl(declFileGenericType2.ts, 32, 22)) + + export class AbstractCompositeElementController extends templa.dom.mvc.AbstractElementController { +>AbstractCompositeElementController : Symbol(AbstractCompositeElementController, Decl(declFileGenericType2.ts, 32, 33)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 33, 52)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>composite : Symbol(templa.mvc.composite, Decl(declFileGenericType2.ts, 13, 26)) +>ICompositeControllerModel : Symbol(templa.mvc.composite.ICompositeControllerModel, Decl(declFileGenericType2.ts, 13, 37)) +>templa.dom.mvc.AbstractElementController : Symbol(AbstractElementController, Decl(declFileGenericType2.ts, 23, 23)) +>templa.dom.mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 18, 18), Decl(declFileGenericType2.ts, 23, 18), Decl(declFileGenericType2.ts, 32, 18)) +>templa.dom : Symbol(dom, Decl(declFileGenericType2.ts, 18, 14), Decl(declFileGenericType2.ts, 23, 14), Decl(declFileGenericType2.ts, 32, 14)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>dom : Symbol(dom, Decl(declFileGenericType2.ts, 18, 14), Decl(declFileGenericType2.ts, 23, 14), Decl(declFileGenericType2.ts, 32, 14)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 18, 18), Decl(declFileGenericType2.ts, 23, 18), Decl(declFileGenericType2.ts, 32, 18)) +>AbstractElementController : Symbol(AbstractElementController, Decl(declFileGenericType2.ts, 23, 23)) +>ModelType : Symbol(ModelType, Decl(declFileGenericType2.ts, 33, 52)) + + public _controllers: templa.mvc.IController[]; +>_controllers : Symbol(_controllers, Decl(declFileGenericType2.ts, 33, 179)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IController : Symbol(templa.mvc.IController, Decl(declFileGenericType2.ts, 5, 27)) +>templa : Symbol(templa, Decl(declFileGenericType2.ts, 0, 0), Decl(declFileGenericType2.ts, 4, 1), Decl(declFileGenericType2.ts, 8, 1), Decl(declFileGenericType2.ts, 12, 1), Decl(declFileGenericType2.ts, 17, 1), Decl(declFileGenericType2.ts, 21, 1), Decl(declFileGenericType2.ts, 30, 1)) +>mvc : Symbol(mvc, Decl(declFileGenericType2.ts, 1, 22), Decl(declFileGenericType2.ts, 5, 22), Decl(declFileGenericType2.ts, 9, 22), Decl(declFileGenericType2.ts, 13, 22)) +>IModel : Symbol(templa.mvc.IModel, Decl(declFileGenericType2.ts, 1, 27)) + + constructor() { + super(); +>super : Symbol(AbstractElementController, Decl(declFileGenericType2.ts, 23, 23)) + + this._controllers = []; +>this._controllers : Symbol(_controllers, Decl(declFileGenericType2.ts, 33, 179)) +>this : Symbol(AbstractCompositeElementController, Decl(declFileGenericType2.ts, 32, 33)) +>_controllers : Symbol(_controllers, Decl(declFileGenericType2.ts, 33, 179)) + } + } +} + diff --git a/tests/baselines/reference/declFileGenericType2.types b/tests/baselines/reference/declFileGenericType2.types index fed2caca7ac..e1e1aa0bbfb 100644 --- a/tests/baselines/reference/declFileGenericType2.types +++ b/tests/baselines/reference/declFileGenericType2.types @@ -15,8 +15,8 @@ declare module templa.mvc { interface IController { >IController : IController >ModelType : ModelType ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IModel : IModel } } @@ -27,9 +27,10 @@ declare module templa.mvc { class AbstractController implements mvc.IController { >AbstractController : AbstractController >ModelType : ModelType ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IModel : IModel +>mvc.IController : any >mvc : typeof mvc >IController : IController >ModelType : ModelType @@ -38,18 +39,19 @@ declare module templa.mvc { declare module templa.mvc.composite { >templa : typeof templa >mvc : typeof mvc ->composite : unknown +>composite : any interface ICompositeControllerModel extends mvc.IModel { >ICompositeControllerModel : ICompositeControllerModel +>mvc.IModel : any >mvc : typeof mvc >IModel : IModel getControllers(): mvc.IController[]; >getControllers : () => IController[] ->mvc : unknown +>mvc : any >IController : IController ->mvc : unknown +>mvc : any >IModel : IModel } } @@ -61,9 +63,11 @@ module templa.dom.mvc { export interface IElementController extends templa.mvc.IController { >IElementController : IElementController >ModelType : ModelType ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IModel : templa.mvc.IModel +>templa.mvc.IController : any +>templa.mvc : typeof templa.mvc >templa : typeof templa >mvc : typeof templa.mvc >IController : templa.mvc.IController @@ -79,9 +83,11 @@ module templa.dom.mvc { export class AbstractElementController extends templa.mvc.AbstractController implements IElementController { >AbstractElementController : AbstractElementController >ModelType : ModelType ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IModel : templa.mvc.IModel +>templa.mvc.AbstractController : any +>templa.mvc : typeof templa.mvc >templa : typeof templa >mvc : typeof templa.mvc >AbstractController : templa.mvc.AbstractController @@ -106,10 +112,13 @@ module templa.dom.mvc.composite { export class AbstractCompositeElementController extends templa.dom.mvc.AbstractElementController { >AbstractCompositeElementController : AbstractCompositeElementController >ModelType : ModelType ->templa : unknown ->mvc : unknown ->composite : unknown +>templa : any +>mvc : any +>composite : any >ICompositeControllerModel : templa.mvc.composite.ICompositeControllerModel +>templa.dom.mvc.AbstractElementController : any +>templa.dom.mvc : typeof mvc +>templa.dom : typeof dom >templa : typeof templa >dom : typeof dom >mvc : typeof mvc @@ -118,11 +127,11 @@ module templa.dom.mvc.composite { public _controllers: templa.mvc.IController[]; >_controllers : templa.mvc.IController[] ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IController : templa.mvc.IController ->templa : unknown ->mvc : unknown +>templa : any +>mvc : any >IModel : templa.mvc.IModel constructor() { diff --git a/tests/baselines/reference/declFileImportChainInExportAssignment.symbols b/tests/baselines/reference/declFileImportChainInExportAssignment.symbols new file mode 100644 index 00000000000..12e05bed75a --- /dev/null +++ b/tests/baselines/reference/declFileImportChainInExportAssignment.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/declFileImportChainInExportAssignment.ts === +module m { +>m : Symbol(m, Decl(declFileImportChainInExportAssignment.ts, 0, 0)) + + export module c { +>c : Symbol(c, Decl(declFileImportChainInExportAssignment.ts, 0, 10)) + + export class c { +>c : Symbol(c, Decl(declFileImportChainInExportAssignment.ts, 1, 21)) + } + } +} +import a = m.c; +>a : Symbol(a, Decl(declFileImportChainInExportAssignment.ts, 5, 1)) +>m : Symbol(m, Decl(declFileImportChainInExportAssignment.ts, 0, 0)) +>c : Symbol(a, Decl(declFileImportChainInExportAssignment.ts, 0, 10)) + +import b = a; +>b : Symbol(b, Decl(declFileImportChainInExportAssignment.ts, 6, 15)) +>a : Symbol(a, Decl(declFileImportChainInExportAssignment.ts, 0, 10)) + +export = b; +>b : Symbol(b, Decl(declFileImportChainInExportAssignment.ts, 6, 15)) + diff --git a/tests/baselines/reference/declFileImportModuleWithExportAssignment.symbols b/tests/baselines/reference/declFileImportModuleWithExportAssignment.symbols new file mode 100644 index 00000000000..62d9d599939 --- /dev/null +++ b/tests/baselines/reference/declFileImportModuleWithExportAssignment.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileImportModuleWithExportAssignment_1.ts === +/**This is on import declaration*/ +import a1 = require("declFileImportModuleWithExportAssignment_0"); +>a1 : Symbol(a1, Decl(declFileImportModuleWithExportAssignment_1.ts, 0, 0)) + +export var a = a1; +>a : Symbol(a, Decl(declFileImportModuleWithExportAssignment_1.ts, 2, 10)) +>a1 : Symbol(a1, Decl(declFileImportModuleWithExportAssignment_1.ts, 0, 0)) + +a.test1(null, null, null); +>a.test1 : Symbol(test1, Decl(declFileImportModuleWithExportAssignment_0.ts, 12, 25)) +>a : Symbol(a, Decl(declFileImportModuleWithExportAssignment_1.ts, 2, 10)) +>test1 : Symbol(test1, Decl(declFileImportModuleWithExportAssignment_0.ts, 12, 25)) + +=== tests/cases/compiler/declFileImportModuleWithExportAssignment_0.ts === + +module m2 { +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) + + export interface connectModule { +>connectModule : Symbol(connectModule, Decl(declFileImportModuleWithExportAssignment_0.ts, 1, 11)) + + (res, req, next): void; +>res : Symbol(res, Decl(declFileImportModuleWithExportAssignment_0.ts, 3, 9)) +>req : Symbol(req, Decl(declFileImportModuleWithExportAssignment_0.ts, 3, 13)) +>next : Symbol(next, Decl(declFileImportModuleWithExportAssignment_0.ts, 3, 18)) + } + export interface connectExport { +>connectExport : Symbol(connectExport, Decl(declFileImportModuleWithExportAssignment_0.ts, 4, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declFileImportModuleWithExportAssignment_0.ts, 5, 36)) +>mod : Symbol(mod, Decl(declFileImportModuleWithExportAssignment_0.ts, 6, 14)) +>connectModule : Symbol(connectModule, Decl(declFileImportModuleWithExportAssignment_0.ts, 1, 11)) +>connectExport : Symbol(connectExport, Decl(declFileImportModuleWithExportAssignment_0.ts, 4, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declFileImportModuleWithExportAssignment_0.ts, 6, 51)) +>port : Symbol(port, Decl(declFileImportModuleWithExportAssignment_0.ts, 7, 17)) + } + +} +var m2: { +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) + + (): m2.connectExport; +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) +>connectExport : Symbol(m2.connectExport, Decl(declFileImportModuleWithExportAssignment_0.ts, 4, 5)) + + test1: m2.connectModule; +>test1 : Symbol(test1, Decl(declFileImportModuleWithExportAssignment_0.ts, 12, 25)) +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) +>connectModule : Symbol(m2.connectModule, Decl(declFileImportModuleWithExportAssignment_0.ts, 1, 11)) + + test2(): m2.connectModule; +>test2 : Symbol(test2, Decl(declFileImportModuleWithExportAssignment_0.ts, 13, 28)) +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) +>connectModule : Symbol(m2.connectModule, Decl(declFileImportModuleWithExportAssignment_0.ts, 1, 11)) + +}; +export = m2; +>m2 : Symbol(m2, Decl(declFileImportModuleWithExportAssignment_0.ts, 0, 0), Decl(declFileImportModuleWithExportAssignment_0.ts, 11, 3)) + diff --git a/tests/baselines/reference/declFileImportModuleWithExportAssignment.types b/tests/baselines/reference/declFileImportModuleWithExportAssignment.types index 15201baa487..d3082311c1d 100644 --- a/tests/baselines/reference/declFileImportModuleWithExportAssignment.types +++ b/tests/baselines/reference/declFileImportModuleWithExportAssignment.types @@ -12,6 +12,9 @@ a.test1(null, null, null); >a.test1 : a1.connectModule >a : { (): a1.connectExport; test1: a1.connectModule; test2(): a1.connectModule; } >test1 : a1.connectModule +>null : null +>null : null +>null : null === tests/cases/compiler/declFileImportModuleWithExportAssignment_0.ts === @@ -45,17 +48,17 @@ var m2: { >m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; ->m2 : unknown +>m2 : any >connectExport : m2.connectExport test1: m2.connectModule; >test1 : m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule test2(): m2.connectModule; >test2 : () => m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule }; diff --git a/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.symbols b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.symbols new file mode 100644 index 00000000000..9efd94c029e --- /dev/null +++ b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/declFileImportedTypeUseInTypeArgPosition.ts === +class List { } +>List : Symbol(List, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 0, 0)) +>T : Symbol(T, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 0, 11)) + +declare module 'mod1' { + class Foo { +>Foo : Symbol(Foo, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 1, 23)) + } +} + +declare module 'moo' { + import x = require('mod1'); +>x : Symbol(x, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 6, 22)) + + export var p: List; +>p : Symbol(p, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 8, 14)) +>List : Symbol(List, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 0, 0)) +>x : Symbol(x, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 6, 22)) +>Foo : Symbol(x.Foo, Decl(declFileImportedTypeUseInTypeArgPosition.ts, 1, 23)) +} + + + diff --git a/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.types b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.types index f5d443d0c57..317f071efc0 100644 --- a/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.types +++ b/tests/baselines/reference/declFileImportedTypeUseInTypeArgPosition.types @@ -16,7 +16,7 @@ declare module 'moo' { export var p: List; >p : List >List : List ->x : unknown +>x : any >Foo : x.Foo } diff --git a/tests/baselines/reference/declFileIndexSignatures.symbols b/tests/baselines/reference/declFileIndexSignatures.symbols new file mode 100644 index 00000000000..e89cfc79b0d --- /dev/null +++ b/tests/baselines/reference/declFileIndexSignatures.symbols @@ -0,0 +1,66 @@ +=== tests/cases/compiler/declFileIndexSignatures_0.ts === + +export interface IStringIndexSignature { +>IStringIndexSignature : Symbol(IStringIndexSignature, Decl(declFileIndexSignatures_0.ts, 0, 0)) + + [s: string]: string; +>s : Symbol(s, Decl(declFileIndexSignatures_0.ts, 2, 5)) +} +export interface INumberIndexSignature { +>INumberIndexSignature : Symbol(INumberIndexSignature, Decl(declFileIndexSignatures_0.ts, 3, 1)) + + [n: number]: number; +>n : Symbol(n, Decl(declFileIndexSignatures_0.ts, 5, 5)) +} + +export interface IBothIndexSignature { +>IBothIndexSignature : Symbol(IBothIndexSignature, Decl(declFileIndexSignatures_0.ts, 6, 1)) + + [s: string]: any; +>s : Symbol(s, Decl(declFileIndexSignatures_0.ts, 9, 5)) + + [n: number]: number; +>n : Symbol(n, Decl(declFileIndexSignatures_0.ts, 10, 5)) +} + +export interface IIndexSignatureWithTypeParameter { +>IIndexSignatureWithTypeParameter : Symbol(IIndexSignatureWithTypeParameter, Decl(declFileIndexSignatures_0.ts, 11, 1)) +>T : Symbol(T, Decl(declFileIndexSignatures_0.ts, 13, 50)) + + [a: string]: T; +>a : Symbol(a, Decl(declFileIndexSignatures_0.ts, 14, 5)) +>T : Symbol(T, Decl(declFileIndexSignatures_0.ts, 13, 50)) +} + +=== tests/cases/compiler/declFileIndexSignatures_1.ts === +interface IGlobalStringIndexSignature { +>IGlobalStringIndexSignature : Symbol(IGlobalStringIndexSignature, Decl(declFileIndexSignatures_1.ts, 0, 0)) + + [s: string]: string; +>s : Symbol(s, Decl(declFileIndexSignatures_1.ts, 1, 5)) +} +interface IGlobalNumberIndexSignature { +>IGlobalNumberIndexSignature : Symbol(IGlobalNumberIndexSignature, Decl(declFileIndexSignatures_1.ts, 2, 1)) + + [n: number]: number; +>n : Symbol(n, Decl(declFileIndexSignatures_1.ts, 4, 5)) +} + +interface IGlobalBothIndexSignature { +>IGlobalBothIndexSignature : Symbol(IGlobalBothIndexSignature, Decl(declFileIndexSignatures_1.ts, 5, 1)) + + [s: string]: any; +>s : Symbol(s, Decl(declFileIndexSignatures_1.ts, 8, 5)) + + [n: number]: number; +>n : Symbol(n, Decl(declFileIndexSignatures_1.ts, 9, 5)) +} + +interface IGlobalIndexSignatureWithTypeParameter { +>IGlobalIndexSignatureWithTypeParameter : Symbol(IGlobalIndexSignatureWithTypeParameter, Decl(declFileIndexSignatures_1.ts, 10, 1)) +>T : Symbol(T, Decl(declFileIndexSignatures_1.ts, 12, 49)) + + [a: string]: T; +>a : Symbol(a, Decl(declFileIndexSignatures_1.ts, 13, 5)) +>T : Symbol(T, Decl(declFileIndexSignatures_1.ts, 12, 49)) +} diff --git a/tests/baselines/reference/declFileInternalAliases.symbols b/tests/baselines/reference/declFileInternalAliases.symbols new file mode 100644 index 00000000000..b41c09a7548 --- /dev/null +++ b/tests/baselines/reference/declFileInternalAliases.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/declFileInternalAliases.ts === +module m { +>m : Symbol(m, Decl(declFileInternalAliases.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(declFileInternalAliases.ts, 0, 10)) + } +} +module m1 { +>m1 : Symbol(m1, Decl(declFileInternalAliases.ts, 3, 1)) + + import x = m.c; +>x : Symbol(x, Decl(declFileInternalAliases.ts, 4, 11)) +>m : Symbol(m, Decl(declFileInternalAliases.ts, 0, 0)) +>c : Symbol(x, Decl(declFileInternalAliases.ts, 0, 10)) + + export var d = new x(); // emit the type as m.c +>d : Symbol(d, Decl(declFileInternalAliases.ts, 6, 14)) +>x : Symbol(x, Decl(declFileInternalAliases.ts, 4, 11)) +} +module m2 { +>m2 : Symbol(m2, Decl(declFileInternalAliases.ts, 7, 1)) + + export import x = m.c; +>x : Symbol(x, Decl(declFileInternalAliases.ts, 8, 11)) +>m : Symbol(m, Decl(declFileInternalAliases.ts, 0, 0)) +>c : Symbol(x, Decl(declFileInternalAliases.ts, 0, 10)) + + export var d = new x(); // emit the type as x +>d : Symbol(d, Decl(declFileInternalAliases.ts, 10, 14)) +>x : Symbol(x, Decl(declFileInternalAliases.ts, 8, 11)) +} diff --git a/tests/baselines/reference/declFileMethods.symbols b/tests/baselines/reference/declFileMethods.symbols new file mode 100644 index 00000000000..f0426e46026 --- /dev/null +++ b/tests/baselines/reference/declFileMethods.symbols @@ -0,0 +1,431 @@ +=== tests/cases/compiler/declFileMethods_0.ts === + +export class c1 { +>c1 : Symbol(c1, Decl(declFileMethods_0.ts, 0, 0)) + + /** This comment should appear for foo*/ + public foo() { +>foo : Symbol(foo, Decl(declFileMethods_0.ts, 1, 17)) + } + /** This is comment for function signature*/ + public fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(declFileMethods_0.ts, 4, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 6, 29)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_0.ts, 6, 68)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_0.ts, 9, 11)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 6, 29)) + } + public fooWithRestParameters(a: string, ...rests: string[]) { +>fooWithRestParameters : Symbol(fooWithRestParameters, Decl(declFileMethods_0.ts, 10, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 11, 33)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 11, 43)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_0.ts, 11, 33)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 11, 43)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + + public fooWithOverloads(a: string): string; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_0.ts, 13, 5), Decl(declFileMethods_0.ts, 15, 47), Decl(declFileMethods_0.ts, 16, 47)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 15, 28)) + + public fooWithOverloads(a: number): number; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_0.ts, 13, 5), Decl(declFileMethods_0.ts, 15, 47), Decl(declFileMethods_0.ts, 16, 47)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 16, 28)) + + public fooWithOverloads(a: any): any { +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_0.ts, 13, 5), Decl(declFileMethods_0.ts, 15, 47), Decl(declFileMethods_0.ts, 16, 47)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 17, 28)) + + return a; +>a : Symbol(a, Decl(declFileMethods_0.ts, 17, 28)) + } + + + /** This comment should appear for privateFoo*/ + private privateFoo() { +>privateFoo : Symbol(privateFoo, Decl(declFileMethods_0.ts, 19, 5)) + } + /** This is comment for function signature*/ + private privateFooWithParameters(/** this is comment about a*/a: string, +>privateFooWithParameters : Symbol(privateFooWithParameters, Decl(declFileMethods_0.ts, 24, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 26, 37)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_0.ts, 26, 76)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_0.ts, 29, 11)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 26, 37)) + } + private privateFooWithRestParameters(a: string, ...rests: string[]) { +>privateFooWithRestParameters : Symbol(privateFooWithRestParameters, Decl(declFileMethods_0.ts, 30, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 31, 41)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 31, 51)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_0.ts, 31, 41)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 31, 51)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + private privateFooWithOverloads(a: string): string; +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_0.ts, 33, 5), Decl(declFileMethods_0.ts, 34, 55), Decl(declFileMethods_0.ts, 35, 55)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 34, 36)) + + private privateFooWithOverloads(a: number): number; +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_0.ts, 33, 5), Decl(declFileMethods_0.ts, 34, 55), Decl(declFileMethods_0.ts, 35, 55)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 35, 36)) + + private privateFooWithOverloads(a: any): any { +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_0.ts, 33, 5), Decl(declFileMethods_0.ts, 34, 55), Decl(declFileMethods_0.ts, 35, 55)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 36, 36)) + + return a; +>a : Symbol(a, Decl(declFileMethods_0.ts, 36, 36)) + } + + + /** This comment should appear for static foo*/ + static staticFoo() { +>staticFoo : Symbol(c1.staticFoo, Decl(declFileMethods_0.ts, 38, 5)) + } + /** This is comment for function signature*/ + static staticFooWithParameters(/** this is comment about a*/a: string, +>staticFooWithParameters : Symbol(c1.staticFooWithParameters, Decl(declFileMethods_0.ts, 43, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 45, 35)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_0.ts, 45, 74)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_0.ts, 48, 11)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 45, 35)) + } + static staticFooWithRestParameters(a: string, ...rests: string[]) { +>staticFooWithRestParameters : Symbol(c1.staticFooWithRestParameters, Decl(declFileMethods_0.ts, 49, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 50, 39)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 50, 49)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_0.ts, 50, 39)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 50, 49)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + static staticFooWithOverloads(a: string): string; +>staticFooWithOverloads : Symbol(c1.staticFooWithOverloads, Decl(declFileMethods_0.ts, 52, 5), Decl(declFileMethods_0.ts, 53, 53), Decl(declFileMethods_0.ts, 54, 53)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 53, 34)) + + static staticFooWithOverloads(a: number): number; +>staticFooWithOverloads : Symbol(c1.staticFooWithOverloads, Decl(declFileMethods_0.ts, 52, 5), Decl(declFileMethods_0.ts, 53, 53), Decl(declFileMethods_0.ts, 54, 53)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 54, 34)) + + static staticFooWithOverloads(a: any): any { +>staticFooWithOverloads : Symbol(c1.staticFooWithOverloads, Decl(declFileMethods_0.ts, 52, 5), Decl(declFileMethods_0.ts, 53, 53), Decl(declFileMethods_0.ts, 54, 53)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 55, 34)) + + return a; +>a : Symbol(a, Decl(declFileMethods_0.ts, 55, 34)) + } + + + /** This comment should appear for privateStaticFoo*/ + private static privateStaticFoo() { +>privateStaticFoo : Symbol(c1.privateStaticFoo, Decl(declFileMethods_0.ts, 57, 5)) + } + /** This is comment for function signature*/ + private static privateStaticFooWithParameters(/** this is comment about a*/a: string, +>privateStaticFooWithParameters : Symbol(c1.privateStaticFooWithParameters, Decl(declFileMethods_0.ts, 62, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 64, 50)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_0.ts, 64, 89)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_0.ts, 67, 11)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 64, 50)) + } + private static privateStaticFooWithRestParameters(a: string, ...rests: string[]) { +>privateStaticFooWithRestParameters : Symbol(c1.privateStaticFooWithRestParameters, Decl(declFileMethods_0.ts, 68, 5)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 69, 54)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 69, 64)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_0.ts, 69, 54)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 69, 64)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + private static privateStaticFooWithOverloads(a: string): string; +>privateStaticFooWithOverloads : Symbol(c1.privateStaticFooWithOverloads, Decl(declFileMethods_0.ts, 71, 5), Decl(declFileMethods_0.ts, 72, 68), Decl(declFileMethods_0.ts, 73, 68)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 72, 49)) + + private static privateStaticFooWithOverloads(a: number): number; +>privateStaticFooWithOverloads : Symbol(c1.privateStaticFooWithOverloads, Decl(declFileMethods_0.ts, 71, 5), Decl(declFileMethods_0.ts, 72, 68), Decl(declFileMethods_0.ts, 73, 68)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 73, 49)) + + private static privateStaticFooWithOverloads(a: any): any { +>privateStaticFooWithOverloads : Symbol(c1.privateStaticFooWithOverloads, Decl(declFileMethods_0.ts, 71, 5), Decl(declFileMethods_0.ts, 72, 68), Decl(declFileMethods_0.ts, 73, 68)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 74, 49)) + + return a; +>a : Symbol(a, Decl(declFileMethods_0.ts, 74, 49)) + } +} + +export interface I1 { +>I1 : Symbol(I1, Decl(declFileMethods_0.ts, 77, 1)) + + /** This comment should appear for foo*/ + foo(): string; +>foo : Symbol(foo, Decl(declFileMethods_0.ts, 79, 21)) + + /** This is comment for function signature*/ + fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(declFileMethods_0.ts, 81, 18)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 84, 22)) + + /** this is comment for b*/ + b: number): void; +>b : Symbol(b, Decl(declFileMethods_0.ts, 84, 61)) + + fooWithRestParameters(a: string, ...rests: string[]): string; +>fooWithRestParameters : Symbol(fooWithRestParameters, Decl(declFileMethods_0.ts, 86, 25)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 88, 26)) +>rests : Symbol(rests, Decl(declFileMethods_0.ts, 88, 36)) + + fooWithOverloads(a: string): string; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_0.ts, 88, 65), Decl(declFileMethods_0.ts, 90, 40)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 90, 21)) + + fooWithOverloads(a: number): number; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_0.ts, 88, 65), Decl(declFileMethods_0.ts, 90, 40)) +>a : Symbol(a, Decl(declFileMethods_0.ts, 91, 21)) +} + +=== tests/cases/compiler/declFileMethods_1.ts === +class c2 { +>c2 : Symbol(c2, Decl(declFileMethods_1.ts, 0, 0)) + + /** This comment should appear for foo*/ + public foo() { +>foo : Symbol(foo, Decl(declFileMethods_1.ts, 0, 10)) + } + /** This is comment for function signature*/ + public fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(declFileMethods_1.ts, 3, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 5, 29)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_1.ts, 5, 68)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_1.ts, 8, 11)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 5, 29)) + } + public fooWithRestParameters(a: string, ...rests: string[]) { +>fooWithRestParameters : Symbol(fooWithRestParameters, Decl(declFileMethods_1.ts, 9, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 10, 33)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 10, 43)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_1.ts, 10, 33)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 10, 43)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + + public fooWithOverloads(a: string): string; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_1.ts, 12, 5), Decl(declFileMethods_1.ts, 14, 47), Decl(declFileMethods_1.ts, 15, 47)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 14, 28)) + + public fooWithOverloads(a: number): number; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_1.ts, 12, 5), Decl(declFileMethods_1.ts, 14, 47), Decl(declFileMethods_1.ts, 15, 47)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 15, 28)) + + public fooWithOverloads(a: any): any { +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_1.ts, 12, 5), Decl(declFileMethods_1.ts, 14, 47), Decl(declFileMethods_1.ts, 15, 47)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 16, 28)) + + return a; +>a : Symbol(a, Decl(declFileMethods_1.ts, 16, 28)) + } + + + /** This comment should appear for privateFoo*/ + private privateFoo() { +>privateFoo : Symbol(privateFoo, Decl(declFileMethods_1.ts, 18, 5)) + } + /** This is comment for function signature*/ + private privateFooWithParameters(/** this is comment about a*/a: string, +>privateFooWithParameters : Symbol(privateFooWithParameters, Decl(declFileMethods_1.ts, 23, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 25, 37)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_1.ts, 25, 76)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_1.ts, 28, 11)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 25, 37)) + } + private privateFooWithRestParameters(a: string, ...rests: string[]) { +>privateFooWithRestParameters : Symbol(privateFooWithRestParameters, Decl(declFileMethods_1.ts, 29, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 30, 41)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 30, 51)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_1.ts, 30, 41)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 30, 51)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + private privateFooWithOverloads(a: string): string; +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_1.ts, 32, 5), Decl(declFileMethods_1.ts, 33, 55), Decl(declFileMethods_1.ts, 34, 55)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 33, 36)) + + private privateFooWithOverloads(a: number): number; +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_1.ts, 32, 5), Decl(declFileMethods_1.ts, 33, 55), Decl(declFileMethods_1.ts, 34, 55)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 34, 36)) + + private privateFooWithOverloads(a: any): any { +>privateFooWithOverloads : Symbol(privateFooWithOverloads, Decl(declFileMethods_1.ts, 32, 5), Decl(declFileMethods_1.ts, 33, 55), Decl(declFileMethods_1.ts, 34, 55)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 35, 36)) + + return a; +>a : Symbol(a, Decl(declFileMethods_1.ts, 35, 36)) + } + + + /** This comment should appear for static foo*/ + static staticFoo() { +>staticFoo : Symbol(c2.staticFoo, Decl(declFileMethods_1.ts, 37, 5)) + } + /** This is comment for function signature*/ + static staticFooWithParameters(/** this is comment about a*/a: string, +>staticFooWithParameters : Symbol(c2.staticFooWithParameters, Decl(declFileMethods_1.ts, 42, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 44, 35)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_1.ts, 44, 74)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_1.ts, 47, 11)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 44, 35)) + } + static staticFooWithRestParameters(a: string, ...rests: string[]) { +>staticFooWithRestParameters : Symbol(c2.staticFooWithRestParameters, Decl(declFileMethods_1.ts, 48, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 49, 39)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 49, 49)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_1.ts, 49, 39)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 49, 49)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + static staticFooWithOverloads(a: string): string; +>staticFooWithOverloads : Symbol(c2.staticFooWithOverloads, Decl(declFileMethods_1.ts, 51, 5), Decl(declFileMethods_1.ts, 52, 53), Decl(declFileMethods_1.ts, 53, 53)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 52, 34)) + + static staticFooWithOverloads(a: number): number; +>staticFooWithOverloads : Symbol(c2.staticFooWithOverloads, Decl(declFileMethods_1.ts, 51, 5), Decl(declFileMethods_1.ts, 52, 53), Decl(declFileMethods_1.ts, 53, 53)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 53, 34)) + + static staticFooWithOverloads(a: any): any { +>staticFooWithOverloads : Symbol(c2.staticFooWithOverloads, Decl(declFileMethods_1.ts, 51, 5), Decl(declFileMethods_1.ts, 52, 53), Decl(declFileMethods_1.ts, 53, 53)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 54, 34)) + + return a; +>a : Symbol(a, Decl(declFileMethods_1.ts, 54, 34)) + } + + + /** This comment should appear for privateStaticFoo*/ + private static privateStaticFoo() { +>privateStaticFoo : Symbol(c2.privateStaticFoo, Decl(declFileMethods_1.ts, 56, 5)) + } + /** This is comment for function signature*/ + private static privateStaticFooWithParameters(/** this is comment about a*/a: string, +>privateStaticFooWithParameters : Symbol(c2.privateStaticFooWithParameters, Decl(declFileMethods_1.ts, 61, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 63, 50)) + + /** this is comment for b*/ + b: number) { +>b : Symbol(b, Decl(declFileMethods_1.ts, 63, 89)) + + var d = a; +>d : Symbol(d, Decl(declFileMethods_1.ts, 66, 11)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 63, 50)) + } + private static privateStaticFooWithRestParameters(a: string, ...rests: string[]) { +>privateStaticFooWithRestParameters : Symbol(c2.privateStaticFooWithRestParameters, Decl(declFileMethods_1.ts, 67, 5)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 68, 54)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 68, 64)) + + return a + rests.join(""); +>a : Symbol(a, Decl(declFileMethods_1.ts, 68, 54)) +>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 68, 64)) +>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31)) + } + private static privateStaticFooWithOverloads(a: string): string; +>privateStaticFooWithOverloads : Symbol(c2.privateStaticFooWithOverloads, Decl(declFileMethods_1.ts, 70, 5), Decl(declFileMethods_1.ts, 71, 68), Decl(declFileMethods_1.ts, 72, 68)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 71, 49)) + + private static privateStaticFooWithOverloads(a: number): number; +>privateStaticFooWithOverloads : Symbol(c2.privateStaticFooWithOverloads, Decl(declFileMethods_1.ts, 70, 5), Decl(declFileMethods_1.ts, 71, 68), Decl(declFileMethods_1.ts, 72, 68)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 72, 49)) + + private static privateStaticFooWithOverloads(a: any): any { +>privateStaticFooWithOverloads : Symbol(c2.privateStaticFooWithOverloads, Decl(declFileMethods_1.ts, 70, 5), Decl(declFileMethods_1.ts, 71, 68), Decl(declFileMethods_1.ts, 72, 68)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 73, 49)) + + return a; +>a : Symbol(a, Decl(declFileMethods_1.ts, 73, 49)) + } +} + +interface I2 { +>I2 : Symbol(I2, Decl(declFileMethods_1.ts, 76, 1)) + + /** This comment should appear for foo*/ + foo(): string; +>foo : Symbol(foo, Decl(declFileMethods_1.ts, 78, 14)) + + /** This is comment for function signature*/ + fooWithParameters(/** this is comment about a*/a: string, +>fooWithParameters : Symbol(fooWithParameters, Decl(declFileMethods_1.ts, 80, 18)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 83, 22)) + + /** this is comment for b*/ + b: number): void; +>b : Symbol(b, Decl(declFileMethods_1.ts, 83, 61)) + + fooWithRestParameters(a: string, ...rests: string[]): string; +>fooWithRestParameters : Symbol(fooWithRestParameters, Decl(declFileMethods_1.ts, 85, 25)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 87, 26)) +>rests : Symbol(rests, Decl(declFileMethods_1.ts, 87, 36)) + + fooWithOverloads(a: string): string; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_1.ts, 87, 65), Decl(declFileMethods_1.ts, 89, 40)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 89, 21)) + + fooWithOverloads(a: number): number; +>fooWithOverloads : Symbol(fooWithOverloads, Decl(declFileMethods_1.ts, 87, 65), Decl(declFileMethods_1.ts, 89, 40)) +>a : Symbol(a, Decl(declFileMethods_1.ts, 90, 21)) +} + diff --git a/tests/baselines/reference/declFileMethods.types b/tests/baselines/reference/declFileMethods.types index 6432540f5a4..ecd7b8e0cff 100644 --- a/tests/baselines/reference/declFileMethods.types +++ b/tests/baselines/reference/declFileMethods.types @@ -32,6 +32,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } public fooWithOverloads(a: string): string; @@ -80,6 +81,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } private privateFooWithOverloads(a: string): string; >privateFooWithOverloads : { (a: string): string; (a: number): number; } @@ -127,6 +129,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } static staticFooWithOverloads(a: string): string; >staticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -174,6 +177,7 @@ export class c1 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } private static privateStaticFooWithOverloads(a: string): string; >privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -255,6 +259,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } public fooWithOverloads(a: string): string; @@ -303,6 +308,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } private privateFooWithOverloads(a: string): string; >privateFooWithOverloads : { (a: string): string; (a: number): number; } @@ -350,6 +356,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } static staticFooWithOverloads(a: string): string; >staticFooWithOverloads : { (a: string): string; (a: number): number; } @@ -397,6 +404,7 @@ class c2 { >rests.join : (separator?: string) => string >rests : string[] >join : (separator?: string) => string +>"" : string } private static privateStaticFooWithOverloads(a: string): string; >privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } diff --git a/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.symbols b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.symbols new file mode 100644 index 00000000000..b47f6faeb50 --- /dev/null +++ b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/declFileModuleAssignmentInObjectLiteralProperty.ts === + +module m1 { +>m1 : Symbol(m1, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 1, 11)) + } +} +var d = { +>d : Symbol(d, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 5, 3)) + + m1: { m: m1 }, +>m1 : Symbol(m1, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 5, 9)) +>m : Symbol(m, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 6, 9)) +>m1 : Symbol(m1, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 0, 0)) + + m2: { c: m1.c }, +>m2 : Symbol(m2, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 6, 18)) +>c : Symbol(c, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 7, 9)) +>m1.c : Symbol(m1.c, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 1, 11)) +>m1 : Symbol(m1, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 0, 0)) +>c : Symbol(m1.c, Decl(declFileModuleAssignmentInObjectLiteralProperty.ts, 1, 11)) + +}; diff --git a/tests/baselines/reference/declFileModuleContinuation.symbols b/tests/baselines/reference/declFileModuleContinuation.symbols new file mode 100644 index 00000000000..6a1b0492f1d --- /dev/null +++ b/tests/baselines/reference/declFileModuleContinuation.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/declFileModuleContinuation.ts === +module A.C { +>A : Symbol(A, Decl(declFileModuleContinuation.ts, 0, 0), Decl(declFileModuleContinuation.ts, 3, 1)) +>C : Symbol(C, Decl(declFileModuleContinuation.ts, 0, 9)) + + export interface Z { +>Z : Symbol(Z, Decl(declFileModuleContinuation.ts, 0, 12)) + } +} + +module A.B.C { +>A : Symbol(A, Decl(declFileModuleContinuation.ts, 0, 0), Decl(declFileModuleContinuation.ts, 3, 1)) +>B : Symbol(B, Decl(declFileModuleContinuation.ts, 5, 9)) +>C : Symbol(C, Decl(declFileModuleContinuation.ts, 5, 11)) + + export class W implements A.C.Z { +>W : Symbol(W, Decl(declFileModuleContinuation.ts, 5, 14)) +>A.C.Z : Symbol(A.C.Z, Decl(declFileModuleContinuation.ts, 0, 12)) +>A.C : Symbol(C, Decl(declFileModuleContinuation.ts, 0, 9)) +>A : Symbol(A, Decl(declFileModuleContinuation.ts, 0, 0), Decl(declFileModuleContinuation.ts, 3, 1)) +>C : Symbol(C, Decl(declFileModuleContinuation.ts, 0, 9)) +>Z : Symbol(A.C.Z, Decl(declFileModuleContinuation.ts, 0, 12)) + } +} diff --git a/tests/baselines/reference/declFileModuleContinuation.types b/tests/baselines/reference/declFileModuleContinuation.types index 0080d7cbbf3..f2a1295d5bd 100644 --- a/tests/baselines/reference/declFileModuleContinuation.types +++ b/tests/baselines/reference/declFileModuleContinuation.types @@ -1,7 +1,7 @@ === tests/cases/compiler/declFileModuleContinuation.ts === module A.C { >A : typeof A ->C : unknown +>C : any export interface Z { >Z : Z @@ -15,8 +15,10 @@ module A.B.C { export class W implements A.C.Z { >W : W +>A.C.Z : any +>A.C : any >A : typeof A ->C : unknown +>C : any >Z : A.C.Z } } diff --git a/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.symbols b/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.symbols new file mode 100644 index 00000000000..ee69745e8d3 --- /dev/null +++ b/tests/baselines/reference/declFileModuleWithPropertyOfTypeModule.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/declFileModuleWithPropertyOfTypeModule.ts === + +module m { +>m : Symbol(m, Decl(declFileModuleWithPropertyOfTypeModule.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(declFileModuleWithPropertyOfTypeModule.ts, 1, 10)) + } + + export var a = m; +>a : Symbol(a, Decl(declFileModuleWithPropertyOfTypeModule.ts, 5, 14)) +>m : Symbol(m, Decl(declFileModuleWithPropertyOfTypeModule.ts, 0, 0)) +} diff --git a/tests/baselines/reference/declFileOptionalInterfaceMethod.symbols b/tests/baselines/reference/declFileOptionalInterfaceMethod.symbols new file mode 100644 index 00000000000..2bf0c640fe5 --- /dev/null +++ b/tests/baselines/reference/declFileOptionalInterfaceMethod.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/declFileOptionalInterfaceMethod.ts === +interface X { +>X : Symbol(X, Decl(declFileOptionalInterfaceMethod.ts, 0, 0)) + + f? (); +>f : Symbol(f, Decl(declFileOptionalInterfaceMethod.ts, 0, 13)) +>T : Symbol(T, Decl(declFileOptionalInterfaceMethod.ts, 1, 8)) +} + diff --git a/tests/baselines/reference/declFilePrivateMethodOverloads.symbols b/tests/baselines/reference/declFilePrivateMethodOverloads.symbols new file mode 100644 index 00000000000..4f02212d79e --- /dev/null +++ b/tests/baselines/reference/declFilePrivateMethodOverloads.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/declFilePrivateMethodOverloads.ts === + +interface IContext { +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + someMethod(); +>someMethod : Symbol(someMethod, Decl(declFilePrivateMethodOverloads.ts, 1, 20)) +} +class c1 { +>c1 : Symbol(c1, Decl(declFilePrivateMethodOverloads.ts, 3, 1)) + + private _forEachBindingContext(bindingContext: IContext, fn: (bindingContext: IContext) => void); +>_forEachBindingContext : Symbol(_forEachBindingContext, Decl(declFilePrivateMethodOverloads.ts, 4, 10), Decl(declFilePrivateMethodOverloads.ts, 5, 101), Decl(declFilePrivateMethodOverloads.ts, 6, 113)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 5, 35)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 5, 60)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 5, 66)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + private _forEachBindingContext(bindingContextArray: Array, fn: (bindingContext: IContext) => void); +>_forEachBindingContext : Symbol(_forEachBindingContext, Decl(declFilePrivateMethodOverloads.ts, 4, 10), Decl(declFilePrivateMethodOverloads.ts, 5, 101), Decl(declFilePrivateMethodOverloads.ts, 6, 113)) +>bindingContextArray : Symbol(bindingContextArray, Decl(declFilePrivateMethodOverloads.ts, 6, 35)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 6, 72)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 6, 78)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + private _forEachBindingContext(context, fn: (bindingContext: IContext) => void): void { +>_forEachBindingContext : Symbol(_forEachBindingContext, Decl(declFilePrivateMethodOverloads.ts, 4, 10), Decl(declFilePrivateMethodOverloads.ts, 5, 101), Decl(declFilePrivateMethodOverloads.ts, 6, 113)) +>context : Symbol(context, Decl(declFilePrivateMethodOverloads.ts, 7, 35)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 7, 43)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 7, 49)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + // Function here + } + + private overloadWithArityDifference(bindingContext: IContext); +>overloadWithArityDifference : Symbol(overloadWithArityDifference, Decl(declFilePrivateMethodOverloads.ts, 9, 5), Decl(declFilePrivateMethodOverloads.ts, 11, 66), Decl(declFilePrivateMethodOverloads.ts, 12, 118)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 11, 40)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + private overloadWithArityDifference(bindingContextArray: Array, fn: (bindingContext: IContext) => void); +>overloadWithArityDifference : Symbol(overloadWithArityDifference, Decl(declFilePrivateMethodOverloads.ts, 9, 5), Decl(declFilePrivateMethodOverloads.ts, 11, 66), Decl(declFilePrivateMethodOverloads.ts, 12, 118)) +>bindingContextArray : Symbol(bindingContextArray, Decl(declFilePrivateMethodOverloads.ts, 12, 40)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 12, 77)) +>bindingContext : Symbol(bindingContext, Decl(declFilePrivateMethodOverloads.ts, 12, 83)) +>IContext : Symbol(IContext, Decl(declFilePrivateMethodOverloads.ts, 0, 0)) + + private overloadWithArityDifference(context): void { +>overloadWithArityDifference : Symbol(overloadWithArityDifference, Decl(declFilePrivateMethodOverloads.ts, 9, 5), Decl(declFilePrivateMethodOverloads.ts, 11, 66), Decl(declFilePrivateMethodOverloads.ts, 12, 118)) +>context : Symbol(context, Decl(declFilePrivateMethodOverloads.ts, 13, 40)) + + // Function here + } +} +declare class c2 { +>c2 : Symbol(c2, Decl(declFilePrivateMethodOverloads.ts, 16, 1)) + + private overload1(context, fn); +>overload1 : Symbol(overload1, Decl(declFilePrivateMethodOverloads.ts, 17, 18)) +>context : Symbol(context, Decl(declFilePrivateMethodOverloads.ts, 18, 22)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 18, 30)) + + private overload2(context); +>overload2 : Symbol(overload2, Decl(declFilePrivateMethodOverloads.ts, 18, 35), Decl(declFilePrivateMethodOverloads.ts, 20, 31)) +>context : Symbol(context, Decl(declFilePrivateMethodOverloads.ts, 20, 22)) + + private overload2(context, fn); +>overload2 : Symbol(overload2, Decl(declFilePrivateMethodOverloads.ts, 18, 35), Decl(declFilePrivateMethodOverloads.ts, 20, 31)) +>context : Symbol(context, Decl(declFilePrivateMethodOverloads.ts, 21, 22)) +>fn : Symbol(fn, Decl(declFilePrivateMethodOverloads.ts, 21, 30)) +} diff --git a/tests/baselines/reference/declFileRegressionTests.symbols b/tests/baselines/reference/declFileRegressionTests.symbols new file mode 100644 index 00000000000..ea8f9e2fe2a --- /dev/null +++ b/tests/baselines/reference/declFileRegressionTests.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/declFileRegressionTests.ts === +// 'null' not converted to 'any' in d.ts +// function types not piped through correctly +var n = { w: null, x: '', y: () => { }, z: 32 }; +>n : Symbol(n, Decl(declFileRegressionTests.ts, 2, 3)) +>w : Symbol(w, Decl(declFileRegressionTests.ts, 2, 9)) +>x : Symbol(x, Decl(declFileRegressionTests.ts, 2, 18)) +>y : Symbol(y, Decl(declFileRegressionTests.ts, 2, 25)) +>z : Symbol(z, Decl(declFileRegressionTests.ts, 2, 39)) + + diff --git a/tests/baselines/reference/declFileRegressionTests.types b/tests/baselines/reference/declFileRegressionTests.types index 8d058769c0a..7b8933e1def 100644 --- a/tests/baselines/reference/declFileRegressionTests.types +++ b/tests/baselines/reference/declFileRegressionTests.types @@ -5,9 +5,12 @@ var n = { w: null, x: '', y: () => { }, z: 32 }; >n : { w: any; x: string; y: () => void; z: number; } >{ w: null, x: '', y: () => { }, z: 32 } : { w: null; x: string; y: () => void; z: number; } >w : null +>null : null >x : string +>'' : string >y : () => void >() => { } : () => void >z : number +>32 : number diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.symbols b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.symbols new file mode 100644 index 00000000000..49758e4ceb1 --- /dev/null +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/declFileRestParametersOfFunctionAndFunctionType.ts === + +function f1(...args) { } +>f1 : Symbol(f1, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 0, 0)) +>args : Symbol(args, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 1, 12)) + +function f2(x: (...args) => void) { } +>f2 : Symbol(f2, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 1, 24)) +>x : Symbol(x, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 2, 12)) +>args : Symbol(args, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 2, 16)) + +function f3(x: { (...args): void }) { } +>f3 : Symbol(f3, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 2, 37)) +>x : Symbol(x, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 3, 12)) +>args : Symbol(args, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 3, 18)) + +function f4 void>() { } +>f4 : Symbol(f4, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 3, 39)) +>T : Symbol(T, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 4, 12)) +>args : Symbol(args, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 4, 23)) + +function f5() { } +>f5 : Symbol(f5, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 4, 46)) +>T : Symbol(T, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 5, 12)) +>args : Symbol(args, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 5, 25)) + +var f6 = () => { return [10]; } +>f6 : Symbol(f6, Decl(declFileRestParametersOfFunctionAndFunctionType.ts, 6, 3)) + + + diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types index ecb7c002089..0bfa5b6312c 100644 --- a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types @@ -29,6 +29,7 @@ var f6 = () => { return [10]; } >() => { return [10]; } : () => any[] >[10] : any[] >10 : any +>10 : number diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.symbols b/tests/baselines/reference/declFileTypeAnnotationArrayType.symbols new file mode 100644 index 00000000000..9092189c3c7 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.symbols @@ -0,0 +1,105 @@ +=== tests/cases/compiler/declFileTypeAnnotationArrayType.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) + } + export class g { +>g : Symbol(g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) +>T : Symbol(T, Decl(declFileTypeAnnotationArrayType.ts, 6, 19)) + } +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationArrayType.ts, 8, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationArrayType.ts, 9, 8)) +} + +// Just the name +function foo(): c[] { +>foo : Symbol(foo, Decl(declFileTypeAnnotationArrayType.ts, 10, 1)) +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) + + return [new c()]; +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) +} +function foo2() { +>foo2 : Symbol(foo2, Decl(declFileTypeAnnotationArrayType.ts, 15, 1)) + + return [new c()]; +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) +} + +// Qualified name +function foo3(): m.c[] { +>foo3 : Symbol(foo3, Decl(declFileTypeAnnotationArrayType.ts, 18, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) + + return [new m.c()]; +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) +} +function foo4() { +>foo4 : Symbol(foo4, Decl(declFileTypeAnnotationArrayType.ts, 23, 1)) + + return m.c; +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationArrayType.ts, 3, 10)) +} + +// Just the name with type arguments +function foo5(): g[] { +>foo5 : Symbol(foo5, Decl(declFileTypeAnnotationArrayType.ts, 26, 1)) +>g : Symbol(g, Decl(declFileTypeAnnotationArrayType.ts, 8, 1)) + + return [new g()]; +>g : Symbol(g, Decl(declFileTypeAnnotationArrayType.ts, 8, 1)) +} +function foo6() { +>foo6 : Symbol(foo6, Decl(declFileTypeAnnotationArrayType.ts, 31, 1)) + + return [new g()]; +>g : Symbol(g, Decl(declFileTypeAnnotationArrayType.ts, 8, 1)) +} + +// Qualified name with type arguments +function foo7(): m.g[] { +>foo7 : Symbol(foo7, Decl(declFileTypeAnnotationArrayType.ts, 34, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) + + return [new m.g()]; +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) +} +function foo8() { +>foo8 : Symbol(foo8, Decl(declFileTypeAnnotationArrayType.ts, 39, 1)) + + return [new m.g()]; +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationArrayType.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationArrayType.ts, 5, 5)) +} + +// Array of function types +function foo9(): (()=>c)[] { +>foo9 : Symbol(foo9, Decl(declFileTypeAnnotationArrayType.ts, 42, 1)) +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) + + return [() => new c()]; +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) +} +function foo10() { +>foo10 : Symbol(foo10, Decl(declFileTypeAnnotationArrayType.ts, 47, 1)) + + return [() => new c()]; +>c : Symbol(c, Decl(declFileTypeAnnotationArrayType.ts, 0, 0)) +} diff --git a/tests/baselines/reference/declFileTypeAnnotationArrayType.types b/tests/baselines/reference/declFileTypeAnnotationArrayType.types index 860d13af47c..7a9d65b8a1f 100644 --- a/tests/baselines/reference/declFileTypeAnnotationArrayType.types +++ b/tests/baselines/reference/declFileTypeAnnotationArrayType.types @@ -41,7 +41,7 @@ function foo2() { // Qualified name function foo3(): m.c[] { >foo3 : () => m.c[] ->m : unknown +>m : any >c : m.c return [new m.c()]; @@ -82,7 +82,7 @@ function foo6() { // Qualified name with type arguments function foo7(): m.g[] { >foo7 : () => m.g[] ->m : unknown +>m : any >g : m.g return [new m.g()]; diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.symbols b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.symbols new file mode 100644 index 00000000000..62de15530b7 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileTypeAnnotationBuiltInType.ts === + +// string +function foo(): string { +>foo : Symbol(foo, Decl(declFileTypeAnnotationBuiltInType.ts, 0, 0)) + + return ""; +} +function foo2() { +>foo2 : Symbol(foo2, Decl(declFileTypeAnnotationBuiltInType.ts, 4, 1)) + + return ""; +} + +// number +function foo3(): number { +>foo3 : Symbol(foo3, Decl(declFileTypeAnnotationBuiltInType.ts, 7, 1)) + + return 10; +} +function foo4() { +>foo4 : Symbol(foo4, Decl(declFileTypeAnnotationBuiltInType.ts, 12, 1)) + + return 10; +} + +// boolean +function foo5(): boolean { +>foo5 : Symbol(foo5, Decl(declFileTypeAnnotationBuiltInType.ts, 15, 1)) + + return true; +} +function foo6() { +>foo6 : Symbol(foo6, Decl(declFileTypeAnnotationBuiltInType.ts, 20, 1)) + + return false; +} + +// void +function foo7(): void { +>foo7 : Symbol(foo7, Decl(declFileTypeAnnotationBuiltInType.ts, 23, 1)) + + return; +} +function foo8() { +>foo8 : Symbol(foo8, Decl(declFileTypeAnnotationBuiltInType.ts, 28, 1)) + + return; +} + +// any +function foo9(): any { +>foo9 : Symbol(foo9, Decl(declFileTypeAnnotationBuiltInType.ts, 31, 1)) + + return undefined; +>undefined : Symbol(undefined) +} +function foo10() { +>foo10 : Symbol(foo10, Decl(declFileTypeAnnotationBuiltInType.ts, 36, 1)) + + return undefined; +>undefined : Symbol(undefined) +} diff --git a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types index ce4f5654a89..a1b2d9edd43 100644 --- a/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types +++ b/tests/baselines/reference/declFileTypeAnnotationBuiltInType.types @@ -5,11 +5,13 @@ function foo(): string { >foo : () => string return ""; +>"" : string } function foo2() { >foo2 : () => string return ""; +>"" : string } // number @@ -17,11 +19,13 @@ function foo3(): number { >foo3 : () => number return 10; +>10 : number } function foo4() { >foo4 : () => number return 10; +>10 : number } // boolean @@ -29,11 +33,13 @@ function foo5(): boolean { >foo5 : () => boolean return true; +>true : boolean } function foo6() { >foo6 : () => boolean return false; +>false : boolean } // void diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.symbols b/tests/baselines/reference/declFileTypeAnnotationParenType.symbols new file mode 100644 index 00000000000..bc5668b70bd --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/declFileTypeAnnotationParenType.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) + + private p: string; +>p : Symbol(p, Decl(declFileTypeAnnotationParenType.ts, 1, 9)) +} + +var x: (() => c)[] = [() => new c()]; +>x : Symbol(x, Decl(declFileTypeAnnotationParenType.ts, 5, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) + +var y = [() => new c()]; +>y : Symbol(y, Decl(declFileTypeAnnotationParenType.ts, 6, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) + +var k: (() => c) | string = (() => new c()) || ""; +>k : Symbol(k, Decl(declFileTypeAnnotationParenType.ts, 8, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) + +var l = (() => new c()) || ""; +>l : Symbol(l, Decl(declFileTypeAnnotationParenType.ts, 9, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationParenType.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileTypeAnnotationParenType.types b/tests/baselines/reference/declFileTypeAnnotationParenType.types index c904f1b3e5a..31b6ad03751 100644 --- a/tests/baselines/reference/declFileTypeAnnotationParenType.types +++ b/tests/baselines/reference/declFileTypeAnnotationParenType.types @@ -30,6 +30,7 @@ var k: (() => c) | string = (() => new c()) || ""; >() => new c() : () => c >new c() : c >c : typeof c +>"" : string var l = (() => new c()) || ""; >l : string | (() => c) @@ -38,4 +39,5 @@ var l = (() => new c()) || ""; >() => new c() : () => c >new c() : c >c : typeof c +>"" : string diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.symbols b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.symbols new file mode 100644 index 00000000000..7250567039a --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/declFileTypeAnnotationStringLiteral.ts === + +function foo(a: "hello"): number; +>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41)) +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 1, 13)) + +function foo(a: "name"): string; +>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41)) +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 2, 13)) + +function foo(a: string): string | number; +>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41)) +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 3, 13)) + +function foo(a: string): string | number { +>foo : Symbol(foo, Decl(declFileTypeAnnotationStringLiteral.ts, 0, 0), Decl(declFileTypeAnnotationStringLiteral.ts, 1, 33), Decl(declFileTypeAnnotationStringLiteral.ts, 2, 32), Decl(declFileTypeAnnotationStringLiteral.ts, 3, 41)) +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13)) + + if (a === "hello") { +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13)) + + return a.length; +>a.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + } + + return a; +>a : Symbol(a, Decl(declFileTypeAnnotationStringLiteral.ts, 4, 13)) +} diff --git a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types index d50d95f988b..3041b92cf6d 100644 --- a/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types +++ b/tests/baselines/reference/declFileTypeAnnotationStringLiteral.types @@ -19,6 +19,7 @@ function foo(a: string): string | number { if (a === "hello") { >a === "hello" : boolean >a : string +>"hello" : string return a.length; >a.length : number diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.symbols b/tests/baselines/reference/declFileTypeAnnotationTupleType.symbols new file mode 100644 index 00000000000..9eea6dfd9f9 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.symbols @@ -0,0 +1,52 @@ +=== tests/cases/compiler/declFileTypeAnnotationTupleType.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 0, 0)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationTupleType.ts, 2, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 3, 10)) + } + export class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTupleType.ts, 5, 5)) +>T : Symbol(T, Decl(declFileTypeAnnotationTupleType.ts, 6, 19)) + } +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTupleType.ts, 8, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationTupleType.ts, 9, 8)) +} + +// Just the name +var k: [c, m.c] = [new c(), new m.c()]; +>k : Symbol(k, Decl(declFileTypeAnnotationTupleType.ts, 13, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 0, 0)) +>m : Symbol(m, Decl(declFileTypeAnnotationTupleType.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTupleType.ts, 3, 10)) +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 0, 0)) +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTupleType.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTupleType.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTupleType.ts, 3, 10)) + +var l = k; +>l : Symbol(l, Decl(declFileTypeAnnotationTupleType.ts, 14, 3)) +>k : Symbol(k, Decl(declFileTypeAnnotationTupleType.ts, 13, 3)) + +var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; +>x : Symbol(x, Decl(declFileTypeAnnotationTupleType.ts, 16, 3)) +>g : Symbol(g, Decl(declFileTypeAnnotationTupleType.ts, 8, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationTupleType.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTupleType.ts, 5, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 0, 0)) +>g : Symbol(g, Decl(declFileTypeAnnotationTupleType.ts, 8, 1)) +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTupleType.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTupleType.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTupleType.ts, 5, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTupleType.ts, 0, 0)) + +var y = x; +>y : Symbol(y, Decl(declFileTypeAnnotationTupleType.ts, 17, 3)) +>x : Symbol(x, Decl(declFileTypeAnnotationTupleType.ts, 16, 3)) + diff --git a/tests/baselines/reference/declFileTypeAnnotationTupleType.types b/tests/baselines/reference/declFileTypeAnnotationTupleType.types index 88cf5a0c743..aad0760fade 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTupleType.types +++ b/tests/baselines/reference/declFileTypeAnnotationTupleType.types @@ -23,7 +23,7 @@ class g { var k: [c, m.c] = [new c(), new m.c()]; >k : [c, m.c] >c : c ->m : unknown +>m : any >c : m.c >[new c(), new m.c()] : [c, m.c] >new c() : c @@ -40,7 +40,7 @@ var l = k; var x: [g, m.g, () => c] = [new g(), new m.g(), () => new c()]; >x : [g, m.g, () => c] >g : g ->m : unknown +>m : any >g : m.g >c : c >[new g(), new m.g(), () => new c()] : [g, m.g, () => c] diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.symbols b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.symbols new file mode 100644 index 00000000000..27507817a77 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeAlias.ts === + +module M { +>M : Symbol(M, Decl(declFileTypeAnnotationTypeAlias.ts, 0, 0), Decl(declFileTypeAnnotationTypeAlias.ts, 22, 1)) + + export type Value = string | number | boolean; +>Value : Symbol(Value, Decl(declFileTypeAnnotationTypeAlias.ts, 1, 10)) + + export var x: Value; +>x : Symbol(x, Decl(declFileTypeAnnotationTypeAlias.ts, 3, 14)) +>Value : Symbol(Value, Decl(declFileTypeAnnotationTypeAlias.ts, 1, 10)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeAlias.ts, 3, 24)) + } + + export type C = c; +>C : Symbol(C, Decl(declFileTypeAnnotationTypeAlias.ts, 6, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeAlias.ts, 3, 24)) + + export module m { +>m : Symbol(m, Decl(declFileTypeAnnotationTypeAlias.ts, 8, 22)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeAlias.ts, 10, 21)) + } + } + + export type MC = m.c; +>MC : Symbol(MC, Decl(declFileTypeAnnotationTypeAlias.ts, 13, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeAlias.ts, 8, 22)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeAlias.ts, 10, 21)) + + export type fc = () => c; +>fc : Symbol(fc, Decl(declFileTypeAnnotationTypeAlias.ts, 15, 25)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeAlias.ts, 3, 24)) +} + +interface Window { +>Window : Symbol(Window, Decl(declFileTypeAnnotationTypeAlias.ts, 18, 1)) + + someMethod(); +>someMethod : Symbol(someMethod, Decl(declFileTypeAnnotationTypeAlias.ts, 20, 18)) +} + +module M { +>M : Symbol(M, Decl(declFileTypeAnnotationTypeAlias.ts, 0, 0), Decl(declFileTypeAnnotationTypeAlias.ts, 22, 1)) + + export type W = Window | string; +>W : Symbol(W, Decl(declFileTypeAnnotationTypeAlias.ts, 24, 10)) +>Window : Symbol(Window, Decl(declFileTypeAnnotationTypeAlias.ts, 18, 1)) + + export module N { +>N : Symbol(N, Decl(declFileTypeAnnotationTypeAlias.ts, 25, 36)) + + export class Window { } +>Window : Symbol(Window, Decl(declFileTypeAnnotationTypeAlias.ts, 26, 21)) + + export var p: W; +>p : Symbol(p, Decl(declFileTypeAnnotationTypeAlias.ts, 28, 18)) +>W : Symbol(W, Decl(declFileTypeAnnotationTypeAlias.ts, 24, 10)) + } +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types index aa475068bf0..beef88c0ca2 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.types @@ -28,7 +28,7 @@ module M { export type MC = m.c; >MC : m.c ->m : unknown +>m : any >c : m.c export type fc = () => c; diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.symbols b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.symbols new file mode 100644 index 00000000000..6a3f2100fab --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.symbols @@ -0,0 +1,85 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTypeLiteral.ts, 2, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationTypeLiteral.ts, 3, 8)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationTypeLiteral.ts, 4, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 5, 10)) + } +} + +// Object literal with everything +var x: { +>x : Symbol(x, Decl(declFileTypeAnnotationTypeLiteral.ts, 11, 3)) + + // Call signatures + (a: number): c; +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 13, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + + (a: string): g; +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 14, 5)) +>g : Symbol(g, Decl(declFileTypeAnnotationTypeLiteral.ts, 2, 1)) + + // Construct signatures + new (a: number): c; +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 17, 9)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + + new (a: string): m.c; +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 18, 9)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeLiteral.ts, 4, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeLiteral.ts, 5, 10)) + + // Indexers + [n: number]: c; +>n : Symbol(n, Decl(declFileTypeAnnotationTypeLiteral.ts, 21, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + + [n: string]: c; +>n : Symbol(n, Decl(declFileTypeAnnotationTypeLiteral.ts, 22, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + + // Properties + a: c; +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 22, 19)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + + b: g; +>b : Symbol(b, Decl(declFileTypeAnnotationTypeLiteral.ts, 25, 9)) +>g : Symbol(g, Decl(declFileTypeAnnotationTypeLiteral.ts, 2, 1)) + + // methods + m1(): g; +>m1 : Symbol(m1, Decl(declFileTypeAnnotationTypeLiteral.ts, 26, 17)) +>g : Symbol(g, Decl(declFileTypeAnnotationTypeLiteral.ts, 2, 1)) + + m2(a: string, b?: number, ...c: c[]): string; +>m2 : Symbol(m2, Decl(declFileTypeAnnotationTypeLiteral.ts, 29, 20)) +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 30, 7)) +>b : Symbol(b, Decl(declFileTypeAnnotationTypeLiteral.ts, 30, 17)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 30, 29)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeLiteral.ts, 0, 0)) + +}; + + +// Function type +var y: (a: string) => string; +>y : Symbol(y, Decl(declFileTypeAnnotationTypeLiteral.ts, 35, 3)) +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 35, 8)) + +// constructor type +var z: new (a: string) => m.c; +>z : Symbol(z, Decl(declFileTypeAnnotationTypeLiteral.ts, 38, 3)) +>a : Symbol(a, Decl(declFileTypeAnnotationTypeLiteral.ts, 38, 12)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeLiteral.ts, 4, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeLiteral.ts, 5, 10)) + diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types index 30d14b77286..e2092008358 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types +++ b/tests/baselines/reference/declFileTypeAnnotationTypeLiteral.types @@ -35,7 +35,7 @@ var x: { new (a: string): m.c; >a : string ->m : unknown +>m : any >c : m.c // Indexers @@ -80,6 +80,6 @@ var y: (a: string) => string; var z: new (a: string) => m.c; >z : new (a: string) => m.c >a : string ->m : unknown +>m : any >c : m.c diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.symbols b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.symbols new file mode 100644 index 00000000000..f5970ce15f5 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.symbols @@ -0,0 +1,92 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeQuery.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeQuery.ts, 0, 0)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) + } + export class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +>T : Symbol(T, Decl(declFileTypeAnnotationTypeQuery.ts, 6, 19)) + } +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTypeQuery.ts, 8, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationTypeQuery.ts, 9, 8)) +} + +// Just the name +function foo(): typeof c { +>foo : Symbol(foo, Decl(declFileTypeAnnotationTypeQuery.ts, 10, 1)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeQuery.ts, 0, 0)) + + return c; +>c : Symbol(c, Decl(declFileTypeAnnotationTypeQuery.ts, 0, 0)) +} +function foo2() { +>foo2 : Symbol(foo2, Decl(declFileTypeAnnotationTypeQuery.ts, 15, 1)) + + return c; +>c : Symbol(c, Decl(declFileTypeAnnotationTypeQuery.ts, 0, 0)) +} + +// Qualified name +function foo3(): typeof m.c { +>foo3 : Symbol(foo3, Decl(declFileTypeAnnotationTypeQuery.ts, 18, 1)) +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) + + return m.c; +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) +} +function foo4() { +>foo4 : Symbol(foo4, Decl(declFileTypeAnnotationTypeQuery.ts, 23, 1)) + + return m.c; +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeQuery.ts, 3, 10)) +} + +// Just the name with type arguments +function foo5(): typeof g { +>foo5 : Symbol(foo5, Decl(declFileTypeAnnotationTypeQuery.ts, 26, 1)) +>g : Symbol(g, Decl(declFileTypeAnnotationTypeQuery.ts, 8, 1)) + + return g; +>g : Symbol(g, Decl(declFileTypeAnnotationTypeQuery.ts, 8, 1)) +} +function foo6() { +>foo6 : Symbol(foo6, Decl(declFileTypeAnnotationTypeQuery.ts, 31, 1)) + + return g; +>g : Symbol(g, Decl(declFileTypeAnnotationTypeQuery.ts, 8, 1)) +} + +// Qualified name with type arguments +function foo7(): typeof m.g { +>foo7 : Symbol(foo7, Decl(declFileTypeAnnotationTypeQuery.ts, 34, 1)) +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) + + return m.g +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +} +function foo8() { +>foo8 : Symbol(foo8, Decl(declFileTypeAnnotationTypeQuery.ts, 39, 1)) + + return m.g +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeQuery.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeQuery.ts, 5, 5)) +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types index c7b5c421de1..01fce150ab8 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types +++ b/tests/baselines/reference/declFileTypeAnnotationTypeQuery.types @@ -37,6 +37,7 @@ function foo2() { // Qualified name function foo3(): typeof m.c { >foo3 : () => typeof m.c +>m.c : typeof m.c >m : typeof m >c : typeof m.c @@ -72,6 +73,7 @@ function foo6() { // Qualified name with type arguments function foo7(): typeof m.g { >foo7 : () => typeof m.g +>m.g : typeof m.g >m : typeof m >g : typeof m.g diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.symbols b/tests/baselines/reference/declFileTypeAnnotationTypeReference.symbols new file mode 100644 index 00000000000..c6e27ecdceb --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.symbols @@ -0,0 +1,90 @@ +=== tests/cases/compiler/declFileTypeAnnotationTypeReference.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeReference.ts, 0, 0)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) + } + export class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) +>T : Symbol(T, Decl(declFileTypeAnnotationTypeReference.ts, 6, 19)) + } +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationTypeReference.ts, 8, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationTypeReference.ts, 9, 8)) +} + +// Just the name +function foo(): c { +>foo : Symbol(foo, Decl(declFileTypeAnnotationTypeReference.ts, 10, 1)) +>c : Symbol(c, Decl(declFileTypeAnnotationTypeReference.ts, 0, 0)) + + return new c(); +>c : Symbol(c, Decl(declFileTypeAnnotationTypeReference.ts, 0, 0)) +} +function foo2() { +>foo2 : Symbol(foo2, Decl(declFileTypeAnnotationTypeReference.ts, 15, 1)) + + return new c(); +>c : Symbol(c, Decl(declFileTypeAnnotationTypeReference.ts, 0, 0)) +} + +// Qualified name +function foo3(): m.c { +>foo3 : Symbol(foo3, Decl(declFileTypeAnnotationTypeReference.ts, 18, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) + + return new m.c(); +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) +} +function foo4() { +>foo4 : Symbol(foo4, Decl(declFileTypeAnnotationTypeReference.ts, 23, 1)) + + return new m.c(); +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationTypeReference.ts, 3, 10)) +} + +// Just the name with type arguments +function foo5(): g { +>foo5 : Symbol(foo5, Decl(declFileTypeAnnotationTypeReference.ts, 26, 1)) +>g : Symbol(g, Decl(declFileTypeAnnotationTypeReference.ts, 8, 1)) + + return new g(); +>g : Symbol(g, Decl(declFileTypeAnnotationTypeReference.ts, 8, 1)) +} +function foo6() { +>foo6 : Symbol(foo6, Decl(declFileTypeAnnotationTypeReference.ts, 31, 1)) + + return new g(); +>g : Symbol(g, Decl(declFileTypeAnnotationTypeReference.ts, 8, 1)) +} + +// Qualified name with type arguments +function foo7(): m.g { +>foo7 : Symbol(foo7, Decl(declFileTypeAnnotationTypeReference.ts, 34, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) + + return new m.g(); +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) +} +function foo8() { +>foo8 : Symbol(foo8, Decl(declFileTypeAnnotationTypeReference.ts, 39, 1)) + + return new m.g(); +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationTypeReference.ts, 2, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationTypeReference.ts, 5, 5)) +} diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeReference.types b/tests/baselines/reference/declFileTypeAnnotationTypeReference.types index 765c86c3415..1d85ad19293 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeReference.types +++ b/tests/baselines/reference/declFileTypeAnnotationTypeReference.types @@ -39,7 +39,7 @@ function foo2() { // Qualified name function foo3(): m.c { >foo3 : () => m.c ->m : unknown +>m : any >c : m.c return new m.c(); @@ -78,7 +78,7 @@ function foo6() { // Qualified name with type arguments function foo7(): m.g { >foo7 : () => m.g ->m : unknown +>m : any >g : m.g return new m.g(); diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.symbols b/tests/baselines/reference/declFileTypeAnnotationUnionType.symbols new file mode 100644 index 00000000000..f57df197579 --- /dev/null +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/declFileTypeAnnotationUnionType.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) + + private p: string; +>p : Symbol(p, Decl(declFileTypeAnnotationUnionType.ts, 1, 9)) +} +module m { +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) + + export class c { +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) + + private q: string; +>q : Symbol(q, Decl(declFileTypeAnnotationUnionType.ts, 5, 20)) + } + export class g { +>g : Symbol(g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>T : Symbol(T, Decl(declFileTypeAnnotationUnionType.ts, 8, 19)) + + private r: string; +>r : Symbol(r, Decl(declFileTypeAnnotationUnionType.ts, 8, 23)) + } +} +class g { +>g : Symbol(g, Decl(declFileTypeAnnotationUnionType.ts, 11, 1)) +>T : Symbol(T, Decl(declFileTypeAnnotationUnionType.ts, 12, 8)) + + private s: string; +>s : Symbol(s, Decl(declFileTypeAnnotationUnionType.ts, 12, 12)) +} + +// Just the name +var k: c | m.c = new c() || new m.c(); +>k : Symbol(k, Decl(declFileTypeAnnotationUnionType.ts, 17, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) + +var l = new c() || new m.c(); +>l : Symbol(l, Decl(declFileTypeAnnotationUnionType.ts, 18, 3)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) +>m.c : Symbol(m.c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>c : Symbol(m.c, Decl(declFileTypeAnnotationUnionType.ts, 4, 10)) + +var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); +>x : Symbol(x, Decl(declFileTypeAnnotationUnionType.ts, 20, 3)) +>g : Symbol(g, Decl(declFileTypeAnnotationUnionType.ts, 11, 1)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) +>g : Symbol(g, Decl(declFileTypeAnnotationUnionType.ts, 11, 1)) +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) + +var y = new g() || new m.g() || (() => new c()); +>y : Symbol(y, Decl(declFileTypeAnnotationUnionType.ts, 21, 3)) +>g : Symbol(g, Decl(declFileTypeAnnotationUnionType.ts, 11, 1)) +>m.g : Symbol(m.g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>m : Symbol(m, Decl(declFileTypeAnnotationUnionType.ts, 3, 1)) +>g : Symbol(m.g, Decl(declFileTypeAnnotationUnionType.ts, 7, 5)) +>c : Symbol(c, Decl(declFileTypeAnnotationUnionType.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileTypeAnnotationUnionType.types b/tests/baselines/reference/declFileTypeAnnotationUnionType.types index 1dce3690bf8..a412f60b36e 100644 --- a/tests/baselines/reference/declFileTypeAnnotationUnionType.types +++ b/tests/baselines/reference/declFileTypeAnnotationUnionType.types @@ -35,7 +35,7 @@ class g { var k: c | m.c = new c() || new m.c(); >k : c | m.c >c : c ->m : unknown +>m : any >c : m.c >new c() || new m.c() : c | m.c >new c() : c @@ -58,7 +58,7 @@ var l = new c() || new m.c(); var x: g | m.g | (() => c) = new g() || new m.g() || (() => new c()); >x : g | m.g | (() => c) >g : g ->m : unknown +>m : any >g : m.g >c : c >new g() || new m.g() || (() => new c()) : g | m.g | (() => c) diff --git a/tests/baselines/reference/declFileTypeofClass.symbols b/tests/baselines/reference/declFileTypeofClass.symbols new file mode 100644 index 00000000000..26adfcc8ee4 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofClass.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/declFileTypeofClass.ts === + +class c { +>c : Symbol(c, Decl(declFileTypeofClass.ts, 0, 0)) + + static x : string; +>x : Symbol(c.x, Decl(declFileTypeofClass.ts, 1, 9)) + + private static y: number; +>y : Symbol(c.y, Decl(declFileTypeofClass.ts, 2, 22)) + + private x3: string; +>x3 : Symbol(x3, Decl(declFileTypeofClass.ts, 3, 29)) + + public y3: number; +>y3 : Symbol(y3, Decl(declFileTypeofClass.ts, 4, 23)) +} + +var x: c; +>x : Symbol(x, Decl(declFileTypeofClass.ts, 8, 3)) +>c : Symbol(c, Decl(declFileTypeofClass.ts, 0, 0)) + +var y = c; +>y : Symbol(y, Decl(declFileTypeofClass.ts, 9, 3)) +>c : Symbol(c, Decl(declFileTypeofClass.ts, 0, 0)) + +var z: typeof c; +>z : Symbol(z, Decl(declFileTypeofClass.ts, 10, 3)) +>c : Symbol(c, Decl(declFileTypeofClass.ts, 0, 0)) + +class genericC +>genericC : Symbol(genericC, Decl(declFileTypeofClass.ts, 10, 16)) +>T : Symbol(T, Decl(declFileTypeofClass.ts, 11, 15)) +{ +} +var genericX = genericC; +>genericX : Symbol(genericX, Decl(declFileTypeofClass.ts, 14, 3)) +>genericC : Symbol(genericC, Decl(declFileTypeofClass.ts, 10, 16)) + diff --git a/tests/baselines/reference/declFileTypeofEnum.symbols b/tests/baselines/reference/declFileTypeofEnum.symbols new file mode 100644 index 00000000000..9980167788a --- /dev/null +++ b/tests/baselines/reference/declFileTypeofEnum.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/declFileTypeofEnum.ts === + +enum days { +>days : Symbol(days, Decl(declFileTypeofEnum.ts, 0, 0)) + + monday, +>monday : Symbol(days.monday, Decl(declFileTypeofEnum.ts, 1, 11)) + + tuesday, +>tuesday : Symbol(days.tuesday, Decl(declFileTypeofEnum.ts, 2, 11)) + + wednesday, +>wednesday : Symbol(days.wednesday, Decl(declFileTypeofEnum.ts, 3, 12)) + + thursday, +>thursday : Symbol(days.thursday, Decl(declFileTypeofEnum.ts, 4, 14)) + + friday, +>friday : Symbol(days.friday, Decl(declFileTypeofEnum.ts, 5, 13)) + + saturday, +>saturday : Symbol(days.saturday, Decl(declFileTypeofEnum.ts, 6, 11)) + + sunday +>sunday : Symbol(days.sunday, Decl(declFileTypeofEnum.ts, 7, 13)) +} + +var weekendDay = days.saturday; +>weekendDay : Symbol(weekendDay, Decl(declFileTypeofEnum.ts, 11, 3)) +>days.saturday : Symbol(days.saturday, Decl(declFileTypeofEnum.ts, 6, 11)) +>days : Symbol(days, Decl(declFileTypeofEnum.ts, 0, 0)) +>saturday : Symbol(days.saturday, Decl(declFileTypeofEnum.ts, 6, 11)) + +var daysOfMonth = days; +>daysOfMonth : Symbol(daysOfMonth, Decl(declFileTypeofEnum.ts, 12, 3)) +>days : Symbol(days, Decl(declFileTypeofEnum.ts, 0, 0)) + +var daysOfYear: typeof days; +>daysOfYear : Symbol(daysOfYear, Decl(declFileTypeofEnum.ts, 13, 3)) +>days : Symbol(days, Decl(declFileTypeofEnum.ts, 0, 0)) + diff --git a/tests/baselines/reference/declFileTypeofFunction.symbols b/tests/baselines/reference/declFileTypeofFunction.symbols new file mode 100644 index 00000000000..649c09cba06 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofFunction.symbols @@ -0,0 +1,82 @@ +=== tests/cases/compiler/declFileTypeofFunction.ts === + +function f(n: typeof f): string; +>f : Symbol(f, Decl(declFileTypeofFunction.ts, 0, 0), Decl(declFileTypeofFunction.ts, 1, 32), Decl(declFileTypeofFunction.ts, 2, 32)) +>n : Symbol(n, Decl(declFileTypeofFunction.ts, 1, 11)) +>f : Symbol(f, Decl(declFileTypeofFunction.ts, 0, 0), Decl(declFileTypeofFunction.ts, 1, 32), Decl(declFileTypeofFunction.ts, 2, 32)) + +function f(n: typeof g): string; +>f : Symbol(f, Decl(declFileTypeofFunction.ts, 0, 0), Decl(declFileTypeofFunction.ts, 1, 32), Decl(declFileTypeofFunction.ts, 2, 32)) +>n : Symbol(n, Decl(declFileTypeofFunction.ts, 2, 11)) +>g : Symbol(g, Decl(declFileTypeofFunction.ts, 3, 34), Decl(declFileTypeofFunction.ts, 4, 32), Decl(declFileTypeofFunction.ts, 5, 32)) + +function f() { return undefined; } +>f : Symbol(f, Decl(declFileTypeofFunction.ts, 0, 0), Decl(declFileTypeofFunction.ts, 1, 32), Decl(declFileTypeofFunction.ts, 2, 32)) +>undefined : Symbol(undefined) + +function g(n: typeof g): number; +>g : Symbol(g, Decl(declFileTypeofFunction.ts, 3, 34), Decl(declFileTypeofFunction.ts, 4, 32), Decl(declFileTypeofFunction.ts, 5, 32)) +>n : Symbol(n, Decl(declFileTypeofFunction.ts, 4, 11)) +>g : Symbol(g, Decl(declFileTypeofFunction.ts, 3, 34), Decl(declFileTypeofFunction.ts, 4, 32), Decl(declFileTypeofFunction.ts, 5, 32)) + +function g(n: typeof f): number; +>g : Symbol(g, Decl(declFileTypeofFunction.ts, 3, 34), Decl(declFileTypeofFunction.ts, 4, 32), Decl(declFileTypeofFunction.ts, 5, 32)) +>n : Symbol(n, Decl(declFileTypeofFunction.ts, 5, 11)) +>f : Symbol(f, Decl(declFileTypeofFunction.ts, 0, 0), Decl(declFileTypeofFunction.ts, 1, 32), Decl(declFileTypeofFunction.ts, 2, 32)) + +function g() { return undefined; } +>g : Symbol(g, Decl(declFileTypeofFunction.ts, 3, 34), Decl(declFileTypeofFunction.ts, 4, 32), Decl(declFileTypeofFunction.ts, 5, 32)) +>undefined : Symbol(undefined) + +var b: () => typeof b; +>b : Symbol(b, Decl(declFileTypeofFunction.ts, 8, 3)) +>b : Symbol(b, Decl(declFileTypeofFunction.ts, 8, 3)) + +function b1() { +>b1 : Symbol(b1, Decl(declFileTypeofFunction.ts, 8, 22)) + + return b1; +>b1 : Symbol(b1, Decl(declFileTypeofFunction.ts, 8, 22)) +} + +function foo(): typeof foo { +>foo : Symbol(foo, Decl(declFileTypeofFunction.ts, 12, 1)) +>foo : Symbol(foo, Decl(declFileTypeofFunction.ts, 12, 1)) + + return null; +} +var foo1: typeof foo; +>foo1 : Symbol(foo1, Decl(declFileTypeofFunction.ts, 17, 3)) +>foo : Symbol(foo, Decl(declFileTypeofFunction.ts, 12, 1)) + +var foo2 = foo; +>foo2 : Symbol(foo2, Decl(declFileTypeofFunction.ts, 18, 3)) +>foo : Symbol(foo, Decl(declFileTypeofFunction.ts, 12, 1)) + +var foo3 = function () { +>foo3 : Symbol(foo3, Decl(declFileTypeofFunction.ts, 20, 3)) + + return foo3; +>foo3 : Symbol(foo3, Decl(declFileTypeofFunction.ts, 20, 3)) +} +var x = () => { +>x : Symbol(x, Decl(declFileTypeofFunction.ts, 23, 3)) + + return x; +>x : Symbol(x, Decl(declFileTypeofFunction.ts, 23, 3)) +} + +function foo5(x: number) { +>foo5 : Symbol(foo5, Decl(declFileTypeofFunction.ts, 25, 1)) +>x : Symbol(x, Decl(declFileTypeofFunction.ts, 27, 14)) + + function bar(x: number) { +>bar : Symbol(bar, Decl(declFileTypeofFunction.ts, 27, 26)) +>x : Symbol(x, Decl(declFileTypeofFunction.ts, 28, 17)) + + return x; +>x : Symbol(x, Decl(declFileTypeofFunction.ts, 28, 17)) + } + return bar; +>bar : Symbol(bar, Decl(declFileTypeofFunction.ts, 27, 26)) +} diff --git a/tests/baselines/reference/declFileTypeofFunction.types b/tests/baselines/reference/declFileTypeofFunction.types index bede9ba254b..b47b07035d1 100644 --- a/tests/baselines/reference/declFileTypeofFunction.types +++ b/tests/baselines/reference/declFileTypeofFunction.types @@ -44,6 +44,7 @@ function foo(): typeof foo { >foo : () => typeof foo return null; +>null : null } var foo1: typeof foo; >foo1 : () => typeof foo diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.symbols b/tests/baselines/reference/declFileTypeofInAnonymousType.symbols new file mode 100644 index 00000000000..426f953d6f2 --- /dev/null +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.symbols @@ -0,0 +1,77 @@ +=== tests/cases/compiler/declFileTypeofInAnonymousType.ts === + +module m1 { +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) + } + export enum e { +>e : Symbol(e, Decl(declFileTypeofInAnonymousType.ts, 3, 5)) + + weekday, +>weekday : Symbol(e.weekday, Decl(declFileTypeofInAnonymousType.ts, 4, 19)) + + weekend, +>weekend : Symbol(e.weekend, Decl(declFileTypeofInAnonymousType.ts, 5, 16)) + + holiday +>holiday : Symbol(e.holiday, Decl(declFileTypeofInAnonymousType.ts, 6, 16)) + } +} +var a: { c: m1.c; }; +>a : Symbol(a, Decl(declFileTypeofInAnonymousType.ts, 10, 3)) +>c : Symbol(c, Decl(declFileTypeofInAnonymousType.ts, 10, 8)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) +>c : Symbol(m1.c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) + +var b = { +>b : Symbol(b, Decl(declFileTypeofInAnonymousType.ts, 11, 3)) + + c: m1.c, +>c : Symbol(c, Decl(declFileTypeofInAnonymousType.ts, 11, 9)) +>m1.c : Symbol(m1.c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) +>c : Symbol(m1.c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) + + m1: m1 +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 12, 12)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) + +}; +var c = { m1: m1 }; +>c : Symbol(c, Decl(declFileTypeofInAnonymousType.ts, 15, 3)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 15, 9)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) + +var d = { +>d : Symbol(d, Decl(declFileTypeofInAnonymousType.ts, 16, 3)) + + m: { mod: m1 }, +>m : Symbol(m, Decl(declFileTypeofInAnonymousType.ts, 16, 9)) +>mod : Symbol(mod, Decl(declFileTypeofInAnonymousType.ts, 17, 8)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) + + mc: { cl: m1.c }, +>mc : Symbol(mc, Decl(declFileTypeofInAnonymousType.ts, 17, 19)) +>cl : Symbol(cl, Decl(declFileTypeofInAnonymousType.ts, 18, 9)) +>m1.c : Symbol(m1.c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) +>c : Symbol(m1.c, Decl(declFileTypeofInAnonymousType.ts, 1, 11)) + + me: { en: m1.e }, +>me : Symbol(me, Decl(declFileTypeofInAnonymousType.ts, 18, 21)) +>en : Symbol(en, Decl(declFileTypeofInAnonymousType.ts, 19, 9)) +>m1.e : Symbol(m1.e, Decl(declFileTypeofInAnonymousType.ts, 3, 5)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) +>e : Symbol(m1.e, Decl(declFileTypeofInAnonymousType.ts, 3, 5)) + + mh: m1.e.holiday +>mh : Symbol(mh, Decl(declFileTypeofInAnonymousType.ts, 19, 21)) +>m1.e.holiday : Symbol(m1.e.holiday, Decl(declFileTypeofInAnonymousType.ts, 6, 16)) +>m1.e : Symbol(m1.e, Decl(declFileTypeofInAnonymousType.ts, 3, 5)) +>m1 : Symbol(m1, Decl(declFileTypeofInAnonymousType.ts, 0, 0)) +>e : Symbol(m1.e, Decl(declFileTypeofInAnonymousType.ts, 3, 5)) +>holiday : Symbol(m1.e.holiday, Decl(declFileTypeofInAnonymousType.ts, 6, 16)) + +}; diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.types b/tests/baselines/reference/declFileTypeofInAnonymousType.types index 39ea7383ca4..fa9d0bcbd17 100644 --- a/tests/baselines/reference/declFileTypeofInAnonymousType.types +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.types @@ -22,7 +22,7 @@ module m1 { var a: { c: m1.c; }; >a : { c: m1.c; } >c : m1.c ->m1 : unknown +>m1 : any >c : m1.c var b = { diff --git a/tests/baselines/reference/declFileTypeofModule.symbols b/tests/baselines/reference/declFileTypeofModule.symbols new file mode 100644 index 00000000000..c84185b105d --- /dev/null +++ b/tests/baselines/reference/declFileTypeofModule.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/declFileTypeofModule.ts === + +module m1 { +>m1 : Symbol(m1, Decl(declFileTypeofModule.ts, 0, 0)) + + export var c: string; +>c : Symbol(c, Decl(declFileTypeofModule.ts, 2, 14)) +} +var m1_1 = m1; +>m1_1 : Symbol(m1_1, Decl(declFileTypeofModule.ts, 4, 3)) +>m1 : Symbol(m1, Decl(declFileTypeofModule.ts, 0, 0)) + +var m1_2: typeof m1; +>m1_2 : Symbol(m1_2, Decl(declFileTypeofModule.ts, 5, 3)) +>m1 : Symbol(m1, Decl(declFileTypeofModule.ts, 0, 0)) + +module m2 { +>m2 : Symbol(m2, Decl(declFileTypeofModule.ts, 5, 20)) + + export var d: typeof m2; +>d : Symbol(d, Decl(declFileTypeofModule.ts, 8, 14)) +>m2 : Symbol(m2, Decl(declFileTypeofModule.ts, 5, 20)) +} + +var m2_1 = m2; +>m2_1 : Symbol(m2_1, Decl(declFileTypeofModule.ts, 11, 3)) +>m2 : Symbol(m2, Decl(declFileTypeofModule.ts, 5, 20)) + +var m2_2: typeof m2; +>m2_2 : Symbol(m2_2, Decl(declFileTypeofModule.ts, 12, 3)) +>m2 : Symbol(m2, Decl(declFileTypeofModule.ts, 5, 20)) + diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.symbols b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.symbols new file mode 100644 index 00000000000..d2548af7c4f --- /dev/null +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts === + +declare module A.B.Base { +>A : Symbol(A, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 0, 0)) +>B : Symbol(B, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 17)) +>Base : Symbol(Base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 19)) + + export class W { +>W : Symbol(W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 25)) + + id: number; +>id : Symbol(id, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 2, 20)) + } +} +module X.Y.base { +>X : Symbol(X, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 5, 1), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 11, 1)) +>Y : Symbol(Y, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 9), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 9)) +>base : Symbol(base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 11), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 11)) + + export class W extends A.B.Base.W { +>W : Symbol(W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 17)) +>A.B.Base.W : Symbol(A.B.Base.W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 25)) +>A.B.Base : Symbol(A.B.Base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 19)) +>A.B : Symbol(A.B, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 17)) +>A : Symbol(A, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 0, 0)) +>B : Symbol(A.B, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 17)) +>Base : Symbol(A.B.Base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 19)) +>W : Symbol(A.B.Base.W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 1, 25)) + + name: string; +>name : Symbol(name, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 8, 39)) + } +} + +module X.Y.base.Z { +>X : Symbol(X, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 5, 1), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 11, 1)) +>Y : Symbol(Y, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 9), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 9)) +>base : Symbol(base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 11), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 11)) +>Z : Symbol(Z, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 16)) + + export class W extends X.Y.base.W { +>W : Symbol(W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 19)) +>TValue : Symbol(TValue, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 15, 19)) +>X.Y.base.W : Symbol(W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 17)) +>X.Y.base : Symbol(base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 11), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 11)) +>X.Y : Symbol(Y, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 9), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 9)) +>X : Symbol(X, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 5, 1), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 11, 1)) +>Y : Symbol(Y, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 9), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 9)) +>base : Symbol(base, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 11), Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 13, 11)) +>W : Symbol(W, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 6, 17)) + + value: boolean; +>value : Symbol(value, Decl(declFileWithClassNameConflictingWithClassReferredByExtendsClause.ts, 15, 47)) + } +} + diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types index 818a31b26d5..56e1d07d0ec 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.types @@ -19,6 +19,9 @@ module X.Y.base { export class W extends A.B.Base.W { >W : W +>A.B.Base.W : any +>A.B.Base : typeof A.B.Base +>A.B : typeof A.B >A : typeof A >B : typeof A.B >Base : typeof A.B.Base @@ -38,6 +41,9 @@ module X.Y.base.Z { export class W extends X.Y.base.W { >W : W >TValue : TValue +>X.Y.base.W : any +>X.Y.base : typeof base +>X.Y : typeof Y >X : typeof X >Y : typeof Y >base : typeof base diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.symbols b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.symbols new file mode 100644 index 00000000000..e5016ec9baa --- /dev/null +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/declFileWithExtendsClauseThatHasItsContainerNameConflict.ts === + +declare module A.B.C { +>A : Symbol(A, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 0, 0), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 4, 1), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 11, 1)) +>B : Symbol(B, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 17), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 6, 9), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 9)) +>C : Symbol(C, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 19), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 11)) + + class B { +>B : Symbol(B, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 22)) + } +} + +module A.B { +>A : Symbol(A, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 0, 0), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 4, 1), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 11, 1)) +>B : Symbol(B, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 17), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 6, 9), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 9)) + + export class EventManager { +>EventManager : Symbol(EventManager, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 6, 12)) + + id: number; +>id : Symbol(id, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 7, 31)) + + } +} + +module A.B.C { +>A : Symbol(A, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 0, 0), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 4, 1), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 11, 1)) +>B : Symbol(B, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 17), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 6, 9), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 9)) +>C : Symbol(C, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 1, 19), Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 11)) + + export class ContextMenu extends EventManager { +>ContextMenu : Symbol(ContextMenu, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 13, 14)) +>EventManager : Symbol(EventManager, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 6, 12)) + + name: string; +>name : Symbol(name, Decl(declFileWithExtendsClauseThatHasItsContainerNameConflict.ts, 14, 51)) + } +} diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.symbols b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.symbols new file mode 100644 index 00000000000..15e9c6c6e85 --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause1.ts === + +module X.A.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 4, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 11)) + + export interface Z { +>Z : Symbol(Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 14)) + } +} +module X.A.B.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 4, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 9)) +>B : Symbol(B, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 11)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 13)) + + module A { +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 16)) + } + export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict +>W : Symbol(W, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 7, 5)) +>X.A.C.Z : Symbol(X.A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 14)) +>X.A.C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 11)) +>X.A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 9)) +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 4, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 5, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 11)) +>Z : Symbol(X.A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause1.ts, 1, 14)) + } +} diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types index b2a1c154412..f6fb6dae297 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause1.types @@ -3,7 +3,7 @@ module X.A.C { >X : typeof X >A : typeof A ->C : unknown +>C : any export interface Z { >Z : Z @@ -16,13 +16,16 @@ module X.A.B.C { >C : typeof C module A { ->A : unknown +>A : any } export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict >W : W +>X.A.C.Z : any +>X.A.C : any +>X.A : typeof A >X : typeof X >A : typeof A ->C : unknown +>C : any >Z : X.A.C.Z } } diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.symbols b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.symbols new file mode 100644 index 00000000000..f0ce1ff2f97 --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause2.ts === + +module X.A.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 11)) + + export interface Z { +>Z : Symbol(Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 14)) + } +} +module X.A.B.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 9)) +>B : Symbol(B, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 11), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 11)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 13), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 13)) + + export class W implements A.C.Z { // This can refer to it as A.C.Z +>W : Symbol(W, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 16)) +>A.C.Z : Symbol(A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 14)) +>A.C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 11)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 11)) +>Z : Symbol(A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 14)) + } +} + +module X.A.B.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 9)) +>B : Symbol(B, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 11), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 11)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 5, 13), Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 13)) + + module A { +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause2.ts, 10, 16)) + } +} diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types index e43d0b78f57..a59a6930743 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause2.types @@ -3,7 +3,7 @@ module X.A.C { >X : typeof X >A : typeof A ->C : unknown +>C : any export interface Z { >Z : Z @@ -17,8 +17,10 @@ module X.A.B.C { export class W implements A.C.Z { // This can refer to it as A.C.Z >W : W +>A.C.Z : any +>A.C : any >A : typeof A ->C : unknown +>C : any >Z : A.C.Z } } @@ -30,6 +32,6 @@ module X.A.B.C { >C : typeof C module A { ->A : unknown +>A : any } } diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.symbols b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.symbols new file mode 100644 index 00000000000..6d2a63b86ca --- /dev/null +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause3.ts === + +module X.A.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 11)) + + export interface Z { +>Z : Symbol(Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 14)) + } +} +module X.A.B.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 9)) +>B : Symbol(B, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 11), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 11)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 13), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 13)) + + export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict +>W : Symbol(W, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 16)) +>X.A.C.Z : Symbol(X.A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 14)) +>X.A.C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 11)) +>X.A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 9)) +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 9)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 11)) +>Z : Symbol(X.A.C.Z, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 14)) + } +} + +module X.A.B.C { +>X : Symbol(X, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 0, 0), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 4, 1), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 8, 1)) +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 1, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 9), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 9)) +>B : Symbol(B, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 11), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 11)) +>C : Symbol(C, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 5, 13), Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 13)) + + export module A { +>A : Symbol(A, Decl(declFileWithInternalModuleNameConflictsInExtendsClause3.ts, 10, 16)) + } +} diff --git a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types index d45c2cf0523..f263cd96af8 100644 --- a/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types +++ b/tests/baselines/reference/declFileWithInternalModuleNameConflictsInExtendsClause3.types @@ -3,7 +3,7 @@ module X.A.C { >X : typeof X >A : typeof A ->C : unknown +>C : any export interface Z { >Z : Z @@ -17,9 +17,12 @@ module X.A.B.C { export class W implements X.A.C.Z { // This needs to be refered as X.A.C.Z as A has conflict >W : W +>X.A.C.Z : any +>X.A.C : any +>X.A : typeof A >X : typeof X >A : typeof A ->C : unknown +>C : any >Z : X.A.C.Z } } @@ -31,6 +34,6 @@ module X.A.B.C { >C : typeof C export module A { ->A : unknown +>A : any } } diff --git a/tests/baselines/reference/declInput3.symbols b/tests/baselines/reference/declInput3.symbols new file mode 100644 index 00000000000..06f35db0164 --- /dev/null +++ b/tests/baselines/reference/declInput3.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/declInput3.ts === +interface bar2 { +>bar2 : Symbol(bar2, Decl(declInput3.ts, 0, 0)) + +} + +class bar { +>bar : Symbol(bar, Decl(declInput3.ts, 2, 1)) + + public f() { return ''; } +>f : Symbol(f, Decl(declInput3.ts, 4, 11)) + + public g() { return {a: null, b: undefined, c: void 4 }; } +>g : Symbol(g, Decl(declInput3.ts, 5, 27)) +>a : Symbol(a, Decl(declInput3.ts, 6, 23)) +>bar : Symbol(bar, Decl(declInput3.ts, 2, 1)) +>b : Symbol(b, Decl(declInput3.ts, 6, 36)) +>undefined : Symbol(undefined) +>c : Symbol(c, Decl(declInput3.ts, 6, 50)) + + public h(x = 4, y = null, z = '') { x++; } +>h : Symbol(h, Decl(declInput3.ts, 6, 65)) +>x : Symbol(x, Decl(declInput3.ts, 7, 11)) +>y : Symbol(y, Decl(declInput3.ts, 7, 17)) +>z : Symbol(z, Decl(declInput3.ts, 7, 27)) +>x : Symbol(x, Decl(declInput3.ts, 7, 11)) +} + diff --git a/tests/baselines/reference/declInput3.types b/tests/baselines/reference/declInput3.types index df69422f55b..0dcbc6bd3cd 100644 --- a/tests/baselines/reference/declInput3.types +++ b/tests/baselines/reference/declInput3.types @@ -9,6 +9,7 @@ class bar { public f() { return ''; } >f : () => string +>'' : string public g() { return {a: null, b: undefined, c: void 4 }; } >g : () => { a: bar; b: any; c: any; } @@ -16,16 +17,21 @@ class bar { >a : bar >null : bar >bar : bar +>null : null >b : undefined >undefined : undefined >c : undefined >void 4 : undefined +>4 : number public h(x = 4, y = null, z = '') { x++; } >h : (x?: number, y?: any, z?: string) => void >x : number +>4 : number >y : any +>null : null >z : string +>'' : string >x++ : number >x : number } diff --git a/tests/baselines/reference/declInput4.symbols b/tests/baselines/reference/declInput4.symbols new file mode 100644 index 00000000000..01af5987a7d --- /dev/null +++ b/tests/baselines/reference/declInput4.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/declInput4.ts === +module M { +>M : Symbol(M, Decl(declInput4.ts, 0, 0)) + + class C { } +>C : Symbol(C, Decl(declInput4.ts, 0, 10)) + + export class E {} +>E : Symbol(E, Decl(declInput4.ts, 1, 15)) + + export interface I1 {} +>I1 : Symbol(I1, Decl(declInput4.ts, 2, 21)) + + interface I2 {} +>I2 : Symbol(I2, Decl(declInput4.ts, 3, 26)) + + export class D { +>D : Symbol(D, Decl(declInput4.ts, 4, 19)) + + public m1: number; +>m1 : Symbol(m1, Decl(declInput4.ts, 5, 20)) + + public m2: string; +>m2 : Symbol(m2, Decl(declInput4.ts, 6, 26)) + + public m23: E; +>m23 : Symbol(m23, Decl(declInput4.ts, 7, 26)) +>E : Symbol(E, Decl(declInput4.ts, 1, 15)) + + public m24: I1; +>m24 : Symbol(m24, Decl(declInput4.ts, 8, 22)) +>I1 : Symbol(I1, Decl(declInput4.ts, 2, 21)) + + public m232(): E { return null;} +>m232 : Symbol(m232, Decl(declInput4.ts, 9, 23)) +>E : Symbol(E, Decl(declInput4.ts, 1, 15)) + + public m242(): I1 { return null; } +>m242 : Symbol(m242, Decl(declInput4.ts, 10, 40)) +>I1 : Symbol(I1, Decl(declInput4.ts, 2, 21)) + + public m26(i:I1) {} +>m26 : Symbol(m26, Decl(declInput4.ts, 11, 42)) +>i : Symbol(i, Decl(declInput4.ts, 12, 19)) +>I1 : Symbol(I1, Decl(declInput4.ts, 2, 21)) + } +} diff --git a/tests/baselines/reference/declInput4.types b/tests/baselines/reference/declInput4.types index 7f5c5a81197..dd6915c162d 100644 --- a/tests/baselines/reference/declInput4.types +++ b/tests/baselines/reference/declInput4.types @@ -34,10 +34,12 @@ module M { public m232(): E { return null;} >m232 : () => E >E : E +>null : null public m242(): I1 { return null; } >m242 : () => I1 >I1 : I1 +>null : null public m26(i:I1) {} >m26 : (i: I1) => void diff --git a/tests/baselines/reference/declarationEmitDefaultExport1.symbols b/tests/baselines/reference/declarationEmitDefaultExport1.symbols new file mode 100644 index 00000000000..a90faac829c --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/declarationEmitDefaultExport1.ts === +export default class C { +>C : Symbol(C, Decl(declarationEmitDefaultExport1.ts, 0, 0)) +} diff --git a/tests/baselines/reference/declarationEmitDefaultExport2.symbols b/tests/baselines/reference/declarationEmitDefaultExport2.symbols new file mode 100644 index 00000000000..b82e6cfb923 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/declarationEmitDefaultExport2.ts === +export default class { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitDefaultExport3.symbols b/tests/baselines/reference/declarationEmitDefaultExport3.symbols new file mode 100644 index 00000000000..f69bbfcf0e7 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport3.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/declarationEmitDefaultExport3.ts === +export default function foo() { +>foo : Symbol(foo, Decl(declarationEmitDefaultExport3.ts, 0, 0)) + + return "" +} diff --git a/tests/baselines/reference/declarationEmitDefaultExport3.types b/tests/baselines/reference/declarationEmitDefaultExport3.types index 0bde6eff915..91ee71f61ac 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport3.types +++ b/tests/baselines/reference/declarationEmitDefaultExport3.types @@ -3,4 +3,5 @@ export default function foo() { >foo : () => string return "" +>"" : string } diff --git a/tests/baselines/reference/declarationEmitDefaultExport4.symbols b/tests/baselines/reference/declarationEmitDefaultExport4.symbols new file mode 100644 index 00000000000..8043af36b76 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport4.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/declarationEmitDefaultExport4.ts === +export default function () { +No type information for this code. return 1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitDefaultExport4.types b/tests/baselines/reference/declarationEmitDefaultExport4.types index 8043af36b76..ab97484176d 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport4.types +++ b/tests/baselines/reference/declarationEmitDefaultExport4.types @@ -1,5 +1,5 @@ === tests/cases/compiler/declarationEmitDefaultExport4.ts === export default function () { -No type information for this code. return 1; -No type information for this code.} -No type information for this code. \ No newline at end of file + return 1; +>1 : number +} diff --git a/tests/baselines/reference/declarationEmitDefaultExport5.symbols b/tests/baselines/reference/declarationEmitDefaultExport5.symbols new file mode 100644 index 00000000000..2ede4a5941a --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/declarationEmitDefaultExport5.ts === +export default 1 + 2; +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitDefaultExport5.types b/tests/baselines/reference/declarationEmitDefaultExport5.types index 702cc51f71e..d2b177cc084 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport5.types +++ b/tests/baselines/reference/declarationEmitDefaultExport5.types @@ -1,4 +1,6 @@ === tests/cases/compiler/declarationEmitDefaultExport5.ts === export default 1 + 2; >1 + 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/declarationEmitDefaultExport6.symbols b/tests/baselines/reference/declarationEmitDefaultExport6.symbols new file mode 100644 index 00000000000..fb52f276f95 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport6.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/declarationEmitDefaultExport6.ts === +export class A {} +>A : Symbol(A, Decl(declarationEmitDefaultExport6.ts, 0, 0)) + +export default new A(); +>A : Symbol(A, Decl(declarationEmitDefaultExport6.ts, 0, 0)) + diff --git a/tests/baselines/reference/declarationEmitDefaultExport8.symbols b/tests/baselines/reference/declarationEmitDefaultExport8.symbols new file mode 100644 index 00000000000..be886b5a289 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDefaultExport8.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/declarationEmitDefaultExport8.ts === + +var _default = 1; +>_default : Symbol(_default, Decl(declarationEmitDefaultExport8.ts, 1, 3)) + +export {_default as d} +>_default : Symbol(d, Decl(declarationEmitDefaultExport8.ts, 2, 8)) +>d : Symbol(d, Decl(declarationEmitDefaultExport8.ts, 2, 8)) + +export default 1 + 2; + diff --git a/tests/baselines/reference/declarationEmitDefaultExport8.types b/tests/baselines/reference/declarationEmitDefaultExport8.types index b33fdc901f9..bd99ee14530 100644 --- a/tests/baselines/reference/declarationEmitDefaultExport8.types +++ b/tests/baselines/reference/declarationEmitDefaultExport8.types @@ -2,6 +2,7 @@ var _default = 1; >_default : number +>1 : number export {_default as d} >_default : number @@ -9,4 +10,6 @@ export {_default as d} export default 1 + 2; >1 + 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/declarationEmitDestructuring1.symbols b/tests/baselines/reference/declarationEmitDestructuring1.symbols new file mode 100644 index 00000000000..10920128eee --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/declarationEmitDestructuring1.ts === +function foo([a, b, c]: [string, string, string]): void { } +>foo : Symbol(foo, Decl(declarationEmitDestructuring1.ts, 0, 0)) +>a : Symbol(a, Decl(declarationEmitDestructuring1.ts, 0, 14)) +>b : Symbol(b, Decl(declarationEmitDestructuring1.ts, 0, 16)) +>c : Symbol(c, Decl(declarationEmitDestructuring1.ts, 0, 19)) + +function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { } +>far : Symbol(far, Decl(declarationEmitDestructuring1.ts, 0, 59)) +>a : Symbol(a, Decl(declarationEmitDestructuring1.ts, 1, 14)) +>b : Symbol(b, Decl(declarationEmitDestructuring1.ts, 1, 18)) +>c : Symbol(c, Decl(declarationEmitDestructuring1.ts, 1, 24)) + +function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { } +>bar : Symbol(bar, Decl(declarationEmitDestructuring1.ts, 1, 72)) +>a1 : Symbol(a1, Decl(declarationEmitDestructuring1.ts, 2, 14)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring1.ts, 2, 17)) +>c1 : Symbol(c1, Decl(declarationEmitDestructuring1.ts, 2, 21)) +>a1 : Symbol(a1, Decl(declarationEmitDestructuring1.ts, 2, 28)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring1.ts, 2, 40)) +>c1 : Symbol(c1, Decl(declarationEmitDestructuring1.ts, 2, 53)) + +function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { } +>baz : Symbol(baz, Decl(declarationEmitDestructuring1.ts, 2, 77)) +>a2 : Symbol(a2, Decl(declarationEmitDestructuring1.ts, 3, 14)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring1.ts, 3, 23)) +>c1 : Symbol(c1, Decl(declarationEmitDestructuring1.ts, 3, 26)) +>a2 : Symbol(a2, Decl(declarationEmitDestructuring1.ts, 3, 34)) +>b2 : Symbol(b2, Decl(declarationEmitDestructuring1.ts, 3, 46)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring1.ts, 3, 52)) +>c1 : Symbol(c1, Decl(declarationEmitDestructuring1.ts, 3, 65)) + diff --git a/tests/baselines/reference/declarationEmitDestructuring1.types b/tests/baselines/reference/declarationEmitDestructuring1.types index 6b22f25b54b..abba67981d8 100644 --- a/tests/baselines/reference/declarationEmitDestructuring1.types +++ b/tests/baselines/reference/declarationEmitDestructuring1.types @@ -23,7 +23,7 @@ function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { } function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { } >baz : ({a2, b2: {b1, c1}}: { a2: number; b2: { b1: boolean; c1: string; }; }) => void >a2 : number ->b2 : unknown +>b2 : any >b1 : boolean >c1 : string >a2 : number diff --git a/tests/baselines/reference/declarationEmitDestructuring2.symbols b/tests/baselines/reference/declarationEmitDestructuring2.symbols new file mode 100644 index 00000000000..9cf35c1d866 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring2.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/declarationEmitDestructuring2.ts === +function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { } +>f : Symbol(f, Decl(declarationEmitDestructuring2.ts, 0, 0)) +>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 0, 12)) +>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 0, 24)) +>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 0, 26)) +>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 0, 29)) +>d : Symbol(d, Decl(declarationEmitDestructuring2.ts, 0, 32)) +>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 0, 55)) +>y : Symbol(y, Decl(declarationEmitDestructuring2.ts, 0, 62)) + +function g([a, b, c, d] = [1, 2, 3, 4]) { } +>g : Symbol(g, Decl(declarationEmitDestructuring2.ts, 0, 85)) +>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 1, 12)) +>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 1, 14)) +>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 1, 17)) +>d : Symbol(d, Decl(declarationEmitDestructuring2.ts, 1, 20)) + +function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } +>h : Symbol(h, Decl(declarationEmitDestructuring2.ts, 1, 43)) +>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 2, 12), Decl(declarationEmitDestructuring2.ts, 2, 40)) +>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 2, 16), Decl(declarationEmitDestructuring2.ts, 2, 42)) +>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 2, 22), Decl(declarationEmitDestructuring2.ts, 2, 45)) +>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 2, 28)) +>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 2, 12), Decl(declarationEmitDestructuring2.ts, 2, 40)) +>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 2, 16), Decl(declarationEmitDestructuring2.ts, 2, 42)) +>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 2, 22), Decl(declarationEmitDestructuring2.ts, 2, 45)) +>a1 : Symbol(a1, Decl(declarationEmitDestructuring2.ts, 2, 54)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring2.ts, 2, 57)) + +function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } +>h1 : Symbol(h1, Decl(declarationEmitDestructuring2.ts, 2, 67)) +>a : Symbol(a, Decl(declarationEmitDestructuring2.ts, 3, 13)) +>b : Symbol(b, Decl(declarationEmitDestructuring2.ts, 3, 17)) +>c : Symbol(c, Decl(declarationEmitDestructuring2.ts, 3, 23)) +>x : Symbol(x, Decl(declarationEmitDestructuring2.ts, 3, 29)) +>y : Symbol(y, Decl(declarationEmitDestructuring2.ts, 3, 36)) +>a1 : Symbol(a1, Decl(declarationEmitDestructuring2.ts, 3, 56)) +>b1 : Symbol(b1, Decl(declarationEmitDestructuring2.ts, 3, 59)) + diff --git a/tests/baselines/reference/declarationEmitDestructuring2.types b/tests/baselines/reference/declarationEmitDestructuring2.types index 3368d4e72fd..619ad13d084 100644 --- a/tests/baselines/reference/declarationEmitDestructuring2.types +++ b/tests/baselines/reference/declarationEmitDestructuring2.types @@ -2,16 +2,26 @@ function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { } >f : ({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]}?: { x: number; y: [number, number, number, number]; }) => void >x : number ->y : unknown +>10 : number +>y : any >a : number >b : number >c : number >d : number >[1, 2, 3, 4] : [number, number, number, number] +>1 : number +>2 : number +>3 : number +>4 : number >{ x: 10, y: [2, 4, 6, 8] } : { x: number; y: [number, number, number, number]; } >x : number +>10 : number >y : [number, number, number, number] >[2, 4, 6, 8] : [number, number, number, number] +>2 : number +>4 : number +>6 : number +>8 : number function g([a, b, c, d] = [1, 2, 3, 4]) { } >g : ([a, b, c, d]?: [number, number, number, number]) => void @@ -20,6 +30,10 @@ function g([a, b, c, d] = [1, 2, 3, 4]) { } >c : number >d : number >[1, 2, 3, 4] : [number, number, number, number] +>1 : number +>2 : number +>3 : number +>4 : number function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } >h : ([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]: [any, [any], [[any]], { x?: number; y: [any, any, any]; z: { a1: any; b1: any; }; }]) => void @@ -27,11 +41,12 @@ function h([a, [b], [[c]], {x = 10, y: [a, b, c], z: {a1, b1}}]){ } >b : any >c : any >x : number ->y : unknown +>10 : number +>y : any >a : any >b : any >c : any ->z : unknown +>z : any >a1 : any >b1 : any @@ -41,9 +56,13 @@ function h1([a, [b], [[c]], {x = 10, y = [1, 2, 3], z: {a1, b1}}]){ } >b : any >c : any >x : number +>10 : number >y : number[] >[1, 2, 3] : number[] ->z : unknown +>1 : number +>2 : number +>3 : number +>z : any >a1 : any >b1 : any diff --git a/tests/baselines/reference/declarationEmitDestructuring3.symbols b/tests/baselines/reference/declarationEmitDestructuring3.symbols new file mode 100644 index 00000000000..76a1c6a003b --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring3.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/declarationEmitDestructuring3.ts === +function bar([x, z, ...w]) { } +>bar : Symbol(bar, Decl(declarationEmitDestructuring3.ts, 0, 0)) +>x : Symbol(x, Decl(declarationEmitDestructuring3.ts, 0, 14)) +>z : Symbol(z, Decl(declarationEmitDestructuring3.ts, 0, 16)) +>w : Symbol(w, Decl(declarationEmitDestructuring3.ts, 0, 19)) + +function foo([x, ...y] = [1, "string", true]) { } +>foo : Symbol(foo, Decl(declarationEmitDestructuring3.ts, 0, 30)) +>x : Symbol(x, Decl(declarationEmitDestructuring3.ts, 1, 14)) +>y : Symbol(y, Decl(declarationEmitDestructuring3.ts, 1, 16)) + + diff --git a/tests/baselines/reference/declarationEmitDestructuring3.types b/tests/baselines/reference/declarationEmitDestructuring3.types index 57764f53eee..da9fc6d6606 100644 --- a/tests/baselines/reference/declarationEmitDestructuring3.types +++ b/tests/baselines/reference/declarationEmitDestructuring3.types @@ -10,5 +10,8 @@ function foo([x, ...y] = [1, "string", true]) { } >x : string | number | boolean >y : (string | number | boolean)[] >[1, "string", true] : (string | number | boolean)[] +>1 : number +>"string" : string +>true : boolean diff --git a/tests/baselines/reference/declarationEmitDestructuring4.symbols b/tests/baselines/reference/declarationEmitDestructuring4.symbols new file mode 100644 index 00000000000..9f2eb162b6f --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring4.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/declarationEmitDestructuring4.ts === +// For an array binding pattern with empty elements, +// we will not make any modification and will emit +// the similar binding pattern users' have written +function baz([]) { } +>baz : Symbol(baz, Decl(declarationEmitDestructuring4.ts, 0, 0)) + +function baz1([] = [1,2,3]) { } +>baz1 : Symbol(baz1, Decl(declarationEmitDestructuring4.ts, 3, 20)) + +function baz2([[]] = [[1,2,3]]) { } +>baz2 : Symbol(baz2, Decl(declarationEmitDestructuring4.ts, 4, 31)) + +function baz3({}) { } +>baz3 : Symbol(baz3, Decl(declarationEmitDestructuring4.ts, 5, 35)) + +function baz4({} = { x: 10 }) { } +>baz4 : Symbol(baz4, Decl(declarationEmitDestructuring4.ts, 7, 21)) +>x : Symbol(x, Decl(declarationEmitDestructuring4.ts, 8, 20)) + + diff --git a/tests/baselines/reference/declarationEmitDestructuring4.types b/tests/baselines/reference/declarationEmitDestructuring4.types index 6a90eda1702..9621d61e02b 100644 --- a/tests/baselines/reference/declarationEmitDestructuring4.types +++ b/tests/baselines/reference/declarationEmitDestructuring4.types @@ -8,11 +8,17 @@ function baz([]) { } function baz1([] = [1,2,3]) { } >baz1 : ([]?: number[]) => void >[1,2,3] : number[] +>1 : number +>2 : number +>3 : number function baz2([[]] = [[1,2,3]]) { } >baz2 : ([[]]?: [number[]]) => void >[[1,2,3]] : [number[]] >[1,2,3] : number[] +>1 : number +>2 : number +>3 : number function baz3({}) { } >baz3 : ({}: {}) => void @@ -21,5 +27,6 @@ function baz4({} = { x: 10 }) { } >baz4 : ({}?: { x: number; }) => void >{ x: 10 } : { x: number; } >x : number +>10 : number diff --git a/tests/baselines/reference/declarationEmitDestructuring5.symbols b/tests/baselines/reference/declarationEmitDestructuring5.symbols new file mode 100644 index 00000000000..6e12358b80c --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuring5.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/declarationEmitDestructuring5.ts === +function baz([, z, , ]) { } +>baz : Symbol(baz, Decl(declarationEmitDestructuring5.ts, 0, 0)) +>z : Symbol(z, Decl(declarationEmitDestructuring5.ts, 0, 15)) + +function foo([, b, ]: [any, any]): void { } +>foo : Symbol(foo, Decl(declarationEmitDestructuring5.ts, 0, 27)) +>b : Symbol(b, Decl(declarationEmitDestructuring5.ts, 1, 15)) + +function bar([z, , , ]) { } +>bar : Symbol(bar, Decl(declarationEmitDestructuring5.ts, 1, 43)) +>z : Symbol(z, Decl(declarationEmitDestructuring5.ts, 2, 14)) + +function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } +>bar1 : Symbol(bar1, Decl(declarationEmitDestructuring5.ts, 2, 27)) +>z : Symbol(z, Decl(declarationEmitDestructuring5.ts, 3, 15)) + +function bar2([,,z, , , ]) { } +>bar2 : Symbol(bar2, Decl(declarationEmitDestructuring5.ts, 3, 46)) +>z : Symbol(z, Decl(declarationEmitDestructuring5.ts, 4, 17)) + diff --git a/tests/baselines/reference/declarationEmitDestructuring5.types b/tests/baselines/reference/declarationEmitDestructuring5.types index 375440bea0b..f09b1ebf50c 100644 --- a/tests/baselines/reference/declarationEmitDestructuring5.types +++ b/tests/baselines/reference/declarationEmitDestructuring5.types @@ -1,22 +1,38 @@ === tests/cases/compiler/declarationEmitDestructuring5.ts === function baz([, z, , ]) { } >baz : ([, z, , ]: [any, any, any]) => void +> : undefined >z : any +> : undefined function foo([, b, ]: [any, any]): void { } >foo : ([, b, ]: [any, any]) => void +> : undefined >b : any function bar([z, , , ]) { } >bar : ([z, , , ]: [any, any, any]) => void >z : any +> : undefined +> : undefined function bar1([z, , , ] = [1, 3, 4, 6, 7]) { } >bar1 : ([z, , , ]?: [number, number, number, number, number]) => void >z : number +> : undefined +> : undefined >[1, 3, 4, 6, 7] : [number, number, number, number, number] +>1 : number +>3 : number +>4 : number +>6 : number +>7 : number function bar2([,,z, , , ]) { } >bar2 : ([,,z, , , ]: [any, any, any, any, any]) => void +> : undefined +> : undefined >z : any +> : undefined +> : undefined diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js index 088bb4e849f..9a9be8c69da 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.js @@ -11,7 +11,7 @@ var [x3, y3, z3] = a; // emit x3, y3, z3 //// [declarationEmitDestructuringArrayPattern1.js] var _a = [1, "hello"]; // Dont emit anything -var x = ([1, "hello"])[0]; // emit x: number +var x = [1, "hello"][0]; // emit x: number var _b = [1, "hello"], x1 = _b[0], y1 = _b[1]; // emit x1: number, y1: string var _c = [0, 1, 2], z1 = _c[2]; // emit z1: number var a = [1, "hello"]; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.symbols b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.symbols new file mode 100644 index 00000000000..e9d80c89f6e --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern1.ts === + +var [] = [1, "hello"]; // Dont emit anything +var [x] = [1, "hello"]; // emit x: number +>x : Symbol(x, Decl(declarationEmitDestructuringArrayPattern1.ts, 2, 5)) + +var [x1, y1] = [1, "hello"]; // emit x1: number, y1: string +>x1 : Symbol(x1, Decl(declarationEmitDestructuringArrayPattern1.ts, 3, 5)) +>y1 : Symbol(y1, Decl(declarationEmitDestructuringArrayPattern1.ts, 3, 8)) + +var [, , z1] = [0, 1, 2]; // emit z1: number +>z1 : Symbol(z1, Decl(declarationEmitDestructuringArrayPattern1.ts, 4, 8)) + +var a = [1, "hello"]; +>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern1.ts, 6, 3)) + +var [x2] = a; // emit x2: number | string +>x2 : Symbol(x2, Decl(declarationEmitDestructuringArrayPattern1.ts, 7, 5)) +>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern1.ts, 6, 3)) + +var [x3, y3, z3] = a; // emit x3, y3, z3 +>x3 : Symbol(x3, Decl(declarationEmitDestructuringArrayPattern1.ts, 8, 5)) +>y3 : Symbol(y3, Decl(declarationEmitDestructuringArrayPattern1.ts, 8, 8)) +>z3 : Symbol(z3, Decl(declarationEmitDestructuringArrayPattern1.ts, 8, 12)) +>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern1.ts, 6, 3)) + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types index 9f6f4c9857d..0feeaf2db1a 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern1.types @@ -2,23 +2,36 @@ var [] = [1, "hello"]; // Dont emit anything >[1, "hello"] : (string | number)[] +>1 : number +>"hello" : string var [x] = [1, "hello"]; // emit x: number >x : number >[1, "hello"] : [number, string] +>1 : number +>"hello" : string var [x1, y1] = [1, "hello"]; // emit x1: number, y1: string >x1 : number >y1 : string >[1, "hello"] : [number, string] +>1 : number +>"hello" : string var [, , z1] = [0, 1, 2]; // emit z1: number +> : undefined +> : undefined >z1 : number >[0, 1, 2] : [number, number, number] +>0 : number +>1 : number +>2 : number var a = [1, "hello"]; >a : (string | number)[] >[1, "hello"] : (string | number)[] +>1 : number +>"hello" : string var [x2] = a; // emit x2: number | string >x2 : string | number diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.symbols b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.symbols new file mode 100644 index 00000000000..9e0e48f89e8 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts === +var [x10, [y10, [z10]]] = [1, ["hello", [true]]]; +>x10 : Symbol(x10, Decl(declarationEmitDestructuringArrayPattern2.ts, 0, 5)) +>y10 : Symbol(y10, Decl(declarationEmitDestructuringArrayPattern2.ts, 0, 11)) +>z10 : Symbol(z10, Decl(declarationEmitDestructuringArrayPattern2.ts, 0, 17)) + +var [x11 = 0, y11 = ""] = [1, "hello"]; +>x11 : Symbol(x11, Decl(declarationEmitDestructuringArrayPattern2.ts, 2, 5)) +>y11 : Symbol(y11, Decl(declarationEmitDestructuringArrayPattern2.ts, 2, 13)) + +var [a11, b11, c11] = []; +>a11 : Symbol(a11, Decl(declarationEmitDestructuringArrayPattern2.ts, 3, 5)) +>b11 : Symbol(b11, Decl(declarationEmitDestructuringArrayPattern2.ts, 3, 9)) +>c11 : Symbol(c11, Decl(declarationEmitDestructuringArrayPattern2.ts, 3, 14)) + +var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello", { x12: 5, y12: true }]]; +>a2 : Symbol(a2, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 5)) +>b2 : Symbol(b2, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 10)) +>x12 : Symbol(x12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 15)) +>c2 : Symbol(c2, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 20)) +>x12 : Symbol(x12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 41)) +>y12 : Symbol(y12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 50)) +>x12 : Symbol(x12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 83)) +>y12 : Symbol(y12, Decl(declarationEmitDestructuringArrayPattern2.ts, 5, 91)) + +var [x13, y13] = [1, "hello"]; +>x13 : Symbol(x13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 5)) +>y13 : Symbol(y13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 9)) + +var [a3, b3] = [[x13, y13], { x: x13, y: y13 }]; +>a3 : Symbol(a3, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 5)) +>b3 : Symbol(b3, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 8)) +>x13 : Symbol(x13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 5)) +>y13 : Symbol(y13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 9)) +>x : Symbol(x, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 29)) +>x13 : Symbol(x13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 5)) +>y : Symbol(y, Decl(declarationEmitDestructuringArrayPattern2.ts, 8, 37)) +>y13 : Symbol(y13, Decl(declarationEmitDestructuringArrayPattern2.ts, 7, 9)) + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types index 2b40a388e3b..9fce72751cf 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types @@ -4,13 +4,20 @@ var [x10, [y10, [z10]]] = [1, ["hello", [true]]]; >y10 : string >z10 : boolean >[1, ["hello", [true]]] : [number, [string, [boolean]]] +>1 : number >["hello", [true]] : [string, [boolean]] +>"hello" : string >[true] : [boolean] +>true : boolean var [x11 = 0, y11 = ""] = [1, "hello"]; >x11 : number +>0 : number >y11 : string +>"" : string >[1, "hello"] : [number, string] +>1 : number +>"hello" : string var [a11, b11, c11] = []; >a11 : any @@ -22,22 +29,31 @@ var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello" >a2 : number >b2 : string >x12 : number ->y12 : unknown +>y12 : any >c2 : boolean >["abc", { x12: 10, y12: false }] : [string, { x12: number; y12: boolean; }] +>"abc" : string >{ x12: 10, y12: false } : { x12: number; y12: boolean; } >x12 : number +>10 : number >y12 : boolean +>false : boolean >[1, ["hello", { x12: 5, y12: true }]] : [number, [string, { x12: number; y12: boolean; }]] +>1 : number >["hello", { x12: 5, y12: true }] : [string, { x12: number; y12: boolean; }] +>"hello" : string >{ x12: 5, y12: true } : { x12: number; y12: boolean; } >x12 : number +>5 : number >y12 : boolean +>true : boolean var [x13, y13] = [1, "hello"]; >x13 : number >y13 : string >[1, "hello"] : [number, string] +>1 : number +>"hello" : string var [a3, b3] = [[x13, y13], { x: x13, y: y13 }]; >a3 : (string | number)[] diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.symbols b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.symbols new file mode 100644 index 00000000000..af0f758684e --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern3.ts === +module M { +>M : Symbol(M, Decl(declarationEmitDestructuringArrayPattern3.ts, 0, 0)) + + export var [a, b] = [1, 2]; +>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern3.ts, 1, 16)) +>b : Symbol(b, Decl(declarationEmitDestructuringArrayPattern3.ts, 1, 18)) +} diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types index 4852a7e37fb..406494aa13b 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern3.types @@ -6,4 +6,6 @@ module M { >a : number >b : number >[1, 2] : [number, number] +>1 : number +>2 : number } diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js index f19a4a840bf..1bd07e7b974 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.js @@ -10,14 +10,14 @@ var [x18, y18, ...a12] = [1, "hello", true]; var [x19, y19, z19, ...a13] = [1, "hello", true]; //// [declarationEmitDestructuringArrayPattern4.js] -var _a = [1, 2, 3], a5 = _a.slice(0); -var _b = [1, 2, 3], x14 = _b[0], a6 = _b.slice(1); -var _c = [1, 2, 3], x15 = _c[0], y15 = _c[1], a7 = _c.slice(2); -var _d = [1, 2, 3], x16 = _d[0], y16 = _d[1], z16 = _d[2], a8 = _d.slice(3); -var _e = [1, "hello", true], a9 = _e.slice(0); -var _f = [1, "hello", true], x17 = _f[0], a10 = _f.slice(1); -var _g = [1, "hello", true], x18 = _g[0], y18 = _g[1], a12 = _g.slice(2); -var _h = [1, "hello", true], x19 = _h[0], y19 = _h[1], z19 = _h[2], a13 = _h.slice(3); +var a5 = [1, 2, 3].slice(0); +var _a = [1, 2, 3], x14 = _a[0], a6 = _a.slice(1); +var _b = [1, 2, 3], x15 = _b[0], y15 = _b[1], a7 = _b.slice(2); +var _c = [1, 2, 3], x16 = _c[0], y16 = _c[1], z16 = _c[2], a8 = _c.slice(3); +var a9 = [1, "hello", true].slice(0); +var _d = [1, "hello", true], x17 = _d[0], a10 = _d.slice(1); +var _e = [1, "hello", true], x18 = _e[0], y18 = _e[1], a12 = _e.slice(2); +var _f = [1, "hello", true], x19 = _f[0], y19 = _f[1], z19 = _f[2], a13 = _f.slice(3); //// [declarationEmitDestructuringArrayPattern4.d.ts] diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.symbols b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.symbols new file mode 100644 index 00000000000..b83f5a5d2d1 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern4.ts === +var [...a5] = [1, 2, 3]; +>a5 : Symbol(a5, Decl(declarationEmitDestructuringArrayPattern4.ts, 0, 5)) + +var [x14, ...a6] = [1, 2, 3]; +>x14 : Symbol(x14, Decl(declarationEmitDestructuringArrayPattern4.ts, 1, 5)) +>a6 : Symbol(a6, Decl(declarationEmitDestructuringArrayPattern4.ts, 1, 9)) + +var [x15, y15, ...a7] = [1, 2, 3]; +>x15 : Symbol(x15, Decl(declarationEmitDestructuringArrayPattern4.ts, 2, 5)) +>y15 : Symbol(y15, Decl(declarationEmitDestructuringArrayPattern4.ts, 2, 9)) +>a7 : Symbol(a7, Decl(declarationEmitDestructuringArrayPattern4.ts, 2, 14)) + +var [x16, y16, z16, ...a8] = [1, 2, 3]; +>x16 : Symbol(x16, Decl(declarationEmitDestructuringArrayPattern4.ts, 3, 5)) +>y16 : Symbol(y16, Decl(declarationEmitDestructuringArrayPattern4.ts, 3, 9)) +>z16 : Symbol(z16, Decl(declarationEmitDestructuringArrayPattern4.ts, 3, 14)) +>a8 : Symbol(a8, Decl(declarationEmitDestructuringArrayPattern4.ts, 3, 19)) + +var [...a9] = [1, "hello", true]; +>a9 : Symbol(a9, Decl(declarationEmitDestructuringArrayPattern4.ts, 5, 5)) + +var [x17, ...a10] = [1, "hello", true]; +>x17 : Symbol(x17, Decl(declarationEmitDestructuringArrayPattern4.ts, 6, 5)) +>a10 : Symbol(a10, Decl(declarationEmitDestructuringArrayPattern4.ts, 6, 9)) + +var [x18, y18, ...a12] = [1, "hello", true]; +>x18 : Symbol(x18, Decl(declarationEmitDestructuringArrayPattern4.ts, 7, 5)) +>y18 : Symbol(y18, Decl(declarationEmitDestructuringArrayPattern4.ts, 7, 9)) +>a12 : Symbol(a12, Decl(declarationEmitDestructuringArrayPattern4.ts, 7, 14)) + +var [x19, y19, z19, ...a13] = [1, "hello", true]; +>x19 : Symbol(x19, Decl(declarationEmitDestructuringArrayPattern4.ts, 8, 5)) +>y19 : Symbol(y19, Decl(declarationEmitDestructuringArrayPattern4.ts, 8, 9)) +>z19 : Symbol(z19, Decl(declarationEmitDestructuringArrayPattern4.ts, 8, 14)) +>a13 : Symbol(a13, Decl(declarationEmitDestructuringArrayPattern4.ts, 8, 19)) + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types index d6d0fa758d7..2cc56abcb05 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern4.types @@ -2,17 +2,26 @@ var [...a5] = [1, 2, 3]; >a5 : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var [x14, ...a6] = [1, 2, 3]; >x14 : number >a6 : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var [x15, y15, ...a7] = [1, 2, 3]; >x15 : number >y15 : number >a7 : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var [x16, y16, z16, ...a8] = [1, 2, 3]; >x16 : number @@ -20,21 +29,33 @@ var [x16, y16, z16, ...a8] = [1, 2, 3]; >z16 : number >a8 : number[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number var [...a9] = [1, "hello", true]; >a9 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] +>1 : number +>"hello" : string +>true : boolean var [x17, ...a10] = [1, "hello", true]; >x17 : string | number | boolean >a10 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] +>1 : number +>"hello" : string +>true : boolean var [x18, y18, ...a12] = [1, "hello", true]; >x18 : string | number | boolean >y18 : string | number | boolean >a12 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] +>1 : number +>"hello" : string +>true : boolean var [x19, y19, z19, ...a13] = [1, "hello", true]; >x19 : string | number | boolean @@ -42,4 +63,7 @@ var [x19, y19, z19, ...a13] = [1, "hello", true]; >z19 : string | number | boolean >a13 : (string | number | boolean)[] >[1, "hello", true] : (string | number | boolean)[] +>1 : number +>"hello" : string +>true : boolean diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.symbols b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.symbols new file mode 100644 index 00000000000..d30aab7832c --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts === +var [, , z] = [1, 2, 4]; +>z : Symbol(z, Decl(declarationEmitDestructuringArrayPattern5.ts, 0, 8)) + +var [, a, , ] = [3, 4, 5]; +>a : Symbol(a, Decl(declarationEmitDestructuringArrayPattern5.ts, 1, 6)) + +var [, , [, b, ]] = [3,5,[0, 1]]; +>b : Symbol(b, Decl(declarationEmitDestructuringArrayPattern5.ts, 2, 11)) + diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types index 6352917682e..fa5720f4da7 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern5.types @@ -1,14 +1,31 @@ === tests/cases/compiler/declarationEmitDestructuringArrayPattern5.ts === var [, , z] = [1, 2, 4]; +> : undefined +> : undefined >z : number >[1, 2, 4] : [number, number, number] +>1 : number +>2 : number +>4 : number var [, a, , ] = [3, 4, 5]; +> : undefined >a : number +> : undefined >[3, 4, 5] : [number, number, number] +>3 : number +>4 : number +>5 : number var [, , [, b, ]] = [3,5,[0, 1]]; +> : undefined +> : undefined +> : undefined >b : number >[3,5,[0, 1]] : [number, number, [number, number]] +>3 : number +>5 : number >[0, 1] : [number, number] +>0 : number +>1 : number diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js index d94da79ad9a..38b0a14af5c 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js @@ -24,11 +24,11 @@ module m { //// [declarationEmitDestructuringObjectLiteralPattern.js] var _a = { x: 5, y: "hello" }; -var x4 = ({ x4: 5, y4: "hello" }).x4; -var y5 = ({ x5: 5, y5: "hello" }).y5; +var x4 = { x4: 5, y4: "hello" }.x4; +var y5 = { x5: 5, y5: "hello" }.y5; var _b = { x6: 5, y6: "hello" }, x6 = _b.x6, y6 = _b.y6; -var a1 = ({ x7: 5, y7: "hello" }).x7; -var b1 = ({ x8: 5, y8: "hello" }).y8; +var a1 = { x7: 5, y7: "hello" }.x7; +var b1 = { x8: 5, y8: "hello" }.y8; var _c = { x9: 5, y9: "hello" }, a2 = _c.x9, b2 = _c.y9; var _d = { a: 1, b: { a: "hello", b: { a: true } } }, x11 = _d.a, _e = _d.b, y11 = _e.a, z11 = _e.b.a; function f15() { diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.symbols b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.symbols new file mode 100644 index 00000000000..3cb4ef28c2b --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.symbols @@ -0,0 +1,80 @@ +=== tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern.ts === + +var { } = { x: 5, y: "hello" }; +>x : Symbol(x, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 1, 11)) +>y : Symbol(y, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 1, 17)) + +var { x4 } = { x4: 5, y4: "hello" }; +>x4 : Symbol(x4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 2, 5)) +>x4 : Symbol(x4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 2, 14)) +>y4 : Symbol(y4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 2, 21)) + +var { y5 } = { x5: 5, y5: "hello" }; +>y5 : Symbol(y5, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 3, 5)) +>x5 : Symbol(x5, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 3, 14)) +>y5 : Symbol(y5, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 3, 21)) + +var { x6, y6 } = { x6: 5, y6: "hello" }; +>x6 : Symbol(x6, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 4, 5)) +>y6 : Symbol(y6, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 4, 9)) +>x6 : Symbol(x6, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 4, 18)) +>y6 : Symbol(y6, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 4, 25)) + +var { x7: a1 } = { x7: 5, y7: "hello" }; +>a1 : Symbol(a1, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 5, 5)) +>x7 : Symbol(x7, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 5, 18)) +>y7 : Symbol(y7, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 5, 25)) + +var { y8: b1 } = { x8: 5, y8: "hello" }; +>b1 : Symbol(b1, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 6, 5)) +>x8 : Symbol(x8, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 6, 18)) +>y8 : Symbol(y8, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 6, 25)) + +var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; +>a2 : Symbol(a2, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 7, 5)) +>b2 : Symbol(b2, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 7, 13)) +>x9 : Symbol(x9, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 7, 26)) +>y9 : Symbol(y9, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 7, 33)) + +var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: true } } }; +>x11 : Symbol(x11, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 5)) +>y11 : Symbol(y11, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 18)) +>z11 : Symbol(z11, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 31)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 46)) +>b : Symbol(b, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 52)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 57)) +>b : Symbol(b, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 69)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 74)) + +function f15() { +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 89)) + + var a4 = "hello"; +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 12, 7)) + + var b4 = 1; +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 13, 7)) + + var c4 = true; +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 14, 7)) + + return { a4, b4, c4 }; +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 15, 12)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 15, 16)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 15, 20)) +} +var { a4, b4, c4 } = f15(); +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 17, 5)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 17, 9)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 17, 13)) +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 89)) + +module m { +>m : Symbol(m, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 17, 27)) + + export var { a4, b4, c4 } = f15(); +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 20, 16)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 20, 20)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 20, 24)) +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern.ts, 9, 89)) +} diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.types b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.types index b3c422e4958..0911a27838b 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.types +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.types @@ -3,79 +3,99 @@ var { } = { x: 5, y: "hello" }; >{ x: 5, y: "hello" } : { x: number; y: string; } >x : number +>5 : number >y : string +>"hello" : string var { x4 } = { x4: 5, y4: "hello" }; >x4 : number >{ x4: 5, y4: "hello" } : { x4: number; y4: string; } >x4 : number +>5 : number >y4 : string +>"hello" : string var { y5 } = { x5: 5, y5: "hello" }; >y5 : string >{ x5: 5, y5: "hello" } : { x5: number; y5: string; } >x5 : number +>5 : number >y5 : string +>"hello" : string var { x6, y6 } = { x6: 5, y6: "hello" }; >x6 : number >y6 : string >{ x6: 5, y6: "hello" } : { x6: number; y6: string; } >x6 : number +>5 : number >y6 : string +>"hello" : string var { x7: a1 } = { x7: 5, y7: "hello" }; ->x7 : unknown +>x7 : any >a1 : number >{ x7: 5, y7: "hello" } : { x7: number; y7: string; } >x7 : number +>5 : number >y7 : string +>"hello" : string var { y8: b1 } = { x8: 5, y8: "hello" }; ->y8 : unknown +>y8 : any >b1 : string >{ x8: 5, y8: "hello" } : { x8: number; y8: string; } >x8 : number +>5 : number >y8 : string +>"hello" : string var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; ->x9 : unknown +>x9 : any >a2 : number ->y9 : unknown +>y9 : any >b2 : string >{ x9: 5, y9: "hello" } : { x9: number; y9: string; } >x9 : number +>5 : number >y9 : string +>"hello" : string var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: true } } }; ->a : unknown +>a : any >x11 : number ->b : unknown ->a : unknown +>b : any +>a : any >y11 : string ->b : unknown ->a : unknown +>b : any +>a : any >z11 : boolean >{ a: 1, b: { a: "hello", b: { a: true } } } : { a: number; b: { a: string; b: { a: boolean; }; }; } >a : number +>1 : number >b : { a: string; b: { a: boolean; }; } >{ a: "hello", b: { a: true } } : { a: string; b: { a: boolean; }; } >a : string +>"hello" : string >b : { a: boolean; } >{ a: true } : { a: boolean; } >a : boolean +>true : boolean function f15() { >f15 : () => { a4: string; b4: number; c4: boolean; } var a4 = "hello"; >a4 : string +>"hello" : string var b4 = 1; >b4 : number +>1 : number var c4 = true; >c4 : boolean +>true : boolean return { a4, b4, c4 }; >{ a4, b4, c4 } : { a4: string; b4: number; c4: boolean; } diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js index 2c14e743039..264e56fe58c 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js @@ -10,11 +10,11 @@ var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; //// [declarationEmitDestructuringObjectLiteralPattern1.js] var _a = { x: 5, y: "hello" }; -var x4 = ({ x4: 5, y4: "hello" }).x4; -var y5 = ({ x5: 5, y5: "hello" }).y5; +var x4 = { x4: 5, y4: "hello" }.x4; +var y5 = { x5: 5, y5: "hello" }.y5; var _b = { x6: 5, y6: "hello" }, x6 = _b.x6, y6 = _b.y6; -var a1 = ({ x7: 5, y7: "hello" }).x7; -var b1 = ({ x8: 5, y8: "hello" }).y8; +var a1 = { x7: 5, y7: "hello" }.x7; +var b1 = { x8: 5, y8: "hello" }.y8; var _c = { x9: 5, y9: "hello" }, a2 = _c.x9, b2 = _c.y9; diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.symbols b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.symbols new file mode 100644 index 00000000000..a4c43a07bc8 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern1.ts === + +var { } = { x: 5, y: "hello" }; +>x : Symbol(x, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 1, 11)) +>y : Symbol(y, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 1, 17)) + +var { x4 } = { x4: 5, y4: "hello" }; +>x4 : Symbol(x4, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 2, 5)) +>x4 : Symbol(x4, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 2, 14)) +>y4 : Symbol(y4, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 2, 21)) + +var { y5 } = { x5: 5, y5: "hello" }; +>y5 : Symbol(y5, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 3, 5)) +>x5 : Symbol(x5, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 3, 14)) +>y5 : Symbol(y5, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 3, 21)) + +var { x6, y6 } = { x6: 5, y6: "hello" }; +>x6 : Symbol(x6, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 4, 5)) +>y6 : Symbol(y6, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 4, 9)) +>x6 : Symbol(x6, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 4, 18)) +>y6 : Symbol(y6, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 4, 25)) + +var { x7: a1 } = { x7: 5, y7: "hello" }; +>a1 : Symbol(a1, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 5, 5)) +>x7 : Symbol(x7, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 5, 18)) +>y7 : Symbol(y7, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 5, 25)) + +var { y8: b1 } = { x8: 5, y8: "hello" }; +>b1 : Symbol(b1, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 6, 5)) +>x8 : Symbol(x8, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 6, 18)) +>y8 : Symbol(y8, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 6, 25)) + +var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; +>a2 : Symbol(a2, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 7, 5)) +>b2 : Symbol(b2, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 7, 13)) +>x9 : Symbol(x9, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 7, 26)) +>y9 : Symbol(y9, Decl(declarationEmitDestructuringObjectLiteralPattern1.ts, 7, 33)) + diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.types b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.types index cc2094c68f4..5411f36fa9a 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.types +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.types @@ -3,47 +3,61 @@ var { } = { x: 5, y: "hello" }; >{ x: 5, y: "hello" } : { x: number; y: string; } >x : number +>5 : number >y : string +>"hello" : string var { x4 } = { x4: 5, y4: "hello" }; >x4 : number >{ x4: 5, y4: "hello" } : { x4: number; y4: string; } >x4 : number +>5 : number >y4 : string +>"hello" : string var { y5 } = { x5: 5, y5: "hello" }; >y5 : string >{ x5: 5, y5: "hello" } : { x5: number; y5: string; } >x5 : number +>5 : number >y5 : string +>"hello" : string var { x6, y6 } = { x6: 5, y6: "hello" }; >x6 : number >y6 : string >{ x6: 5, y6: "hello" } : { x6: number; y6: string; } >x6 : number +>5 : number >y6 : string +>"hello" : string var { x7: a1 } = { x7: 5, y7: "hello" }; ->x7 : unknown +>x7 : any >a1 : number >{ x7: 5, y7: "hello" } : { x7: number; y7: string; } >x7 : number +>5 : number >y7 : string +>"hello" : string var { y8: b1 } = { x8: 5, y8: "hello" }; ->y8 : unknown +>y8 : any >b1 : string >{ x8: 5, y8: "hello" } : { x8: number; y8: string; } >x8 : number +>5 : number >y8 : string +>"hello" : string var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; ->x9 : unknown +>x9 : any >a2 : number ->y9 : unknown +>y9 : any >b2 : string >{ x9: 5, y9: "hello" } : { x9: number; y9: string; } >x9 : number +>5 : number >y9 : string +>"hello" : string diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.symbols b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.symbols new file mode 100644 index 00000000000..76440b60038 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern2.ts === + +var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: true } } }; +>x11 : Symbol(x11, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 5)) +>y11 : Symbol(y11, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 18)) +>z11 : Symbol(z11, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 31)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 46)) +>b : Symbol(b, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 52)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 57)) +>b : Symbol(b, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 69)) +>a : Symbol(a, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 74)) + +function f15() { +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 89)) + + var a4 = "hello"; +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 4, 7)) + + var b4 = 1; +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 5, 7)) + + var c4 = true; +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 6, 7)) + + return { a4, b4, c4 }; +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 7, 12)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 7, 16)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 7, 20)) +} +var { a4, b4, c4 } = f15(); +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 9, 5)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 9, 9)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 9, 13)) +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 89)) + +module m { +>m : Symbol(m, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 9, 27)) + + export var { a4, b4, c4 } = f15(); +>a4 : Symbol(a4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 12, 16)) +>b4 : Symbol(b4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 12, 20)) +>c4 : Symbol(c4, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 12, 24)) +>f15 : Symbol(f15, Decl(declarationEmitDestructuringObjectLiteralPattern2.ts, 1, 89)) +} diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types index 68394686e31..49d4e2e837c 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern2.types @@ -1,34 +1,40 @@ === tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern2.ts === var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: true } } }; ->a : unknown +>a : any >x11 : number ->b : unknown ->a : unknown +>b : any +>a : any >y11 : string ->b : unknown ->a : unknown +>b : any +>a : any >z11 : boolean >{ a: 1, b: { a: "hello", b: { a: true } } } : { a: number; b: { a: string; b: { a: boolean; }; }; } >a : number +>1 : number >b : { a: string; b: { a: boolean; }; } >{ a: "hello", b: { a: true } } : { a: string; b: { a: boolean; }; } >a : string +>"hello" : string >b : { a: boolean; } >{ a: true } : { a: boolean; } >a : boolean +>true : boolean function f15() { >f15 : () => { a4: string; b4: number; c4: boolean; } var a4 = "hello"; >a4 : string +>"hello" : string var b4 = 1; >b4 : number +>1 : number var c4 = true; >c4 : boolean +>true : boolean return { a4, b4, c4 }; >{ a4, b4, c4 } : { a4: string; b4: number; c4: boolean; } diff --git a/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.symbols b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.symbols new file mode 100644 index 00000000000..fbe26452476 --- /dev/null +++ b/tests/baselines/reference/declarationEmitDestructuringOptionalBindingParametersInOverloads.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/declarationEmitDestructuringOptionalBindingParametersInOverloads.ts === + +function foo([x, y, z] ?: [string, number, boolean]); +>foo : Symbol(foo, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 0, 0), Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 1, 53)) +>x : Symbol(x, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 1, 14)) +>y : Symbol(y, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 1, 16)) +>z : Symbol(z, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 1, 19)) + +function foo(...rest: any[]) { +>foo : Symbol(foo, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 0, 0), Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 1, 53)) +>rest : Symbol(rest, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 2, 13)) +} + +function foo2( { x, y, z }?: { x: string; y: number; z: boolean }); +>foo2 : Symbol(foo2, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 3, 1), Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 67)) +>x : Symbol(x, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 16)) +>y : Symbol(y, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 19)) +>z : Symbol(z, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 22)) +>x : Symbol(x, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 30)) +>y : Symbol(y, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 41)) +>z : Symbol(z, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 52)) + +function foo2(...rest: any[]) { +>foo2 : Symbol(foo2, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 3, 1), Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 5, 67)) +>rest : Symbol(rest, Decl(declarationEmitDestructuringOptionalBindingParametersInOverloads.ts, 6, 14)) + +} diff --git a/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.symbols b/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.symbols new file mode 100644 index 00000000000..c4c92d547f3 --- /dev/null +++ b/tests/baselines/reference/declarationEmitImportInExportAssignmentModule.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/declarationEmitImportInExportAssignmentModule.ts === + +module m { +>m : Symbol(m, Decl(declarationEmitImportInExportAssignmentModule.ts, 0, 0)) + + export module c { +>c : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 1, 10)) + + export class c { +>c : Symbol(c, Decl(declarationEmitImportInExportAssignmentModule.ts, 2, 21)) + } + } + import x = c; +>x : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 5, 5)) +>c : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 1, 10)) + + export var a: typeof x; +>a : Symbol(a, Decl(declarationEmitImportInExportAssignmentModule.ts, 7, 14)) +>x : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 5, 5)) +} +export = m; +>m : Symbol(m, Decl(declarationEmitImportInExportAssignmentModule.ts, 0, 0)) + diff --git a/tests/baselines/reference/declarationEmit_array-types-from-generic-array-usage.symbols b/tests/baselines/reference/declarationEmit_array-types-from-generic-array-usage.symbols new file mode 100644 index 00000000000..4f79e47277b --- /dev/null +++ b/tests/baselines/reference/declarationEmit_array-types-from-generic-array-usage.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/declarationEmit_array-types-from-generic-array-usage.ts === +interface A extends Array { } +>A : Symbol(A, Decl(declarationEmit_array-types-from-generic-array-usage.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + diff --git a/tests/baselines/reference/declarationEmit_invalidReference.symbols b/tests/baselines/reference/declarationEmit_invalidReference.symbols new file mode 100644 index 00000000000..b23bf697661 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_invalidReference.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/declarationEmit_invalidReference.ts === +/// +var x = 0; +>x : Symbol(x, Decl(declarationEmit_invalidReference.ts, 1, 3)) + diff --git a/tests/baselines/reference/declarationEmit_invalidReference.types b/tests/baselines/reference/declarationEmit_invalidReference.types index 1fe465887ed..35d623c3c05 100644 --- a/tests/baselines/reference/declarationEmit_invalidReference.types +++ b/tests/baselines/reference/declarationEmit_invalidReference.types @@ -2,4 +2,5 @@ /// var x = 0; >x : number +>0 : number diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.symbols b/tests/baselines/reference/declarationEmit_nameConflicts.symbols new file mode 100644 index 00000000000..a626ed05b15 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts.symbols @@ -0,0 +1,153 @@ +=== tests/cases/compiler/declarationEmit_nameConflicts_0.ts === +import im = require('declarationEmit_nameConflicts_1'); +>im : Symbol(im, Decl(declarationEmit_nameConflicts_0.ts, 0, 0)) + +export module M { +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts_0.ts, 1, 17)) + + export class C { } +>C : Symbol(C, Decl(declarationEmit_nameConflicts_0.ts, 2, 27)) + + export module N { +>N : Symbol(N, Decl(declarationEmit_nameConflicts_0.ts, 3, 22)) + + export function g() { }; +>g : Symbol(g, Decl(declarationEmit_nameConflicts_0.ts, 4, 21)) + + export interface I { } +>I : Symbol(I, Decl(declarationEmit_nameConflicts_0.ts, 5, 32)) + } + + export import a = M.f; +>a : Symbol(a, Decl(declarationEmit_nameConflicts_0.ts, 7, 5)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>f : Symbol(f, Decl(declarationEmit_nameConflicts_0.ts, 1, 17)) + + export import b = M.C; +>b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 9, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>C : Symbol(C, Decl(declarationEmit_nameConflicts_0.ts, 2, 27)) + + export import c = N; +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>N : Symbol(N, Decl(declarationEmit_nameConflicts_0.ts, 3, 22)) + + export import d = im; +>d : Symbol(d, Decl(declarationEmit_nameConflicts_0.ts, 11, 24)) +>im : Symbol(d, Decl(declarationEmit_nameConflicts_1.ts, 0, 0)) +} + +export module M.P { +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>P : Symbol(P, Decl(declarationEmit_nameConflicts_0.ts, 15, 16)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts_0.ts, 15, 19)) + + export class C { } +>C : Symbol(C, Decl(declarationEmit_nameConflicts_0.ts, 16, 27)) + + export module N { +>N : Symbol(N, Decl(declarationEmit_nameConflicts_0.ts, 17, 22)) + + export function g() { }; +>g : Symbol(g, Decl(declarationEmit_nameConflicts_0.ts, 18, 21)) + + export interface I { } +>I : Symbol(I, Decl(declarationEmit_nameConflicts_0.ts, 19, 32)) + } + export import im = M.P.f; +>im : Symbol(im, Decl(declarationEmit_nameConflicts_0.ts, 21, 5)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>P : Symbol(P, Decl(declarationEmit_nameConflicts_0.ts, 15, 16)) +>f : Symbol(f, Decl(declarationEmit_nameConflicts_0.ts, 15, 19)) + + export var a = M.a; // emitted incorrectly as typeof f +>a : Symbol(a, Decl(declarationEmit_nameConflicts_0.ts, 23, 14)) +>M.a : Symbol(a, Decl(declarationEmit_nameConflicts_0.ts, 7, 5)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>a : Symbol(a, Decl(declarationEmit_nameConflicts_0.ts, 7, 5)) + + export var b = M.b; // ok +>b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 24, 14)) +>M.b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 9, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 9, 26)) + + export var c = M.c; // ok +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 25, 14)) +>M.c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) + + export var g = M.c.g; // ok +>g : Symbol(g, Decl(declarationEmit_nameConflicts_0.ts, 26, 14)) +>M.c.g : Symbol(c.g, Decl(declarationEmit_nameConflicts_0.ts, 4, 21)) +>M.c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>g : Symbol(c.g, Decl(declarationEmit_nameConflicts_0.ts, 4, 21)) + + export var d = M.d; // emitted incorrectly as typeof im +>d : Symbol(d, Decl(declarationEmit_nameConflicts_0.ts, 27, 14)) +>M.d : Symbol(d, Decl(declarationEmit_nameConflicts_0.ts, 11, 24)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>d : Symbol(d, Decl(declarationEmit_nameConflicts_0.ts, 11, 24)) +} + +export module M.Q { +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>Q : Symbol(Q, Decl(declarationEmit_nameConflicts_0.ts, 30, 16)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts_0.ts, 30, 19)) + + export class C { } +>C : Symbol(C, Decl(declarationEmit_nameConflicts_0.ts, 31, 27)) + + export module N { +>N : Symbol(N, Decl(declarationEmit_nameConflicts_0.ts, 32, 22)) + + export function g() { }; +>g : Symbol(g, Decl(declarationEmit_nameConflicts_0.ts, 33, 21)) + + export interface I { } +>I : Symbol(I, Decl(declarationEmit_nameConflicts_0.ts, 34, 32)) + } + export interface b extends M.b { } // ok +>b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 36, 5)) +>M.b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 9, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>b : Symbol(b, Decl(declarationEmit_nameConflicts_0.ts, 9, 26)) + + export interface I extends M.c.I { } // ok +>I : Symbol(I, Decl(declarationEmit_nameConflicts_0.ts, 37, 38)) +>M.c.I : Symbol(M.c.I, Decl(declarationEmit_nameConflicts_0.ts, 5, 32)) +>M.c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>I : Symbol(M.c.I, Decl(declarationEmit_nameConflicts_0.ts, 5, 32)) + + export module c { +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 38, 40)) + + export interface I extends M.c.I { } // ok +>I : Symbol(I, Decl(declarationEmit_nameConflicts_0.ts, 39, 21)) +>M.c.I : Symbol(M.c.I, Decl(declarationEmit_nameConflicts_0.ts, 5, 32)) +>M.c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts_0.ts, 0, 55), Decl(declarationEmit_nameConflicts_0.ts, 13, 1), Decl(declarationEmit_nameConflicts_0.ts, 28, 1)) +>c : Symbol(c, Decl(declarationEmit_nameConflicts_0.ts, 10, 26)) +>I : Symbol(M.c.I, Decl(declarationEmit_nameConflicts_0.ts, 5, 32)) + } +} +=== tests/cases/compiler/declarationEmit_nameConflicts_1.ts === +module f { export class c { } } +>f : Symbol(f, Decl(declarationEmit_nameConflicts_1.ts, 0, 0)) +>c : Symbol(c, Decl(declarationEmit_nameConflicts_1.ts, 0, 10)) + +export = f; +>f : Symbol(f, Decl(declarationEmit_nameConflicts_1.ts, 0, 0)) + diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.types b/tests/baselines/reference/declarationEmit_nameConflicts.types index e38c831493d..dacd657706d 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts.types +++ b/tests/baselines/reference/declarationEmit_nameConflicts.types @@ -119,20 +119,25 @@ export module M.Q { } export interface b extends M.b { } // ok >b : b +>M.b : any >M : typeof M >b : M.C export interface I extends M.c.I { } // ok >I : I +>M.c.I : any +>M.c : typeof M.N >M : typeof M >c : typeof M.N >I : M.c.I export module c { ->c : unknown +>c : any export interface I extends M.c.I { } // ok >I : I +>M.c.I : any +>M.c : typeof M.N >M : typeof M >c : typeof M.N >I : M.c.I diff --git a/tests/baselines/reference/declarationEmit_nameConflicts2.symbols b/tests/baselines/reference/declarationEmit_nameConflicts2.symbols new file mode 100644 index 00000000000..801ad3e7cfc --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts2.symbols @@ -0,0 +1,68 @@ +=== tests/cases/compiler/declarationEmit_nameConflicts2.ts === +module X.Y.base { +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts2.ts, 0, 17)) + + export class C { } +>C : Symbol(C, Decl(declarationEmit_nameConflicts2.ts, 1, 27)) + + export module M { +>M : Symbol(M, Decl(declarationEmit_nameConflicts2.ts, 2, 22)) + + export var v; +>v : Symbol(v, Decl(declarationEmit_nameConflicts2.ts, 4, 18)) + } + export enum E { } +>E : Symbol(E, Decl(declarationEmit_nameConflicts2.ts, 5, 5)) +} + +module X.Y.base.Z { +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>Z : Symbol(Z, Decl(declarationEmit_nameConflicts2.ts, 9, 16)) + + export var f = X.Y.base.f; // Should be base.f +>f : Symbol(f, Decl(declarationEmit_nameConflicts2.ts, 10, 14)) +>X.Y.base.f : Symbol(f, Decl(declarationEmit_nameConflicts2.ts, 0, 17)) +>X.Y.base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>X.Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>f : Symbol(f, Decl(declarationEmit_nameConflicts2.ts, 0, 17)) + + export var C = X.Y.base.C; // Should be base.C +>C : Symbol(C, Decl(declarationEmit_nameConflicts2.ts, 11, 14)) +>X.Y.base.C : Symbol(C, Decl(declarationEmit_nameConflicts2.ts, 1, 27)) +>X.Y.base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>X.Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>C : Symbol(C, Decl(declarationEmit_nameConflicts2.ts, 1, 27)) + + export var M = X.Y.base.M; // Should be base.M +>M : Symbol(M, Decl(declarationEmit_nameConflicts2.ts, 12, 14)) +>X.Y.base.M : Symbol(M, Decl(declarationEmit_nameConflicts2.ts, 2, 22)) +>X.Y.base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>X.Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts2.ts, 2, 22)) + + export var E = X.Y.base.E; // Should be base.E +>E : Symbol(E, Decl(declarationEmit_nameConflicts2.ts, 13, 14)) +>X.Y.base.E : Symbol(E, Decl(declarationEmit_nameConflicts2.ts, 5, 5)) +>X.Y.base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>X.Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>X : Symbol(X, Decl(declarationEmit_nameConflicts2.ts, 0, 0), Decl(declarationEmit_nameConflicts2.ts, 7, 1)) +>Y : Symbol(Y, Decl(declarationEmit_nameConflicts2.ts, 0, 9), Decl(declarationEmit_nameConflicts2.ts, 9, 9)) +>base : Symbol(base, Decl(declarationEmit_nameConflicts2.ts, 0, 11), Decl(declarationEmit_nameConflicts2.ts, 9, 11)) +>E : Symbol(E, Decl(declarationEmit_nameConflicts2.ts, 5, 5)) +} diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.symbols b/tests/baselines/reference/declarationEmit_nameConflicts3.symbols new file mode 100644 index 00000000000..051ffe59365 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/declarationEmit_nameConflicts3.ts === +module M { +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) + + export interface D { } +>D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 0, 10), Decl(declarationEmit_nameConflicts3.ts, 1, 26)) + + export module D { +>D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 0, 10), Decl(declarationEmit_nameConflicts3.ts, 1, 26)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts3.ts, 2, 21)) + } + export module C { +>C : Symbol(C, Decl(declarationEmit_nameConflicts3.ts, 4, 5)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts3.ts, 5, 21)) + } + export module E { +>E : Symbol(E, Decl(declarationEmit_nameConflicts3.ts, 7, 5)) + + export function f() { } +>f : Symbol(f, Decl(declarationEmit_nameConflicts3.ts, 8, 21)) + } +} + +module M.P { +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) +>P : Symbol(P, Decl(declarationEmit_nameConflicts3.ts, 13, 9)) + + export class C { +>C : Symbol(C, Decl(declarationEmit_nameConflicts3.ts, 13, 12)) + + static f() { } +>f : Symbol(C.f, Decl(declarationEmit_nameConflicts3.ts, 14, 20)) + } + export class E extends C { } +>E : Symbol(E, Decl(declarationEmit_nameConflicts3.ts, 16, 5)) +>C : Symbol(C, Decl(declarationEmit_nameConflicts3.ts, 13, 12)) + + export enum D { +>D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 17, 32)) + + f +>f : Symbol(D.f, Decl(declarationEmit_nameConflicts3.ts, 18, 19)) + } + export var v: M.D; // ok +>v : Symbol(v, Decl(declarationEmit_nameConflicts3.ts, 21, 14)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) +>D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 0, 10), Decl(declarationEmit_nameConflicts3.ts, 1, 26)) + + export var w = M.D.f; // error, should be typeof M.D.f +>w : Symbol(w, Decl(declarationEmit_nameConflicts3.ts, 22, 14)) +>M.D.f : Symbol(D.f, Decl(declarationEmit_nameConflicts3.ts, 2, 21)) +>M.D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 0, 10), Decl(declarationEmit_nameConflicts3.ts, 1, 26)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) +>D : Symbol(D, Decl(declarationEmit_nameConflicts3.ts, 0, 10), Decl(declarationEmit_nameConflicts3.ts, 1, 26)) +>f : Symbol(D.f, Decl(declarationEmit_nameConflicts3.ts, 2, 21)) + + export var x = M.C.f; // error, should be typeof M.C.f +>x : Symbol(x, Decl(declarationEmit_nameConflicts3.ts, 23, 14), Decl(declarationEmit_nameConflicts3.ts, 24, 14)) +>M.C.f : Symbol(C.f, Decl(declarationEmit_nameConflicts3.ts, 5, 21)) +>M.C : Symbol(C, Decl(declarationEmit_nameConflicts3.ts, 4, 5)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) +>C : Symbol(C, Decl(declarationEmit_nameConflicts3.ts, 4, 5)) +>f : Symbol(C.f, Decl(declarationEmit_nameConflicts3.ts, 5, 21)) + + export var x = M.E.f; // error, should be typeof M.E.f +>x : Symbol(x, Decl(declarationEmit_nameConflicts3.ts, 23, 14), Decl(declarationEmit_nameConflicts3.ts, 24, 14)) +>M.E.f : Symbol(E.f, Decl(declarationEmit_nameConflicts3.ts, 8, 21)) +>M.E : Symbol(E, Decl(declarationEmit_nameConflicts3.ts, 7, 5)) +>M : Symbol(M, Decl(declarationEmit_nameConflicts3.ts, 0, 0), Decl(declarationEmit_nameConflicts3.ts, 11, 1)) +>E : Symbol(E, Decl(declarationEmit_nameConflicts3.ts, 7, 5)) +>f : Symbol(E.f, Decl(declarationEmit_nameConflicts3.ts, 8, 21)) +} diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.types b/tests/baselines/reference/declarationEmit_nameConflicts3.types index 50fd6ecdd1b..8d52bda68f5 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts3.types +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.types @@ -47,7 +47,7 @@ module M.P { } export var v: M.D; // ok >v : M.D ->M : unknown +>M : any >D : M.D export var w = M.D.f; // error, should be typeof M.D.f diff --git a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.symbols b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.symbols new file mode 100644 index 00000000000..26c8875a236 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/declarationEmit_nameConflictsWithAlias.ts === +export module C { export interface I { } } +>C : Symbol(C, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 0)) +>I : Symbol(I, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 17)) + +export import v = C; +>v : Symbol(v, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 42)) +>C : Symbol(C, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 0)) + +export module M { +>M : Symbol(M, Decl(declarationEmit_nameConflictsWithAlias.ts, 1, 20)) + + export module C { export interface I { } } +>C : Symbol(C, Decl(declarationEmit_nameConflictsWithAlias.ts, 2, 17)) +>I : Symbol(I, Decl(declarationEmit_nameConflictsWithAlias.ts, 3, 21)) + + export var w: v.I; // Gets emitted as C.I, which is the wrong interface +>w : Symbol(w, Decl(declarationEmit_nameConflictsWithAlias.ts, 4, 14)) +>v : Symbol(v, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 42)) +>I : Symbol(v.I, Decl(declarationEmit_nameConflictsWithAlias.ts, 0, 17)) +} diff --git a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types index 50c45a44a19..744869f0e3a 100644 --- a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types +++ b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types @@ -1,21 +1,21 @@ === tests/cases/compiler/declarationEmit_nameConflictsWithAlias.ts === export module C { export interface I { } } ->C : unknown +>C : any >I : I export import v = C; ->v : unknown ->C : unknown +>v : any +>C : any export module M { >M : typeof M export module C { export interface I { } } ->C : unknown +>C : any >I : I export var w: v.I; // Gets emitted as C.I, which is the wrong interface >w : v.I ->v : unknown +>v : any >I : v.I } diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.symbols b/tests/baselines/reference/declarationEmit_protectedMembers.symbols new file mode 100644 index 00000000000..cbf3db094ea --- /dev/null +++ b/tests/baselines/reference/declarationEmit_protectedMembers.symbols @@ -0,0 +1,114 @@ +=== tests/cases/compiler/declarationEmit_protectedMembers.ts === + +// Class with protected members +class C1 { +>C1 : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) + + protected x: number; +>x : Symbol(x, Decl(declarationEmit_protectedMembers.ts, 2, 10)) + + protected f() { +>f : Symbol(f, Decl(declarationEmit_protectedMembers.ts, 3, 24)) + + return this.x; +>this.x : Symbol(x, Decl(declarationEmit_protectedMembers.ts, 2, 10)) +>this : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) +>x : Symbol(x, Decl(declarationEmit_protectedMembers.ts, 2, 10)) + } + + protected set accessor(a: number) { } +>accessor : Symbol(accessor, Decl(declarationEmit_protectedMembers.ts, 7, 5), Decl(declarationEmit_protectedMembers.ts, 9, 41)) +>a : Symbol(a, Decl(declarationEmit_protectedMembers.ts, 9, 27)) + + protected get accessor() { return 0; } +>accessor : Symbol(accessor, Decl(declarationEmit_protectedMembers.ts, 7, 5), Decl(declarationEmit_protectedMembers.ts, 9, 41)) + + protected static sx: number; +>sx : Symbol(C1.sx, Decl(declarationEmit_protectedMembers.ts, 10, 42)) + + protected static sf() { +>sf : Symbol(C1.sf, Decl(declarationEmit_protectedMembers.ts, 12, 32)) + + return this.sx; +>this.sx : Symbol(C1.sx, Decl(declarationEmit_protectedMembers.ts, 10, 42)) +>this : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) +>sx : Symbol(C1.sx, Decl(declarationEmit_protectedMembers.ts, 10, 42)) + } + + protected static set staticSetter(a: number) { } +>staticSetter : Symbol(C1.staticSetter, Decl(declarationEmit_protectedMembers.ts, 16, 5)) +>a : Symbol(a, Decl(declarationEmit_protectedMembers.ts, 18, 38)) + + protected static get staticGetter() { return 0; } +>staticGetter : Symbol(C1.staticGetter, Decl(declarationEmit_protectedMembers.ts, 18, 52)) +} + +// Derived class overriding protected members +class C2 extends C1 { +>C2 : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) +>C1 : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) + + protected f() { +>f : Symbol(f, Decl(declarationEmit_protectedMembers.ts, 23, 21)) + + return super.f() + this.x; +>super.f : Symbol(C1.f, Decl(declarationEmit_protectedMembers.ts, 3, 24)) +>super : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) +>f : Symbol(C1.f, Decl(declarationEmit_protectedMembers.ts, 3, 24)) +>this.x : Symbol(C1.x, Decl(declarationEmit_protectedMembers.ts, 2, 10)) +>this : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) +>x : Symbol(C1.x, Decl(declarationEmit_protectedMembers.ts, 2, 10)) + } + protected static sf() { +>sf : Symbol(C2.sf, Decl(declarationEmit_protectedMembers.ts, 26, 5)) + + return super.sf() + this.sx; +>super.sf : Symbol(C1.sf, Decl(declarationEmit_protectedMembers.ts, 12, 32)) +>super : Symbol(C1, Decl(declarationEmit_protectedMembers.ts, 0, 0)) +>sf : Symbol(C1.sf, Decl(declarationEmit_protectedMembers.ts, 12, 32)) +>this.sx : Symbol(C1.sx, Decl(declarationEmit_protectedMembers.ts, 10, 42)) +>this : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) +>sx : Symbol(C1.sx, Decl(declarationEmit_protectedMembers.ts, 10, 42)) + } +} + +// Derived class making protected members public +class C3 extends C2 { +>C3 : Symbol(C3, Decl(declarationEmit_protectedMembers.ts, 30, 1)) +>C2 : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) + + x: number; +>x : Symbol(x, Decl(declarationEmit_protectedMembers.ts, 33, 21)) + + static sx: number; +>sx : Symbol(C3.sx, Decl(declarationEmit_protectedMembers.ts, 34, 14)) + + f() { +>f : Symbol(f, Decl(declarationEmit_protectedMembers.ts, 35, 22)) + + return super.f(); +>super.f : Symbol(C2.f, Decl(declarationEmit_protectedMembers.ts, 23, 21)) +>super : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) +>f : Symbol(C2.f, Decl(declarationEmit_protectedMembers.ts, 23, 21)) + } + static sf() { +>sf : Symbol(C3.sf, Decl(declarationEmit_protectedMembers.ts, 38, 5)) + + return super.sf(); +>super.sf : Symbol(C2.sf, Decl(declarationEmit_protectedMembers.ts, 26, 5)) +>super : Symbol(C2, Decl(declarationEmit_protectedMembers.ts, 20, 1)) +>sf : Symbol(C2.sf, Decl(declarationEmit_protectedMembers.ts, 26, 5)) + } + + static get staticGetter() { return 1; } +>staticGetter : Symbol(C3.staticGetter, Decl(declarationEmit_protectedMembers.ts, 41, 5)) +} + +// Protected properties in constructors +class C4 { +>C4 : Symbol(C4, Decl(declarationEmit_protectedMembers.ts, 44, 1)) + + constructor(protected a: number, protected b) { } +>a : Symbol(a, Decl(declarationEmit_protectedMembers.ts, 48, 16)) +>b : Symbol(b, Decl(declarationEmit_protectedMembers.ts, 48, 36)) +} diff --git a/tests/baselines/reference/declarationEmit_protectedMembers.types b/tests/baselines/reference/declarationEmit_protectedMembers.types index 28217b0c070..89aa3f56332 100644 --- a/tests/baselines/reference/declarationEmit_protectedMembers.types +++ b/tests/baselines/reference/declarationEmit_protectedMembers.types @@ -22,6 +22,7 @@ class C1 { protected get accessor() { return 0; } >accessor : number +>0 : number protected static sx: number; >sx : number @@ -41,6 +42,7 @@ class C1 { protected static get staticGetter() { return 0; } >staticGetter : number +>0 : number } // Derived class overriding protected members @@ -108,6 +110,7 @@ class C3 extends C2 { static get staticGetter() { return 1; } >staticGetter : number +>1 : number } // Protected properties in constructors diff --git a/tests/baselines/reference/declarationInAmbientContext.symbols b/tests/baselines/reference/declarationInAmbientContext.symbols new file mode 100644 index 00000000000..4ab3aad99bf --- /dev/null +++ b/tests/baselines/reference/declarationInAmbientContext.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts === +declare var [a, b]; // Error, destructuring declaration not allowed in ambient context +>a : Symbol(a, Decl(declarationInAmbientContext.ts, 0, 13)) +>b : Symbol(b, Decl(declarationInAmbientContext.ts, 0, 15)) + +declare var {c, d}; // Error, destructuring declaration not allowed in ambient context +>c : Symbol(c, Decl(declarationInAmbientContext.ts, 1, 13)) +>d : Symbol(d, Decl(declarationInAmbientContext.ts, 1, 15)) + diff --git a/tests/baselines/reference/declarationsAndAssignments.js b/tests/baselines/reference/declarationsAndAssignments.js index 032f4cb0e63..5c47756e7fe 100644 --- a/tests/baselines/reference/declarationsAndAssignments.js +++ b/tests/baselines/reference/declarationsAndAssignments.js @@ -183,7 +183,7 @@ function f21() { //// [declarationsAndAssignments.js] function f0() { var _a = [1, "hello"]; - var x = ([1, "hello"])[0]; + var x = [1, "hello"][0]; var _b = [1, "hello"], x = _b[0], y = _b[1]; var _c = [1, "hello"], x = _c[0], y = _c[1], z = _c[2]; // Error var _d = [0, 1, 2], z = _d[2]; @@ -201,13 +201,13 @@ function f1() { } function f2() { var _a = { x: 5, y: "hello" }; - var x = ({ x: 5, y: "hello" }).x; - var y = ({ x: 5, y: "hello" }).y; + var x = { x: 5, y: "hello" }.x; + var y = { x: 5, y: "hello" }.y; var _b = { x: 5, y: "hello" }, x = _b.x, y = _b.y; var x; var y; - var a = ({ x: 5, y: "hello" }).x; - var b = ({ x: 5, y: "hello" }).y; + var a = { x: 5, y: "hello" }.x; + var b = { x: 5, y: "hello" }.y; var _c = { x: 5, y: "hello" }, a = _c.x, b = _c.y; var a; var b; @@ -312,7 +312,7 @@ function f19() { _a = [1, 2], a = _a[0], b = _a[1]; _b = [b, a], a = _b[0], b = _b[1]; (_c = { b: b, a: a }, a = _c.a, b = _c.b, _c); - _d = ([[2, 3]])[0], _e = _d === void 0 ? [1, 2] : _d, a = _e[0], b = _e[1]; + _d = [[2, 3]][0], _e = _d === void 0 ? [1, 2] : _d, a = _e[0], b = _e[1]; var x = (_f = [1, 2], a = _f[0], b = _f[1], _f); var _a, _b, _c, _d, _e, _f; } @@ -321,28 +321,28 @@ function f20() { var x; var y; var z; - var _a = [1, 2, 3], a = _a.slice(0); - var _b = [1, 2, 3], x = _b[0], a = _b.slice(1); - var _c = [1, 2, 3], x = _c[0], y = _c[1], a = _c.slice(2); - var _d = [1, 2, 3], x = _d[0], y = _d[1], z = _d[2], a = _d.slice(3); - _e = [1, 2, 3], a = _e.slice(0); - _f = [1, 2, 3], x = _f[0], a = _f.slice(1); - _g = [1, 2, 3], x = _g[0], y = _g[1], a = _g.slice(2); - _h = [1, 2, 3], x = _h[0], y = _h[1], z = _h[2], a = _h.slice(3); - var _e, _f, _g, _h; + var a = [1, 2, 3].slice(0); + var _a = [1, 2, 3], x = _a[0], a = _a.slice(1); + var _b = [1, 2, 3], x = _b[0], y = _b[1], a = _b.slice(2); + var _c = [1, 2, 3], x = _c[0], y = _c[1], z = _c[2], a = _c.slice(3); + a = [1, 2, 3].slice(0); + _d = [1, 2, 3], x = _d[0], a = _d.slice(1); + _e = [1, 2, 3], x = _e[0], y = _e[1], a = _e.slice(2); + _f = [1, 2, 3], x = _f[0], y = _f[1], z = _f[2], a = _f.slice(3); + var _d, _e, _f; } function f21() { var a; var x; var y; var z; - var _a = [1, "hello", true], a = _a.slice(0); - var _b = [1, "hello", true], x = _b[0], a = _b.slice(1); - var _c = [1, "hello", true], x = _c[0], y = _c[1], a = _c.slice(2); - var _d = [1, "hello", true], x = _d[0], y = _d[1], z = _d[2], a = _d.slice(3); - _e = [1, "hello", true], a = _e.slice(0); - _f = [1, "hello", true], x = _f[0], a = _f.slice(1); - _g = [1, "hello", true], x = _g[0], y = _g[1], a = _g.slice(2); - _h = [1, "hello", true], x = _h[0], y = _h[1], z = _h[2], a = _h.slice(3); - var _e, _f, _g, _h; + var a = [1, "hello", true].slice(0); + var _a = [1, "hello", true], x = _a[0], a = _a.slice(1); + var _b = [1, "hello", true], x = _b[0], y = _b[1], a = _b.slice(2); + var _c = [1, "hello", true], x = _c[0], y = _c[1], z = _c[2], a = _c.slice(3); + a = [1, "hello", true].slice(0); + _d = [1, "hello", true], x = _d[0], a = _d.slice(1); + _e = [1, "hello", true], x = _e[0], y = _e[1], a = _e.slice(2); + _f = [1, "hello", true], x = _f[0], y = _f[1], z = _f[2], a = _f.slice(3); + var _d, _e, _f; } diff --git a/tests/baselines/reference/declareDottedExtend.symbols b/tests/baselines/reference/declareDottedExtend.symbols new file mode 100644 index 00000000000..c9695ecb342 --- /dev/null +++ b/tests/baselines/reference/declareDottedExtend.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/declareDottedExtend.ts === +declare module A.B +>A : Symbol(A, Decl(declareDottedExtend.ts, 0, 0)) +>B : Symbol(B, Decl(declareDottedExtend.ts, 0, 17)) +{ + export class C{ } +>C : Symbol(C, Decl(declareDottedExtend.ts, 1, 1)) +} + +import ab = A.B; +>ab : Symbol(ab, Decl(declareDottedExtend.ts, 3, 1)) +>A : Symbol(A, Decl(declareDottedExtend.ts, 0, 0)) +>B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 17)) + +class D extends ab.C{ } +>D : Symbol(D, Decl(declareDottedExtend.ts, 5, 16)) +>ab.C : Symbol(ab.C, Decl(declareDottedExtend.ts, 1, 1)) +>ab : Symbol(ab, Decl(declareDottedExtend.ts, 3, 1)) +>C : Symbol(ab.C, Decl(declareDottedExtend.ts, 1, 1)) + +class E extends A.B.C{ } +>E : Symbol(E, Decl(declareDottedExtend.ts, 7, 23)) +>A.B.C : Symbol(ab.C, Decl(declareDottedExtend.ts, 1, 1)) +>A.B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 17)) +>A : Symbol(A, Decl(declareDottedExtend.ts, 0, 0)) +>B : Symbol(ab, Decl(declareDottedExtend.ts, 0, 17)) +>C : Symbol(ab.C, Decl(declareDottedExtend.ts, 1, 1)) + diff --git a/tests/baselines/reference/declareDottedExtend.types b/tests/baselines/reference/declareDottedExtend.types index 6b529b5e00d..7df6c9ecb7c 100644 --- a/tests/baselines/reference/declareDottedExtend.types +++ b/tests/baselines/reference/declareDottedExtend.types @@ -14,11 +14,14 @@ import ab = A.B; class D extends ab.C{ } >D : D +>ab.C : any >ab : typeof ab >C : ab.C class E extends A.B.C{ } >E : E +>A.B.C : any +>A.B : typeof ab >A : typeof A >B : typeof ab >C : ab.C diff --git a/tests/baselines/reference/declareDottedModuleName.symbols b/tests/baselines/reference/declareDottedModuleName.symbols new file mode 100644 index 00000000000..de69bc1dc8e --- /dev/null +++ b/tests/baselines/reference/declareDottedModuleName.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/declareDottedModuleName.ts === +module M { +>M : Symbol(M, Decl(declareDottedModuleName.ts, 0, 0), Decl(declareDottedModuleName.ts, 2, 1)) + + module P.Q { } // This shouldnt be emitted +>P : Symbol(P, Decl(declareDottedModuleName.ts, 0, 10)) +>Q : Symbol(Q, Decl(declareDottedModuleName.ts, 1, 13)) +} + +module M { +>M : Symbol(M, Decl(declareDottedModuleName.ts, 0, 0), Decl(declareDottedModuleName.ts, 2, 1)) + + export module R.S { } //This should be emitted +>R : Symbol(R, Decl(declareDottedModuleName.ts, 4, 10)) +>S : Symbol(S, Decl(declareDottedModuleName.ts, 5, 20)) +} + +module T.U { // This needs to be emitted +>T : Symbol(T, Decl(declareDottedModuleName.ts, 6, 1)) +>U : Symbol(U, Decl(declareDottedModuleName.ts, 8, 9)) +} diff --git a/tests/baselines/reference/declareDottedModuleName.types b/tests/baselines/reference/declareDottedModuleName.types index 8ccd2298847..54786f9e747 100644 --- a/tests/baselines/reference/declareDottedModuleName.types +++ b/tests/baselines/reference/declareDottedModuleName.types @@ -1,21 +1,21 @@ === tests/cases/compiler/declareDottedModuleName.ts === module M { ->M : unknown +>M : any module P.Q { } // This shouldnt be emitted ->P : unknown ->Q : unknown +>P : any +>Q : any } module M { ->M : unknown +>M : any export module R.S { } //This should be emitted ->R : unknown ->S : unknown +>R : any +>S : any } module T.U { // This needs to be emitted ->T : unknown ->U : unknown +>T : any +>U : any } diff --git a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.symbols b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.symbols new file mode 100644 index 00000000000..881728ce641 --- /dev/null +++ b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/declareExternalModuleWithExportAssignedFundule.ts === +declare module "express" { + + export = express; +>express : Symbol(express, Decl(declareExternalModuleWithExportAssignedFundule.ts, 2, 21), Decl(declareExternalModuleWithExportAssignedFundule.ts, 4, 46)) + + function express(): express.ExpressServer; +>express : Symbol(express, Decl(declareExternalModuleWithExportAssignedFundule.ts, 2, 21), Decl(declareExternalModuleWithExportAssignedFundule.ts, 4, 46)) +>express : Symbol(express, Decl(declareExternalModuleWithExportAssignedFundule.ts, 2, 21), Decl(declareExternalModuleWithExportAssignedFundule.ts, 4, 46)) +>ExpressServer : Symbol(express.ExpressServer, Decl(declareExternalModuleWithExportAssignedFundule.ts, 6, 20)) + + module express { +>express : Symbol(express, Decl(declareExternalModuleWithExportAssignedFundule.ts, 2, 21), Decl(declareExternalModuleWithExportAssignedFundule.ts, 4, 46)) + + export interface ExpressServer { +>ExpressServer : Symbol(ExpressServer, Decl(declareExternalModuleWithExportAssignedFundule.ts, 6, 20)) + + enable(name: string): ExpressServer; +>enable : Symbol(enable, Decl(declareExternalModuleWithExportAssignedFundule.ts, 8, 40)) +>name : Symbol(name, Decl(declareExternalModuleWithExportAssignedFundule.ts, 10, 19)) +>ExpressServer : Symbol(ExpressServer, Decl(declareExternalModuleWithExportAssignedFundule.ts, 6, 20)) + + post(path: RegExp, handler: (req: Function) => void ): void; +>post : Symbol(post, Decl(declareExternalModuleWithExportAssignedFundule.ts, 10, 48)) +>path : Symbol(path, Decl(declareExternalModuleWithExportAssignedFundule.ts, 12, 17)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>handler : Symbol(handler, Decl(declareExternalModuleWithExportAssignedFundule.ts, 12, 30)) +>req : Symbol(req, Decl(declareExternalModuleWithExportAssignedFundule.ts, 12, 41)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + + } + + export class ExpressServerRequest { +>ExpressServerRequest : Symbol(ExpressServerRequest, Decl(declareExternalModuleWithExportAssignedFundule.ts, 14, 9)) + + } + + } + +} + diff --git a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types index 70718471d50..2206c804448 100644 --- a/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types +++ b/tests/baselines/reference/declareExternalModuleWithExportAssignedFundule.types @@ -6,7 +6,7 @@ declare module "express" { function express(): express.ExpressServer; >express : typeof express ->express : unknown +>express : any >ExpressServer : express.ExpressServer module express { diff --git a/tests/baselines/reference/declareFileExportAssignment.symbols b/tests/baselines/reference/declareFileExportAssignment.symbols new file mode 100644 index 00000000000..bb626e9eeab --- /dev/null +++ b/tests/baselines/reference/declareFileExportAssignment.symbols @@ -0,0 +1,50 @@ +=== tests/cases/compiler/declareFileExportAssignment.ts === +module m2 { +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) + + export interface connectModule { +>connectModule : Symbol(connectModule, Decl(declareFileExportAssignment.ts, 0, 11)) + + (res, req, next): void; +>res : Symbol(res, Decl(declareFileExportAssignment.ts, 2, 9)) +>req : Symbol(req, Decl(declareFileExportAssignment.ts, 2, 13)) +>next : Symbol(next, Decl(declareFileExportAssignment.ts, 2, 18)) + } + export interface connectExport { +>connectExport : Symbol(connectExport, Decl(declareFileExportAssignment.ts, 3, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declareFileExportAssignment.ts, 4, 36)) +>mod : Symbol(mod, Decl(declareFileExportAssignment.ts, 5, 14)) +>connectModule : Symbol(connectModule, Decl(declareFileExportAssignment.ts, 0, 11)) +>connectExport : Symbol(connectExport, Decl(declareFileExportAssignment.ts, 3, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declareFileExportAssignment.ts, 5, 51)) +>port : Symbol(port, Decl(declareFileExportAssignment.ts, 6, 17)) + } + +} + +var m2: { +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) + + (): m2.connectExport; +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) +>connectExport : Symbol(m2.connectExport, Decl(declareFileExportAssignment.ts, 3, 5)) + + test1: m2.connectModule; +>test1 : Symbol(test1, Decl(declareFileExportAssignment.ts, 12, 25)) +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) +>connectModule : Symbol(m2.connectModule, Decl(declareFileExportAssignment.ts, 0, 11)) + + test2(): m2.connectModule; +>test2 : Symbol(test2, Decl(declareFileExportAssignment.ts, 13, 28)) +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) +>connectModule : Symbol(m2.connectModule, Decl(declareFileExportAssignment.ts, 0, 11)) + +}; + +export = m2; +>m2 : Symbol(m2, Decl(declareFileExportAssignment.ts, 0, 0), Decl(declareFileExportAssignment.ts, 11, 3)) + diff --git a/tests/baselines/reference/declareFileExportAssignment.types b/tests/baselines/reference/declareFileExportAssignment.types index f30586b07e3..cf9377b2904 100644 --- a/tests/baselines/reference/declareFileExportAssignment.types +++ b/tests/baselines/reference/declareFileExportAssignment.types @@ -30,17 +30,17 @@ var m2: { >m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; ->m2 : unknown +>m2 : any >connectExport : m2.connectExport test1: m2.connectModule; >test1 : m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule test2(): m2.connectModule; >test2 : () => m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule }; diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.symbols b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.symbols new file mode 100644 index 00000000000..e829c3d2f92 --- /dev/null +++ b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/declareFileExportAssignmentWithVarFromVariableStatement.ts === +module m2 { +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) + + export interface connectModule { +>connectModule : Symbol(connectModule, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 11)) + + (res, req, next): void; +>res : Symbol(res, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 2, 9)) +>req : Symbol(req, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 2, 13)) +>next : Symbol(next, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 2, 18)) + } + export interface connectExport { +>connectExport : Symbol(connectExport, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 3, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 4, 36)) +>mod : Symbol(mod, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 5, 14)) +>connectModule : Symbol(connectModule, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 11)) +>connectExport : Symbol(connectExport, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 3, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 5, 51)) +>port : Symbol(port, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 6, 17)) + } + +} + +var x = 10, m2: { +>x : Symbol(x, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 3)) +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) + + (): m2.connectExport; +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) +>connectExport : Symbol(m2.connectExport, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 3, 5)) + + test1: m2.connectModule; +>test1 : Symbol(test1, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 12, 25)) +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) +>connectModule : Symbol(m2.connectModule, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 11)) + + test2(): m2.connectModule; +>test2 : Symbol(test2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 13, 28)) +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) +>connectModule : Symbol(m2.connectModule, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 11)) + +}; + +export = m2; +>m2 : Symbol(m2, Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 0, 0), Decl(declareFileExportAssignmentWithVarFromVariableStatement.ts, 11, 11)) + diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types index 675dc38c869..c33ed5219a8 100644 --- a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types +++ b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types @@ -28,20 +28,21 @@ module m2 { var x = 10, m2: { >x : number +>10 : number >m2 : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; ->m2 : unknown +>m2 : any >connectExport : m2.connectExport test1: m2.connectModule; >test1 : m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule test2(): m2.connectModule; >test2 : () => m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule }; diff --git a/tests/baselines/reference/declaredExternalModule.symbols b/tests/baselines/reference/declaredExternalModule.symbols new file mode 100644 index 00000000000..e6fde33f2d0 --- /dev/null +++ b/tests/baselines/reference/declaredExternalModule.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/declaredExternalModule.ts === +declare module 'connect' { + + interface connectModule { +>connectModule : Symbol(connectModule, Decl(declaredExternalModule.ts, 0, 26)) + + (res, req, next): void; +>res : Symbol(res, Decl(declaredExternalModule.ts, 4, 9)) +>req : Symbol(req, Decl(declaredExternalModule.ts, 4, 13)) +>next : Symbol(next, Decl(declaredExternalModule.ts, 4, 18)) + + } + + interface connectExport { +>connectExport : Symbol(connectExport, Decl(declaredExternalModule.ts, 6, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declaredExternalModule.ts, 8, 29)) +>mod : Symbol(mod, Decl(declaredExternalModule.ts, 10, 14)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModule.ts, 0, 26)) +>connectExport : Symbol(connectExport, Decl(declaredExternalModule.ts, 6, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declaredExternalModule.ts, 10, 51)) +>port : Symbol(port, Decl(declaredExternalModule.ts, 12, 17)) + + } + + var server: { +>server : Symbol(server, Decl(declaredExternalModule.ts, 16, 7)) + + (): connectExport; +>connectExport : Symbol(connectExport, Decl(declaredExternalModule.ts, 6, 5)) + + test1: connectModule; // No error +>test1 : Symbol(test1, Decl(declaredExternalModule.ts, 18, 26)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModule.ts, 0, 26)) + + test2(): connectModule; // ERROR: Return type of method from exported interface has or is using private type ''connect'.connectModule'. +>test2 : Symbol(test2, Decl(declaredExternalModule.ts, 20, 29)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModule.ts, 0, 26)) + + }; +} + diff --git a/tests/baselines/reference/declaredExternalModuleWithExportAssignment.symbols b/tests/baselines/reference/declaredExternalModuleWithExportAssignment.symbols new file mode 100644 index 00000000000..360f57d7a9a --- /dev/null +++ b/tests/baselines/reference/declaredExternalModuleWithExportAssignment.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/declaredExternalModuleWithExportAssignment.ts === +declare module 'connect' { + interface connectModule { +>connectModule : Symbol(connectModule, Decl(declaredExternalModuleWithExportAssignment.ts, 0, 26)) + + (res, req, next): void; +>res : Symbol(res, Decl(declaredExternalModuleWithExportAssignment.ts, 2, 9)) +>req : Symbol(req, Decl(declaredExternalModuleWithExportAssignment.ts, 2, 13)) +>next : Symbol(next, Decl(declaredExternalModuleWithExportAssignment.ts, 2, 18)) + } + + interface connectExport { +>connectExport : Symbol(connectExport, Decl(declaredExternalModuleWithExportAssignment.ts, 3, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(declaredExternalModuleWithExportAssignment.ts, 5, 29)) +>mod : Symbol(mod, Decl(declaredExternalModuleWithExportAssignment.ts, 6, 14)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModuleWithExportAssignment.ts, 0, 26)) +>connectExport : Symbol(connectExport, Decl(declaredExternalModuleWithExportAssignment.ts, 3, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(declaredExternalModuleWithExportAssignment.ts, 6, 51)) +>port : Symbol(port, Decl(declaredExternalModuleWithExportAssignment.ts, 7, 17)) + } + + var server: { +>server : Symbol(server, Decl(declaredExternalModuleWithExportAssignment.ts, 10, 7)) + + (): connectExport; +>connectExport : Symbol(connectExport, Decl(declaredExternalModuleWithExportAssignment.ts, 3, 5)) + + test1: connectModule; +>test1 : Symbol(test1, Decl(declaredExternalModuleWithExportAssignment.ts, 11, 26)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModuleWithExportAssignment.ts, 0, 26)) + + test2(): connectModule; +>test2 : Symbol(test2, Decl(declaredExternalModuleWithExportAssignment.ts, 12, 29)) +>connectModule : Symbol(connectModule, Decl(declaredExternalModuleWithExportAssignment.ts, 0, 26)) + + }; + export = server; +>server : Symbol(server, Decl(declaredExternalModuleWithExportAssignment.ts, 10, 7)) +} + diff --git a/tests/baselines/reference/decoratedClassFromExternalModule.symbols b/tests/baselines/reference/decoratedClassFromExternalModule.symbols new file mode 100644 index 00000000000..aa17dde616a --- /dev/null +++ b/tests/baselines/reference/decoratedClassFromExternalModule.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decorated.ts === +function decorate() { } +>decorate : Symbol(decorate, Decl(decorated.ts, 0, 0)) + +@decorate +>decorate : Symbol(decorate, Decl(decorated.ts, 0, 0)) + +export default class Decorated { } +>Decorated : Symbol(Decorated, Decl(decorated.ts, 0, 23)) + +=== tests/cases/conformance/decorators/class/undecorated.ts === +import Decorated from 'decorated'; +>Decorated : Symbol(Decorated, Decl(undecorated.ts, 0, 6)) + diff --git a/tests/baselines/reference/decoratorOnClass1.symbols b/tests/baselines/reference/decoratorOnClass1.symbols new file mode 100644 index 00000000000..580bf2999ee --- /dev/null +++ b/tests/baselines/reference/decoratorOnClass1.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decoratorOnClass1.ts === +declare function dec(target: T): T; +>dec : Symbol(dec, Decl(decoratorOnClass1.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClass1.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClass1.ts, 0, 24)) +>T : Symbol(T, Decl(decoratorOnClass1.ts, 0, 21)) +>T : Symbol(T, Decl(decoratorOnClass1.ts, 0, 21)) + +@dec +>dec : Symbol(dec, Decl(decoratorOnClass1.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(decoratorOnClass1.ts, 0, 38)) +} diff --git a/tests/baselines/reference/decoratorOnClass2.symbols b/tests/baselines/reference/decoratorOnClass2.symbols new file mode 100644 index 00000000000..9fadb25b055 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClass2.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decoratorOnClass2.ts === +declare function dec(target: T): T; +>dec : Symbol(dec, Decl(decoratorOnClass2.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClass2.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClass2.ts, 0, 24)) +>T : Symbol(T, Decl(decoratorOnClass2.ts, 0, 21)) +>T : Symbol(T, Decl(decoratorOnClass2.ts, 0, 21)) + +@dec +>dec : Symbol(dec, Decl(decoratorOnClass2.ts, 0, 0)) + +export class C { +>C : Symbol(C, Decl(decoratorOnClass2.ts, 0, 38)) +} diff --git a/tests/baselines/reference/decoratorOnClass4.symbols b/tests/baselines/reference/decoratorOnClass4.symbols new file mode 100644 index 00000000000..7ecec97ec75 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClass4.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decoratorOnClass4.ts === +declare function dec(): (target: T) => T; +>dec : Symbol(dec, Decl(decoratorOnClass4.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClass4.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClass4.ts, 0, 28)) +>T : Symbol(T, Decl(decoratorOnClass4.ts, 0, 25)) +>T : Symbol(T, Decl(decoratorOnClass4.ts, 0, 25)) + +@dec() +>dec : Symbol(dec, Decl(decoratorOnClass4.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(decoratorOnClass4.ts, 0, 44)) +} diff --git a/tests/baselines/reference/decoratorOnClass5.symbols b/tests/baselines/reference/decoratorOnClass5.symbols new file mode 100644 index 00000000000..7291d593842 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClass5.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/decoratorOnClass5.ts === +declare function dec(): (target: T) => T; +>dec : Symbol(dec, Decl(decoratorOnClass5.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClass5.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClass5.ts, 0, 28)) +>T : Symbol(T, Decl(decoratorOnClass5.ts, 0, 25)) +>T : Symbol(T, Decl(decoratorOnClass5.ts, 0, 25)) + +@dec() +>dec : Symbol(dec, Decl(decoratorOnClass5.ts, 0, 0)) + +class C { +>C : Symbol(C, Decl(decoratorOnClass5.ts, 0, 44)) +} diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.symbols b/tests/baselines/reference/decoratorOnClassAccessor1.symbols new file mode 100644 index 00000000000..933dff1b4c5 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor1.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor1.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassAccessor1.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassAccessor1.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassAccessor1.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassAccessor1.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassAccessor1.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor1.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor1.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassAccessor1.ts, 0, 126)) + + @dec get accessor() { return 1; } +>dec : Symbol(dec, Decl(decoratorOnClassAccessor1.ts, 0, 0)) +>accessor : Symbol(accessor, Decl(decoratorOnClassAccessor1.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.types b/tests/baselines/reference/decoratorOnClassAccessor1.types index 602faf1fd22..e5ba5149d7a 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.types +++ b/tests/baselines/reference/decoratorOnClassAccessor1.types @@ -16,4 +16,5 @@ class C { @dec get accessor() { return 1; } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number +>1 : number } diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.symbols b/tests/baselines/reference/decoratorOnClassAccessor2.symbols new file mode 100644 index 00000000000..5738bb50bb8 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor2.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassAccessor2.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassAccessor2.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassAccessor2.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassAccessor2.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassAccessor2.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor2.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor2.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassAccessor2.ts, 0, 126)) + + @dec public get accessor() { return 1; } +>dec : Symbol(dec, Decl(decoratorOnClassAccessor2.ts, 0, 0)) +>accessor : Symbol(accessor, Decl(decoratorOnClassAccessor2.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.types b/tests/baselines/reference/decoratorOnClassAccessor2.types index e43733db132..32902ce7ca0 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor2.types +++ b/tests/baselines/reference/decoratorOnClassAccessor2.types @@ -16,4 +16,5 @@ class C { @dec public get accessor() { return 1; } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >accessor : number +>1 : number } diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.symbols b/tests/baselines/reference/decoratorOnClassAccessor4.symbols new file mode 100644 index 00000000000..1100df1c081 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor4.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor4.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassAccessor4.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassAccessor4.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassAccessor4.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassAccessor4.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassAccessor4.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor4.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor4.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassAccessor4.ts, 0, 126)) + + @dec set accessor(value: number) { } +>dec : Symbol(dec, Decl(decoratorOnClassAccessor4.ts, 0, 0)) +>accessor : Symbol(accessor, Decl(decoratorOnClassAccessor4.ts, 2, 9)) +>value : Symbol(value, Decl(decoratorOnClassAccessor4.ts, 3, 22)) +} diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.symbols b/tests/baselines/reference/decoratorOnClassAccessor5.symbols new file mode 100644 index 00000000000..8d9927776c2 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassAccessor5.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor5.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassAccessor5.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassAccessor5.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassAccessor5.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassAccessor5.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassAccessor5.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor5.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassAccessor5.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassAccessor5.ts, 0, 126)) + + @dec public set accessor(value: number) { } +>dec : Symbol(dec, Decl(decoratorOnClassAccessor5.ts, 0, 0)) +>accessor : Symbol(accessor, Decl(decoratorOnClassAccessor5.ts, 2, 9)) +>value : Symbol(value, Decl(decoratorOnClassAccessor5.ts, 3, 29)) +} diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter1.symbols b/tests/baselines/reference/decoratorOnClassConstructorParameter1.symbols new file mode 100644 index 00000000000..a863f74e2ff --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter1.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter1.ts === +declare function dec(target: Function, propertyKey: string | symbol, parameterIndex: number): void; +>dec : Symbol(dec, Decl(decoratorOnClassConstructorParameter1.ts, 0, 0)) +>target : Symbol(target, Decl(decoratorOnClassConstructorParameter1.ts, 0, 21)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassConstructorParameter1.ts, 0, 38)) +>parameterIndex : Symbol(parameterIndex, Decl(decoratorOnClassConstructorParameter1.ts, 0, 68)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassConstructorParameter1.ts, 0, 99)) + + constructor(@dec p: number) {} +>dec : Symbol(dec, Decl(decoratorOnClassConstructorParameter1.ts, 0, 0)) +>p : Symbol(p, Decl(decoratorOnClassConstructorParameter1.ts, 3, 16)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod1.symbols b/tests/baselines/reference/decoratorOnClassMethod1.symbols new file mode 100644 index 00000000000..f1463115f49 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod1.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod1.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod1.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod1.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassMethod1.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod1.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod1.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod1.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod1.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod1.ts, 0, 126)) + + @dec method() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod1.ts, 0, 0)) +>method : Symbol(method, Decl(decoratorOnClassMethod1.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod13.symbols b/tests/baselines/reference/decoratorOnClassMethod13.symbols new file mode 100644 index 00000000000..af3819924f4 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod13.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts === +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod13.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod13.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClassMethod13.ts, 0, 28)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod13.ts, 0, 40)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod13.ts, 0, 61)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod13.ts, 0, 25)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod13.ts, 0, 25)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod13.ts, 0, 132)) + + @dec ["1"]() { } +>dec : Symbol(dec, Decl(decoratorOnClassMethod13.ts, 0, 0)) + + @dec ["b"]() { } +>dec : Symbol(dec, Decl(decoratorOnClassMethod13.ts, 0, 0)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod13.types b/tests/baselines/reference/decoratorOnClassMethod13.types index 1390f5750e6..2858f8877bd 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.types +++ b/tests/baselines/reference/decoratorOnClassMethod13.types @@ -15,7 +15,9 @@ class C { @dec ["1"]() { } >dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"1" : string @dec ["b"]() { } >dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"b" : string } diff --git a/tests/baselines/reference/decoratorOnClassMethod2.symbols b/tests/baselines/reference/decoratorOnClassMethod2.symbols new file mode 100644 index 00000000000..e7942d3ae45 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod2.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod2.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod2.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassMethod2.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod2.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod2.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod2.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod2.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod2.ts, 0, 126)) + + @dec public method() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod2.ts, 0, 0)) +>method : Symbol(method, Decl(decoratorOnClassMethod2.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod4.symbols b/tests/baselines/reference/decoratorOnClassMethod4.symbols new file mode 100644 index 00000000000..688bc03775a --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod4.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod4.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod4.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod4.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassMethod4.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod4.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod4.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod4.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod4.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod4.ts, 0, 126)) + + @dec ["method"]() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod4.ts, 0, 0)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod4.types b/tests/baselines/reference/decoratorOnClassMethod4.types index 5b48b267e1d..026508257a5 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.types +++ b/tests/baselines/reference/decoratorOnClassMethod4.types @@ -15,4 +15,5 @@ class C { @dec ["method"]() {} >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"method" : string } diff --git a/tests/baselines/reference/decoratorOnClassMethod5.symbols b/tests/baselines/reference/decoratorOnClassMethod5.symbols new file mode 100644 index 00000000000..6356ca35449 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod5.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod5.ts === +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod5.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod5.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClassMethod5.ts, 0, 28)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod5.ts, 0, 40)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod5.ts, 0, 61)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod5.ts, 0, 25)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod5.ts, 0, 25)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod5.ts, 0, 132)) + + @dec() ["method"]() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod5.ts, 0, 0)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod5.types b/tests/baselines/reference/decoratorOnClassMethod5.types index d87de2b351a..d55ddd832b9 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.types +++ b/tests/baselines/reference/decoratorOnClassMethod5.types @@ -16,4 +16,5 @@ class C { @dec() ["method"]() {} >dec() : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"method" : string } diff --git a/tests/baselines/reference/decoratorOnClassMethod6.symbols b/tests/baselines/reference/decoratorOnClassMethod6.symbols new file mode 100644 index 00000000000..8dcdd99a8e9 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts === +declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod6.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod6.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClassMethod6.ts, 0, 28)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod6.ts, 0, 40)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod6.ts, 0, 61)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod6.ts, 0, 25)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod6.ts, 0, 25)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod6.ts, 0, 132)) + + @dec ["method"]() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod6.ts, 0, 0)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod6.types b/tests/baselines/reference/decoratorOnClassMethod6.types index 8b167b5fb0f..9da71791763 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.types +++ b/tests/baselines/reference/decoratorOnClassMethod6.types @@ -15,4 +15,5 @@ class C { @dec ["method"]() {} >dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"method" : string } diff --git a/tests/baselines/reference/decoratorOnClassMethod7.symbols b/tests/baselines/reference/decoratorOnClassMethod7.symbols new file mode 100644 index 00000000000..75c3bee294d --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod7.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod7.ts === +declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; +>dec : Symbol(dec, Decl(decoratorOnClassMethod7.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod7.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassMethod7.ts, 0, 24)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod7.ts, 0, 36)) +>descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod7.ts, 0, 57)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod7.ts, 0, 21)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.d.ts, 1171, 36)) +>T : Symbol(T, Decl(decoratorOnClassMethod7.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod7.ts, 0, 126)) + + @dec public ["method"]() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod7.ts, 0, 0)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethod7.types b/tests/baselines/reference/decoratorOnClassMethod7.types index 038d3ca7df5..8a72e24bd5b 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.types +++ b/tests/baselines/reference/decoratorOnClassMethod7.types @@ -15,4 +15,5 @@ class C { @dec public ["method"]() {} >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>"method" : string } diff --git a/tests/baselines/reference/decoratorOnClassMethod8.symbols b/tests/baselines/reference/decoratorOnClassMethod8.symbols new file mode 100644 index 00000000000..84b68b81421 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethod8.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts === +declare function dec(target: T): T; +>dec : Symbol(dec, Decl(decoratorOnClassMethod8.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassMethod8.ts, 0, 21)) +>target : Symbol(target, Decl(decoratorOnClassMethod8.ts, 0, 24)) +>T : Symbol(T, Decl(decoratorOnClassMethod8.ts, 0, 21)) +>T : Symbol(T, Decl(decoratorOnClassMethod8.ts, 0, 21)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethod8.ts, 0, 38)) + + @dec method() {} +>dec : Symbol(dec, Decl(decoratorOnClassMethod8.ts, 0, 0)) +>method : Symbol(method, Decl(decoratorOnClassMethod8.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.symbols b/tests/baselines/reference/decoratorOnClassMethodParameter1.symbols new file mode 100644 index 00000000000..0ced8829766 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/decorators/class/method/parameter/decoratorOnClassMethodParameter1.ts === +declare function dec(target: Function, propertyKey: string | symbol, parameterIndex: number): void; +>dec : Symbol(dec, Decl(decoratorOnClassMethodParameter1.ts, 0, 0)) +>target : Symbol(target, Decl(decoratorOnClassMethodParameter1.ts, 0, 21)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethodParameter1.ts, 0, 38)) +>parameterIndex : Symbol(parameterIndex, Decl(decoratorOnClassMethodParameter1.ts, 0, 68)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassMethodParameter1.ts, 0, 99)) + + method(@dec p: number) {} +>method : Symbol(method, Decl(decoratorOnClassMethodParameter1.ts, 2, 9)) +>dec : Symbol(dec, Decl(decoratorOnClassMethodParameter1.ts, 0, 0)) +>p : Symbol(p, Decl(decoratorOnClassMethodParameter1.ts, 3, 11)) +} diff --git a/tests/baselines/reference/decoratorOnClassProperty1.symbols b/tests/baselines/reference/decoratorOnClassProperty1.symbols new file mode 100644 index 00000000000..1cf97d5ec3b --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassProperty1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty1.ts === +declare function dec(target: any, propertyKey: string): void; +>dec : Symbol(dec, Decl(decoratorOnClassProperty1.ts, 0, 0)) +>target : Symbol(target, Decl(decoratorOnClassProperty1.ts, 0, 21)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassProperty1.ts, 0, 33)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassProperty1.ts, 0, 61)) + + @dec prop; +>dec : Symbol(dec, Decl(decoratorOnClassProperty1.ts, 0, 0)) +>prop : Symbol(prop, Decl(decoratorOnClassProperty1.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassProperty10.symbols b/tests/baselines/reference/decoratorOnClassProperty10.symbols new file mode 100644 index 00000000000..22af0bd8b50 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassProperty10.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty10.ts === +declare function dec(): (target: any, propertyKey: string) => void; +>dec : Symbol(dec, Decl(decoratorOnClassProperty10.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassProperty10.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClassProperty10.ts, 0, 28)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassProperty10.ts, 0, 40)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassProperty10.ts, 0, 70)) + + @dec() prop; +>dec : Symbol(dec, Decl(decoratorOnClassProperty10.ts, 0, 0)) +>prop : Symbol(prop, Decl(decoratorOnClassProperty10.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassProperty11.symbols b/tests/baselines/reference/decoratorOnClassProperty11.symbols new file mode 100644 index 00000000000..c7d6e39c713 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassProperty11.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts === +declare function dec(): (target: any, propertyKey: string) => void; +>dec : Symbol(dec, Decl(decoratorOnClassProperty11.ts, 0, 0)) +>T : Symbol(T, Decl(decoratorOnClassProperty11.ts, 0, 25)) +>target : Symbol(target, Decl(decoratorOnClassProperty11.ts, 0, 28)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassProperty11.ts, 0, 40)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassProperty11.ts, 0, 70)) + + @dec prop; +>dec : Symbol(dec, Decl(decoratorOnClassProperty11.ts, 0, 0)) +>prop : Symbol(prop, Decl(decoratorOnClassProperty11.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassProperty2.symbols b/tests/baselines/reference/decoratorOnClassProperty2.symbols new file mode 100644 index 00000000000..3383fb1418a --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassProperty2.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty2.ts === +declare function dec(target: any, propertyKey: string): void; +>dec : Symbol(dec, Decl(decoratorOnClassProperty2.ts, 0, 0)) +>target : Symbol(target, Decl(decoratorOnClassProperty2.ts, 0, 21)) +>propertyKey : Symbol(propertyKey, Decl(decoratorOnClassProperty2.ts, 0, 33)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassProperty2.ts, 0, 61)) + + @dec public prop; +>dec : Symbol(dec, Decl(decoratorOnClassProperty2.ts, 0, 0)) +>prop : Symbol(prop, Decl(decoratorOnClassProperty2.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decoratorOnClassProperty6.symbols b/tests/baselines/reference/decoratorOnClassProperty6.symbols new file mode 100644 index 00000000000..7b9857e0a19 --- /dev/null +++ b/tests/baselines/reference/decoratorOnClassProperty6.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty6.ts === +declare function dec(target: Function): void; +>dec : Symbol(dec, Decl(decoratorOnClassProperty6.ts, 0, 0)) +>target : Symbol(target, Decl(decoratorOnClassProperty6.ts, 0, 21)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +class C { +>C : Symbol(C, Decl(decoratorOnClassProperty6.ts, 0, 45)) + + @dec prop; +>dec : Symbol(dec, Decl(decoratorOnClassProperty6.ts, 0, 0)) +>prop : Symbol(prop, Decl(decoratorOnClassProperty6.ts, 2, 9)) +} diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.symbols b/tests/baselines/reference/decrementOperatorWithAnyOtherType.symbols new file mode 100644 index 00000000000..594e6d50ac4 --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.symbols @@ -0,0 +1,154 @@ +=== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherType.ts === +// -- operator on any type + +var ANY: any; +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) + +var ANY1; +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ANY2: any[] = ["", ""]; +>ANY2 : Symbol(ANY2, Decl(decrementOperatorWithAnyOtherType.ts, 4, 3)) + +var obj = {x:1,y:null}; +>obj : Symbol(obj, Decl(decrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(decrementOperatorWithAnyOtherType.ts, 5, 11)) +>y : Symbol(y, Decl(decrementOperatorWithAnyOtherType.ts, 5, 15)) + +class A { +>A : Symbol(A, Decl(decrementOperatorWithAnyOtherType.ts, 5, 23)) + + public a: any; +>a : Symbol(a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) +} +module M { +>M : Symbol(M, Decl(decrementOperatorWithAnyOtherType.ts, 8, 1)) + + export var n: any; +>n : Symbol(n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) +} +var objA = new A(); +>objA : Symbol(objA, Decl(decrementOperatorWithAnyOtherType.ts, 12, 3)) +>A : Symbol(A, Decl(decrementOperatorWithAnyOtherType.ts, 5, 23)) + +// any type var +var ResultIsNumber1 = --ANY; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(decrementOperatorWithAnyOtherType.ts, 15, 3)) +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) + +var ResultIsNumber2 = --ANY1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(decrementOperatorWithAnyOtherType.ts, 16, 3)) +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ResultIsNumber3 = ANY1--; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(decrementOperatorWithAnyOtherType.ts, 18, 3)) +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ResultIsNumber4 = ANY1--; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(decrementOperatorWithAnyOtherType.ts, 19, 3)) +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +// expressions +var ResultIsNumber5 = --ANY2[0]; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(decrementOperatorWithAnyOtherType.ts, 22, 3)) +>ANY2 : Symbol(ANY2, Decl(decrementOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber6 = --obj.x; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(decrementOperatorWithAnyOtherType.ts, 23, 3)) +>obj.x : Symbol(x, Decl(decrementOperatorWithAnyOtherType.ts, 5, 11)) +>obj : Symbol(obj, Decl(decrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(decrementOperatorWithAnyOtherType.ts, 5, 11)) + +var ResultIsNumber7 = --obj.y; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(decrementOperatorWithAnyOtherType.ts, 24, 3)) +>obj.y : Symbol(y, Decl(decrementOperatorWithAnyOtherType.ts, 5, 15)) +>obj : Symbol(obj, Decl(decrementOperatorWithAnyOtherType.ts, 5, 3)) +>y : Symbol(y, Decl(decrementOperatorWithAnyOtherType.ts, 5, 15)) + +var ResultIsNumber8 = --objA.a; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(decrementOperatorWithAnyOtherType.ts, 25, 3)) +>objA.a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) + +var ResultIsNumber = --M.n; +>ResultIsNumber : Symbol(ResultIsNumber, Decl(decrementOperatorWithAnyOtherType.ts, 26, 3)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(decrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) + +var ResultIsNumber9 = ANY2[0]--; +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(decrementOperatorWithAnyOtherType.ts, 28, 3)) +>ANY2 : Symbol(ANY2, Decl(decrementOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber10 = obj.x--; +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(decrementOperatorWithAnyOtherType.ts, 29, 3)) +>obj.x : Symbol(x, Decl(decrementOperatorWithAnyOtherType.ts, 5, 11)) +>obj : Symbol(obj, Decl(decrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(decrementOperatorWithAnyOtherType.ts, 5, 11)) + +var ResultIsNumber11 = obj.y--; +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(decrementOperatorWithAnyOtherType.ts, 30, 3)) +>obj.y : Symbol(y, Decl(decrementOperatorWithAnyOtherType.ts, 5, 15)) +>obj : Symbol(obj, Decl(decrementOperatorWithAnyOtherType.ts, 5, 3)) +>y : Symbol(y, Decl(decrementOperatorWithAnyOtherType.ts, 5, 15)) + +var ResultIsNumber12 = objA.a--; +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(decrementOperatorWithAnyOtherType.ts, 31, 3)) +>objA.a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) + +var ResultIsNumber13 = M.n--; +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(decrementOperatorWithAnyOtherType.ts, 32, 3)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(decrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) + +// miss assignment opertors +--ANY; +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) + +--ANY1; +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +--ANY2[0]; +>ANY2 : Symbol(ANY2, Decl(decrementOperatorWithAnyOtherType.ts, 4, 3)) + +--ANY, --ANY1; +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +--objA.a; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) + +--M.n; +>M.n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(decrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) + +ANY--; +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) + +ANY1--; +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +ANY2[0]--; +>ANY2 : Symbol(ANY2, Decl(decrementOperatorWithAnyOtherType.ts, 4, 3)) + +ANY--, ANY1--; +>ANY : Symbol(ANY, Decl(decrementOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(decrementOperatorWithAnyOtherType.ts, 3, 3)) + +objA.a--; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithAnyOtherType.ts, 6, 9)) + +M.n--; +>M.n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(decrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithAnyOtherType.ts, 10, 14)) + diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types index ab21dd9db5c..65eea6d1a71 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherType.types @@ -10,12 +10,16 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] +>"" : string +>"" : string var obj = {x:1,y:null}; >obj : { x: number; y: any; } >{x:1,y:null} : { x: number; y: null; } >x : number +>1 : number >y : null +>null : null class A { >A : A @@ -61,6 +65,7 @@ var ResultIsNumber5 = --ANY2[0]; >--ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number var ResultIsNumber6 = --obj.x; >ResultIsNumber6 : number @@ -95,6 +100,7 @@ var ResultIsNumber9 = ANY2[0]--; >ANY2[0]-- : number >ANY2[0] : any >ANY2 : any[] +>0 : number var ResultIsNumber10 = obj.x--; >ResultIsNumber10 : number @@ -137,6 +143,7 @@ var ResultIsNumber13 = M.n--; >--ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number --ANY, --ANY1; >--ANY, --ANY1 : number @@ -169,6 +176,7 @@ ANY2[0]--; >ANY2[0]-- : number >ANY2[0] : any >ANY2 : any[] +>0 : number ANY--, ANY1--; >ANY--, ANY1-- : number diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.symbols b/tests/baselines/reference/decrementOperatorWithNumberType.symbols new file mode 100644 index 00000000000..40d9a67735e --- /dev/null +++ b/tests/baselines/reference/decrementOperatorWithNumberType.symbols @@ -0,0 +1,112 @@ +=== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithNumberType.ts === +// -- operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(decrementOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(decrementOperatorWithNumberType.ts, 2, 3)) + +class A { +>A : Symbol(A, Decl(decrementOperatorWithNumberType.ts, 2, 31)) + + public a: number; +>a : Symbol(a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +} +module M { +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) + + export var n: number; +>n : Symbol(n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>A : Symbol(A, Decl(decrementOperatorWithNumberType.ts, 2, 31)) + +// number type var +var ResultIsNumber1 = --NUMBER; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(decrementOperatorWithNumberType.ts, 14, 3)) +>NUMBER : Symbol(NUMBER, Decl(decrementOperatorWithNumberType.ts, 1, 3)) + +var ResultIsNumber2 = NUMBER--; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(decrementOperatorWithNumberType.ts, 16, 3)) +>NUMBER : Symbol(NUMBER, Decl(decrementOperatorWithNumberType.ts, 1, 3)) + +// expressions +var ResultIsNumber3 = --objA.a; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(decrementOperatorWithNumberType.ts, 19, 3)) +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) + +var ResultIsNumber4 = --M.n; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(decrementOperatorWithNumberType.ts, 20, 3)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + +var ResultIsNumber5 = objA.a--; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(decrementOperatorWithNumberType.ts, 22, 3)) +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) + +var ResultIsNumber6 = M.n--; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(decrementOperatorWithNumberType.ts, 23, 3)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + +var ResultIsNumber7 = NUMBER1[0]--; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(decrementOperatorWithNumberType.ts, 24, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(decrementOperatorWithNumberType.ts, 2, 3)) + +// miss assignment operators +--NUMBER; +>NUMBER : Symbol(NUMBER, Decl(decrementOperatorWithNumberType.ts, 1, 3)) + +--NUMBER1[0]; +>NUMBER1 : Symbol(NUMBER1, Decl(decrementOperatorWithNumberType.ts, 2, 3)) + +--objA.a; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) + +--M.n; +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + +--objA.a, M.n; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + +NUMBER--; +>NUMBER : Symbol(NUMBER, Decl(decrementOperatorWithNumberType.ts, 1, 3)) + +NUMBER1[0]--; +>NUMBER1 : Symbol(NUMBER1, Decl(decrementOperatorWithNumberType.ts, 2, 3)) + +objA.a--; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) + +M.n--; +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + +objA.a--, M.n--; +>objA.a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(decrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(decrementOperatorWithNumberType.ts, 4, 9)) +>M.n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(decrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(decrementOperatorWithNumberType.ts, 8, 14)) + diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.types b/tests/baselines/reference/decrementOperatorWithNumberType.types index d619db84e46..f990ad18fc7 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberType.types +++ b/tests/baselines/reference/decrementOperatorWithNumberType.types @@ -6,6 +6,8 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number class A { >A : A @@ -70,6 +72,7 @@ var ResultIsNumber7 = NUMBER1[0]--; >NUMBER1[0]-- : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number // miss assignment operators --NUMBER; @@ -80,6 +83,7 @@ var ResultIsNumber7 = NUMBER1[0]--; >--NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number --objA.a; >--objA.a : number @@ -111,6 +115,7 @@ NUMBER1[0]--; >NUMBER1[0]-- : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number objA.a--; >objA.a-- : number diff --git a/tests/baselines/reference/defaultIndexProps1.symbols b/tests/baselines/reference/defaultIndexProps1.symbols new file mode 100644 index 00000000000..e294b9e7dba --- /dev/null +++ b/tests/baselines/reference/defaultIndexProps1.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/defaultIndexProps1.ts === +class Foo { +>Foo : Symbol(Foo, Decl(defaultIndexProps1.ts, 0, 0)) + + public v = "Yo"; +>v : Symbol(v, Decl(defaultIndexProps1.ts, 0, 11)) +} + +var f = new Foo(); +>f : Symbol(f, Decl(defaultIndexProps1.ts, 4, 3)) +>Foo : Symbol(Foo, Decl(defaultIndexProps1.ts, 0, 0)) + +var q = f["v"]; +>q : Symbol(q, Decl(defaultIndexProps1.ts, 6, 3)) +>f : Symbol(f, Decl(defaultIndexProps1.ts, 4, 3)) +>"v" : Symbol(Foo.v, Decl(defaultIndexProps1.ts, 0, 11)) + +var o = {v:"Yo2"}; +>o : Symbol(o, Decl(defaultIndexProps1.ts, 8, 3)) +>v : Symbol(v, Decl(defaultIndexProps1.ts, 8, 9)) + +var q2 = o["v"]; +>q2 : Symbol(q2, Decl(defaultIndexProps1.ts, 10, 3)) +>o : Symbol(o, Decl(defaultIndexProps1.ts, 8, 3)) +>"v" : Symbol(v, Decl(defaultIndexProps1.ts, 8, 9)) + diff --git a/tests/baselines/reference/defaultIndexProps1.types b/tests/baselines/reference/defaultIndexProps1.types index 9bb9c4a32c2..0b188a40c20 100644 --- a/tests/baselines/reference/defaultIndexProps1.types +++ b/tests/baselines/reference/defaultIndexProps1.types @@ -4,6 +4,7 @@ class Foo { public v = "Yo"; >v : string +>"Yo" : string } var f = new Foo(); @@ -15,14 +16,17 @@ var q = f["v"]; >q : string >f["v"] : string >f : Foo +>"v" : string var o = {v:"Yo2"}; >o : { v: string; } >{v:"Yo2"} : { v: string; } >v : string +>"Yo2" : string var q2 = o["v"]; >q2 : string >o["v"] : string >o : { v: string; } +>"v" : string diff --git a/tests/baselines/reference/defaultIndexProps2.symbols b/tests/baselines/reference/defaultIndexProps2.symbols new file mode 100644 index 00000000000..53d433351c3 --- /dev/null +++ b/tests/baselines/reference/defaultIndexProps2.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/defaultIndexProps2.ts === +class Foo { +>Foo : Symbol(Foo, Decl(defaultIndexProps2.ts, 0, 0)) + + public v = "Yo"; +>v : Symbol(v, Decl(defaultIndexProps2.ts, 0, 11)) +} + +var f = new Foo(); +>f : Symbol(f, Decl(defaultIndexProps2.ts, 4, 3)) +>Foo : Symbol(Foo, Decl(defaultIndexProps2.ts, 0, 0)) + +// WScript.Echo(f[0]); + +var o = {v:"Yo2"}; +>o : Symbol(o, Decl(defaultIndexProps2.ts, 8, 3)) +>v : Symbol(v, Decl(defaultIndexProps2.ts, 8, 9)) + +// WScript.Echo(o[0]); + +1[0]; +var q = "s"[0]; +>q : Symbol(q, Decl(defaultIndexProps2.ts, 13, 3)) + diff --git a/tests/baselines/reference/defaultIndexProps2.types b/tests/baselines/reference/defaultIndexProps2.types index 26850bd1456..3b0d8278966 100644 --- a/tests/baselines/reference/defaultIndexProps2.types +++ b/tests/baselines/reference/defaultIndexProps2.types @@ -4,6 +4,7 @@ class Foo { public v = "Yo"; >v : string +>"Yo" : string } var f = new Foo(); @@ -17,13 +18,18 @@ var o = {v:"Yo2"}; >o : { v: string; } >{v:"Yo2"} : { v: string; } >v : string +>"Yo2" : string // WScript.Echo(o[0]); 1[0]; >1[0] : any +>1 : number +>0 : number var q = "s"[0]; >q : string >"s"[0] : string +>"s" : string +>0 : number diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.symbols b/tests/baselines/reference/deleteOperatorWithBooleanType.symbols new file mode 100644 index 00000000000..71cb78760f6 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.symbols @@ -0,0 +1,89 @@ +=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithBooleanType.ts === +// delete operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3)) + +function foo(): boolean { return true; } +>foo : Symbol(foo, Decl(deleteOperatorWithBooleanType.ts, 1, 21)) + +class A { +>A : Symbol(A, Decl(deleteOperatorWithBooleanType.ts, 3, 40)) + + public a: boolean; +>a : Symbol(a, Decl(deleteOperatorWithBooleanType.ts, 5, 9)) + + static foo() { return false; } +>foo : Symbol(A.foo, Decl(deleteOperatorWithBooleanType.ts, 6, 22)) +} +module M { +>M : Symbol(M, Decl(deleteOperatorWithBooleanType.ts, 8, 1)) + + export var n: boolean; +>n : Symbol(n, Decl(deleteOperatorWithBooleanType.ts, 10, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(deleteOperatorWithBooleanType.ts, 13, 3)) +>A : Symbol(A, Decl(deleteOperatorWithBooleanType.ts, 3, 40)) + +// boolean type var +var ResultIsBoolean1 = delete BOOLEAN; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(deleteOperatorWithBooleanType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3)) + +// boolean type literal +var ResultIsBoolean2 = delete true; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(deleteOperatorWithBooleanType.ts, 19, 3)) + +var ResultIsBoolean3 = delete { x: true, y: false }; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(deleteOperatorWithBooleanType.ts, 20, 3)) +>x : Symbol(x, Decl(deleteOperatorWithBooleanType.ts, 20, 31)) +>y : Symbol(y, Decl(deleteOperatorWithBooleanType.ts, 20, 40)) + +// boolean type expressions +var ResultIsBoolean4 = delete objA.a; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(deleteOperatorWithBooleanType.ts, 23, 3)) +>objA.a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9)) + +var ResultIsBoolean5 = delete M.n; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(deleteOperatorWithBooleanType.ts, 24, 3)) +>M.n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(deleteOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14)) + +var ResultIsBoolean6 = delete foo(); +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(deleteOperatorWithBooleanType.ts, 25, 3)) +>foo : Symbol(foo, Decl(deleteOperatorWithBooleanType.ts, 1, 21)) + +var ResultIsBoolean7 = delete A.foo(); +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(deleteOperatorWithBooleanType.ts, 26, 3)) +>A.foo : Symbol(A.foo, Decl(deleteOperatorWithBooleanType.ts, 6, 22)) +>A : Symbol(A, Decl(deleteOperatorWithBooleanType.ts, 3, 40)) +>foo : Symbol(A.foo, Decl(deleteOperatorWithBooleanType.ts, 6, 22)) + +// multiple delete operator +var ResultIsBoolean8 = delete delete BOOLEAN; +>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(deleteOperatorWithBooleanType.ts, 29, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3)) + +// miss assignment operators +delete true; +delete BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(deleteOperatorWithBooleanType.ts, 1, 3)) + +delete foo(); +>foo : Symbol(foo, Decl(deleteOperatorWithBooleanType.ts, 1, 21)) + +delete true, false; +delete objA.a; +>objA.a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithBooleanType.ts, 5, 9)) + +delete M.n; +>M.n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(deleteOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithBooleanType.ts, 10, 14)) + diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.types b/tests/baselines/reference/deleteOperatorWithBooleanType.types index fa8c375b0a5..068c67031ef 100644 --- a/tests/baselines/reference/deleteOperatorWithBooleanType.types +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.types @@ -5,6 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean +>true : boolean class A { >A : A @@ -14,6 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean +>false : boolean } module M { >M : typeof M @@ -37,13 +39,16 @@ var ResultIsBoolean1 = delete BOOLEAN; var ResultIsBoolean2 = delete true; >ResultIsBoolean2 : boolean >delete true : boolean +>true : boolean var ResultIsBoolean3 = delete { x: true, y: false }; >ResultIsBoolean3 : boolean >delete { x: true, y: false } : boolean >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean +>true : boolean >y : boolean +>false : boolean // boolean type expressions var ResultIsBoolean4 = delete objA.a; @@ -84,6 +89,7 @@ var ResultIsBoolean8 = delete delete BOOLEAN; // miss assignment operators delete true; >delete true : boolean +>true : boolean delete BOOLEAN; >delete BOOLEAN : boolean @@ -97,6 +103,8 @@ delete foo(); delete true, false; >delete true, false : boolean >delete true : boolean +>true : boolean +>false : boolean delete objA.a; >delete objA.a : boolean diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.symbols b/tests/baselines/reference/deleteOperatorWithEnumType.symbols new file mode 100644 index 00000000000..bdef75325da --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithEnumType.symbols @@ -0,0 +1,59 @@ +=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithEnumType.ts === +// delete operator on enum type + +enum ENUM { }; +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) + +enum ENUM1 { A, B, "" }; +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) +>A : Symbol(ENUM1.A, Decl(deleteOperatorWithEnumType.ts, 3, 12)) +>B : Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15)) + +// enum type var +var ResultIsBoolean1 = delete ENUM; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(deleteOperatorWithEnumType.ts, 6, 3)) +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) + +var ResultIsBoolean2 = delete ENUM1; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(deleteOperatorWithEnumType.ts, 7, 3)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) + +// enum type expressions +var ResultIsBoolean3 = delete ENUM1["A"]; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(deleteOperatorWithEnumType.ts, 10, 3)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) +>"A" : Symbol(ENUM1.A, Decl(deleteOperatorWithEnumType.ts, 3, 12)) + +var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(deleteOperatorWithEnumType.ts, 11, 3)) +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) +>"B" : Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15)) + +// multiple delete operators +var ResultIsBoolean5 = delete delete ENUM; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(deleteOperatorWithEnumType.ts, 14, 3)) +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) + +var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]); +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(deleteOperatorWithEnumType.ts, 15, 3)) +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) +>"B" : Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15)) + +// miss assignment operators +delete ENUM; +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) + +delete ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) + +delete ENUM1.B; +>ENUM1.B : Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) +>B : Symbol(ENUM1.B, Decl(deleteOperatorWithEnumType.ts, 3, 15)) + +delete ENUM, ENUM1; +>ENUM : Symbol(ENUM, Decl(deleteOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(deleteOperatorWithEnumType.ts, 2, 14)) + diff --git a/tests/baselines/reference/deleteOperatorWithEnumType.types b/tests/baselines/reference/deleteOperatorWithEnumType.types index e436ac3373f..d3266a6aa6c 100644 --- a/tests/baselines/reference/deleteOperatorWithEnumType.types +++ b/tests/baselines/reference/deleteOperatorWithEnumType.types @@ -26,6 +26,7 @@ var ResultIsBoolean3 = delete ENUM1["A"]; >delete ENUM1["A"] : boolean >ENUM1["A"] : ENUM1 >ENUM1 : typeof ENUM1 +>"A" : string var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); >ResultIsBoolean4 : boolean @@ -34,8 +35,10 @@ var ResultIsBoolean4 = delete (ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM +>0 : number >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string // multiple delete operators var ResultIsBoolean5 = delete delete ENUM; @@ -53,8 +56,10 @@ var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1["B"]); >ENUM[0] + ENUM1["B"] : string >ENUM[0] : string >ENUM : typeof ENUM +>0 : number >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string // miss assignment operators delete ENUM; diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.symbols b/tests/baselines/reference/deleteOperatorWithNumberType.symbols new file mode 100644 index 00000000000..589b1f91db2 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithNumberType.symbols @@ -0,0 +1,127 @@ +=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithNumberType.ts === +// delete operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(deleteOperatorWithNumberType.ts, 2, 3)) + +function foo(): number { return 1; } +>foo : Symbol(foo, Decl(deleteOperatorWithNumberType.ts, 2, 31)) + +class A { +>A : Symbol(A, Decl(deleteOperatorWithNumberType.ts, 4, 36)) + + public a: number; +>a : Symbol(a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) + + static foo() { return 1; } +>foo : Symbol(A.foo, Decl(deleteOperatorWithNumberType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(deleteOperatorWithNumberType.ts, 9, 1)) + + export var n: number; +>n : Symbol(n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(deleteOperatorWithNumberType.ts, 14, 3)) +>A : Symbol(A, Decl(deleteOperatorWithNumberType.ts, 4, 36)) + +// number type var +var ResultIsBoolean1 = delete NUMBER; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(deleteOperatorWithNumberType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +var ResultIsBoolean2 = delete NUMBER1; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(deleteOperatorWithNumberType.ts, 18, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(deleteOperatorWithNumberType.ts, 2, 3)) + +// number type literal +var ResultIsBoolean3 = delete 1; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(deleteOperatorWithNumberType.ts, 21, 3)) + +var ResultIsBoolean4 = delete { x: 1, y: 2}; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(deleteOperatorWithNumberType.ts, 22, 3)) +>x : Symbol(x, Decl(deleteOperatorWithNumberType.ts, 22, 31)) +>y : Symbol(y, Decl(deleteOperatorWithNumberType.ts, 22, 37)) + +var ResultIsBoolean5 = delete { x: 1, y: (n: number) => { return n; } }; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(deleteOperatorWithNumberType.ts, 23, 3)) +>x : Symbol(x, Decl(deleteOperatorWithNumberType.ts, 23, 31)) +>y : Symbol(y, Decl(deleteOperatorWithNumberType.ts, 23, 37)) +>n : Symbol(n, Decl(deleteOperatorWithNumberType.ts, 23, 42)) +>n : Symbol(n, Decl(deleteOperatorWithNumberType.ts, 23, 42)) + +// number type expressions +var ResultIsBoolean6 = delete objA.a; +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(deleteOperatorWithNumberType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) + +var ResultIsBoolean7 = delete M.n; +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(deleteOperatorWithNumberType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(deleteOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) + +var ResultIsBoolean8 = delete NUMBER1[0]; +>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(deleteOperatorWithNumberType.ts, 28, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(deleteOperatorWithNumberType.ts, 2, 3)) + +var ResultIsBoolean9 = delete foo(); +>ResultIsBoolean9 : Symbol(ResultIsBoolean9, Decl(deleteOperatorWithNumberType.ts, 29, 3)) +>foo : Symbol(foo, Decl(deleteOperatorWithNumberType.ts, 2, 31)) + +var ResultIsBoolean10 = delete A.foo(); +>ResultIsBoolean10 : Symbol(ResultIsBoolean10, Decl(deleteOperatorWithNumberType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(deleteOperatorWithNumberType.ts, 7, 21)) +>A : Symbol(A, Decl(deleteOperatorWithNumberType.ts, 4, 36)) +>foo : Symbol(A.foo, Decl(deleteOperatorWithNumberType.ts, 7, 21)) + +var ResultIsBoolean11 = delete (NUMBER + NUMBER); +>ResultIsBoolean11 : Symbol(ResultIsBoolean11, Decl(deleteOperatorWithNumberType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +// multiple delete operator +var ResultIsBoolean12 = delete delete NUMBER; +>ResultIsBoolean12 : Symbol(ResultIsBoolean12, Decl(deleteOperatorWithNumberType.ts, 34, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +var ResultIsBoolean13 = delete delete delete (NUMBER + NUMBER); +>ResultIsBoolean13 : Symbol(ResultIsBoolean13, Decl(deleteOperatorWithNumberType.ts, 35, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +// miss assignment operators +delete 1; +delete NUMBER; +>NUMBER : Symbol(NUMBER, Decl(deleteOperatorWithNumberType.ts, 1, 3)) + +delete NUMBER1; +>NUMBER1 : Symbol(NUMBER1, Decl(deleteOperatorWithNumberType.ts, 2, 3)) + +delete foo(); +>foo : Symbol(foo, Decl(deleteOperatorWithNumberType.ts, 2, 31)) + +delete objA.a; +>objA.a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) + +delete M.n; +>M.n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(deleteOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) + +delete objA.a, M.n; +>objA.a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithNumberType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(deleteOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithNumberType.ts, 11, 14)) + diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.types b/tests/baselines/reference/deleteOperatorWithNumberType.types index 542efe04c34..e631745d089 100644 --- a/tests/baselines/reference/deleteOperatorWithNumberType.types +++ b/tests/baselines/reference/deleteOperatorWithNumberType.types @@ -6,9 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number function foo(): number { return 1; } >foo : () => number +>1 : number class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return 1; } >foo : () => number +>1 : number } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsBoolean2 = delete NUMBER1; var ResultIsBoolean3 = delete 1; >ResultIsBoolean3 : boolean >delete 1 : boolean +>1 : number var ResultIsBoolean4 = delete { x: 1, y: 2}; >ResultIsBoolean4 : boolean >delete { x: 1, y: 2} : boolean >{ x: 1, y: 2} : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number var ResultIsBoolean5 = delete { x: 1, y: (n: number) => { return n; } }; >ResultIsBoolean5 : boolean >delete { x: 1, y: (n: number) => { return n; } } : boolean >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number +>1 : number >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -84,6 +92,7 @@ var ResultIsBoolean8 = delete NUMBER1[0]; >delete NUMBER1[0] : boolean >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number var ResultIsBoolean9 = delete foo(); >ResultIsBoolean9 : boolean @@ -127,6 +136,7 @@ var ResultIsBoolean13 = delete delete delete (NUMBER + NUMBER); // miss assignment operators delete 1; >delete 1 : boolean +>1 : number delete NUMBER; >delete NUMBER : boolean diff --git a/tests/baselines/reference/deleteOperatorWithStringType.symbols b/tests/baselines/reference/deleteOperatorWithStringType.symbols new file mode 100644 index 00000000000..a13ddd5fa39 --- /dev/null +++ b/tests/baselines/reference/deleteOperatorWithStringType.symbols @@ -0,0 +1,123 @@ +=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithStringType.ts === +// delete operator on string type +var STRING: string; +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +var STRING1: string[] = ["", "abc"]; +>STRING1 : Symbol(STRING1, Decl(deleteOperatorWithStringType.ts, 2, 3)) + +function foo(): string { return "abc"; } +>foo : Symbol(foo, Decl(deleteOperatorWithStringType.ts, 2, 36)) + +class A { +>A : Symbol(A, Decl(deleteOperatorWithStringType.ts, 4, 40)) + + public a: string; +>a : Symbol(a, Decl(deleteOperatorWithStringType.ts, 6, 9)) + + static foo() { return ""; } +>foo : Symbol(A.foo, Decl(deleteOperatorWithStringType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(deleteOperatorWithStringType.ts, 9, 1)) + + export var n: string; +>n : Symbol(n, Decl(deleteOperatorWithStringType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(deleteOperatorWithStringType.ts, 14, 3)) +>A : Symbol(A, Decl(deleteOperatorWithStringType.ts, 4, 40)) + +// string type var +var ResultIsBoolean1 = delete STRING; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(deleteOperatorWithStringType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean2 = delete STRING1; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(deleteOperatorWithStringType.ts, 18, 3)) +>STRING1 : Symbol(STRING1, Decl(deleteOperatorWithStringType.ts, 2, 3)) + +// string type literal +var ResultIsBoolean3 = delete ""; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(deleteOperatorWithStringType.ts, 21, 3)) + +var ResultIsBoolean4 = delete { x: "", y: "" }; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(deleteOperatorWithStringType.ts, 22, 3)) +>x : Symbol(x, Decl(deleteOperatorWithStringType.ts, 22, 31)) +>y : Symbol(y, Decl(deleteOperatorWithStringType.ts, 22, 38)) + +var ResultIsBoolean5 = delete { x: "", y: (s: string) => { return s; } }; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(deleteOperatorWithStringType.ts, 23, 3)) +>x : Symbol(x, Decl(deleteOperatorWithStringType.ts, 23, 31)) +>y : Symbol(y, Decl(deleteOperatorWithStringType.ts, 23, 38)) +>s : Symbol(s, Decl(deleteOperatorWithStringType.ts, 23, 43)) +>s : Symbol(s, Decl(deleteOperatorWithStringType.ts, 23, 43)) + +// string type expressions +var ResultIsBoolean6 = delete objA.a; +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(deleteOperatorWithStringType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(deleteOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithStringType.ts, 6, 9)) + +var ResultIsBoolean7 = delete M.n; +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(deleteOperatorWithStringType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(deleteOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(deleteOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithStringType.ts, 11, 14)) + +var ResultIsBoolean8 = delete STRING1[0]; +>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(deleteOperatorWithStringType.ts, 28, 3)) +>STRING1 : Symbol(STRING1, Decl(deleteOperatorWithStringType.ts, 2, 3)) + +var ResultIsBoolean9 = delete foo(); +>ResultIsBoolean9 : Symbol(ResultIsBoolean9, Decl(deleteOperatorWithStringType.ts, 29, 3)) +>foo : Symbol(foo, Decl(deleteOperatorWithStringType.ts, 2, 36)) + +var ResultIsBoolean10 = delete A.foo(); +>ResultIsBoolean10 : Symbol(ResultIsBoolean10, Decl(deleteOperatorWithStringType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(deleteOperatorWithStringType.ts, 7, 21)) +>A : Symbol(A, Decl(deleteOperatorWithStringType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(deleteOperatorWithStringType.ts, 7, 21)) + +var ResultIsBoolean11 = delete (STRING + STRING); +>ResultIsBoolean11 : Symbol(ResultIsBoolean11, Decl(deleteOperatorWithStringType.ts, 31, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean12 = delete STRING.charAt(0); +>ResultIsBoolean12 : Symbol(ResultIsBoolean12, Decl(deleteOperatorWithStringType.ts, 32, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +// multiple delete operator +var ResultIsBoolean13 = delete delete STRING; +>ResultIsBoolean13 : Symbol(ResultIsBoolean13, Decl(deleteOperatorWithStringType.ts, 35, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean14 = delete delete delete (STRING + STRING); +>ResultIsBoolean14 : Symbol(ResultIsBoolean14, Decl(deleteOperatorWithStringType.ts, 36, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +// miss assignment operators +delete ""; +delete STRING; +>STRING : Symbol(STRING, Decl(deleteOperatorWithStringType.ts, 1, 3)) + +delete STRING1; +>STRING1 : Symbol(STRING1, Decl(deleteOperatorWithStringType.ts, 2, 3)) + +delete foo(); +>foo : Symbol(foo, Decl(deleteOperatorWithStringType.ts, 2, 36)) + +delete objA.a,M.n; +>objA.a : Symbol(A.a, Decl(deleteOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(deleteOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(deleteOperatorWithStringType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(deleteOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(deleteOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(deleteOperatorWithStringType.ts, 11, 14)) + diff --git a/tests/baselines/reference/deleteOperatorWithStringType.types b/tests/baselines/reference/deleteOperatorWithStringType.types index f86afc39c49..0492aeff176 100644 --- a/tests/baselines/reference/deleteOperatorWithStringType.types +++ b/tests/baselines/reference/deleteOperatorWithStringType.types @@ -6,9 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] +>"" : string +>"abc" : string function foo(): string { return "abc"; } >foo : () => string +>"abc" : string class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return ""; } >foo : () => string +>"" : string } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsBoolean2 = delete STRING1; var ResultIsBoolean3 = delete ""; >ResultIsBoolean3 : boolean >delete "" : boolean +>"" : string var ResultIsBoolean4 = delete { x: "", y: "" }; >ResultIsBoolean4 : boolean >delete { x: "", y: "" } : boolean >{ x: "", y: "" } : { x: string; y: string; } >x : string +>"" : string >y : string +>"" : string var ResultIsBoolean5 = delete { x: "", y: (s: string) => { return s; } }; >ResultIsBoolean5 : boolean >delete { x: "", y: (s: string) => { return s; } } : boolean >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string +>"" : string >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -84,6 +92,7 @@ var ResultIsBoolean8 = delete STRING1[0]; >delete STRING1[0] : boolean >STRING1[0] : string >STRING1 : string[] +>0 : number var ResultIsBoolean9 = delete foo(); >ResultIsBoolean9 : boolean @@ -114,6 +123,7 @@ var ResultIsBoolean12 = delete STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number // multiple delete operator var ResultIsBoolean13 = delete delete STRING; @@ -135,6 +145,7 @@ var ResultIsBoolean14 = delete delete delete (STRING + STRING); // miss assignment operators delete ""; >delete "" : boolean +>"" : string delete STRING; >delete STRING : boolean diff --git a/tests/baselines/reference/dependencyViaImportAlias.symbols b/tests/baselines/reference/dependencyViaImportAlias.symbols new file mode 100644 index 00000000000..8855b8d6451 --- /dev/null +++ b/tests/baselines/reference/dependencyViaImportAlias.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/B.ts === +import a = require('A'); +>a : Symbol(a, Decl(B.ts, 0, 0)) + +import A = a.A; +>A : Symbol(A, Decl(B.ts, 0, 24)) +>a : Symbol(a, Decl(A.ts, 0, 0)) +>A : Symbol(a.A, Decl(A.ts, 0, 0)) + +export = A; +>A : Symbol(A, Decl(B.ts, 0, 24)) + +=== tests/cases/compiler/A.ts === +export class A { +>A : Symbol(A, Decl(A.ts, 0, 0)) +} diff --git a/tests/baselines/reference/deprecatedBool.symbols b/tests/baselines/reference/deprecatedBool.symbols new file mode 100644 index 00000000000..c9c27ca945a --- /dev/null +++ b/tests/baselines/reference/deprecatedBool.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/deprecatedBool.ts === +var b4: boolean; +>b4 : Symbol(b4, Decl(deprecatedBool.ts, 0, 3)) + +var bool: boolean; +>bool : Symbol(bool, Decl(deprecatedBool.ts, 1, 3)) + diff --git a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.symbols b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.symbols new file mode 100644 index 00000000000..dd384838694 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesIndexersWithAssignmentCompatibility.ts === +class Base { +>Base : Symbol(Base, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 0, 0)) + + [x: string]: Object; +>x : Symbol(x, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 1, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +// ok, use assignment compatibility +class Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 2, 1)) +>Base : Symbol(Base, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 0, 0)) + + [x: string]: any; +>x : Symbol(x, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 6, 5)) +} + +class Base2 { +>Base2 : Symbol(Base2, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 7, 1)) + + [x: number]: Object; +>x : Symbol(x, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 10, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +// ok, use assignment compatibility +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 11, 1)) +>Base2 : Symbol(Base2, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 7, 1)) + + [x: number]: any; +>x : Symbol(x, Decl(derivedClassOverridesIndexersWithAssignmentCompatibility.ts, 15, 5)) +} diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.symbols b/tests/baselines/reference/derivedClassOverridesProtectedMembers.symbols new file mode 100644 index 00000000000..3c826325b91 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.symbols @@ -0,0 +1,122 @@ +=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers.ts === + +var x: { foo: string; } +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) +>foo : Symbol(foo, Decl(derivedClassOverridesProtectedMembers.ts, 1, 8)) + +var y: { foo: string; bar: string; } +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) +>foo : Symbol(foo, Decl(derivedClassOverridesProtectedMembers.ts, 2, 8)) +>bar : Symbol(bar, Decl(derivedClassOverridesProtectedMembers.ts, 2, 21)) + +class Base { +>Base : Symbol(Base, Decl(derivedClassOverridesProtectedMembers.ts, 2, 36)) + + protected a: typeof x; +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 4, 12)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected b(a: typeof x) { } +>b : Symbol(b, Decl(derivedClassOverridesProtectedMembers.ts, 5, 26)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 6, 16)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected get c() { return x; } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers.ts, 6, 32), Decl(derivedClassOverridesProtectedMembers.ts, 7, 35)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected set c(v: typeof x) { } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers.ts, 6, 32), Decl(derivedClassOverridesProtectedMembers.ts, 7, 35)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers.ts, 8, 20)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected d: (a: typeof x) => void; +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers.ts, 8, 36)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 9, 18)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected static r: typeof x; +>r : Symbol(Base.r, Decl(derivedClassOverridesProtectedMembers.ts, 9, 39)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected static s(a: typeof x) { } +>s : Symbol(Base.s, Decl(derivedClassOverridesProtectedMembers.ts, 11, 33)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 12, 23)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected static get t() { return x; } +>t : Symbol(Base.t, Decl(derivedClassOverridesProtectedMembers.ts, 12, 39), Decl(derivedClassOverridesProtectedMembers.ts, 13, 42)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected static set t(v: typeof x) { } +>t : Symbol(Base.t, Decl(derivedClassOverridesProtectedMembers.ts, 12, 39), Decl(derivedClassOverridesProtectedMembers.ts, 13, 42)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers.ts, 14, 27)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + protected static u: (a: typeof x) => void; +>u : Symbol(Base.u, Decl(derivedClassOverridesProtectedMembers.ts, 14, 43)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 15, 25)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) + + constructor(a: typeof x) { } +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 17, 16)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers.ts, 18, 1)) +>Base : Symbol(Base, Decl(derivedClassOverridesProtectedMembers.ts, 2, 36)) + + protected a: typeof y; +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 20, 28)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected b(a: typeof y) { } +>b : Symbol(b, Decl(derivedClassOverridesProtectedMembers.ts, 21, 26)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 22, 16)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected get c() { return y; } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers.ts, 22, 32), Decl(derivedClassOverridesProtectedMembers.ts, 23, 35)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected set c(v: typeof y) { } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers.ts, 22, 32), Decl(derivedClassOverridesProtectedMembers.ts, 23, 35)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers.ts, 24, 20)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected d: (a: typeof y) => void; +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers.ts, 24, 36)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 25, 18)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected static r: typeof y; +>r : Symbol(Derived.r, Decl(derivedClassOverridesProtectedMembers.ts, 25, 39)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected static s(a: typeof y) { } +>s : Symbol(Derived.s, Decl(derivedClassOverridesProtectedMembers.ts, 27, 33)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 28, 23)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected static get t() { return y; } +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers.ts, 28, 39), Decl(derivedClassOverridesProtectedMembers.ts, 29, 42)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected static set t(a: typeof y) { } +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers.ts, 28, 39), Decl(derivedClassOverridesProtectedMembers.ts, 29, 42)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 30, 27)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + protected static u: (a: typeof y) => void; +>u : Symbol(Derived.u, Decl(derivedClassOverridesProtectedMembers.ts, 30, 43)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 31, 25)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) + + constructor(a: typeof y) { super(x) } +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers.ts, 33, 16)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers.ts, 2, 3)) +>super : Symbol(Base, Decl(derivedClassOverridesProtectedMembers.ts, 2, 36)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers.ts, 1, 3)) +} + diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.symbols b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.symbols new file mode 100644 index 00000000000..59d062f459c --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.symbols @@ -0,0 +1,228 @@ +=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesProtectedMembers2.ts === +var x: { foo: string; } +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) +>foo : Symbol(foo, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 8)) + +var y: { foo: string; bar: string; } +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) +>foo : Symbol(foo, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 8)) +>bar : Symbol(bar, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 21)) + +class Base { +>Base : Symbol(Base, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 36)) + + protected a: typeof x; +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 3, 12)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected b(a: typeof x) { } +>b : Symbol(b, Decl(derivedClassOverridesProtectedMembers2.ts, 4, 26)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 5, 16)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected get c() { return x; } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers2.ts, 5, 32), Decl(derivedClassOverridesProtectedMembers2.ts, 6, 35)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected set c(v: typeof x) { } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers2.ts, 5, 32), Decl(derivedClassOverridesProtectedMembers2.ts, 6, 35)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers2.ts, 7, 20)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected d: (a: typeof x) => void ; +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 7, 36)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 8, 18)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected static r: typeof x; +>r : Symbol(Base.r, Decl(derivedClassOverridesProtectedMembers2.ts, 8, 40)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected static s(a: typeof x) { } +>s : Symbol(Base.s, Decl(derivedClassOverridesProtectedMembers2.ts, 10, 33)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 11, 23)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected static get t() { return x; } +>t : Symbol(Base.t, Decl(derivedClassOverridesProtectedMembers2.ts, 11, 39), Decl(derivedClassOverridesProtectedMembers2.ts, 12, 42)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected static set t(v: typeof x) { } +>t : Symbol(Base.t, Decl(derivedClassOverridesProtectedMembers2.ts, 11, 39), Decl(derivedClassOverridesProtectedMembers2.ts, 12, 42)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers2.ts, 13, 27)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + protected static u: (a: typeof x) => void ; +>u : Symbol(Base.u, Decl(derivedClassOverridesProtectedMembers2.ts, 13, 43)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 14, 25)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + +constructor(a: typeof x) { } +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 16, 12)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) +} + +// Increase visibility of all protected members to public +class Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>Base : Symbol(Base, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 36)) + + a: typeof y; +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 20, 28)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + b(a: typeof y) { } +>b : Symbol(b, Decl(derivedClassOverridesProtectedMembers2.ts, 21, 16)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 6)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + get c() { return y; } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + set c(v: typeof y) { } +>c : Symbol(c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) +>v : Symbol(v, Decl(derivedClassOverridesProtectedMembers2.ts, 24, 10)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + d: (a: typeof y) => void; +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 24, 26)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 25, 8)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + static r: typeof y; +>r : Symbol(Derived.r, Decl(derivedClassOverridesProtectedMembers2.ts, 25, 29)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + static s(a: typeof y) { } +>s : Symbol(Derived.s, Decl(derivedClassOverridesProtectedMembers2.ts, 27, 23)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 13)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + static get t() { return y; } +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + static set t(a: typeof y) { } +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 30, 17)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + static u: (a: typeof y) => void; +>u : Symbol(Derived.u, Decl(derivedClassOverridesProtectedMembers2.ts, 30, 33)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 31, 15)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + + constructor(a: typeof y) { super(a); } +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 33, 16)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) +>super : Symbol(Base, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 36)) +>a : Symbol(a, Decl(derivedClassOverridesProtectedMembers2.ts, 33, 16)) +} + +var d: Derived = new Derived(y); +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + +var r1 = d.a; +>r1 : Symbol(r1, Decl(derivedClassOverridesProtectedMembers2.ts, 37, 3)) +>d.a : Symbol(Derived.a, Decl(derivedClassOverridesProtectedMembers2.ts, 20, 28)) +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>a : Symbol(Derived.a, Decl(derivedClassOverridesProtectedMembers2.ts, 20, 28)) + +var r2 = d.b(y); +>r2 : Symbol(r2, Decl(derivedClassOverridesProtectedMembers2.ts, 38, 3)) +>d.b : Symbol(Derived.b, Decl(derivedClassOverridesProtectedMembers2.ts, 21, 16)) +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>b : Symbol(Derived.b, Decl(derivedClassOverridesProtectedMembers2.ts, 21, 16)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + +var r3 = d.c; +>r3 : Symbol(r3, Decl(derivedClassOverridesProtectedMembers2.ts, 39, 3)) +>d.c : Symbol(Derived.c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>c : Symbol(Derived.c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) + +var r3a = d.d; +>r3a : Symbol(r3a, Decl(derivedClassOverridesProtectedMembers2.ts, 40, 3)) +>d.d : Symbol(Derived.d, Decl(derivedClassOverridesProtectedMembers2.ts, 24, 26)) +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>d : Symbol(Derived.d, Decl(derivedClassOverridesProtectedMembers2.ts, 24, 26)) + +d.c = y; +>d.c : Symbol(Derived.c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) +>d : Symbol(d, Decl(derivedClassOverridesProtectedMembers2.ts, 36, 3)) +>c : Symbol(Derived.c, Decl(derivedClassOverridesProtectedMembers2.ts, 22, 22), Decl(derivedClassOverridesProtectedMembers2.ts, 23, 25)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + +var r4 = Derived.r; +>r4 : Symbol(r4, Decl(derivedClassOverridesProtectedMembers2.ts, 42, 3)) +>Derived.r : Symbol(Derived.r, Decl(derivedClassOverridesProtectedMembers2.ts, 25, 29)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>r : Symbol(Derived.r, Decl(derivedClassOverridesProtectedMembers2.ts, 25, 29)) + +var r5 = Derived.s(y); +>r5 : Symbol(r5, Decl(derivedClassOverridesProtectedMembers2.ts, 43, 3)) +>Derived.s : Symbol(Derived.s, Decl(derivedClassOverridesProtectedMembers2.ts, 27, 23)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>s : Symbol(Derived.s, Decl(derivedClassOverridesProtectedMembers2.ts, 27, 23)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + +var r6 = Derived.t; +>r6 : Symbol(r6, Decl(derivedClassOverridesProtectedMembers2.ts, 44, 3)) +>Derived.t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) + +var r6a = Derived.u; +>r6a : Symbol(r6a, Decl(derivedClassOverridesProtectedMembers2.ts, 45, 3)) +>Derived.u : Symbol(Derived.u, Decl(derivedClassOverridesProtectedMembers2.ts, 30, 33)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>u : Symbol(Derived.u, Decl(derivedClassOverridesProtectedMembers2.ts, 30, 33)) + +Derived.t = y; +>Derived.t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) +>Derived : Symbol(Derived, Decl(derivedClassOverridesProtectedMembers2.ts, 17, 1)) +>t : Symbol(Derived.t, Decl(derivedClassOverridesProtectedMembers2.ts, 28, 29), Decl(derivedClassOverridesProtectedMembers2.ts, 29, 32)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) + +class Base2 { +>Base2 : Symbol(Base2, Decl(derivedClassOverridesProtectedMembers2.ts, 46, 14)) + + [i: string]: Object; +>i : Symbol(i, Decl(derivedClassOverridesProtectedMembers2.ts, 49, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [i: number]: typeof x; +>i : Symbol(i, Decl(derivedClassOverridesProtectedMembers2.ts, 50, 5)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) +} + +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(derivedClassOverridesProtectedMembers2.ts, 51, 1)) +>Base2 : Symbol(Base2, Decl(derivedClassOverridesProtectedMembers2.ts, 46, 14)) + + [i: string]: typeof x; +>i : Symbol(i, Decl(derivedClassOverridesProtectedMembers2.ts, 54, 5)) +>x : Symbol(x, Decl(derivedClassOverridesProtectedMembers2.ts, 0, 3)) + + [i: number]: typeof y; +>i : Symbol(i, Decl(derivedClassOverridesProtectedMembers2.ts, 55, 5)) +>y : Symbol(y, Decl(derivedClassOverridesProtectedMembers2.ts, 1, 3)) +} + +var d2: Derived2; +>d2 : Symbol(d2, Decl(derivedClassOverridesProtectedMembers2.ts, 58, 3)) +>Derived2 : Symbol(Derived2, Decl(derivedClassOverridesProtectedMembers2.ts, 51, 1)) + +var r7 = d2['']; +>r7 : Symbol(r7, Decl(derivedClassOverridesProtectedMembers2.ts, 59, 3)) +>d2 : Symbol(d2, Decl(derivedClassOverridesProtectedMembers2.ts, 58, 3)) + +var r8 = d2[1]; +>r8 : Symbol(r8, Decl(derivedClassOverridesProtectedMembers2.ts, 60, 3)) +>d2 : Symbol(d2, Decl(derivedClassOverridesProtectedMembers2.ts, 58, 3)) + + diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types index 3b6eb55256e..2799555a3a2 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.types @@ -227,10 +227,12 @@ var r7 = d2['']; >r7 : { foo: string; } >d2[''] : { foo: string; } >d2 : Derived2 +>'' : string var r8 = d2[1]; >r8 : { foo: string; bar: string; } >d2[1] : { foo: string; bar: string; } >d2 : Derived2 +>1 : number diff --git a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.symbols b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.symbols new file mode 100644 index 00000000000..452da91f034 --- /dev/null +++ b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassOverridesWithoutSubtype.ts === +class Base { +>Base : Symbol(Base, Decl(derivedClassOverridesWithoutSubtype.ts, 0, 0)) + + x: { +>x : Symbol(x, Decl(derivedClassOverridesWithoutSubtype.ts, 0, 12)) + + foo: string; +>foo : Symbol(foo, Decl(derivedClassOverridesWithoutSubtype.ts, 1, 8)) + } +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedClassOverridesWithoutSubtype.ts, 4, 1)) +>Base : Symbol(Base, Decl(derivedClassOverridesWithoutSubtype.ts, 0, 0)) + + x: { +>x : Symbol(x, Decl(derivedClassOverridesWithoutSubtype.ts, 6, 28)) + + foo: any; +>foo : Symbol(foo, Decl(derivedClassOverridesWithoutSubtype.ts, 7, 8)) + } +} + +class Base2 { +>Base2 : Symbol(Base2, Decl(derivedClassOverridesWithoutSubtype.ts, 10, 1)) + + static y: { +>y : Symbol(Base2.y, Decl(derivedClassOverridesWithoutSubtype.ts, 12, 13)) + + foo: string; +>foo : Symbol(foo, Decl(derivedClassOverridesWithoutSubtype.ts, 13, 15)) + } +} + +class Derived2 extends Base2 { +>Derived2 : Symbol(Derived2, Decl(derivedClassOverridesWithoutSubtype.ts, 16, 1)) +>Base2 : Symbol(Base2, Decl(derivedClassOverridesWithoutSubtype.ts, 10, 1)) + + static y: { +>y : Symbol(Derived2.y, Decl(derivedClassOverridesWithoutSubtype.ts, 18, 30)) + + foo: any; +>foo : Symbol(foo, Decl(derivedClassOverridesWithoutSubtype.ts, 19, 15)) + } +} diff --git a/tests/baselines/reference/derivedClasses.symbols b/tests/baselines/reference/derivedClasses.symbols new file mode 100644 index 00000000000..f265c2dce53 --- /dev/null +++ b/tests/baselines/reference/derivedClasses.symbols @@ -0,0 +1,77 @@ +=== tests/cases/compiler/derivedClasses.ts === +class Red extends Color { +>Red : Symbol(Red, Decl(derivedClasses.ts, 0, 0)) +>Color : Symbol(Color, Decl(derivedClasses.ts, 5, 1)) + + public shade() { +>shade : Symbol(shade, Decl(derivedClasses.ts, 0, 25)) + + var getHue = () => { return this.hue(); }; +>getHue : Symbol(getHue, Decl(derivedClasses.ts, 2, 8)) +>this.hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) +>this : Symbol(Red, Decl(derivedClasses.ts, 0, 0)) +>hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) + + return getHue() + " red"; +>getHue : Symbol(getHue, Decl(derivedClasses.ts, 2, 8)) + } +} + +class Color { +>Color : Symbol(Color, Decl(derivedClasses.ts, 5, 1)) + + public shade() { return "some shade"; } +>shade : Symbol(shade, Decl(derivedClasses.ts, 7, 13)) + + public hue() { return "some hue"; } +>hue : Symbol(hue, Decl(derivedClasses.ts, 8, 43)) +} + +class Blue extends Color { +>Blue : Symbol(Blue, Decl(derivedClasses.ts, 10, 1)) +>Color : Symbol(Color, Decl(derivedClasses.ts, 5, 1)) + + public shade() { +>shade : Symbol(shade, Decl(derivedClasses.ts, 12, 26)) + + var getHue = () => { return this.hue(); }; +>getHue : Symbol(getHue, Decl(derivedClasses.ts, 15, 8)) +>this.hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) +>this : Symbol(Blue, Decl(derivedClasses.ts, 10, 1)) +>hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) + + return getHue() + " blue"; +>getHue : Symbol(getHue, Decl(derivedClasses.ts, 15, 8)) + } +} + +var r = new Red(); +>r : Symbol(r, Decl(derivedClasses.ts, 20, 3)) +>Red : Symbol(Red, Decl(derivedClasses.ts, 0, 0)) + +var b = new Blue(); +>b : Symbol(b, Decl(derivedClasses.ts, 21, 3)) +>Blue : Symbol(Blue, Decl(derivedClasses.ts, 10, 1)) + +r.shade(); +>r.shade : Symbol(Red.shade, Decl(derivedClasses.ts, 0, 25)) +>r : Symbol(r, Decl(derivedClasses.ts, 20, 3)) +>shade : Symbol(Red.shade, Decl(derivedClasses.ts, 0, 25)) + +r.hue(); +>r.hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) +>r : Symbol(r, Decl(derivedClasses.ts, 20, 3)) +>hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) + +b.shade(); +>b.shade : Symbol(Blue.shade, Decl(derivedClasses.ts, 12, 26)) +>b : Symbol(b, Decl(derivedClasses.ts, 21, 3)) +>shade : Symbol(Blue.shade, Decl(derivedClasses.ts, 12, 26)) + +b.hue(); +>b.hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) +>b : Symbol(b, Decl(derivedClasses.ts, 21, 3)) +>hue : Symbol(Color.hue, Decl(derivedClasses.ts, 8, 43)) + + + diff --git a/tests/baselines/reference/derivedClasses.types b/tests/baselines/reference/derivedClasses.types index ce054b99223..906cfb2741c 100644 --- a/tests/baselines/reference/derivedClasses.types +++ b/tests/baselines/reference/derivedClasses.types @@ -18,6 +18,7 @@ class Red extends Color { >getHue() + " red" : string >getHue() : string >getHue : () => string +>" red" : string } } @@ -26,9 +27,11 @@ class Color { public shade() { return "some shade"; } >shade : () => string +>"some shade" : string public hue() { return "some hue"; } >hue : () => string +>"some hue" : string } class Blue extends Color { @@ -50,6 +53,7 @@ class Blue extends Color { >getHue() + " blue" : string >getHue() : string >getHue : () => string +>" blue" : string } } diff --git a/tests/baselines/reference/derivedInterfaceDoesNotHideBaseSignatures.symbols b/tests/baselines/reference/derivedInterfaceDoesNotHideBaseSignatures.symbols new file mode 100644 index 00000000000..5cd63ba9008 --- /dev/null +++ b/tests/baselines/reference/derivedInterfaceDoesNotHideBaseSignatures.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceDoesNotHideBaseSignatures.ts === +// Derived interfaces no longer hide signatures from base types, so these signatures are always compatible. +interface Base { +>Base : Symbol(Base, Decl(derivedInterfaceDoesNotHideBaseSignatures.ts, 0, 0)) + + (): string; + new (x: string): number; +>x : Symbol(x, Decl(derivedInterfaceDoesNotHideBaseSignatures.ts, 3, 9)) +} + +interface Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedInterfaceDoesNotHideBaseSignatures.ts, 4, 1)) +>Base : Symbol(Base, Decl(derivedInterfaceDoesNotHideBaseSignatures.ts, 0, 0)) + + (): number; + new (x: string): string; +>x : Symbol(x, Decl(derivedInterfaceDoesNotHideBaseSignatures.ts, 8, 9)) +} diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.symbols b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.symbols new file mode 100644 index 00000000000..e935d7bf66a --- /dev/null +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.symbols @@ -0,0 +1,56 @@ +=== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts === +class Base { +>Base : Symbol(Base, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 0)) + + foo(x: { a: number }): { a: number } { +>foo : Symbol(foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 12)) +>x : Symbol(x, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 1, 8)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 1, 12)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 1, 28)) + + return null; + } +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 4, 1)) +>Base : Symbol(Base, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 0)) + + foo(x: { a: number; b: number }): { a: number; b: number } { +>foo : Symbol(foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 6, 28)) +>x : Symbol(x, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 7, 8)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 7, 12)) +>b : Symbol(b, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 7, 23)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 7, 39)) +>b : Symbol(b, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 7, 50)) + + return null; + } + + bar() { +>bar : Symbol(bar, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 9, 5)) + + var r = super.foo({ a: 1 }); // { a: number } +>r : Symbol(r, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 12, 11)) +>super.foo : Symbol(Base.foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 12)) +>super : Symbol(Base, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 0)) +>foo : Symbol(Base.foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 12)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 12, 27)) + + var r2 = super.foo({ a: 1, b: 2 }); // { a: number } +>r2 : Symbol(r2, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 13, 11)) +>super.foo : Symbol(Base.foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 12)) +>super : Symbol(Base, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 0)) +>foo : Symbol(Base.foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 0, 12)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 13, 28)) +>b : Symbol(b, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 13, 34)) + + var r3 = this.foo({ a: 1, b: 2 }); // { a: number; b: number; } +>r3 : Symbol(r3, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 14, 11)) +>this.foo : Symbol(foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 6, 28)) +>this : Symbol(Derived, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 4, 1)) +>foo : Symbol(foo, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 6, 28)) +>a : Symbol(a, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 14, 27)) +>b : Symbol(b, Decl(derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts, 14, 33)) + } +} diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types index 4f1ff1780dc..d8d9f657255 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types @@ -9,6 +9,7 @@ class Base { >a : number return null; +>null : null } } @@ -25,6 +26,7 @@ class Derived extends Base { >b : number return null; +>null : null } bar() { @@ -38,6 +40,7 @@ class Derived extends Base { >foo : (x: { a: number; }) => { a: number; } >{ a: 1 } : { a: number; } >a : number +>1 : number var r2 = super.foo({ a: 1, b: 2 }); // { a: number } >r2 : { a: number; } @@ -47,7 +50,9 @@ class Derived extends Base { >foo : (x: { a: number; }) => { a: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number +>1 : number >b : number +>2 : number var r3 = this.foo({ a: 1, b: 2 }); // { a: number; b: number; } >r3 : { a: number; b: number; } @@ -57,6 +62,8 @@ class Derived extends Base { >foo : (x: { a: number; b: number; }) => { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number +>1 : number >b : number +>2 : number } } diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.symbols b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.symbols new file mode 100644 index 00000000000..e0f41b72f76 --- /dev/null +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.symbols @@ -0,0 +1,52 @@ +=== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/derivedTypeDoesNotRequireExtendsClause.ts === +class Base { +>Base : Symbol(Base, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 0, 12)) +} + +class Derived { +>Derived : Symbol(Derived, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 2, 1)) + + foo: string; +>foo : Symbol(foo, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 4, 15)) + + bar: number; +>bar : Symbol(bar, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 5, 16)) +} + +class Derived2 extends Base { +>Derived2 : Symbol(Derived2, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 7, 1)) +>Base : Symbol(Base, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 9, 29)) +} + +var b: Base; +>b : Symbol(b, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 13, 3)) +>Base : Symbol(Base, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 0, 0)) + +var d1: Derived; +>d1 : Symbol(d1, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 14, 3)) +>Derived : Symbol(Derived, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 2, 1)) + +var d2: Derived2; +>d2 : Symbol(d2, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 15, 3)) +>Derived2 : Symbol(Derived2, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 7, 1)) + +b = d1; +>b : Symbol(b, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 13, 3)) +>d1 : Symbol(d1, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 14, 3)) + +b = d2; +>b : Symbol(b, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 13, 3)) +>d2 : Symbol(d2, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 15, 3)) + +var r: Base[] = [d1, d2]; +>r : Symbol(r, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 19, 3)) +>Base : Symbol(Base, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 0, 0)) +>d1 : Symbol(d1, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 14, 3)) +>d2 : Symbol(d2, Decl(derivedTypeDoesNotRequireExtendsClause.ts, 15, 3)) + diff --git a/tests/baselines/reference/destructuringWithNewExpression.js b/tests/baselines/reference/destructuringWithNewExpression.js new file mode 100644 index 00000000000..310129674b1 --- /dev/null +++ b/tests/baselines/reference/destructuringWithNewExpression.js @@ -0,0 +1,15 @@ +//// [destructuringWithNewExpression.ts] +class C { + x = 0; +} + +var { x } = new C; + +//// [destructuringWithNewExpression.js] +var C = (function () { + function C() { + this.x = 0; + } + return C; +})(); +var x = (new C).x; diff --git a/tests/baselines/reference/destructuringWithNewExpression.symbols b/tests/baselines/reference/destructuringWithNewExpression.symbols new file mode 100644 index 00000000000..c7dce468485 --- /dev/null +++ b/tests/baselines/reference/destructuringWithNewExpression.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/destructuringWithNewExpression.ts === +class C { +>C : Symbol(C, Decl(destructuringWithNewExpression.ts, 0, 0)) + + x = 0; +>x : Symbol(x, Decl(destructuringWithNewExpression.ts, 0, 9)) +} + +var { x } = new C; +>x : Symbol(x, Decl(destructuringWithNewExpression.ts, 4, 5)) +>C : Symbol(C, Decl(destructuringWithNewExpression.ts, 0, 0)) + diff --git a/tests/baselines/reference/destructuringWithNewExpression.types b/tests/baselines/reference/destructuringWithNewExpression.types new file mode 100644 index 00000000000..1d36746a44d --- /dev/null +++ b/tests/baselines/reference/destructuringWithNewExpression.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/destructuringWithNewExpression.ts === +class C { +>C : C + + x = 0; +>x : number +>0 : number +} + +var { x } = new C; +>x : number +>new C : C +>C : typeof C + diff --git a/tests/baselines/reference/destructuringWithNumberLiteral.js b/tests/baselines/reference/destructuringWithNumberLiteral.js new file mode 100644 index 00000000000..8804b850cc3 --- /dev/null +++ b/tests/baselines/reference/destructuringWithNumberLiteral.js @@ -0,0 +1,5 @@ +//// [destructuringWithNumberLiteral.ts] +var { toExponential } = 0; + +//// [destructuringWithNumberLiteral.js] +var toExponential = (0).toExponential; diff --git a/tests/baselines/reference/destructuringWithNumberLiteral.symbols b/tests/baselines/reference/destructuringWithNumberLiteral.symbols new file mode 100644 index 00000000000..6190dc15052 --- /dev/null +++ b/tests/baselines/reference/destructuringWithNumberLiteral.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/destructuringWithNumberLiteral.ts === +var { toExponential } = 0; +>toExponential : Symbol(toExponential, Decl(destructuringWithNumberLiteral.ts, 0, 5)) + diff --git a/tests/baselines/reference/destructuringWithNumberLiteral.types b/tests/baselines/reference/destructuringWithNumberLiteral.types new file mode 100644 index 00000000000..7fe902c622e --- /dev/null +++ b/tests/baselines/reference/destructuringWithNumberLiteral.types @@ -0,0 +1,5 @@ +=== tests/cases/compiler/destructuringWithNumberLiteral.ts === +var { toExponential } = 0; +>toExponential : (fractionDigits?: number) => string +>0 : number + diff --git a/tests/baselines/reference/detachedCommentAtStartOfConstructor1.symbols b/tests/baselines/reference/detachedCommentAtStartOfConstructor1.symbols new file mode 100644 index 00000000000..9590abaa460 --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfConstructor1.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/detachedCommentAtStartOfConstructor1.ts === +class TestFile { +>TestFile : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 0)) + + public message: string; +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 16)) + + public name; +>name : Symbol(name, Decl(detachedCommentAtStartOfConstructor1.ts, 1, 27)) + + constructor(message: string) { +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor1.ts, 3, 16)) + + /// Test summary + /// + var getMessage = () => message + this.name; +>getMessage : Symbol(getMessage, Decl(detachedCommentAtStartOfConstructor1.ts, 6, 11)) +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor1.ts, 3, 16)) +>this.name : Symbol(name, Decl(detachedCommentAtStartOfConstructor1.ts, 1, 27)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 0)) +>name : Symbol(name, Decl(detachedCommentAtStartOfConstructor1.ts, 1, 27)) + + this.message = getMessage(); +>this.message : Symbol(message, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 16)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 0)) +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor1.ts, 0, 16)) +>getMessage : Symbol(getMessage, Decl(detachedCommentAtStartOfConstructor1.ts, 6, 11)) + } +} diff --git a/tests/baselines/reference/detachedCommentAtStartOfConstructor2.symbols b/tests/baselines/reference/detachedCommentAtStartOfConstructor2.symbols new file mode 100644 index 00000000000..78af9430034 --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfConstructor2.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/detachedCommentAtStartOfConstructor2.ts === +class TestFile { +>TestFile : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 0)) + + public message: string; +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 16)) + + public name: string; +>name : Symbol(name, Decl(detachedCommentAtStartOfConstructor2.ts, 1, 27)) + + constructor(message: string) { +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor2.ts, 3, 16)) + + /// Test summary + /// + + var getMessage = () => message + this.name; +>getMessage : Symbol(getMessage, Decl(detachedCommentAtStartOfConstructor2.ts, 7, 11)) +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor2.ts, 3, 16)) +>this.name : Symbol(name, Decl(detachedCommentAtStartOfConstructor2.ts, 1, 27)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 0)) +>name : Symbol(name, Decl(detachedCommentAtStartOfConstructor2.ts, 1, 27)) + + this.message = getMessage(); +>this.message : Symbol(message, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 16)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 0)) +>message : Symbol(message, Decl(detachedCommentAtStartOfConstructor2.ts, 0, 16)) +>getMessage : Symbol(getMessage, Decl(detachedCommentAtStartOfConstructor2.ts, 7, 11)) + } +} diff --git a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.symbols b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.symbols new file mode 100644 index 00000000000..aa34885d79b --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/detachedCommentAtStartOfLambdaFunction1.ts === +class TestFile { +>TestFile : Symbol(TestFile, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 0, 16)) + + foo(message: string): () => string { +>foo : Symbol(foo, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 1, 17)) +>message : Symbol(message, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 2, 8)) + + return (...x: string[]) => +>x : Symbol(x, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 3, 16)) + + /// Test summary + /// + /// + message + this.name; +>message : Symbol(message, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 2, 8)) +>this.name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 0, 16)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 0, 0)) +>name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction1.ts, 0, 16)) + } +} diff --git a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.symbols b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.symbols new file mode 100644 index 00000000000..29cef430c3a --- /dev/null +++ b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/detachedCommentAtStartOfLambdaFunction2.ts === +class TestFile { +>TestFile : Symbol(TestFile, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 0, 16)) + + foo(message: string): () => string { +>foo : Symbol(foo, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 1, 17)) +>message : Symbol(message, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 2, 8)) + + return (...x: string[]) => +>x : Symbol(x, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 3, 16)) + + /// Test summary + /// + /// + + message + this.name; +>message : Symbol(message, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 2, 8)) +>this.name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 0, 16)) +>this : Symbol(TestFile, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 0, 0)) +>name : Symbol(name, Decl(detachedCommentAtStartOfLambdaFunction2.ts, 0, 16)) + } +} diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.symbols b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.symbols new file mode 100644 index 00000000000..7aaf3b98f4a --- /dev/null +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/doNotWidenAtObjectLiteralPropertyAssignment.ts === +interface ITestEventInterval { +>ITestEventInterval : Symbol(ITestEventInterval, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 0, 0)) + + begin: number; +>begin : Symbol(begin, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 0, 30)) +} + +interface IIntervalTreeNode { +>IIntervalTreeNode : Symbol(IIntervalTreeNode, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 2, 1)) + + interval: ITestEventInterval; +>interval : Symbol(interval, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 4, 29)) +>ITestEventInterval : Symbol(ITestEventInterval, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 0, 0)) + + children?: IIntervalTreeNode[]; +>children : Symbol(children, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 5, 33)) +>IIntervalTreeNode : Symbol(IIntervalTreeNode, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 2, 1)) +} + +var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // was error here because best common type is {} +>test : Symbol(test, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 9, 3)) +>IIntervalTreeNode : Symbol(IIntervalTreeNode, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 2, 1)) +>interval : Symbol(interval, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 9, 34)) +>begin : Symbol(begin, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 9, 46)) +>children : Symbol(children, Decl(doNotWidenAtObjectLiteralPropertyAssignment.ts, 9, 58)) + diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types index cd8c03fd6a6..f151b5841c0 100644 --- a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types @@ -26,5 +26,7 @@ var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // >interval : { begin: number; } >{ begin: 0 } : { begin: number; } >begin : number +>0 : number >children : null +>null : null diff --git a/tests/baselines/reference/doWhileBreakStatements.symbols b/tests/baselines/reference/doWhileBreakStatements.symbols new file mode 100644 index 00000000000..7d9db9a5ebb --- /dev/null +++ b/tests/baselines/reference/doWhileBreakStatements.symbols @@ -0,0 +1,41 @@ +=== tests/cases/conformance/statements/breakStatements/doWhileBreakStatements.ts === +do { + break; +} while(true) + +ONE: +do { + break ONE; +} +while (true) + +TWO: +THREE: +do { + break THREE; +}while (true) + +FOUR: +do { + FIVE: + do { + break FOUR; + }while (true) +}while (true) + +do { + SIX: + do break SIX; while(true) +}while (true) + +SEVEN: +do do do break SEVEN; while (true) while (true) while (true) + +EIGHT: +do{ + var fn = function () { } +>fn : Symbol(fn, Decl(doWhileBreakStatements.ts, 34, 7)) + + break EIGHT; +}while(true) + diff --git a/tests/baselines/reference/doWhileBreakStatements.types b/tests/baselines/reference/doWhileBreakStatements.types index c32adda7f4b..c3ca932910a 100644 --- a/tests/baselines/reference/doWhileBreakStatements.types +++ b/tests/baselines/reference/doWhileBreakStatements.types @@ -2,41 +2,79 @@ do { break; } while(true) +>true : boolean ONE: +>ONE : any + do { break ONE; +>ONE : any } while (true) +>true : boolean TWO: +>TWO : any + THREE: +>THREE : any + do { break THREE; +>THREE : any + }while (true) +>true : boolean FOUR: +>FOUR : any + do { FIVE: +>FIVE : any + do { break FOUR; +>FOUR : any + }while (true) +>true : boolean + }while (true) +>true : boolean do { SIX: +>SIX : any + do break SIX; while(true) +>SIX : any +>true : boolean + }while (true) +>true : boolean SEVEN: +>SEVEN : any + do do do break SEVEN; while (true) while (true) while (true) +>SEVEN : any +>true : boolean +>true : boolean +>true : boolean EIGHT: +>EIGHT : any + do{ var fn = function () { } >fn : () => void >function () { } : () => void break EIGHT; +>EIGHT : any + }while(true) +>true : boolean diff --git a/tests/baselines/reference/doWhileContinueStatements.symbols b/tests/baselines/reference/doWhileContinueStatements.symbols new file mode 100644 index 00000000000..e4c6d577d5a --- /dev/null +++ b/tests/baselines/reference/doWhileContinueStatements.symbols @@ -0,0 +1,41 @@ +=== tests/cases/conformance/statements/continueStatements/doWhileContinueStatements.ts === +do { + continue; +} while(true) + +ONE: +do { + continue ONE; +} +while (true) + +TWO: +THREE: +do { + continue THREE; +}while (true) + +FOUR: +do { + FIVE: + do { + continue FOUR; + }while (true) +}while (true) + +do { + SIX: + do continue SIX; while(true) +}while (true) + +SEVEN: +do do do continue SEVEN; while (true) while (true) while (true) + +EIGHT: +do{ + var fn = function () { } +>fn : Symbol(fn, Decl(doWhileContinueStatements.ts, 34, 7)) + + continue EIGHT; +}while(true) + diff --git a/tests/baselines/reference/doWhileContinueStatements.types b/tests/baselines/reference/doWhileContinueStatements.types index 398a8508e31..90c9f59842a 100644 --- a/tests/baselines/reference/doWhileContinueStatements.types +++ b/tests/baselines/reference/doWhileContinueStatements.types @@ -2,41 +2,79 @@ do { continue; } while(true) +>true : boolean ONE: +>ONE : any + do { continue ONE; +>ONE : any } while (true) +>true : boolean TWO: +>TWO : any + THREE: +>THREE : any + do { continue THREE; +>THREE : any + }while (true) +>true : boolean FOUR: +>FOUR : any + do { FIVE: +>FIVE : any + do { continue FOUR; +>FOUR : any + }while (true) +>true : boolean + }while (true) +>true : boolean do { SIX: +>SIX : any + do continue SIX; while(true) +>SIX : any +>true : boolean + }while (true) +>true : boolean SEVEN: +>SEVEN : any + do do do continue SEVEN; while (true) while (true) while (true) +>SEVEN : any +>true : boolean +>true : boolean +>true : boolean EIGHT: +>EIGHT : any + do{ var fn = function () { } >fn : () => void >function () { } : () => void continue EIGHT; +>EIGHT : any + }while(true) +>true : boolean diff --git a/tests/baselines/reference/doWhileLoop.symbols b/tests/baselines/reference/doWhileLoop.symbols new file mode 100644 index 00000000000..ec213e46ec2 --- /dev/null +++ b/tests/baselines/reference/doWhileLoop.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/doWhileLoop.ts === +do { } while (false); +var n; +>n : Symbol(n, Decl(doWhileLoop.ts, 1, 3)) + diff --git a/tests/baselines/reference/doWhileLoop.types b/tests/baselines/reference/doWhileLoop.types index 93f17659c64..9d1767b45aa 100644 --- a/tests/baselines/reference/doWhileLoop.types +++ b/tests/baselines/reference/doWhileLoop.types @@ -1,5 +1,7 @@ === tests/cases/compiler/doWhileLoop.ts === do { } while (false); +>false : boolean + var n; >n : any diff --git a/tests/baselines/reference/dottedModuleName2.symbols b/tests/baselines/reference/dottedModuleName2.symbols new file mode 100644 index 00000000000..a26de2987ba --- /dev/null +++ b/tests/baselines/reference/dottedModuleName2.symbols @@ -0,0 +1,76 @@ +=== tests/cases/compiler/dottedModuleName2.ts === +module A.B { +>A : Symbol(A, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) +>B : Symbol(B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) + + export var x = 1; +>x : Symbol(x, Decl(dottedModuleName2.ts, 2, 12)) + +} + + + +module AA { export module B { +>AA : Symbol(AA, Decl(dottedModuleName2.ts, 4, 1)) +>B : Symbol(B, Decl(dottedModuleName2.ts, 8, 11)) + + export var x = 1; +>x : Symbol(x, Decl(dottedModuleName2.ts, 10, 12)) + +} } + + + +var tmpOK = AA.B.x; +>tmpOK : Symbol(tmpOK, Decl(dottedModuleName2.ts, 16, 3)) +>AA.B.x : Symbol(AA.B.x, Decl(dottedModuleName2.ts, 10, 12)) +>AA.B : Symbol(AA.B, Decl(dottedModuleName2.ts, 8, 11)) +>AA : Symbol(AA, Decl(dottedModuleName2.ts, 4, 1)) +>B : Symbol(AA.B, Decl(dottedModuleName2.ts, 8, 11)) +>x : Symbol(AA.B.x, Decl(dottedModuleName2.ts, 10, 12)) + +var tmpError = A.B.x; +>tmpError : Symbol(tmpError, Decl(dottedModuleName2.ts, 18, 3)) +>A.B.x : Symbol(A.B.x, Decl(dottedModuleName2.ts, 2, 12)) +>A.B : Symbol(A.B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) +>A : Symbol(A, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) +>B : Symbol(A.B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) +>x : Symbol(A.B.x, Decl(dottedModuleName2.ts, 2, 12)) + + +module A.B.C +>A : Symbol(A, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) +>B : Symbol(B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) +>C : Symbol(C, Decl(dottedModuleName2.ts, 21, 11)) + +{ + + export var x = 1; +>x : Symbol(x, Decl(dottedModuleName2.ts, 25, 14)) + +} + + + +module M +>M : Symbol(M, Decl(dottedModuleName2.ts, 27, 1)) + +{ + + import X1 = A; +>X1 : Symbol(X1, Decl(dottedModuleName2.ts, 33, 1)) +>A : Symbol(X1, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) + + import X2 = A.B; +>X2 : Symbol(X2, Decl(dottedModuleName2.ts, 35, 18)) +>A : Symbol(X1, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) +>B : Symbol(X1.B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) + + import X3 = A.B.C; +>X3 : Symbol(X3, Decl(dottedModuleName2.ts, 37, 20)) +>A : Symbol(X1, Decl(dottedModuleName2.ts, 0, 0), Decl(dottedModuleName2.ts, 18, 21)) +>B : Symbol(X1.B, Decl(dottedModuleName2.ts, 0, 9), Decl(dottedModuleName2.ts, 21, 9)) +>C : Symbol(X2.C, Decl(dottedModuleName2.ts, 21, 11)) + +} + diff --git a/tests/baselines/reference/dottedModuleName2.types b/tests/baselines/reference/dottedModuleName2.types index e5a9806dd11..869bbfb4cfc 100644 --- a/tests/baselines/reference/dottedModuleName2.types +++ b/tests/baselines/reference/dottedModuleName2.types @@ -5,6 +5,7 @@ module A.B { export var x = 1; >x : number +>1 : number } @@ -16,6 +17,7 @@ module AA { export module B { export var x = 1; >x : number +>1 : number } } @@ -47,13 +49,14 @@ module A.B.C export var x = 1; >x : number +>1 : number } module M ->M : unknown +>M : any { diff --git a/tests/baselines/reference/dottedSymbolResolution1.symbols b/tests/baselines/reference/dottedSymbolResolution1.symbols new file mode 100644 index 00000000000..25ff8a6fe92 --- /dev/null +++ b/tests/baselines/reference/dottedSymbolResolution1.symbols @@ -0,0 +1,81 @@ +=== tests/cases/compiler/dottedSymbolResolution1.ts === +interface JQuery { +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) + + find(selector: string): JQuery; +>find : Symbol(find, Decl(dottedSymbolResolution1.ts, 0, 18)) +>selector : Symbol(selector, Decl(dottedSymbolResolution1.ts, 1, 9)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +} + +interface JQueryStatic { +>JQueryStatic : Symbol(JQueryStatic, Decl(dottedSymbolResolution1.ts, 2, 1)) + + (selector: string): JQuery; +>selector : Symbol(selector, Decl(dottedSymbolResolution1.ts, 6, 5)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) + + (object: JQuery): JQuery; +>object : Symbol(object, Decl(dottedSymbolResolution1.ts, 7, 5)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +} + +class Base { foo() { } } +>Base : Symbol(Base, Decl(dottedSymbolResolution1.ts, 8, 1)) +>foo : Symbol(foo, Decl(dottedSymbolResolution1.ts, 10, 12)) + +function each(collection: string, callback: (indexInArray: any, valueOfElement: any) => any): any; +>each : Symbol(each, Decl(dottedSymbolResolution1.ts, 10, 24), Decl(dottedSymbolResolution1.ts, 12, 98), Decl(dottedSymbolResolution1.ts, 13, 102)) +>collection : Symbol(collection, Decl(dottedSymbolResolution1.ts, 12, 14)) +>callback : Symbol(callback, Decl(dottedSymbolResolution1.ts, 12, 33)) +>indexInArray : Symbol(indexInArray, Decl(dottedSymbolResolution1.ts, 12, 45)) +>valueOfElement : Symbol(valueOfElement, Decl(dottedSymbolResolution1.ts, 12, 63)) + +function each(collection: JQuery, callback: (indexInArray: number, valueOfElement: Base) => any): any; +>each : Symbol(each, Decl(dottedSymbolResolution1.ts, 10, 24), Decl(dottedSymbolResolution1.ts, 12, 98), Decl(dottedSymbolResolution1.ts, 13, 102)) +>collection : Symbol(collection, Decl(dottedSymbolResolution1.ts, 13, 14)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +>callback : Symbol(callback, Decl(dottedSymbolResolution1.ts, 13, 33)) +>indexInArray : Symbol(indexInArray, Decl(dottedSymbolResolution1.ts, 13, 45)) +>valueOfElement : Symbol(valueOfElement, Decl(dottedSymbolResolution1.ts, 13, 66)) +>Base : Symbol(Base, Decl(dottedSymbolResolution1.ts, 8, 1)) + +function each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any { +>each : Symbol(each, Decl(dottedSymbolResolution1.ts, 10, 24), Decl(dottedSymbolResolution1.ts, 12, 98), Decl(dottedSymbolResolution1.ts, 13, 102)) +>collection : Symbol(collection, Decl(dottedSymbolResolution1.ts, 14, 14)) +>callback : Symbol(callback, Decl(dottedSymbolResolution1.ts, 14, 30)) +>indexInArray : Symbol(indexInArray, Decl(dottedSymbolResolution1.ts, 14, 42)) +>valueOfElement : Symbol(valueOfElement, Decl(dottedSymbolResolution1.ts, 14, 60)) + + return null; +} + +function _setBarAndText(): void { +>_setBarAndText : Symbol(_setBarAndText, Decl(dottedSymbolResolution1.ts, 16, 1)) + + var x: JQuery, $: JQueryStatic +>x : Symbol(x, Decl(dottedSymbolResolution1.ts, 19, 7)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +>$ : Symbol($, Decl(dottedSymbolResolution1.ts, 19, 18)) +>JQueryStatic : Symbol(JQueryStatic, Decl(dottedSymbolResolution1.ts, 2, 1)) + + each(x.find(" "), function () { +>each : Symbol(each, Decl(dottedSymbolResolution1.ts, 10, 24), Decl(dottedSymbolResolution1.ts, 12, 98), Decl(dottedSymbolResolution1.ts, 13, 102)) +>x.find : Symbol(JQuery.find, Decl(dottedSymbolResolution1.ts, 0, 18)) +>x : Symbol(x, Decl(dottedSymbolResolution1.ts, 19, 7)) +>find : Symbol(JQuery.find, Decl(dottedSymbolResolution1.ts, 0, 18)) + + var $this: JQuery = $(''), +>$this : Symbol($this, Decl(dottedSymbolResolution1.ts, 21, 11)) +>JQuery : Symbol(JQuery, Decl(dottedSymbolResolution1.ts, 0, 0)) +>$ : Symbol($, Decl(dottedSymbolResolution1.ts, 19, 18)) + + thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here +>thisBar : Symbol(thisBar, Decl(dottedSymbolResolution1.ts, 21, 34)) +>$this.find : Symbol(JQuery.find, Decl(dottedSymbolResolution1.ts, 0, 18)) +>$this : Symbol($this, Decl(dottedSymbolResolution1.ts, 21, 11)) +>find : Symbol(JQuery.find, Decl(dottedSymbolResolution1.ts, 0, 18)) + + } ); +} diff --git a/tests/baselines/reference/dottedSymbolResolution1.types b/tests/baselines/reference/dottedSymbolResolution1.types index 776b9704e73..cf5a5e3ba9d 100644 --- a/tests/baselines/reference/dottedSymbolResolution1.types +++ b/tests/baselines/reference/dottedSymbolResolution1.types @@ -49,6 +49,7 @@ function each(collection: any, callback: (indexInArray: any, valueOfElement: any >valueOfElement : any return null; +>null : null } function _setBarAndText(): void { @@ -67,6 +68,7 @@ function _setBarAndText(): void { >x.find : (selector: string) => JQuery >x : JQuery >find : (selector: string) => JQuery +>" " : string >function () { var $this: JQuery = $(''), thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here } : () => void var $this: JQuery = $(''), @@ -74,6 +76,7 @@ function _setBarAndText(): void { >JQuery : JQuery >$('') : JQuery >$ : JQueryStatic +>'' : string thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here >thisBar : JQuery @@ -81,6 +84,7 @@ function _setBarAndText(): void { >$this.find : (selector: string) => JQuery >$this : JQuery >find : (selector: string) => JQuery +>".fx-usagebars-calloutbar-this" : string } ); } diff --git a/tests/baselines/reference/downlevelLetConst10.symbols b/tests/baselines/reference/downlevelLetConst10.symbols new file mode 100644 index 00000000000..ba0aac7adb5 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst10.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst10.ts === +let a: number = 1 +>a : Symbol(a, Decl(downlevelLetConst10.ts, 0, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst10.types b/tests/baselines/reference/downlevelLetConst10.types index 05fe3029455..3d700b0694d 100644 --- a/tests/baselines/reference/downlevelLetConst10.types +++ b/tests/baselines/reference/downlevelLetConst10.types @@ -1,4 +1,5 @@ === tests/cases/compiler/downlevelLetConst10.ts === let a: number = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/downlevelLetConst12.js b/tests/baselines/reference/downlevelLetConst12.js index 6437d17accb..bd0ab2fb46f 100644 --- a/tests/baselines/reference/downlevelLetConst12.js +++ b/tests/baselines/reference/downlevelLetConst12.js @@ -16,7 +16,7 @@ const {a: baz4} = { a: 1 }; // top level let\const should not be renamed var foo; var bar = 1; -var baz = ([])[0]; -var baz2 = ({ a: 1 }).a; -var baz3 = ([])[0]; -var baz4 = ({ a: 1 }).a; +var baz = [][0]; +var baz2 = { a: 1 }.a; +var baz3 = [][0]; +var baz4 = { a: 1 }.a; diff --git a/tests/baselines/reference/downlevelLetConst12.symbols b/tests/baselines/reference/downlevelLetConst12.symbols new file mode 100644 index 00000000000..d1c7fe3ea5b --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst12.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/downlevelLetConst12.ts === + +'use strict' +// top level let\const should not be renamed +let foo; +>foo : Symbol(foo, Decl(downlevelLetConst12.ts, 3, 3)) + +const bar = 1; +>bar : Symbol(bar, Decl(downlevelLetConst12.ts, 4, 5)) + +let [baz] = []; +>baz : Symbol(baz, Decl(downlevelLetConst12.ts, 6, 5)) + +let {a: baz2} = { a: 1 }; +>baz2 : Symbol(baz2, Decl(downlevelLetConst12.ts, 7, 5)) +>a : Symbol(a, Decl(downlevelLetConst12.ts, 7, 17)) + +const [baz3] = [] +>baz3 : Symbol(baz3, Decl(downlevelLetConst12.ts, 9, 7)) + +const {a: baz4} = { a: 1 }; +>baz4 : Symbol(baz4, Decl(downlevelLetConst12.ts, 10, 7)) +>a : Symbol(a, Decl(downlevelLetConst12.ts, 10, 19)) + diff --git a/tests/baselines/reference/downlevelLetConst12.types b/tests/baselines/reference/downlevelLetConst12.types index 90a814e0753..51d3b8eb086 100644 --- a/tests/baselines/reference/downlevelLetConst12.types +++ b/tests/baselines/reference/downlevelLetConst12.types @@ -1,30 +1,35 @@ === tests/cases/compiler/downlevelLetConst12.ts === 'use strict' +>'use strict' : string + // top level let\const should not be renamed let foo; >foo : any const bar = 1; >bar : number +>1 : number let [baz] = []; >baz : any >[] : undefined[] let {a: baz2} = { a: 1 }; ->a : unknown +>a : any >baz2 : number >{ a: 1 } : { a: number; } >a : number +>1 : number const [baz3] = [] >baz3 : any >[] : undefined[] const {a: baz4} = { a: 1 }; ->a : unknown +>a : any >baz4 : number >{ a: 1 } : { a: number; } >a : number +>1 : number diff --git a/tests/baselines/reference/downlevelLetConst13.js b/tests/baselines/reference/downlevelLetConst13.js index 8324d697e95..b6baf850800 100644 --- a/tests/baselines/reference/downlevelLetConst13.js +++ b/tests/baselines/reference/downlevelLetConst13.js @@ -24,16 +24,16 @@ export module M { // exported let\const bindings should not be renamed exports.foo = 10; exports.bar = "123"; -exports.bar1 = ([1])[0]; -exports.bar2 = ([2])[0]; -exports.bar3 = ({ a: 1 }).a; -exports.bar4 = ({ a: 1 }).a; +exports.bar1 = [1][0]; +exports.bar2 = [2][0]; +exports.bar3 = { a: 1 }.a; +exports.bar4 = { a: 1 }.a; var M; (function (M) { M.baz = 100; M.baz2 = true; - M.bar5 = ([1])[0]; - M.bar6 = ([2])[0]; - M.bar7 = ({ a: 1 }).a; - M.bar8 = ({ a: 1 }).a; + M.bar5 = [1][0]; + M.bar6 = [2][0]; + M.bar7 = { a: 1 }.a; + M.bar8 = { a: 1 }.a; })(M = exports.M || (exports.M = {})); diff --git a/tests/baselines/reference/downlevelLetConst13.symbols b/tests/baselines/reference/downlevelLetConst13.symbols new file mode 100644 index 00000000000..1b06184f2b3 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst13.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/downlevelLetConst13.ts === + +'use strict' +// exported let\const bindings should not be renamed + +export let foo = 10; +>foo : Symbol(foo, Decl(downlevelLetConst13.ts, 4, 10)) + +export const bar = "123" +>bar : Symbol(bar, Decl(downlevelLetConst13.ts, 5, 12)) + +export let [bar1] = [1]; +>bar1 : Symbol(bar1, Decl(downlevelLetConst13.ts, 6, 12)) + +export const [bar2] = [2]; +>bar2 : Symbol(bar2, Decl(downlevelLetConst13.ts, 7, 14)) + +export let {a: bar3} = { a: 1 }; +>bar3 : Symbol(bar3, Decl(downlevelLetConst13.ts, 8, 12)) +>a : Symbol(a, Decl(downlevelLetConst13.ts, 8, 24)) + +export const {a: bar4} = { a: 1 }; +>bar4 : Symbol(bar4, Decl(downlevelLetConst13.ts, 9, 14)) +>a : Symbol(a, Decl(downlevelLetConst13.ts, 9, 26)) + +export module M { +>M : Symbol(M, Decl(downlevelLetConst13.ts, 9, 34)) + + export let baz = 100; +>baz : Symbol(baz, Decl(downlevelLetConst13.ts, 12, 14)) + + export const baz2 = true; +>baz2 : Symbol(baz2, Decl(downlevelLetConst13.ts, 13, 16)) + + export let [bar5] = [1]; +>bar5 : Symbol(bar5, Decl(downlevelLetConst13.ts, 14, 16)) + + export const [bar6] = [2]; +>bar6 : Symbol(bar6, Decl(downlevelLetConst13.ts, 15, 18)) + + export let {a: bar7} = { a: 1 }; +>bar7 : Symbol(bar7, Decl(downlevelLetConst13.ts, 16, 16)) +>a : Symbol(a, Decl(downlevelLetConst13.ts, 16, 28)) + + export const {a: bar8} = { a: 1 }; +>bar8 : Symbol(bar8, Decl(downlevelLetConst13.ts, 17, 18)) +>a : Symbol(a, Decl(downlevelLetConst13.ts, 17, 30)) +} diff --git a/tests/baselines/reference/downlevelLetConst13.types b/tests/baselines/reference/downlevelLetConst13.types index e72e3936f43..0453d3a6ad3 100644 --- a/tests/baselines/reference/downlevelLetConst13.types +++ b/tests/baselines/reference/downlevelLetConst13.types @@ -1,60 +1,74 @@ === tests/cases/compiler/downlevelLetConst13.ts === 'use strict' +>'use strict' : string + // exported let\const bindings should not be renamed export let foo = 10; >foo : number +>10 : number export const bar = "123" >bar : string +>"123" : string export let [bar1] = [1]; >bar1 : number >[1] : [number] +>1 : number export const [bar2] = [2]; >bar2 : number >[2] : [number] +>2 : number export let {a: bar3} = { a: 1 }; ->a : unknown +>a : any >bar3 : number >{ a: 1 } : { a: number; } >a : number +>1 : number export const {a: bar4} = { a: 1 }; ->a : unknown +>a : any >bar4 : number >{ a: 1 } : { a: number; } >a : number +>1 : number export module M { >M : typeof M export let baz = 100; >baz : number +>100 : number export const baz2 = true; >baz2 : boolean +>true : boolean export let [bar5] = [1]; >bar5 : number >[1] : [number] +>1 : number export const [bar6] = [2]; >bar6 : number >[2] : [number] +>2 : number export let {a: bar7} = { a: 1 }; ->a : unknown +>a : any >bar7 : number >{ a: 1 } : { a: number; } >a : number +>1 : number export const {a: bar8} = { a: 1 }; ->a : unknown +>a : any >bar8 : number >{ a: 1 } : { a: number; } >a : number +>1 : number } diff --git a/tests/baselines/reference/downlevelLetConst14.js b/tests/baselines/reference/downlevelLetConst14.js index d45cf10d3a7..cddfb967217 100644 --- a/tests/baselines/reference/downlevelLetConst14.js +++ b/tests/baselines/reference/downlevelLetConst14.js @@ -61,13 +61,13 @@ var z0, z1, z2, z3; { var x_1 = 20; use(x_1); - var z0_1 = ([1])[0]; + var z0_1 = [1][0]; use(z0_1); - var z1_1 = ([1])[0]; + var z1_1 = [1][0]; use(z1_1); - var z2_1 = ({ a: 1 }).a; + var z2_1 = { a: 1 }.a; use(z2_1); - var z3_1 = ({ a: 1 }).a; + var z3_1 = { a: 1 }.a; use(z3_1); } use(x); @@ -79,10 +79,10 @@ var z6; var y = true; { var y_1 = ""; - var z6_1 = ([true])[0]; + var z6_1 = [true][0]; { var y_2 = 1; - var z6_2 = ({ a: 1 }).a; + var z6_2 = { a: 1 }.a; use(y_2); use(z6_2); } @@ -95,10 +95,10 @@ var z = false; var z5 = 1; { var z_1 = ""; - var z5_1 = ([5])[0]; + var z5_1 = [5][0]; { var _z = 1; - var _z5 = ({ a: 1 }).a; + var _z5 = { a: 1 }.a; // try to step on generated name use(_z); } diff --git a/tests/baselines/reference/downlevelLetConst14.symbols b/tests/baselines/reference/downlevelLetConst14.symbols new file mode 100644 index 00000000000..bf3450af71c --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst14.symbols @@ -0,0 +1,147 @@ +=== tests/cases/compiler/downlevelLetConst14.ts === +'use strict' +declare function use(a: any); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>a : Symbol(a, Decl(downlevelLetConst14.ts, 1, 21)) + +var x = 10; +>x : Symbol(x, Decl(downlevelLetConst14.ts, 3, 3)) + +var z0, z1, z2, z3; +>z0 : Symbol(z0, Decl(downlevelLetConst14.ts, 4, 3)) +>z1 : Symbol(z1, Decl(downlevelLetConst14.ts, 4, 7)) +>z2 : Symbol(z2, Decl(downlevelLetConst14.ts, 4, 11)) +>z3 : Symbol(z3, Decl(downlevelLetConst14.ts, 4, 15)) +{ + let x = 20; +>x : Symbol(x, Decl(downlevelLetConst14.ts, 6, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst14.ts, 6, 7)) + + let [z0] = [1]; +>z0 : Symbol(z0, Decl(downlevelLetConst14.ts, 9, 9)) + + use(z0); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z0 : Symbol(z0, Decl(downlevelLetConst14.ts, 9, 9)) + + let [z1] = [1] +>z1 : Symbol(z1, Decl(downlevelLetConst14.ts, 11, 9)) + + use(z1); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z1 : Symbol(z1, Decl(downlevelLetConst14.ts, 11, 9)) + + let {a: z2} = { a: 1 }; +>z2 : Symbol(z2, Decl(downlevelLetConst14.ts, 13, 9)) +>a : Symbol(a, Decl(downlevelLetConst14.ts, 13, 19)) + + use(z2); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z2 : Symbol(z2, Decl(downlevelLetConst14.ts, 13, 9)) + + let {a: z3} = { a: 1 }; +>z3 : Symbol(z3, Decl(downlevelLetConst14.ts, 15, 9)) +>a : Symbol(a, Decl(downlevelLetConst14.ts, 15, 19)) + + use(z3); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z3 : Symbol(z3, Decl(downlevelLetConst14.ts, 15, 9)) +} +use(x); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst14.ts, 3, 3)) + +use(z0); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z0 : Symbol(z0, Decl(downlevelLetConst14.ts, 4, 3)) + +use(z1); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z1 : Symbol(z1, Decl(downlevelLetConst14.ts, 4, 7)) + +use(z2); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z2 : Symbol(z2, Decl(downlevelLetConst14.ts, 4, 11)) + +use(z3); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z3 : Symbol(z3, Decl(downlevelLetConst14.ts, 4, 15)) + +var z6; +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 23, 3)) + +var y = true; +>y : Symbol(y, Decl(downlevelLetConst14.ts, 24, 3)) +{ + let y = ""; +>y : Symbol(y, Decl(downlevelLetConst14.ts, 26, 7)) + + let [z6] = [true] +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 27, 9)) + { + let y = 1; +>y : Symbol(y, Decl(downlevelLetConst14.ts, 29, 11)) + + let {a: z6} = {a: 1} +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 30, 13)) +>a : Symbol(a, Decl(downlevelLetConst14.ts, 30, 23)) + + use(y); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst14.ts, 29, 11)) + + use(z6); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 30, 13)) + } + use(y); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst14.ts, 26, 7)) + + use(z6); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 27, 9)) +} +use(y); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst14.ts, 24, 3)) + +use(z6); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst14.ts, 23, 3)) + +var z = false; +>z : Symbol(z, Decl(downlevelLetConst14.ts, 40, 3)) + +var z5 = 1; +>z5 : Symbol(z5, Decl(downlevelLetConst14.ts, 41, 3)) +{ + let z = ""; +>z : Symbol(z, Decl(downlevelLetConst14.ts, 43, 7)) + + let [z5] = [5]; +>z5 : Symbol(z5, Decl(downlevelLetConst14.ts, 44, 9)) + { + let _z = 1; +>_z : Symbol(_z, Decl(downlevelLetConst14.ts, 46, 11)) + + let {a: _z5} = { a: 1 }; +>_z5 : Symbol(_z5, Decl(downlevelLetConst14.ts, 47, 13)) +>a : Symbol(a, Decl(downlevelLetConst14.ts, 47, 24)) + + // try to step on generated name + use(_z); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>_z : Symbol(_z, Decl(downlevelLetConst14.ts, 46, 11)) + } + use(z); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>z : Symbol(z, Decl(downlevelLetConst14.ts, 43, 7)) +} +use(y); +>use : Symbol(use, Decl(downlevelLetConst14.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst14.ts, 24, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst14.types b/tests/baselines/reference/downlevelLetConst14.types index 05b66948830..ea6aadfe2a8 100644 --- a/tests/baselines/reference/downlevelLetConst14.types +++ b/tests/baselines/reference/downlevelLetConst14.types @@ -1,11 +1,14 @@ === tests/cases/compiler/downlevelLetConst14.ts === 'use strict' +>'use strict' : string + declare function use(a: any); >use : (a: any) => any >a : any var x = 10; >x : number +>10 : number var z0, z1, z2, z3; >z0 : any @@ -15,6 +18,7 @@ var z0, z1, z2, z3; { let x = 20; >x : number +>20 : number use(x); >use(x) : any @@ -24,6 +28,7 @@ var z0, z1, z2, z3; let [z0] = [1]; >z0 : number >[1] : [number] +>1 : number use(z0); >use(z0) : any @@ -33,6 +38,7 @@ var z0, z1, z2, z3; let [z1] = [1] >z1 : number >[1] : [number] +>1 : number use(z1); >use(z1) : any @@ -40,10 +46,11 @@ var z0, z1, z2, z3; >z1 : number let {a: z2} = { a: 1 }; ->a : unknown +>a : any >z2 : number >{ a: 1 } : { a: number; } >a : number +>1 : number use(z2); >use(z2) : any @@ -51,10 +58,11 @@ var z0, z1, z2, z3; >z2 : number let {a: z3} = { a: 1 }; ->a : unknown +>a : any >z3 : number >{ a: 1 } : { a: number; } >a : number +>1 : number use(z3); >use(z3) : any @@ -91,22 +99,27 @@ var z6; var y = true; >y : boolean +>true : boolean { let y = ""; >y : string +>"" : string let [z6] = [true] >z6 : boolean >[true] : [boolean] +>true : boolean { let y = 1; >y : number +>1 : number let {a: z6} = {a: 1} ->a : unknown +>a : any >z6 : number >{a: 1} : { a: number; } >a : number +>1 : number use(y); >use(y) : any @@ -140,25 +153,31 @@ use(z6); var z = false; >z : boolean +>false : boolean var z5 = 1; >z5 : number +>1 : number { let z = ""; >z : string +>"" : string let [z5] = [5]; >z5 : number >[5] : [number] +>5 : number { let _z = 1; >_z : number +>1 : number let {a: _z5} = { a: 1 }; ->a : unknown +>a : any >_z5 : number >{ a: 1 } : { a: number; } >a : number +>1 : number // try to step on generated name use(_z); diff --git a/tests/baselines/reference/downlevelLetConst15.js b/tests/baselines/reference/downlevelLetConst15.js index 99522542d38..807f49bf84e 100644 --- a/tests/baselines/reference/downlevelLetConst15.js +++ b/tests/baselines/reference/downlevelLetConst15.js @@ -61,13 +61,13 @@ var z0, z1, z2, z3; { var x_1 = 20; use(x_1); - var z0_1 = ([1])[0]; + var z0_1 = [1][0]; use(z0_1); - var z1_1 = ([{ a: 1 }])[0].a; + var z1_1 = [{ a: 1 }][0].a; use(z1_1); - var z2_1 = ({ a: 1 }).a; + var z2_1 = { a: 1 }.a; use(z2_1); - var z3_1 = ({ a: { b: 1 } }).a.b; + var z3_1 = { a: { b: 1 } }.a.b; use(z3_1); } use(x); @@ -79,10 +79,10 @@ var z6; var y = true; { var y_1 = ""; - var z6_1 = ([true])[0]; + var z6_1 = [true][0]; { var y_2 = 1; - var z6_2 = ({ a: 1 }).a; + var z6_2 = { a: 1 }.a; use(y_2); use(z6_2); } @@ -95,10 +95,10 @@ var z = false; var z5 = 1; { var z_1 = ""; - var z5_1 = ([5])[0]; + var z5_1 = [5][0]; { var _z = 1; - var _z5 = ({ a: 1 }).a; + var _z5 = { a: 1 }.a; // try to step on generated name use(_z); } diff --git a/tests/baselines/reference/downlevelLetConst15.symbols b/tests/baselines/reference/downlevelLetConst15.symbols new file mode 100644 index 00000000000..159e5a6d676 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst15.symbols @@ -0,0 +1,149 @@ +=== tests/cases/compiler/downlevelLetConst15.ts === +'use strict' +declare function use(a: any); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 1, 21)) + +var x = 10; +>x : Symbol(x, Decl(downlevelLetConst15.ts, 3, 3)) + +var z0, z1, z2, z3; +>z0 : Symbol(z0, Decl(downlevelLetConst15.ts, 4, 3)) +>z1 : Symbol(z1, Decl(downlevelLetConst15.ts, 4, 7)) +>z2 : Symbol(z2, Decl(downlevelLetConst15.ts, 4, 11)) +>z3 : Symbol(z3, Decl(downlevelLetConst15.ts, 4, 15)) +{ + const x = 20; +>x : Symbol(x, Decl(downlevelLetConst15.ts, 6, 9)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst15.ts, 6, 9)) + + const [z0] = [1]; +>z0 : Symbol(z0, Decl(downlevelLetConst15.ts, 9, 11)) + + use(z0); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z0 : Symbol(z0, Decl(downlevelLetConst15.ts, 9, 11)) + + const [{a: z1}] = [{a: 1}] +>z1 : Symbol(z1, Decl(downlevelLetConst15.ts, 11, 12)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 11, 24)) + + use(z1); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z1 : Symbol(z1, Decl(downlevelLetConst15.ts, 11, 12)) + + const {a: z2} = { a: 1 }; +>z2 : Symbol(z2, Decl(downlevelLetConst15.ts, 13, 11)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 13, 21)) + + use(z2); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z2 : Symbol(z2, Decl(downlevelLetConst15.ts, 13, 11)) + + const {a: {b: z3}} = { a: {b: 1} }; +>z3 : Symbol(z3, Decl(downlevelLetConst15.ts, 15, 15)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 15, 26)) +>b : Symbol(b, Decl(downlevelLetConst15.ts, 15, 31)) + + use(z3); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z3 : Symbol(z3, Decl(downlevelLetConst15.ts, 15, 15)) +} +use(x); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst15.ts, 3, 3)) + +use(z0); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z0 : Symbol(z0, Decl(downlevelLetConst15.ts, 4, 3)) + +use(z1); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z1 : Symbol(z1, Decl(downlevelLetConst15.ts, 4, 7)) + +use(z2); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z2 : Symbol(z2, Decl(downlevelLetConst15.ts, 4, 11)) + +use(z3); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z3 : Symbol(z3, Decl(downlevelLetConst15.ts, 4, 15)) + +var z6; +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 23, 3)) + +var y = true; +>y : Symbol(y, Decl(downlevelLetConst15.ts, 24, 3)) +{ + const y = ""; +>y : Symbol(y, Decl(downlevelLetConst15.ts, 26, 9)) + + const [z6] = [true] +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 27, 11)) + { + const y = 1; +>y : Symbol(y, Decl(downlevelLetConst15.ts, 29, 13)) + + const {a: z6} = { a: 1 } +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 30, 15)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 30, 25)) + + use(y); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst15.ts, 29, 13)) + + use(z6); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 30, 15)) + } + use(y); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst15.ts, 26, 9)) + + use(z6); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 27, 11)) +} +use(y); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst15.ts, 24, 3)) + +use(z6); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z6 : Symbol(z6, Decl(downlevelLetConst15.ts, 23, 3)) + +var z = false; +>z : Symbol(z, Decl(downlevelLetConst15.ts, 40, 3)) + +var z5 = 1; +>z5 : Symbol(z5, Decl(downlevelLetConst15.ts, 41, 3)) +{ + const z = ""; +>z : Symbol(z, Decl(downlevelLetConst15.ts, 43, 9)) + + const [z5] = [5]; +>z5 : Symbol(z5, Decl(downlevelLetConst15.ts, 44, 11)) + { + const _z = 1; +>_z : Symbol(_z, Decl(downlevelLetConst15.ts, 46, 13)) + + const {a: _z5} = { a: 1 }; +>_z5 : Symbol(_z5, Decl(downlevelLetConst15.ts, 47, 15)) +>a : Symbol(a, Decl(downlevelLetConst15.ts, 47, 26)) + + // try to step on generated name + use(_z); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>_z : Symbol(_z, Decl(downlevelLetConst15.ts, 46, 13)) + } + use(z); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>z : Symbol(z, Decl(downlevelLetConst15.ts, 43, 9)) +} +use(y); +>use : Symbol(use, Decl(downlevelLetConst15.ts, 0, 12)) +>y : Symbol(y, Decl(downlevelLetConst15.ts, 24, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst15.types b/tests/baselines/reference/downlevelLetConst15.types index 008d132ab70..72b29e3fe66 100644 --- a/tests/baselines/reference/downlevelLetConst15.types +++ b/tests/baselines/reference/downlevelLetConst15.types @@ -1,11 +1,14 @@ === tests/cases/compiler/downlevelLetConst15.ts === 'use strict' +>'use strict' : string + declare function use(a: any); >use : (a: any) => any >a : any var x = 10; >x : number +>10 : number var z0, z1, z2, z3; >z0 : any @@ -15,6 +18,7 @@ var z0, z1, z2, z3; { const x = 20; >x : number +>20 : number use(x); >use(x) : any @@ -24,6 +28,7 @@ var z0, z1, z2, z3; const [z0] = [1]; >z0 : number >[1] : [number] +>1 : number use(z0); >use(z0) : any @@ -31,11 +36,12 @@ var z0, z1, z2, z3; >z0 : number const [{a: z1}] = [{a: 1}] ->a : unknown +>a : any >z1 : number >[{a: 1}] : [{ a: number; }] >{a: 1} : { a: number; } >a : number +>1 : number use(z1); >use(z1) : any @@ -43,10 +49,11 @@ var z0, z1, z2, z3; >z1 : number const {a: z2} = { a: 1 }; ->a : unknown +>a : any >z2 : number >{ a: 1 } : { a: number; } >a : number +>1 : number use(z2); >use(z2) : any @@ -54,13 +61,14 @@ var z0, z1, z2, z3; >z2 : number const {a: {b: z3}} = { a: {b: 1} }; ->a : unknown ->b : unknown +>a : any +>b : any >z3 : number >{ a: {b: 1} } : { a: { b: number; }; } >a : { b: number; } >{b: 1} : { b: number; } >b : number +>1 : number use(z3); >use(z3) : any @@ -97,22 +105,27 @@ var z6; var y = true; >y : boolean +>true : boolean { const y = ""; >y : string +>"" : string const [z6] = [true] >z6 : boolean >[true] : [boolean] +>true : boolean { const y = 1; >y : number +>1 : number const {a: z6} = { a: 1 } ->a : unknown +>a : any >z6 : number >{ a: 1 } : { a: number; } >a : number +>1 : number use(y); >use(y) : any @@ -146,25 +159,31 @@ use(z6); var z = false; >z : boolean +>false : boolean var z5 = 1; >z5 : number +>1 : number { const z = ""; >z : string +>"" : string const [z5] = [5]; >z5 : number >[5] : [number] +>5 : number { const _z = 1; >_z : number +>1 : number const {a: _z5} = { a: 1 }; ->a : unknown +>a : any >_z5 : number >{ a: 1 } : { a: number; } >a : number +>1 : number // try to step on generated name use(_z); diff --git a/tests/baselines/reference/downlevelLetConst16.js b/tests/baselines/reference/downlevelLetConst16.js index 4765b50e0a1..874fc121191 100644 --- a/tests/baselines/reference/downlevelLetConst16.js +++ b/tests/baselines/reference/downlevelLetConst16.js @@ -238,18 +238,18 @@ use(z); function foo1() { var x = 1; use(x); - var y = ([1])[0]; + var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); } function foo2() { { var x_1 = 1; use(x_1); - var y_1 = ([1])[0]; + var y_1 = [1][0]; use(y_1); - var z_1 = ({ a: 1 }).a; + var z_1 = { a: 1 }.a; use(z_1); } use(x); @@ -260,18 +260,18 @@ var A = (function () { A.prototype.m1 = function () { var x = 1; use(x); - var y = ([1])[0]; + var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); }; A.prototype.m2 = function () { { var x_2 = 1; use(x_2); - var y_2 = ([1])[0]; + var y_2 = [1][0]; use(y_2); - var z_2 = ({ a: 1 }).a; + var z_2 = { a: 1 }.a; use(z_2); } use(x); @@ -284,18 +284,18 @@ var B = (function () { B.prototype.m1 = function () { var x = 1; use(x); - var y = ([1])[0]; + var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); }; B.prototype.m2 = function () { { var x_3 = 1; use(x_3); - var y_3 = ([1])[0]; + var y_3 = [1][0]; use(y_3); - var z_3 = ({ a: 1 }).a; + var z_3 = { a: 1 }.a; use(z_3); } use(x); @@ -305,18 +305,18 @@ var B = (function () { function bar1() { var x = 1; use(x); - var y = ([1])[0]; + var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); } function bar2() { { var x_4 = 1; use(x_4); - var y_4 = ([1])[0]; + var y_4 = [1][0]; use(y_4); - var z_4 = ({ a: 1 }).a; + var z_4 = { a: 1 }.a; use(z_4); } use(x); @@ -325,9 +325,9 @@ var M1; (function (M1) { var x = 1; use(x); - var y = ([1])[0]; + var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); })(M1 || (M1 = {})); var M2; @@ -335,9 +335,9 @@ var M2; { var x_5 = 1; use(x_5); - var y_5 = ([1])[0]; + var y_5 = [1][0]; use(y_5); - var z_5 = ({ a: 1 }).a; + var z_5 = { a: 1 }.a; use(z_5); } use(x); @@ -346,9 +346,9 @@ var M3; (function (M3) { var x = 1; use(x); - var y = ([1])[0]; + var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); })(M3 || (M3 = {})); var M4; @@ -356,9 +356,9 @@ var M4; { var x_6 = 1; use(x_6); - var y_6 = ([1])[0]; + var y_6 = [1][0]; use(y_6); - var z_6 = ({ a: 1 }).a; + var z_6 = { a: 1 }.a; use(z_6); } use(x); @@ -369,10 +369,10 @@ function foo3() { for (var x_7 = void 0;;) { use(x_7); } - for (var y_7 = ([])[0];;) { + for (var y_7 = [][0];;) { use(y_7); } - for (var z_7 = ({ a: 1 }).a;;) { + for (var z_7 = { a: 1 }.a;;) { use(z_7); } use(x); @@ -381,10 +381,10 @@ function foo4() { for (var x_8 = 1;;) { use(x_8); } - for (var y_8 = ([])[0];;) { + for (var y_8 = [][0];;) { use(y_8); } - for (var z_8 = ({ a: 1 }).a;;) { + for (var z_8 = { a: 1 }.a;;) { use(z_8); } use(x); diff --git a/tests/baselines/reference/downlevelLetConst17.symbols b/tests/baselines/reference/downlevelLetConst17.symbols new file mode 100644 index 00000000000..809a835774c --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst17.symbols @@ -0,0 +1,134 @@ +=== tests/cases/compiler/downlevelLetConst17.ts === +'use strict' + +declare function use(a: any); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>a : Symbol(a, Decl(downlevelLetConst17.ts, 2, 21)) + +var x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 4, 3)) + +for (let x = 10; ;) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 5, 8)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 5, 8)) +} +use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 4, 3)) + +for (const x = 10; ;) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 10, 10)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 10, 10)) +} + +for (; ;) { + let x = 10; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) + + x = 1; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 15, 7)) +} + +for (; ;) { + const x = 10; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 21, 9)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 21, 9)) +} + +for (let x; ;) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) + + x = 1; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 25, 8)) +} + +for (; ;) { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) + + x = 1; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 31, 7)) +} + +while (true) { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 37, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 37, 7)) +} + +while (true) { + const x = true; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 42, 9)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 42, 9)) +} + +do { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 47, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 47, 7)) + +} while (true); + +do { + let x; +>x : Symbol(x, Decl(downlevelLetConst17.ts, 52, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 52, 7)) + +} while (true); + +for (let x in []) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 56, 8)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 56, 8)) +} + +for (const x in []) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 60, 10)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 60, 10)) +} + +for (const x of []) { +>x : Symbol(x, Decl(downlevelLetConst17.ts, 64, 10)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst17.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst17.ts, 64, 10)) +} diff --git a/tests/baselines/reference/downlevelLetConst17.types b/tests/baselines/reference/downlevelLetConst17.types index 0c5a8eaa86b..824abcc76be 100644 --- a/tests/baselines/reference/downlevelLetConst17.types +++ b/tests/baselines/reference/downlevelLetConst17.types @@ -1,5 +1,6 @@ === tests/cases/compiler/downlevelLetConst17.ts === 'use strict' +>'use strict' : string declare function use(a: any); >use : (a: any) => any @@ -10,6 +11,7 @@ var x; for (let x = 10; ;) { >x : number +>10 : number use(x); >use(x) : any @@ -23,6 +25,7 @@ use(x); for (const x = 10; ;) { >x : number +>10 : number use(x); >use(x) : any @@ -33,6 +36,7 @@ for (const x = 10; ;) { for (; ;) { let x = 10; >x : number +>10 : number use(x); >use(x) : any @@ -42,11 +46,13 @@ for (; ;) { x = 1; >x = 1 : number >x : number +>1 : number } for (; ;) { const x = 10; >x : number +>10 : number use(x); >use(x) : any @@ -65,6 +71,7 @@ for (let x; ;) { x = 1; >x = 1 : number >x : any +>1 : number } for (; ;) { @@ -79,9 +86,12 @@ for (; ;) { x = 1; >x = 1 : number >x : any +>1 : number } while (true) { +>true : boolean + let x; >x : any @@ -92,8 +102,11 @@ while (true) { } while (true) { +>true : boolean + const x = true; >x : boolean +>true : boolean use(x); >use(x) : any @@ -111,6 +124,7 @@ do { >x : any } while (true); +>true : boolean do { let x; @@ -122,6 +136,7 @@ do { >x : any } while (true); +>true : boolean for (let x in []) { >x : any diff --git a/tests/baselines/reference/downlevelLetConst19.symbols b/tests/baselines/reference/downlevelLetConst19.symbols new file mode 100644 index 00000000000..9ed23e43447 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst19.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/downlevelLetConst19.ts === +'use strict' +declare function use(a: any); +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>a : Symbol(a, Decl(downlevelLetConst19.ts, 1, 21)) + +var x; +>x : Symbol(x, Decl(downlevelLetConst19.ts, 2, 3)) + +function a() { +>a : Symbol(a, Decl(downlevelLetConst19.ts, 2, 6)) + { + let x; +>x : Symbol(x, Decl(downlevelLetConst19.ts, 5, 7)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst19.ts, 5, 7)) + + function b() { +>b : Symbol(b, Decl(downlevelLetConst19.ts, 6, 11)) + { + let x; +>x : Symbol(x, Decl(downlevelLetConst19.ts, 10, 15)) + + use(x); +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst19.ts, 10, 15)) + } + use(x); +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst19.ts, 5, 7)) + } + } + use(x) +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst19.ts, 2, 3)) +} +use(x) +>use : Symbol(use, Decl(downlevelLetConst19.ts, 0, 12)) +>x : Symbol(x, Decl(downlevelLetConst19.ts, 2, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst19.types b/tests/baselines/reference/downlevelLetConst19.types index 492d10b59c9..687033c195a 100644 --- a/tests/baselines/reference/downlevelLetConst19.types +++ b/tests/baselines/reference/downlevelLetConst19.types @@ -1,5 +1,7 @@ === tests/cases/compiler/downlevelLetConst19.ts === 'use strict' +>'use strict' : string + declare function use(a: any); >use : (a: any) => any >a : any diff --git a/tests/baselines/reference/downlevelLetConst3.symbols b/tests/baselines/reference/downlevelLetConst3.symbols new file mode 100644 index 00000000000..26732da3352 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst3.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst3.ts === +const a = 1 +>a : Symbol(a, Decl(downlevelLetConst3.ts, 0, 5)) + diff --git a/tests/baselines/reference/downlevelLetConst3.types b/tests/baselines/reference/downlevelLetConst3.types index 6cd3f85e074..cf8def45e3c 100644 --- a/tests/baselines/reference/downlevelLetConst3.types +++ b/tests/baselines/reference/downlevelLetConst3.types @@ -1,4 +1,5 @@ === tests/cases/compiler/downlevelLetConst3.ts === const a = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/downlevelLetConst5.symbols b/tests/baselines/reference/downlevelLetConst5.symbols new file mode 100644 index 00000000000..93181df78de --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst5.ts === +const a: number = 1 +>a : Symbol(a, Decl(downlevelLetConst5.ts, 0, 5)) + diff --git a/tests/baselines/reference/downlevelLetConst5.types b/tests/baselines/reference/downlevelLetConst5.types index dd8cdf9fcdd..2cdf6ff53cc 100644 --- a/tests/baselines/reference/downlevelLetConst5.types +++ b/tests/baselines/reference/downlevelLetConst5.types @@ -1,4 +1,5 @@ === tests/cases/compiler/downlevelLetConst5.ts === const a: number = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/downlevelLetConst7.symbols b/tests/baselines/reference/downlevelLetConst7.symbols new file mode 100644 index 00000000000..1db555c4273 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst7.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst7.ts === +let a +>a : Symbol(a, Decl(downlevelLetConst7.ts, 0, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst8.symbols b/tests/baselines/reference/downlevelLetConst8.symbols new file mode 100644 index 00000000000..68e8e06c2c1 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst8.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst8.ts === +let a = 1 +>a : Symbol(a, Decl(downlevelLetConst8.ts, 0, 3)) + diff --git a/tests/baselines/reference/downlevelLetConst8.types b/tests/baselines/reference/downlevelLetConst8.types index a3b9986bbc8..c941d673503 100644 --- a/tests/baselines/reference/downlevelLetConst8.types +++ b/tests/baselines/reference/downlevelLetConst8.types @@ -1,4 +1,5 @@ === tests/cases/compiler/downlevelLetConst8.ts === let a = 1 >a : number +>1 : number diff --git a/tests/baselines/reference/downlevelLetConst9.symbols b/tests/baselines/reference/downlevelLetConst9.symbols new file mode 100644 index 00000000000..7b11987ea08 --- /dev/null +++ b/tests/baselines/reference/downlevelLetConst9.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/downlevelLetConst9.ts === +let a: number +>a : Symbol(a, Decl(downlevelLetConst9.ts, 0, 3)) + diff --git a/tests/baselines/reference/duplicateAnonymousInners1.symbols b/tests/baselines/reference/duplicateAnonymousInners1.symbols new file mode 100644 index 00000000000..8cf2a3301c3 --- /dev/null +++ b/tests/baselines/reference/duplicateAnonymousInners1.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/duplicateAnonymousInners1.ts === +module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousInners1.ts, 0, 0), Decl(duplicateAnonymousInners1.ts, 10, 1)) + + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousInners1.ts, 0, 12)) + + } + + class Inner {} +>Inner : Symbol(Inner, Decl(duplicateAnonymousInners1.ts, 4, 5)) + + // Inner should show up in intellisense + + export var Outer=0; +>Outer : Symbol(Outer, Decl(duplicateAnonymousInners1.ts, 9, 14)) +} + + +module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousInners1.ts, 0, 0), Decl(duplicateAnonymousInners1.ts, 10, 1)) + + // Should not be an error + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousInners1.ts, 13, 12)) + + } + + // Inner should not show up in intellisense + // Outer should show up in intellisense + +} + diff --git a/tests/baselines/reference/duplicateAnonymousInners1.types b/tests/baselines/reference/duplicateAnonymousInners1.types index 7c63fb4163b..6840e5a14f6 100644 --- a/tests/baselines/reference/duplicateAnonymousInners1.types +++ b/tests/baselines/reference/duplicateAnonymousInners1.types @@ -14,6 +14,7 @@ module Foo { export var Outer=0; >Outer : number +>0 : number } diff --git a/tests/baselines/reference/duplicateAnonymousModuleClasses.symbols b/tests/baselines/reference/duplicateAnonymousModuleClasses.symbols new file mode 100644 index 00000000000..60120c09375 --- /dev/null +++ b/tests/baselines/reference/duplicateAnonymousModuleClasses.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/duplicateAnonymousModuleClasses.ts === +module F { +>F : Symbol(F, Decl(duplicateAnonymousModuleClasses.ts, 0, 0), Decl(duplicateAnonymousModuleClasses.ts, 6, 1)) + + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 0, 10)) + + } + +} + + +module F { +>F : Symbol(F, Decl(duplicateAnonymousModuleClasses.ts, 0, 0), Decl(duplicateAnonymousModuleClasses.ts, 6, 1)) + + // Should not be an error + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 9, 10)) + + } + +} + +module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousModuleClasses.ts, 16, 1), Decl(duplicateAnonymousModuleClasses.ts, 24, 1)) + + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 18, 12)) + + } + +} + + +module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousModuleClasses.ts, 16, 1), Decl(duplicateAnonymousModuleClasses.ts, 24, 1)) + + // Should not be an error + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 27, 12)) + + } + +} + +module Gar { +>Gar : Symbol(Gar, Decl(duplicateAnonymousModuleClasses.ts, 34, 1)) + + module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousModuleClasses.ts, 36, 12), Decl(duplicateAnonymousModuleClasses.ts, 43, 5)) + + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 37, 16)) + + } + + } + + + module Foo { +>Foo : Symbol(Foo, Decl(duplicateAnonymousModuleClasses.ts, 36, 12), Decl(duplicateAnonymousModuleClasses.ts, 43, 5)) + + // Should not be an error + class Helper { +>Helper : Symbol(Helper, Decl(duplicateAnonymousModuleClasses.ts, 46, 16)) + + } + + } +} + diff --git a/tests/baselines/reference/duplicateConstructSignature.symbols b/tests/baselines/reference/duplicateConstructSignature.symbols new file mode 100644 index 00000000000..e34f9738d8b --- /dev/null +++ b/tests/baselines/reference/duplicateConstructSignature.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/duplicateConstructSignature.ts === +interface I { +>I : Symbol(I, Decl(duplicateConstructSignature.ts, 0, 0)) + + (): number; + (): string; +} diff --git a/tests/baselines/reference/duplicateConstructSignature2.symbols b/tests/baselines/reference/duplicateConstructSignature2.symbols new file mode 100644 index 00000000000..f07e3f39b4c --- /dev/null +++ b/tests/baselines/reference/duplicateConstructSignature2.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/duplicateConstructSignature2.ts === +interface I { +>I : Symbol(I, Decl(duplicateConstructSignature2.ts, 0, 0)) +>T : Symbol(T, Decl(duplicateConstructSignature2.ts, 0, 12)) + + (x: T): number; +>x : Symbol(x, Decl(duplicateConstructSignature2.ts, 1, 5)) +>T : Symbol(T, Decl(duplicateConstructSignature2.ts, 0, 12)) + + (x: T): string; +>x : Symbol(x, Decl(duplicateConstructSignature2.ts, 2, 5)) +>T : Symbol(T, Decl(duplicateConstructSignature2.ts, 0, 12)) +} diff --git a/tests/baselines/reference/duplicateConstructorOverloadSignature.symbols b/tests/baselines/reference/duplicateConstructorOverloadSignature.symbols new file mode 100644 index 00000000000..a5313302e13 --- /dev/null +++ b/tests/baselines/reference/duplicateConstructorOverloadSignature.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/duplicateConstructorOverloadSignature.ts === +class C { +>C : Symbol(C, Decl(duplicateConstructorOverloadSignature.ts, 0, 0)) + + constructor(x: number); +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature.ts, 1, 16)) + + constructor(x: number); +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature.ts, 2, 16)) + + constructor(x: any) { } +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature.ts, 3, 16)) +} diff --git a/tests/baselines/reference/duplicateConstructorOverloadSignature2.symbols b/tests/baselines/reference/duplicateConstructorOverloadSignature2.symbols new file mode 100644 index 00000000000..c3c08ece56d --- /dev/null +++ b/tests/baselines/reference/duplicateConstructorOverloadSignature2.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/duplicateConstructorOverloadSignature2.ts === +class C { +>C : Symbol(C, Decl(duplicateConstructorOverloadSignature2.ts, 0, 0)) +>T : Symbol(T, Decl(duplicateConstructorOverloadSignature2.ts, 0, 8)) + + constructor(x: T); +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature2.ts, 1, 16)) +>T : Symbol(T, Decl(duplicateConstructorOverloadSignature2.ts, 0, 8)) + + constructor(x: T); +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature2.ts, 2, 16)) +>T : Symbol(T, Decl(duplicateConstructorOverloadSignature2.ts, 0, 8)) + + constructor(x: any) { } +>x : Symbol(x, Decl(duplicateConstructorOverloadSignature2.ts, 3, 16)) +} diff --git a/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.symbols b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.symbols new file mode 100644 index 00000000000..61cc569b965 --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/duplicateIdentifierShouldNotShortCircuitBaseTypeBinding.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel3.symbols b/tests/baselines/reference/duplicateLabel3.symbols new file mode 100644 index 00000000000..07d0ded2923 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel3.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/duplicateLabel3.ts === +target: +while (true) { + function f() { +>f : Symbol(f, Decl(duplicateLabel3.ts, 1, 14)) + + target: + while (true) { + } + } +} diff --git a/tests/baselines/reference/duplicateLabel3.types b/tests/baselines/reference/duplicateLabel3.types index d4a26fa22a0..8d75b08c768 100644 --- a/tests/baselines/reference/duplicateLabel3.types +++ b/tests/baselines/reference/duplicateLabel3.types @@ -1,11 +1,18 @@ === tests/cases/compiler/duplicateLabel3.ts === target: +>target : any + while (true) { +>true : boolean + function f() { >f : () => void target: +>target : any + while (true) { +>true : boolean } } } diff --git a/tests/baselines/reference/duplicateLabel4.symbols b/tests/baselines/reference/duplicateLabel4.symbols new file mode 100644 index 00000000000..c671abcef35 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel4.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/duplicateLabel4.ts === +target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. +No type information for this code.target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel4.types b/tests/baselines/reference/duplicateLabel4.types index c671abcef35..9238986b582 100644 --- a/tests/baselines/reference/duplicateLabel4.types +++ b/tests/baselines/reference/duplicateLabel4.types @@ -1,9 +1,14 @@ === tests/cases/compiler/duplicateLabel4.ts === target: -No type information for this code.while (true) { -No type information for this code.} -No type information for this code. -No type information for this code.target: -No type information for this code.while (true) { -No type information for this code.} -No type information for this code. \ No newline at end of file +>target : any + +while (true) { +>true : boolean +} + +target: +>target : any + +while (true) { +>true : boolean +} diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols new file mode 100644 index 00000000000..41916162553 --- /dev/null +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/duplicateOverloadInTypeAugmentation1.ts === +interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 0)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) + + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, +>reduce : Symbol(reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>callbackfn : Symbol(callbackfn, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 11)) +>previousValue : Symbol(previousValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 24)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>currentValue : Symbol(currentValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 41)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>currentIndex : Symbol(currentIndex, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 58)) +>array : Symbol(array, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 80)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) + + initialValue?: T): T; +>initialValue : Symbol(initialValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 98)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) + + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, +>reduce : Symbol(reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) +>callbackfn : Symbol(callbackfn, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 14)) +>previousValue : Symbol(previousValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 27)) +>U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) +>currentValue : Symbol(currentValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 44)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>currentIndex : Symbol(currentIndex, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 61)) +>array : Symbol(array, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 83)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) +>U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) + + initialValue: U): U; +>initialValue : Symbol(initialValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 101)) +>U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) +>U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) +} +var a: Array; +>a : Symbol(a, Decl(duplicateOverloadInTypeAugmentation1.ts, 6, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 0)) + +var r5 = a.reduce((x, y) => x + y); +>r5 : Symbol(r5, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 3)) +>a.reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>a : Symbol(a, Decl(duplicateOverloadInTypeAugmentation1.ts, 6, 3)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>x : Symbol(x, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 19)) +>y : Symbol(y, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 21)) +>x : Symbol(x, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 19)) +>y : Symbol(y, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 21)) + diff --git a/tests/baselines/reference/duplicateVarAndImport.symbols b/tests/baselines/reference/duplicateVarAndImport.symbols new file mode 100644 index 00000000000..597713b1f30 --- /dev/null +++ b/tests/baselines/reference/duplicateVarAndImport.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/duplicateVarAndImport.ts === +// no error since module is not instantiated + +var a; +>a : Symbol(a, Decl(duplicateVarAndImport.ts, 2, 3), Decl(duplicateVarAndImport.ts, 3, 12)) + +module M { } +>M : Symbol(M, Decl(duplicateVarAndImport.ts, 2, 6)) + +import a = M; +>a : Symbol(a, Decl(duplicateVarAndImport.ts, 2, 3), Decl(duplicateVarAndImport.ts, 3, 12)) +>M : Symbol(M, Decl(duplicateVarAndImport.ts, 2, 6)) + diff --git a/tests/baselines/reference/duplicateVarAndImport.types b/tests/baselines/reference/duplicateVarAndImport.types index 10db2738dde..4e60c4ecf20 100644 --- a/tests/baselines/reference/duplicateVarAndImport.types +++ b/tests/baselines/reference/duplicateVarAndImport.types @@ -5,9 +5,9 @@ var a; >a : any module M { } ->M : unknown +>M : any import a = M; >a : any ->M : unknown +>M : any diff --git a/tests/baselines/reference/duplicateVariableDeclaration1.symbols b/tests/baselines/reference/duplicateVariableDeclaration1.symbols new file mode 100644 index 00000000000..02b85a89a1f --- /dev/null +++ b/tests/baselines/reference/duplicateVariableDeclaration1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/duplicateVariableDeclaration1.ts === +var v +>v : Symbol(v, Decl(duplicateVariableDeclaration1.ts, 0, 3), Decl(duplicateVariableDeclaration1.ts, 1, 3)) + +var v +>v : Symbol(v, Decl(duplicateVariableDeclaration1.ts, 0, 3), Decl(duplicateVariableDeclaration1.ts, 1, 3)) + diff --git a/tests/baselines/reference/duplicateVariablesByScope.symbols b/tests/baselines/reference/duplicateVariablesByScope.symbols new file mode 100644 index 00000000000..bc94dc9b807 --- /dev/null +++ b/tests/baselines/reference/duplicateVariablesByScope.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/duplicateVariablesByScope.ts === +// duplicate local variables are only reported at global scope + +module M { +>M : Symbol(M, Decl(duplicateVariablesByScope.ts, 0, 0)) + + for (var j = 0; j < 10; j++) { +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) + } + + for (var j = 0; j < 10; j++) { +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) +>j : Symbol(j, Decl(duplicateVariablesByScope.ts, 3, 12), Decl(duplicateVariablesByScope.ts, 6, 12)) + } +} + +function foo() { +>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 8, 1)) + + var x = 2; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 11, 7), Decl(duplicateVariablesByScope.ts, 12, 7)) + + var x = 1; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 11, 7), Decl(duplicateVariablesByScope.ts, 12, 7)) + + if (true) { + var result = 1; +>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 14, 11), Decl(duplicateVariablesByScope.ts, 17, 11)) + } + else { + var result = 2; +>result : Symbol(result, Decl(duplicateVariablesByScope.ts, 14, 11), Decl(duplicateVariablesByScope.ts, 17, 11)) + } +} + +class C { +>C : Symbol(C, Decl(duplicateVariablesByScope.ts, 19, 1)) + + foo() { +>foo : Symbol(foo, Decl(duplicateVariablesByScope.ts, 21, 9)) + + try { + var x = 1; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 24, 15), Decl(duplicateVariablesByScope.ts, 27, 15)) + } + catch (e) { +>e : Symbol(e, Decl(duplicateVariablesByScope.ts, 26, 15)) + + var x = 2; +>x : Symbol(x, Decl(duplicateVariablesByScope.ts, 24, 15), Decl(duplicateVariablesByScope.ts, 27, 15)) + } + } +} diff --git a/tests/baselines/reference/duplicateVariablesByScope.types b/tests/baselines/reference/duplicateVariablesByScope.types index ec20d665ad8..42d8cae2a3c 100644 --- a/tests/baselines/reference/duplicateVariablesByScope.types +++ b/tests/baselines/reference/duplicateVariablesByScope.types @@ -6,16 +6,20 @@ module M { for (var j = 0; j < 10; j++) { >j : number +>0 : number >j < 10 : boolean >j : number +>10 : number >j++ : number >j : number } for (var j = 0; j < 10; j++) { >j : number +>0 : number >j < 10 : boolean >j : number +>10 : number >j++ : number >j : number } @@ -26,17 +30,23 @@ function foo() { var x = 2; >x : number +>2 : number var x = 1; >x : number +>1 : number if (true) { +>true : boolean + var result = 1; >result : number +>1 : number } else { var result = 2; >result : number +>2 : number } } @@ -49,12 +59,14 @@ class C { try { var x = 1; >x : number +>1 : number } catch (e) { >e : any var x = 2; >x : number +>2 : number } } } diff --git a/tests/baselines/reference/dynamicModuleTypecheckError.symbols b/tests/baselines/reference/dynamicModuleTypecheckError.symbols new file mode 100644 index 00000000000..ff141fe72e2 --- /dev/null +++ b/tests/baselines/reference/dynamicModuleTypecheckError.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/dynamicModuleTypecheckError.ts === +export var x = 1; +>x : Symbol(x, Decl(dynamicModuleTypecheckError.ts, 0, 10)) + +for(var i = 0; i < 30; i++) { +>i : Symbol(i, Decl(dynamicModuleTypecheckError.ts, 2, 7)) +>i : Symbol(i, Decl(dynamicModuleTypecheckError.ts, 2, 7)) +>i : Symbol(i, Decl(dynamicModuleTypecheckError.ts, 2, 7)) + + x = i * 1000; // should not be an error here +>x : Symbol(x, Decl(dynamicModuleTypecheckError.ts, 0, 10)) +>i : Symbol(i, Decl(dynamicModuleTypecheckError.ts, 2, 7)) + +} + diff --git a/tests/baselines/reference/dynamicModuleTypecheckError.types b/tests/baselines/reference/dynamicModuleTypecheckError.types index c7d213d1661..e50107f328b 100644 --- a/tests/baselines/reference/dynamicModuleTypecheckError.types +++ b/tests/baselines/reference/dynamicModuleTypecheckError.types @@ -1,11 +1,14 @@ === tests/cases/compiler/dynamicModuleTypecheckError.ts === export var x = 1; >x : number +>1 : number for(var i = 0; i < 30; i++) { >i : number +>0 : number >i < 30 : boolean >i : number +>30 : number >i++ : number >i : number @@ -14,6 +17,7 @@ for(var i = 0; i < 30; i++) { >x : number >i * 1000 : number >i : number +>1000 : number } diff --git a/tests/baselines/reference/elidingImportNames.symbols b/tests/baselines/reference/elidingImportNames.symbols new file mode 100644 index 00000000000..02646b5c3e2 --- /dev/null +++ b/tests/baselines/reference/elidingImportNames.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/elidingImportNames_test.ts === + +import a = require('elidingImportNames_main'); // alias used in typeof +>a : Symbol(a, Decl(elidingImportNames_test.ts, 0, 0)) + +var b = a; +>b : Symbol(b, Decl(elidingImportNames_test.ts, 2, 3)) +>a : Symbol(a, Decl(elidingImportNames_test.ts, 0, 0)) + +var x: typeof a; +>x : Symbol(x, Decl(elidingImportNames_test.ts, 3, 3)) +>a : Symbol(a, Decl(elidingImportNames_test.ts, 0, 0)) + +import a2 = require('elidingImportNames_main1'); // alias not used in typeof +>a2 : Symbol(a2, Decl(elidingImportNames_test.ts, 3, 16)) + +var b2 = a2; +>b2 : Symbol(b2, Decl(elidingImportNames_test.ts, 5, 3)) +>a2 : Symbol(a2, Decl(elidingImportNames_test.ts, 3, 16)) + + +=== tests/cases/compiler/elidingImportNames_main.ts === +export var main = 10; +>main : Symbol(main, Decl(elidingImportNames_main.ts, 0, 10)) + +=== tests/cases/compiler/elidingImportNames_main1.ts === +export var main = 10; +>main : Symbol(main, Decl(elidingImportNames_main1.ts, 0, 10)) + diff --git a/tests/baselines/reference/elidingImportNames.types b/tests/baselines/reference/elidingImportNames.types index ad93c72860b..65bd16a6d97 100644 --- a/tests/baselines/reference/elidingImportNames.types +++ b/tests/baselines/reference/elidingImportNames.types @@ -22,8 +22,10 @@ var b2 = a2; === tests/cases/compiler/elidingImportNames_main.ts === export var main = 10; >main : number +>10 : number === tests/cases/compiler/elidingImportNames_main1.ts === export var main = 10; >main : number +>10 : number diff --git a/tests/baselines/reference/emitArrowFunction.symbols b/tests/baselines/reference/emitArrowFunction.symbols new file mode 100644 index 00000000000..33de13d877c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunction.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunction.ts === +var f1 = () => { } +>f1 : Symbol(f1, Decl(emitArrowFunction.ts, 0, 3)) + +var f2 = (x: string, y: string) => { } +>f2 : Symbol(f2, Decl(emitArrowFunction.ts, 1, 3)) +>x : Symbol(x, Decl(emitArrowFunction.ts, 1, 10)) +>y : Symbol(y, Decl(emitArrowFunction.ts, 1, 20)) + +var f3 = (x: string, y: number, ...rest) => { } +>f3 : Symbol(f3, Decl(emitArrowFunction.ts, 2, 3)) +>x : Symbol(x, Decl(emitArrowFunction.ts, 2, 10)) +>y : Symbol(y, Decl(emitArrowFunction.ts, 2, 20)) +>rest : Symbol(rest, Decl(emitArrowFunction.ts, 2, 31)) + +var f4 = (x: string, y: number, z = 10) => { } +>f4 : Symbol(f4, Decl(emitArrowFunction.ts, 3, 3)) +>x : Symbol(x, Decl(emitArrowFunction.ts, 3, 10)) +>y : Symbol(y, Decl(emitArrowFunction.ts, 3, 20)) +>z : Symbol(z, Decl(emitArrowFunction.ts, 3, 31)) + +function foo(func: () => boolean) { } +>foo : Symbol(foo, Decl(emitArrowFunction.ts, 3, 46)) +>func : Symbol(func, Decl(emitArrowFunction.ts, 4, 13)) + +foo(() => true); +>foo : Symbol(foo, Decl(emitArrowFunction.ts, 3, 46)) + +foo(() => { return false; }); +>foo : Symbol(foo, Decl(emitArrowFunction.ts, 3, 46)) + diff --git a/tests/baselines/reference/emitArrowFunction.types b/tests/baselines/reference/emitArrowFunction.types index 030ed0cde60..2ac9ef07af4 100644 --- a/tests/baselines/reference/emitArrowFunction.types +++ b/tests/baselines/reference/emitArrowFunction.types @@ -22,6 +22,7 @@ var f4 = (x: string, y: number, z = 10) => { } >x : string >y : number >z : number +>10 : number function foo(func: () => boolean) { } >foo : (func: () => boolean) => void @@ -31,9 +32,11 @@ foo(() => true); >foo(() => true) : void >foo : (func: () => boolean) => void >() => true : () => boolean +>true : boolean foo(() => { return false; }); >foo(() => { return false; }) : void >foo : (func: () => boolean) => void >() => { return false; } : () => boolean +>false : boolean diff --git a/tests/baselines/reference/emitArrowFunctionAsIs.symbols b/tests/baselines/reference/emitArrowFunctionAsIs.symbols new file mode 100644 index 00000000000..d853996ccd9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionAsIs.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIs.ts === +var arrow1 = a => { }; +>arrow1 : Symbol(arrow1, Decl(emitArrowFunctionAsIs.ts, 0, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIs.ts, 0, 12)) + +var arrow2 = (a) => { }; +>arrow2 : Symbol(arrow2, Decl(emitArrowFunctionAsIs.ts, 1, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIs.ts, 1, 14)) + +var arrow3 = (a, b) => { }; +>arrow3 : Symbol(arrow3, Decl(emitArrowFunctionAsIs.ts, 3, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIs.ts, 3, 14)) +>b : Symbol(b, Decl(emitArrowFunctionAsIs.ts, 3, 16)) + diff --git a/tests/baselines/reference/emitArrowFunctionAsIsES6.symbols b/tests/baselines/reference/emitArrowFunctionAsIsES6.symbols new file mode 100644 index 00000000000..c435db55648 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionAsIsES6.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionAsIsES6.ts === +var arrow1 = a => { }; +>arrow1 : Symbol(arrow1, Decl(emitArrowFunctionAsIsES6.ts, 0, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIsES6.ts, 0, 12)) + +var arrow2 = (a) => { }; +>arrow2 : Symbol(arrow2, Decl(emitArrowFunctionAsIsES6.ts, 1, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIsES6.ts, 1, 14)) + +var arrow3 = (a, b) => { }; +>arrow3 : Symbol(arrow3, Decl(emitArrowFunctionAsIsES6.ts, 3, 3)) +>a : Symbol(a, Decl(emitArrowFunctionAsIsES6.ts, 3, 14)) +>b : Symbol(b, Decl(emitArrowFunctionAsIsES6.ts, 3, 16)) + diff --git a/tests/baselines/reference/emitArrowFunctionES6.symbols b/tests/baselines/reference/emitArrowFunctionES6.symbols new file mode 100644 index 00000000000..06f83f7f6f0 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionES6.symbols @@ -0,0 +1,74 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionES6.ts === +var f1 = () => { } +>f1 : Symbol(f1, Decl(emitArrowFunctionES6.ts, 0, 3)) + +var f2 = (x: string, y: string) => { } +>f2 : Symbol(f2, Decl(emitArrowFunctionES6.ts, 1, 3)) +>x : Symbol(x, Decl(emitArrowFunctionES6.ts, 1, 10)) +>y : Symbol(y, Decl(emitArrowFunctionES6.ts, 1, 20)) + +var f3 = (x: string, y: number, ...rest) => { } +>f3 : Symbol(f3, Decl(emitArrowFunctionES6.ts, 2, 3)) +>x : Symbol(x, Decl(emitArrowFunctionES6.ts, 2, 10)) +>y : Symbol(y, Decl(emitArrowFunctionES6.ts, 2, 20)) +>rest : Symbol(rest, Decl(emitArrowFunctionES6.ts, 2, 31)) + +var f4 = (x: string, y: number, z=10) => { } +>f4 : Symbol(f4, Decl(emitArrowFunctionES6.ts, 3, 3)) +>x : Symbol(x, Decl(emitArrowFunctionES6.ts, 3, 10)) +>y : Symbol(y, Decl(emitArrowFunctionES6.ts, 3, 20)) +>z : Symbol(z, Decl(emitArrowFunctionES6.ts, 3, 31)) + +function foo(func: () => boolean) { } +>foo : Symbol(foo, Decl(emitArrowFunctionES6.ts, 3, 44)) +>func : Symbol(func, Decl(emitArrowFunctionES6.ts, 4, 13)) + +foo(() => true); +>foo : Symbol(foo, Decl(emitArrowFunctionES6.ts, 3, 44)) + +foo(() => { return false; }); +>foo : Symbol(foo, Decl(emitArrowFunctionES6.ts, 3, 44)) + +// Binding patterns in arrow functions +var p1 = ([a]) => { }; +>p1 : Symbol(p1, Decl(emitArrowFunctionES6.ts, 9, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 9, 11)) + +var p2 = ([...a]) => { }; +>p2 : Symbol(p2, Decl(emitArrowFunctionES6.ts, 10, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 10, 11)) + +var p3 = ([, a]) => { }; +>p3 : Symbol(p3, Decl(emitArrowFunctionES6.ts, 11, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 11, 12)) + +var p4 = ([, ...a]) => { }; +>p4 : Symbol(p4, Decl(emitArrowFunctionES6.ts, 12, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 12, 12)) + +var p5 = ([a = 1]) => { }; +>p5 : Symbol(p5, Decl(emitArrowFunctionES6.ts, 13, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 13, 11)) + +var p6 = ({ a }) => { }; +>p6 : Symbol(p6, Decl(emitArrowFunctionES6.ts, 14, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 14, 11)) + +var p7 = ({ a: { b } }) => { }; +>p7 : Symbol(p7, Decl(emitArrowFunctionES6.ts, 15, 3)) +>b : Symbol(b, Decl(emitArrowFunctionES6.ts, 15, 16)) + +var p8 = ({ a = 1 }) => { }; +>p8 : Symbol(p8, Decl(emitArrowFunctionES6.ts, 16, 3)) +>a : Symbol(a, Decl(emitArrowFunctionES6.ts, 16, 11)) + +var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; +>p9 : Symbol(p9, Decl(emitArrowFunctionES6.ts, 17, 3)) +>b : Symbol(b, Decl(emitArrowFunctionES6.ts, 17, 16)) +>b : Symbol(b, Decl(emitArrowFunctionES6.ts, 17, 28)) + +var p10 = ([{ value, done }]) => { }; +>p10 : Symbol(p10, Decl(emitArrowFunctionES6.ts, 18, 3)) +>value : Symbol(value, Decl(emitArrowFunctionES6.ts, 18, 13)) +>done : Symbol(done, Decl(emitArrowFunctionES6.ts, 18, 20)) + diff --git a/tests/baselines/reference/emitArrowFunctionES6.types b/tests/baselines/reference/emitArrowFunctionES6.types index 6f47b51a167..e2ad176fd7d 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.types +++ b/tests/baselines/reference/emitArrowFunctionES6.types @@ -22,6 +22,7 @@ var f4 = (x: string, y: number, z=10) => { } >x : string >y : number >z : number +>10 : number function foo(func: () => boolean) { } >foo : (func: () => boolean) => void @@ -31,11 +32,13 @@ foo(() => true); >foo(() => true) : void >foo : (func: () => boolean) => void >() => true : () => boolean +>true : boolean foo(() => { return false; }); >foo(() => { return false; }) : void >foo : (func: () => boolean) => void >() => { return false; } : () => boolean +>false : boolean // Binding patterns in arrow functions var p1 = ([a]) => { }; @@ -51,17 +54,20 @@ var p2 = ([...a]) => { }; var p3 = ([, a]) => { }; >p3 : ([, a]: [any, any]) => void >([, a]) => { } : ([, a]: [any, any]) => void +> : undefined >a : any var p4 = ([, ...a]) => { }; >p4 : ([, ...a]: Iterable) => void >([, ...a]) => { } : ([, ...a]: Iterable) => void +> : undefined >a : any[] var p5 = ([a = 1]) => { }; >p5 : ([a = 1]: [number]) => void >([a = 1]) => { } : ([a = 1]: [number]) => void >a : number +>1 : number var p6 = ({ a }) => { }; >p6 : ({ a }: { a: any; }) => void @@ -71,21 +77,24 @@ var p6 = ({ a }) => { }; var p7 = ({ a: { b } }) => { }; >p7 : ({ a: { b } }: { a: { b: any; }; }) => void >({ a: { b } }) => { } : ({ a: { b } }: { a: { b: any; }; }) => void ->a : unknown +>a : any >b : any var p8 = ({ a = 1 }) => { }; >p8 : ({ a = 1 }: { a?: number; }) => void >({ a = 1 }) => { } : ({ a = 1 }: { a?: number; }) => void >a : number +>1 : number var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; >p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void >({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void ->a : unknown +>a : any >b : number +>1 : number >{ b: 1 } : { b: number; } >b : number +>1 : number var p10 = ([{ value, done }]) => { }; >p10 : ([{ value, done }]: [{ value: any; done: any; }]) => void diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturing.symbols b/tests/baselines/reference/emitArrowFunctionThisCapturing.symbols new file mode 100644 index 00000000000..ad62a0df5be --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionThisCapturing.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturing.ts === +var f1 = () => { +>f1 : Symbol(f1, Decl(emitArrowFunctionThisCapturing.ts, 0, 3)) + + this.age = 10 +}; + +var f2 = (x: string) => { +>f2 : Symbol(f2, Decl(emitArrowFunctionThisCapturing.ts, 4, 3)) +>x : Symbol(x, Decl(emitArrowFunctionThisCapturing.ts, 4, 10)) + + this.name = x +>x : Symbol(x, Decl(emitArrowFunctionThisCapturing.ts, 4, 10)) +} + +function foo(func: () => boolean) { } +>foo : Symbol(foo, Decl(emitArrowFunctionThisCapturing.ts, 6, 1)) +>func : Symbol(func, Decl(emitArrowFunctionThisCapturing.ts, 8, 13)) + +foo(() => { +>foo : Symbol(foo, Decl(emitArrowFunctionThisCapturing.ts, 6, 1)) + + this.age = 100; + return true; +}); + diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturing.types b/tests/baselines/reference/emitArrowFunctionThisCapturing.types index 433f38e5ecc..2cfe06579af 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturing.types +++ b/tests/baselines/reference/emitArrowFunctionThisCapturing.types @@ -8,6 +8,7 @@ var f1 = () => { >this.age : any >this : any >age : any +>10 : number }; @@ -38,7 +39,10 @@ foo(() => { >this.age : any >this : any >age : any +>100 : number return true; +>true : boolean + }); diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.symbols b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.symbols new file mode 100644 index 00000000000..0e8855dd680 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionThisCapturingES6.ts === +var f1 = () => { +>f1 : Symbol(f1, Decl(emitArrowFunctionThisCapturingES6.ts, 0, 3)) + + this.age = 10 +}; + +var f2 = (x: string) => { +>f2 : Symbol(f2, Decl(emitArrowFunctionThisCapturingES6.ts, 4, 3)) +>x : Symbol(x, Decl(emitArrowFunctionThisCapturingES6.ts, 4, 10)) + + this.name = x +>x : Symbol(x, Decl(emitArrowFunctionThisCapturingES6.ts, 4, 10)) +} + +function foo(func: () => boolean){ } +>foo : Symbol(foo, Decl(emitArrowFunctionThisCapturingES6.ts, 6, 1)) +>func : Symbol(func, Decl(emitArrowFunctionThisCapturingES6.ts, 8, 13)) + +foo(() => { +>foo : Symbol(foo, Decl(emitArrowFunctionThisCapturingES6.ts, 6, 1)) + + this.age = 100; + return true; +}); + diff --git a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types index 989130ef280..cc5405cebb4 100644 --- a/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types +++ b/tests/baselines/reference/emitArrowFunctionThisCapturingES6.types @@ -8,6 +8,7 @@ var f1 = () => { >this.age : any >this : any >age : any +>10 : number }; @@ -38,7 +39,10 @@ foo(() => { >this.age : any >this : any >age : any +>100 : number return true; +>true : boolean + }); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt deleted file mode 100644 index 2f5ca2a387c..00000000000 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.errors.txt +++ /dev/null @@ -1,46 +0,0 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - - -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments.ts (4 errors) ==== - var a = () => { - var arg = arguments[0]; // error - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - - var b = function () { - var a = () => { - var arg = arguments[0]; // error - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - } - - function baz() { - () => { - var arg = arguments[0]; - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - } - } - - function foo(inputFunc: () => void) { } - foo(() => { - var arg = arguments[0]; // error - ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. - }); - - function bar() { - var arg = arguments[0]; // no error - } - - - () => { - function foo() { - var arg = arguments[0]; // no error - } - } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt similarity index 53% rename from tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt rename to tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt index 26f204d3ee6..1137835c2c2 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.errors.txt +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.errors.txt @@ -1,21 +1,21 @@ -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. -tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(7,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(13,13): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts(19,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. -==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6.ts (4 errors) ==== +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01.ts (4 errors) ==== var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } var b = function () { var a = () => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } } @@ -23,7 +23,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6 () => { var arg = arguments[0]; ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. } } @@ -31,7 +31,7 @@ tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArgumentsES6 foo(() => { var arg = arguments[0]; // error ~~~~~~~~~ -!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression. +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. }); function bar() { diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.js similarity index 78% rename from tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js rename to tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.js index 2f84d0843de..40a2748fdae 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArgumentsES6.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01.js @@ -1,4 +1,4 @@ -//// [emitArrowFunctionWhenUsingArgumentsES6.ts] +//// [emitArrowFunctionWhenUsingArguments01.ts] var a = () => { var arg = arguments[0]; // error } @@ -31,28 +31,28 @@ function bar() { } } -//// [emitArrowFunctionWhenUsingArgumentsES6.js] -var a = () => { +//// [emitArrowFunctionWhenUsingArguments01.js] +var a = function () { var arg = arguments[0]; // error }; var b = function () { - var a = () => { + var a = function () { var arg = arguments[0]; // error }; }; function baz() { - (() => { + (function () { var arg = arguments[0]; }); } function foo(inputFunc) { } -foo(() => { +foo(function () { var arg = arguments[0]; // error }); function bar() { var arg = arguments[0]; // no error } -(() => { +(function () { function foo() { var arg = arguments[0]; // no error } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.js similarity index 86% rename from tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js rename to tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.js index 589449fad62..6641e28b867 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.js @@ -1,4 +1,4 @@ -//// [emitArrowFunctionWhenUsingArguments.ts] +//// [emitArrowFunctionWhenUsingArguments01_ES6.ts] var a = () => { var arg = arguments[0]; // error } @@ -31,7 +31,7 @@ function bar() { } } -//// [emitArrowFunctionWhenUsingArguments.js] +//// [emitArrowFunctionWhenUsingArguments01_ES6.js] var a = () => { var arg = arguments[0]; // error }; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols new file mode 100644 index 00000000000..698b32da7ad --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts === +var a = () => { +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 0, 3)) + + var arg = arguments[0]; // error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 1, 7)) +>arguments : Symbol(arguments) +} + +var b = function () { +>b : Symbol(b, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 4, 3)) + + var a = () => { +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 5, 7)) + + var arg = arguments[0]; // error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 6, 11)) +>arguments : Symbol(arguments) + } +} + +function baz() { +>baz : Symbol(baz, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 8, 1)) + + () => { + var arg = arguments[0]; +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 12, 5)) +>arguments : Symbol(arguments) + } +} + +function foo(inputFunc: () => void) { } +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 14, 1)) +>inputFunc : Symbol(inputFunc, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 16, 13)) + +foo(() => { +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 14, 1)) + + var arg = arguments[0]; // error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 18, 7)) +>arguments : Symbol(arguments) + +}); + +function bar() { +>bar : Symbol(bar, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 19, 3)) + + var arg = arguments[0]; // no error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 22, 7)) +>arguments : Symbol(arguments) +} + + +() => { + function foo() { +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 26, 7)) + + var arg = arguments[0]; // no error +>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 28, 5)) +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types new file mode 100644 index 00000000000..669bf411e63 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types @@ -0,0 +1,83 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts === +var a = () => { +>a : () => void +>() => { var arg = arguments[0]; // error} : () => void + + var arg = arguments[0]; // error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number +} + +var b = function () { +>b : () => void +>function () { var a = () => { var arg = arguments[0]; // error }} : () => void + + var a = () => { +>a : () => void +>() => { var arg = arguments[0]; // error } : () => void + + var arg = arguments[0]; // error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + } +} + +function baz() { +>baz : () => void + + () => { +>() => { var arg = arguments[0]; } : () => void + + var arg = arguments[0]; +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + } +} + +function foo(inputFunc: () => void) { } +>foo : (inputFunc: () => void) => void +>inputFunc : () => void + +foo(() => { +>foo(() => { var arg = arguments[0]; // error}) : void +>foo : (inputFunc: () => void) => void +>() => { var arg = arguments[0]; // error} : () => void + + var arg = arguments[0]; // error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + +}); + +function bar() { +>bar : () => void + + var arg = arguments[0]; // no error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number +} + + +() => { +>() => { function foo() { var arg = arguments[0]; // no error }} : () => void + + function foo() { +>foo : () => void + + var arg = arguments[0]; // no error +>arg : any +>arguments[0] : any +>arguments : IArguments +>0 : number + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt new file mode 100644 index 00000000000..55f0ce2230a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts(2,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02.ts (1 errors) ==== + + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.js new file mode 100644 index 00000000000..b6774dd5407 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02.js @@ -0,0 +1,6 @@ +//// [emitArrowFunctionWhenUsingArguments02.ts] + +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments02.js] +var a = function () { return arguments; }; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.js new file mode 100644 index 00000000000..0f35b8898b2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.js @@ -0,0 +1,6 @@ +//// [emitArrowFunctionWhenUsingArguments02_ES6.ts] + +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments02_ES6.js] +var a = () => arguments; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols new file mode 100644 index 00000000000..e403a2c3da1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts === + +var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments02_ES6.ts, 1, 3)) +>arguments : Symbol(arguments) + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types new file mode 100644 index 00000000000..fe5ac353ce6 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts === + +var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt new file mode 100644 index 00000000000..d914e14d93a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.errors.txt @@ -0,0 +1,9 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts(3,15): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03.ts (1 errors) ==== + + var arguments; + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.js new file mode 100644 index 00000000000..5b57f7acf0d --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03.js @@ -0,0 +1,8 @@ +//// [emitArrowFunctionWhenUsingArguments03.ts] + +var arguments; +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments03.js] +var arguments; +var a = function () { return arguments; }; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.js new file mode 100644 index 00000000000..d4d35e7abdc --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.js @@ -0,0 +1,8 @@ +//// [emitArrowFunctionWhenUsingArguments03_ES6.ts] + +var arguments; +var a = () => arguments; + +//// [emitArrowFunctionWhenUsingArguments03_ES6.js] +var arguments; +var a = () => arguments; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols new file mode 100644 index 00000000000..08bae382794 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts === + +var arguments; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 1, 3)) + +var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 2, 3)) +>arguments : Symbol(arguments) + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types new file mode 100644 index 00000000000..33a45a39af1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts === + +var arguments; +>arguments : any + +var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments + diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt new file mode 100644 index 00000000000..12e416f893f --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts(4,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04.ts (1 errors) ==== + + function f() { + var arguments; + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.js new file mode 100644 index 00000000000..588610a4022 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments04.ts] + +function f() { + var arguments; + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments04.js] +function f() { + var arguments; + var a = function () { return arguments; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.js new file mode 100644 index 00000000000..63e896039c9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments04_ES6.ts] + +function f() { + var arguments; + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments04_ES6.js] +function f() { + var arguments; + var a = () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols new file mode 100644 index 00000000000..708615a95c6 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 0, 0)) + + var arguments; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 2, 7)) + + var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 3, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types new file mode 100644 index 00000000000..495ca1582e6 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts === + +function f() { +>f : () => void + + var arguments; +>arguments : any + + var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt new file mode 100644 index 00000000000..4256dab30c2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts(3,19): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05.ts (1 errors) ==== + + function f(arguments) { + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.js new file mode 100644 index 00000000000..b4ed2b383b7 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments05.ts] + +function f(arguments) { + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments05.js] +function f(arguments) { + var a = function () { return arguments; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.js new file mode 100644 index 00000000000..9fe68e9bb48 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments05_ES6.ts] + +function f(arguments) { + var a = () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments05_ES6.js] +function f(arguments) { + var a = () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols new file mode 100644 index 00000000000..379a5cf92f1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 1, 11)) + + var a = () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 2, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types new file mode 100644 index 00000000000..4e9da2f642b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => arguments; +>a : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt new file mode 100644 index 00000000000..5b078f22f44 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06.ts (1 errors) ==== + + function f(arguments) { + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.js new file mode 100644 index 00000000000..d004b77e947 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments06.ts] + +function f(arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments06.js] +function f(arguments) { + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.js new file mode 100644 index 00000000000..6b83e0c60d9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments06_ES6.ts] + +function f(arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments06_ES6.js] +function f(arguments) { + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols new file mode 100644 index 00000000000..e59f487f864 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 1, 11)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 2, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types new file mode 100644 index 00000000000..82571174a1e --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt new file mode 100644 index 00000000000..da1f7dd28f9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts(3,34): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07.ts (1 errors) ==== + + function f(arguments) { + var a = (arguments) => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.js new file mode 100644 index 00000000000..7f06036dfc1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments07.ts] + +function f(arguments) { + var a = (arguments) => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments07.js] +function f(arguments) { + var a = function (arguments) { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.js new file mode 100644 index 00000000000..bdc8cf82d44 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments07_ES6.ts] + +function f(arguments) { + var a = (arguments) => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments07_ES6.js] +function f(arguments) { + var a = (arguments) => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols new file mode 100644 index 00000000000..5de21ffbebd --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 1, 11)) + + var a = (arguments) => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 2, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 2, 13)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types new file mode 100644 index 00000000000..967631cc57b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = (arguments) => () => arguments; +>a : (arguments: any) => () => IArguments +>(arguments) => () => arguments : (arguments: any) => () => IArguments +>arguments : any +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.js new file mode 100644 index 00000000000..dbb89d4eb6b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments08.ts] + +function f(arguments) { + var a = () => (arguments) => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments08.js] +function f(arguments) { + var a = function () { return function (arguments) { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.symbols new file mode 100644 index 00000000000..80f7f507978 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments08.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08.ts, 1, 11)) + + var a = () => (arguments) => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments08.ts, 2, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08.ts, 2, 19)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08.ts, 2, 19)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types new file mode 100644 index 00000000000..4b6d1e19b4a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => (arguments) => arguments; +>a : () => (arguments: any) => any +>() => (arguments) => arguments : () => (arguments: any) => any +>(arguments) => arguments : (arguments: any) => any +>arguments : any +>arguments : any +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.js new file mode 100644 index 00000000000..ee568185c0a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments08_ES6.ts] + +function f(arguments) { + var a = () => (arguments) => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments08_ES6.js] +function f(arguments) { + var a = () => (arguments) => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.symbols new file mode 100644 index 00000000000..bfbb055cc32 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 1, 11)) + + var a = () => (arguments) => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 2, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 2, 19)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments08_ES6.ts, 2, 19)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types new file mode 100644 index 00000000000..ffa0f7f0bca --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var a = () => (arguments) => arguments; +>a : () => (arguments: any) => any +>() => (arguments) => arguments : () => (arguments: any) => any +>(arguments) => arguments : (arguments: any) => any +>arguments : any +>arguments : any +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt new file mode 100644 index 00000000000..72239150cf3 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts(3,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09.ts (1 errors) ==== + + function f(_arguments) { + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.js new file mode 100644 index 00000000000..c879e6f1ce9 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments09.ts] + +function f(_arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments09.js] +function f(_arguments) { + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.js new file mode 100644 index 00000000000..15932510d39 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.js @@ -0,0 +1,10 @@ +//// [emitArrowFunctionWhenUsingArguments09_ES6.ts] + +function f(_arguments) { + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments09_ES6.js] +function f(_arguments) { + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.symbols new file mode 100644 index 00000000000..ff8f114c052 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts === + +function f(_arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 0, 0)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 1, 11)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 2, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.types new file mode 100644 index 00000000000..77f44eebfca --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments09_ES6.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts === + +function f(_arguments) { +>f : (_arguments: any) => void +>_arguments : any + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt new file mode 100644 index 00000000000..254ad2cbc4d --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10.ts (1 errors) ==== + + function f() { + var _arguments = 10; + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.js new file mode 100644 index 00000000000..a0da99f796c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments10.ts] + +function f() { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments10.js] +function f() { + var _arguments = 10; + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.js new file mode 100644 index 00000000000..83d2b735829 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments10_ES6.ts] + +function f() { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments10_ES6.js] +function f() { + var _arguments = 10; + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.symbols new file mode 100644 index 00000000000..1d9965fa6ad --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 0, 0)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 2, 7)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 3, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types new file mode 100644 index 00000000000..dd567d3bdca --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments10_ES6.types @@ -0,0 +1,15 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts === + +function f() { +>f : () => void + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt new file mode 100644 index 00000000000..0606a7784b3 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts(4,25): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11.ts (1 errors) ==== + + function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.js new file mode 100644 index 00000000000..13c1c771c34 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments11.ts] + +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments11.js] +function f(arguments) { + var _arguments = 10; + var a = function () { return function () { return arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.js new file mode 100644 index 00000000000..9616d2d351c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments11_ES6.ts] + +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} + +//// [emitArrowFunctionWhenUsingArguments11_ES6.js] +function f(arguments) { + var _arguments = 10; + var a = () => () => arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols new file mode 100644 index 00000000000..a8f9c86c1b2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts === + +function f(arguments) { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 0, 0)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 1, 11)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 2, 7)) + + var a = () => () => arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 3, 7)) +>arguments : Symbol(arguments) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types new file mode 100644 index 00000000000..b977a77010c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts === + +function f(arguments) { +>f : (arguments: any) => void +>arguments : any + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = () => () => arguments; +>a : () => () => IArguments +>() => () => arguments : () => () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt new file mode 100644 index 00000000000..4b2dd76a5d0 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts(3,7): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts(4,23): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12.ts (2 errors) ==== + + class C { + f(arguments) { + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js new file mode 100644 index 00000000000..df4fddd3b32 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12.js @@ -0,0 +1,17 @@ +//// [emitArrowFunctionWhenUsingArguments12.ts] + +class C { + f(arguments) { + var a = () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments12.js] +var C = (function () { + function C() { + } + C.prototype.f = function (arguments) { + var a = function () { return arguments; }; + }; + return C; +})(); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt new file mode 100644 index 00000000000..8a3018ceb9c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts(3,7): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments12_ES6.ts (1 errors) ==== + + class C { + f(arguments) { + ~~~~~~~~~ +!!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. + var a = () => arguments; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.js new file mode 100644 index 00000000000..8e7631f6fed --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.js @@ -0,0 +1,14 @@ +//// [emitArrowFunctionWhenUsingArguments12_ES6.ts] + +class C { + f(arguments) { + var a = () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments12_ES6.js] +class C { + f(arguments) { + var a = () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.js new file mode 100644 index 00000000000..ead0a96dacd --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments13.ts] + +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} + +//// [emitArrowFunctionWhenUsingArguments13.js] +function f() { + var _arguments = 10; + var a = function (arguments) { return function () { return _arguments; }; }; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.symbols new file mode 100644 index 00000000000..b46d8ab1a63 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments13.ts, 0, 0)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13.ts, 2, 7)) + + var a = (arguments) => () => _arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments13.ts, 3, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments13.ts, 3, 13)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13.ts, 2, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types new file mode 100644 index 00000000000..6e5a7555315 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts === + +function f() { +>f : () => void + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = (arguments) => () => _arguments; +>a : (arguments: any) => () => number +>(arguments) => () => _arguments : (arguments: any) => () => number +>arguments : any +>() => _arguments : () => number +>_arguments : number +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.js new file mode 100644 index 00000000000..818d27a1f57 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.js @@ -0,0 +1,12 @@ +//// [emitArrowFunctionWhenUsingArguments13_ES6.ts] + +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} + +//// [emitArrowFunctionWhenUsingArguments13_ES6.js] +function f() { + var _arguments = 10; + var a = (arguments) => () => _arguments; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.symbols new file mode 100644 index 00000000000..5c4ec4cb687 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 0, 0)) + + var _arguments = 10; +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 2, 7)) + + var a = (arguments) => () => _arguments; +>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 3, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 3, 13)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments13_ES6.ts, 2, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types new file mode 100644 index 00000000000..294f5c692e4 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments13_ES6.types @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts === + +function f() { +>f : () => void + + var _arguments = 10; +>_arguments : number +>10 : number + + var a = (arguments) => () => _arguments; +>a : (arguments: any) => () => number +>(arguments) => () => _arguments : (arguments: any) => () => number +>arguments : any +>() => _arguments : () => number +>_arguments : number +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt new file mode 100644 index 00000000000..8e38cb9d4d3 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14.ts (1 errors) ==== + + function f() { + if (Math.random()) { + const arguments = 100; + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.js new file mode 100644 index 00000000000..bd94a2fda9c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments14.ts] + +function f() { + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments14.js] +function f() { + if (Math.random()) { + var arguments_1 = 100; + return function () { return arguments; }; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.js new file mode 100644 index 00000000000..cea4589debb --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments14_ES6.ts] + +function f() { + if (Math.random()) { + let arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments14_ES6.js] +function f() { + if (Math.random()) { + let arguments = 100; + return () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols new file mode 100644 index 00000000000..623cc4c9690 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 0, 0)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + let arguments = 100; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 3, 11)) + + return () => arguments; +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types new file mode 100644 index 00000000000..29989ea0f9c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts === + +function f() { +>f : () => () => IArguments + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + let arguments = 100; +>arguments : number +>100 : number + + return () => arguments; +>() => arguments : () => IArguments +>arguments : IArguments + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt new file mode 100644 index 00000000000..02fb22861c5 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts(6,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15.ts (1 errors) ==== + + function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.js new file mode 100644 index 00000000000..bc5f7dca7ee --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments15.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments15.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + var arguments_1 = 100; + return function () { return arguments; }; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.js new file mode 100644 index 00000000000..0fa3c9d5f64 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments15_ES6.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments15_ES6.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + const arguments = 100; + return () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols new file mode 100644 index 00000000000..d140c21284c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 0, 0)) + + var arguments = "hello"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 2, 7)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + const arguments = 100; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 4, 13)) + + return () => arguments; +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types new file mode 100644 index 00000000000..0bb34b22eef --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts === + +function f() { +>f : () => () => IArguments + + var arguments = "hello"; +>arguments : string +>"hello" : string + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + const arguments = 100; +>arguments : number +>100 : number + + return () => arguments; +>() => arguments : () => IArguments +>arguments : IArguments + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt new file mode 100644 index 00000000000..4480e0f570a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16.ts (1 errors) ==== + + function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + var arguments = "world"; + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.js new file mode 100644 index 00000000000..0a87a3c6ac2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments16.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments16.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + return function () { return arguments[0]; }; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.js new file mode 100644 index 00000000000..b9aaf7240a7 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments16_ES6.ts] + +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments16_ES6.js] +function f() { + var arguments = "hello"; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols new file mode 100644 index 00000000000..e970b527d56 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 0, 0)) + + var arguments = "hello"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 2, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 6, 7)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + return () => arguments[0]; +>arguments : Symbol(arguments) + } + var arguments = "world"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 2, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 6, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types new file mode 100644 index 00000000000..41c6b87fb42 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types @@ -0,0 +1,25 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts === + +function f() { +>f : () => () => any + + var arguments = "hello"; +>arguments : string +>"hello" : string + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + return () => arguments[0]; +>() => arguments[0] : () => any +>arguments[0] : any +>arguments : IArguments +>0 : number + } + var arguments = "world"; +>arguments : string +>"world" : string +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt new file mode 100644 index 00000000000..a54d52e3475 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17.ts (1 errors) ==== + + function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + var arguments = "world"; + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js new file mode 100644 index 00000000000..8a845ab0cb2 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments17.ts] + +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments17.js] +function f() { + var arguments = { arguments: "hello" }.arguments; + if (Math.random()) { + return function () { return arguments[0]; }; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.js new file mode 100644 index 00000000000..1d1a8ece338 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.js @@ -0,0 +1,18 @@ +//// [emitArrowFunctionWhenUsingArguments17_ES6.ts] + +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} + +//// [emitArrowFunctionWhenUsingArguments17_ES6.js] +function f() { + var { arguments } = { arguments: "hello" }; + if (Math.random()) { + return () => arguments[0]; + } + var arguments = "world"; +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols new file mode 100644 index 00000000000..8612e0896d1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 0, 0)) + + var { arguments } = { arguments: "hello" }; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 6, 7)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 25)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + return () => arguments[0]; +>arguments : Symbol(arguments) + } + var arguments = "world"; +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 6, 7)) +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types new file mode 100644 index 00000000000..f62a2dce84c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types @@ -0,0 +1,27 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts === + +function f() { +>f : () => () => any + + var { arguments } = { arguments: "hello" }; +>arguments : string +>{ arguments: "hello" } : { arguments: string; } +>arguments : string +>"hello" : string + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + return () => arguments[0]; +>() => arguments[0] : () => any +>arguments[0] : any +>arguments : IArguments +>0 : number + } + var arguments = "world"; +>arguments : string +>"world" : string +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt new file mode 100644 index 00000000000..2595b22801f --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts(5,22): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18.ts (1 errors) ==== + + function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js new file mode 100644 index 00000000000..dc40302892b --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments18.ts] + +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments18.js] +function f() { + var args = { arguments: arguments }.arguments; + if (Math.random()) { + return function () { return arguments; }; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.js new file mode 100644 index 00000000000..ae9e7e4ef10 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.js @@ -0,0 +1,16 @@ +//// [emitArrowFunctionWhenUsingArguments18_ES6.ts] + +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} + +//// [emitArrowFunctionWhenUsingArguments18_ES6.js] +function f() { + var { arguments: args } = { arguments }; + if (Math.random()) { + return () => arguments; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols new file mode 100644 index 00000000000..96f9712635c --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 0, 0)) + + var { arguments: args } = { arguments }; +>args : Symbol(args, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 2, 9)) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 2, 31)) + + if (Math.random()) { +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + return () => arguments; +>arguments : Symbol(arguments) + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.types new file mode 100644 index 00000000000..f2fe76e8926 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts === + +function f() { +>f : () => () => IArguments + + var { arguments: args } = { arguments }; +>arguments : any +>args : IArguments +>{ arguments } : { arguments: IArguments; } +>arguments : IArguments + + if (Math.random()) { +>Math.random() : number +>Math.random : () => number +>Math : Math +>random : () => number + + return () => arguments; +>() => arguments : () => IArguments +>arguments : IArguments + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt new file mode 100644 index 00000000000..e6496443e7e --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.errors.txt @@ -0,0 +1,20 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts(6,33): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19.ts (1 errors) ==== + + function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + ~~~~~~~~~ +!!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression. + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.js new file mode 100644 index 00000000000..566c0aa49cd --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19.js @@ -0,0 +1,29 @@ +//// [emitArrowFunctionWhenUsingArguments19.ts] + +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } +} + +//// [emitArrowFunctionWhenUsingArguments19.js] +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = function () { return arguments; }; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + function foo(x) { + return 100; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.js new file mode 100644 index 00000000000..e41aed4f4bf --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.js @@ -0,0 +1,29 @@ +//// [emitArrowFunctionWhenUsingArguments19_ES6.ts] + +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + + function foo(x: any) { + return 100; + } +} + +//// [emitArrowFunctionWhenUsingArguments19_ES6.js] +function f() { + function g() { + var _arguments = 10; // No capture in 'g', so no conflict. + function h() { + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' + } + } + function foo(x) { + return 100; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.symbols new file mode 100644 index 00000000000..9e6392daaf1 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts === + +function f() { +>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 0, 0)) + + function g() { +>g : Symbol(g, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 1, 14)) + + var _arguments = 10; // No capture in 'g', so no conflict. +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 11)) + + function h() { +>h : Symbol(h, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 28)) + + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' +>capture : Symbol(capture, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 5, 15)) +>arguments : Symbol(arguments) + + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 8, 5)) +>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 11)) + } + } + + function foo(x: any) { +>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 8, 5)) +>x : Symbol(x, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 10, 17)) + + return 100; + } +} diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types new file mode 100644 index 00000000000..a672389720a --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments19_ES6.types @@ -0,0 +1,35 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts === + +function f() { +>f : () => void + + function g() { +>g : () => void + + var _arguments = 10; // No capture in 'g', so no conflict. +>_arguments : number +>10 : number + + function h() { +>h : () => void + + var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' +>capture : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments + + foo(_arguments); // Error as this does not resolve to the user defined '_arguments' +>foo(_arguments) : number +>foo : (x: any) => number +>_arguments : number + } + } + + function foo(x: any) { +>foo : (x: any) => number +>x : any + + return 100; +>100 : number + } +} diff --git a/tests/baselines/reference/emitArrowFunctionsAsIs.symbols b/tests/baselines/reference/emitArrowFunctionsAsIs.symbols new file mode 100644 index 00000000000..73c68bd194d --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionsAsIs.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIs.ts === +var arrow1 = a => { }; +>arrow1 : Symbol(arrow1, Decl(emitArrowFunctionsAsIs.ts, 0, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIs.ts, 0, 12)) + +var arrow2 = (a) => { }; +>arrow2 : Symbol(arrow2, Decl(emitArrowFunctionsAsIs.ts, 1, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIs.ts, 1, 14)) + +var arrow3 = (a, b) => { }; +>arrow3 : Symbol(arrow3, Decl(emitArrowFunctionsAsIs.ts, 3, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIs.ts, 3, 14)) +>b : Symbol(b, Decl(emitArrowFunctionsAsIs.ts, 3, 16)) + diff --git a/tests/baselines/reference/emitArrowFunctionsAsIsES6.symbols b/tests/baselines/reference/emitArrowFunctionsAsIsES6.symbols new file mode 100644 index 00000000000..73f4df744e8 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionsAsIsES6.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionsAsIsES6.ts === +var arrow1 = a => { }; +>arrow1 : Symbol(arrow1, Decl(emitArrowFunctionsAsIsES6.ts, 0, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIsES6.ts, 0, 12)) + +var arrow2 = (a) => { }; +>arrow2 : Symbol(arrow2, Decl(emitArrowFunctionsAsIsES6.ts, 1, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIsES6.ts, 1, 14)) + +var arrow3 = (a, b) => { }; +>arrow3 : Symbol(arrow3, Decl(emitArrowFunctionsAsIsES6.ts, 3, 3)) +>a : Symbol(a, Decl(emitArrowFunctionsAsIsES6.ts, 3, 14)) +>b : Symbol(b, Decl(emitArrowFunctionsAsIsES6.ts, 3, 16)) + diff --git a/tests/baselines/reference/emitBOM.symbols b/tests/baselines/reference/emitBOM.symbols new file mode 100644 index 00000000000..85f495580d7 --- /dev/null +++ b/tests/baselines/reference/emitBOM.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/emitBOM.ts === + +// JS and d.ts output should have a BOM but not the sourcemap +var x; +>x : Symbol(x, Decl(emitBOM.ts, 2, 3)) + diff --git a/tests/baselines/reference/emitClassDeclarationOverloadInES6.symbols b/tests/baselines/reference/emitClassDeclarationOverloadInES6.symbols new file mode 100644 index 00000000000..8a3b157d546 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationOverloadInES6.symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationOverloadInES6.ts === +class C { +>C : Symbol(C, Decl(emitClassDeclarationOverloadInES6.ts, 0, 0)) + + constructor(y: any) +>y : Symbol(y, Decl(emitClassDeclarationOverloadInES6.ts, 1, 16)) + + constructor(x: number) { +>x : Symbol(x, Decl(emitClassDeclarationOverloadInES6.ts, 2, 16)) + } +} + +class D { +>D : Symbol(D, Decl(emitClassDeclarationOverloadInES6.ts, 4, 1)) + + constructor(y: any) +>y : Symbol(y, Decl(emitClassDeclarationOverloadInES6.ts, 7, 16)) + + constructor(x: number, z="hello") {} +>x : Symbol(x, Decl(emitClassDeclarationOverloadInES6.ts, 8, 16)) +>z : Symbol(z, Decl(emitClassDeclarationOverloadInES6.ts, 8, 26)) +} diff --git a/tests/baselines/reference/emitClassDeclarationOverloadInES6.types b/tests/baselines/reference/emitClassDeclarationOverloadInES6.types index 850a5aa5456..94cc2c88ddc 100644 --- a/tests/baselines/reference/emitClassDeclarationOverloadInES6.types +++ b/tests/baselines/reference/emitClassDeclarationOverloadInES6.types @@ -19,4 +19,5 @@ class D { constructor(x: number, z="hello") {} >x : number >z : string +>"hello" : string } diff --git a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.symbols new file mode 100644 index 00000000000..8186b029471 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithConstructorInES6.ts === +class A { +>A : Symbol(A, Decl(emitClassDeclarationWithConstructorInES6.ts, 0, 0)) + + y: number; +>y : Symbol(y, Decl(emitClassDeclarationWithConstructorInES6.ts, 0, 9)) + + constructor(x: number) { +>x : Symbol(x, Decl(emitClassDeclarationWithConstructorInES6.ts, 2, 16)) + } + foo(a: any); +>foo : Symbol(foo, Decl(emitClassDeclarationWithConstructorInES6.ts, 3, 5), Decl(emitClassDeclarationWithConstructorInES6.ts, 4, 16)) +>a : Symbol(a, Decl(emitClassDeclarationWithConstructorInES6.ts, 4, 8)) + + foo() { } +>foo : Symbol(foo, Decl(emitClassDeclarationWithConstructorInES6.ts, 3, 5), Decl(emitClassDeclarationWithConstructorInES6.ts, 4, 16)) +} + +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithConstructorInES6.ts, 6, 1)) + + y: number; +>y : Symbol(y, Decl(emitClassDeclarationWithConstructorInES6.ts, 8, 9)) + + x: string = "hello"; +>x : Symbol(x, Decl(emitClassDeclarationWithConstructorInES6.ts, 9, 14)) + + _bar: string; +>_bar : Symbol(_bar, Decl(emitClassDeclarationWithConstructorInES6.ts, 10, 24)) + + constructor(x: number, z = "hello", ...args) { +>x : Symbol(x, Decl(emitClassDeclarationWithConstructorInES6.ts, 13, 16)) +>z : Symbol(z, Decl(emitClassDeclarationWithConstructorInES6.ts, 13, 26)) +>args : Symbol(args, Decl(emitClassDeclarationWithConstructorInES6.ts, 13, 39)) + + this.y = 10; +>this.y : Symbol(y, Decl(emitClassDeclarationWithConstructorInES6.ts, 8, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithConstructorInES6.ts, 6, 1)) +>y : Symbol(y, Decl(emitClassDeclarationWithConstructorInES6.ts, 8, 9)) + } + baz(...args): string; +>baz : Symbol(baz, Decl(emitClassDeclarationWithConstructorInES6.ts, 15, 5), Decl(emitClassDeclarationWithConstructorInES6.ts, 16, 25)) +>args : Symbol(args, Decl(emitClassDeclarationWithConstructorInES6.ts, 16, 8)) + + baz(z: string, v: number): string { +>baz : Symbol(baz, Decl(emitClassDeclarationWithConstructorInES6.ts, 15, 5), Decl(emitClassDeclarationWithConstructorInES6.ts, 16, 25)) +>z : Symbol(z, Decl(emitClassDeclarationWithConstructorInES6.ts, 17, 8)) +>v : Symbol(v, Decl(emitClassDeclarationWithConstructorInES6.ts, 17, 18)) + + return this._bar; +>this._bar : Symbol(_bar, Decl(emitClassDeclarationWithConstructorInES6.ts, 10, 24)) +>this : Symbol(B, Decl(emitClassDeclarationWithConstructorInES6.ts, 6, 1)) +>_bar : Symbol(_bar, Decl(emitClassDeclarationWithConstructorInES6.ts, 10, 24)) + } +} + + + diff --git a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types index 10244bf6170..ecb48cb3047 100644 --- a/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithConstructorInES6.types @@ -24,6 +24,7 @@ class B { x: string = "hello"; >x : string +>"hello" : string _bar: string; >_bar : string @@ -31,6 +32,7 @@ class B { constructor(x: number, z = "hello", ...args) { >x : number >z : string +>"hello" : string >args : any[] this.y = 10; @@ -38,6 +40,7 @@ class B { >this.y : number >this : B >y : number +>10 : number } baz(...args): string; >baz : (...args: any[]) => string diff --git a/tests/baselines/reference/emitClassDeclarationWithExtensionAndTypeArgumentInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithExtensionAndTypeArgumentInES6.symbols new file mode 100644 index 00000000000..f93b3bafcd3 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithExtensionAndTypeArgumentInES6.symbols @@ -0,0 +1,28 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 0)) +>T : Symbol(T, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 8)) + + constructor(a: T) { } +>a : Symbol(a, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 1, 16)) +>T : Symbol(T, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 8)) +} +class C extends B { } +>C : Symbol(C, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 2, 1)) +>B : Symbol(B, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 0)) + +class D extends B { +>D : Symbol(D, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 3, 29)) +>B : Symbol(B, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 0)) + + constructor(a: any) +>a : Symbol(a, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 5, 16)) + + constructor(b: number) { +>b : Symbol(b, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 6, 16)) + + super(b); +>super : Symbol(B, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 0, 0)) +>b : Symbol(b, Decl(emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts, 6, 16)) + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.symbols new file mode 100644 index 00000000000..586a924a260 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.symbols @@ -0,0 +1,57 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithExtensionInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 0)) + + baz(a: string, y = 10) { } +>baz : Symbol(baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 9)) +>a : Symbol(a, Decl(emitClassDeclarationWithExtensionInES6.ts, 1, 8)) +>y : Symbol(y, Decl(emitClassDeclarationWithExtensionInES6.ts, 1, 18)) +} +class C extends B { +>C : Symbol(C, Decl(emitClassDeclarationWithExtensionInES6.ts, 2, 1)) +>B : Symbol(B, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 0)) + + foo() { } +>foo : Symbol(foo, Decl(emitClassDeclarationWithExtensionInES6.ts, 3, 19)) + + baz(a: string, y:number) { +>baz : Symbol(baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 4, 13)) +>a : Symbol(a, Decl(emitClassDeclarationWithExtensionInES6.ts, 5, 8)) +>y : Symbol(y, Decl(emitClassDeclarationWithExtensionInES6.ts, 5, 18)) + + super.baz(a, y); +>super.baz : Symbol(B.baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 9)) +>super : Symbol(B, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 0)) +>baz : Symbol(B.baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 0, 9)) +>a : Symbol(a, Decl(emitClassDeclarationWithExtensionInES6.ts, 5, 8)) +>y : Symbol(y, Decl(emitClassDeclarationWithExtensionInES6.ts, 5, 18)) + } +} +class D extends C { +>D : Symbol(D, Decl(emitClassDeclarationWithExtensionInES6.ts, 8, 1)) +>C : Symbol(C, Decl(emitClassDeclarationWithExtensionInES6.ts, 2, 1)) + + constructor() { + super(); +>super : Symbol(C, Decl(emitClassDeclarationWithExtensionInES6.ts, 2, 1)) + } + + foo() { +>foo : Symbol(foo, Decl(emitClassDeclarationWithExtensionInES6.ts, 12, 5)) + + super.foo(); +>super.foo : Symbol(C.foo, Decl(emitClassDeclarationWithExtensionInES6.ts, 3, 19)) +>super : Symbol(C, Decl(emitClassDeclarationWithExtensionInES6.ts, 2, 1)) +>foo : Symbol(C.foo, Decl(emitClassDeclarationWithExtensionInES6.ts, 3, 19)) + } + + baz() { +>baz : Symbol(baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 16, 5)) + + super.baz("hello", 10); +>super.baz : Symbol(C.baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 4, 13)) +>super : Symbol(C, Decl(emitClassDeclarationWithExtensionInES6.ts, 2, 1)) +>baz : Symbol(C.baz, Decl(emitClassDeclarationWithExtensionInES6.ts, 4, 13)) + } +} + diff --git a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types index a1549be5df4..7267af2fde0 100644 --- a/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithExtensionInES6.types @@ -6,6 +6,7 @@ class B { >baz : (a: string, y?: number) => void >a : string >y : number +>10 : number } class C extends B { >C : C @@ -56,6 +57,8 @@ class D extends C { >super.baz : (a: string, y: number) => void >super : C >baz : (a: string, y: number) => void +>"hello" : string +>10 : number } } diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols new file mode 100644 index 00000000000..2d249348f9b --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols @@ -0,0 +1,48 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithGetterSetterInES6.ts === +class C { +>C : Symbol(C, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 0, 0)) + + _name: string; +>_name : Symbol(_name, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 0, 9)) + + get name(): string { +>name : Symbol(name, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 1, 18)) + + return this._name; +>this._name : Symbol(_name, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 0, 9)) +>this : Symbol(C, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 0, 0)) +>_name : Symbol(_name, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 0, 9)) + } + static get name2(): string { +>name2 : Symbol(C.name2, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 4, 5)) + + return "BYE"; + } + static get ["computedname"]() { + return ""; + } + get ["computedname"]() { + return ""; + } + get ["computedname"]() { + return ""; + } + + set ["computedname"](x: any) { +>x : Symbol(x, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 18, 25)) + } + set ["computedname"](y: string) { +>y : Symbol(y, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 20, 25)) + } + + set foo(a: string) { } +>foo : Symbol(foo, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 21, 5)) +>a : Symbol(a, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 23, 12)) + + static set bar(b: number) { } +>bar : Symbol(C.bar, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 23, 26)) +>b : Symbol(b, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 24, 19)) + + static set ["computedname"](b: string) { } +>b : Symbol(b, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 25, 32)) +} diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types index 83d4fcd0d80..b26d6b3dd81 100644 --- a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types @@ -17,21 +17,33 @@ class C { >name2 : string return "BYE"; +>"BYE" : string } static get ["computedname"]() { +>"computedname" : string + return ""; +>"" : string } get ["computedname"]() { +>"computedname" : string + return ""; +>"" : string } get ["computedname"]() { +>"computedname" : string + return ""; +>"" : string } set ["computedname"](x: any) { +>"computedname" : string >x : any } set ["computedname"](y: string) { +>"computedname" : string >y : string } @@ -44,5 +56,6 @@ class C { >b : number static set ["computedname"](b: string) { } +>"computedname" : string >b : string } diff --git a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.symbols new file mode 100644 index 00000000000..fdceb9831c1 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.symbols @@ -0,0 +1,19 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithLiteralPropertyNameInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithLiteralPropertyNameInES6.ts, 0, 0)) + + "hello" = 10; + 0b110 = "world"; + 0o23534 = "WORLD"; + 20 = "twenty"; + "foo"() { } + 0b1110() {} + 11() { } + interface() { } +>interface : Symbol(interface, Decl(emitClassDeclarationWithLiteralPropertyNameInES6.ts, 7, 12)) + + static "hi" = 10000; + static 22 = "twenty-two"; + static 0b101 = "binary"; + static 0o3235 = "octal"; +} diff --git a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types index 65ba8f7d2b9..d4bc18539dd 100644 --- a/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithLiteralPropertyNameInES6.types @@ -3,9 +3,17 @@ class B { >B : B "hello" = 10; +>10 : number + 0b110 = "world"; +>"world" : string + 0o23534 = "WORLD"; +>"WORLD" : string + 20 = "twenty"; +>"twenty" : string + "foo"() { } 0b1110() {} 11() { } @@ -13,7 +21,14 @@ class B { >interface : () => void static "hi" = 10000; +>10000 : number + static 22 = "twenty-two"; +>"twenty-two" : string + static 0b101 = "binary"; +>"binary" : string + static 0o3235 = "octal"; +>"octal" : string } diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols new file mode 100644 index 00000000000..b7a4dbbf341 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols @@ -0,0 +1,56 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithMethodInES6.ts === +class D { +>D : Symbol(D, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 0)) + + _bar: string; +>_bar : Symbol(_bar, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 9)) + + foo() { } +>foo : Symbol(foo, Decl(emitClassDeclarationWithMethodInES6.ts, 1, 17)) + + ["computedName"]() { } + ["computedName"](a: string) { } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 4, 21)) + + ["computedName"](a: string): number { return 1; } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 5, 21)) + + bar(): string { +>bar : Symbol(bar, Decl(emitClassDeclarationWithMethodInES6.ts, 5, 53)) + + return this._bar; +>this._bar : Symbol(_bar, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 9)) +>this : Symbol(D, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 0)) +>_bar : Symbol(_bar, Decl(emitClassDeclarationWithMethodInES6.ts, 0, 9)) + } + baz(a: any, x: string): string { +>baz : Symbol(baz, Decl(emitClassDeclarationWithMethodInES6.ts, 8, 5)) +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 9, 8)) +>x : Symbol(x, Decl(emitClassDeclarationWithMethodInES6.ts, 9, 15)) + + return "HELLO"; + } + static ["computedname"]() { } + static ["computedname"](a: string) { } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 13, 28)) + + static ["computedname"](a: string): boolean { return true; } +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 14, 28)) + + static staticMethod() { +>staticMethod : Symbol(D.staticMethod, Decl(emitClassDeclarationWithMethodInES6.ts, 14, 64)) + + var x = 1 + 2; +>x : Symbol(x, Decl(emitClassDeclarationWithMethodInES6.ts, 16, 11)) + + return x +>x : Symbol(x, Decl(emitClassDeclarationWithMethodInES6.ts, 16, 11)) + } + static foo(a: string) { } +>foo : Symbol(D.foo, Decl(emitClassDeclarationWithMethodInES6.ts, 18, 5)) +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 19, 15)) + + static bar(a: string): number { return 1; } +>bar : Symbol(D.bar, Decl(emitClassDeclarationWithMethodInES6.ts, 19, 29)) +>a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 20, 15)) +} diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types index f26a9f87e6d..d3e75c9235c 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types @@ -9,11 +9,16 @@ class D { >foo : () => void ["computedName"]() { } +>"computedName" : string + ["computedName"](a: string) { } +>"computedName" : string >a : string ["computedName"](a: string): number { return 1; } +>"computedName" : string >a : string +>1 : number bar(): string { >bar : () => string @@ -29,13 +34,19 @@ class D { >x : string return "HELLO"; +>"HELLO" : string } static ["computedname"]() { } +>"computedname" : string + static ["computedname"](a: string) { } +>"computedname" : string >a : string static ["computedname"](a: string): boolean { return true; } +>"computedname" : string >a : string +>true : boolean static staticMethod() { >staticMethod : () => number @@ -43,6 +54,8 @@ class D { var x = 1 + 2; >x : number >1 + 2 : number +>1 : number +>2 : number return x >x : number @@ -54,4 +67,5 @@ class D { static bar(a: string): number { return 1; } >bar : (a: string) => number >a : string +>1 : number } diff --git a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.symbols new file mode 100644 index 00000000000..67878625bda --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.symbols @@ -0,0 +1,53 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithPropertyAssignmentInES6.ts === +class C { +>C : Symbol(C, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 0, 0)) + + x: string = "Hello world"; +>x : Symbol(x, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 0, 9)) +} + +class D { +>D : Symbol(D, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 2, 1)) + + x: string = "Hello world"; +>x : Symbol(x, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 4, 9)) + + y: number; +>y : Symbol(y, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 5, 30)) + + constructor() { + this.y = 10; +>this.y : Symbol(y, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 5, 30)) +>this : Symbol(D, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 2, 1)) +>y : Symbol(y, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 5, 30)) + } +} + +class E extends D{ +>E : Symbol(E, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 10, 1)) +>D : Symbol(D, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 2, 1)) + + z: boolean = true; +>z : Symbol(z, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 12, 18)) +} + +class F extends D{ +>F : Symbol(F, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 14, 1)) +>D : Symbol(D, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 2, 1)) + + z: boolean = true; +>z : Symbol(z, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 16, 18)) + + j: string; +>j : Symbol(j, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 17, 22)) + + constructor() { + super(); +>super : Symbol(D, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 2, 1)) + + this.j = "HI"; +>this.j : Symbol(j, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 17, 22)) +>this : Symbol(F, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 14, 1)) +>j : Symbol(j, Decl(emitClassDeclarationWithPropertyAssignmentInES6.ts, 17, 22)) + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types index 5e7ebbc167c..f3504d655ed 100644 --- a/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithPropertyAssignmentInES6.types @@ -4,6 +4,7 @@ class C { x: string = "Hello world"; >x : string +>"Hello world" : string } class D { @@ -11,6 +12,7 @@ class D { x: string = "Hello world"; >x : string +>"Hello world" : string y: number; >y : number @@ -21,6 +23,7 @@ class D { >this.y : number >this : D >y : number +>10 : number } } @@ -30,6 +33,7 @@ class E extends D{ z: boolean = true; >z : boolean +>true : boolean } class F extends D{ @@ -38,6 +42,7 @@ class F extends D{ z: boolean = true; >z : boolean +>true : boolean j: string; >j : string @@ -52,5 +57,6 @@ class F extends D{ >this.j : string >this : F >j : string +>"HI" : string } } diff --git a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.symbols new file mode 100644 index 00000000000..1b64646f788 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithStaticPropertyAssignmentInES6.ts === +class C { +>C : Symbol(C, Decl(emitClassDeclarationWithStaticPropertyAssignmentInES6.ts, 0, 0)) + + static z: string = "Foo"; +>z : Symbol(C.z, Decl(emitClassDeclarationWithStaticPropertyAssignmentInES6.ts, 0, 9)) +} + +class D { +>D : Symbol(D, Decl(emitClassDeclarationWithStaticPropertyAssignmentInES6.ts, 2, 1)) + + x = 20000; +>x : Symbol(x, Decl(emitClassDeclarationWithStaticPropertyAssignmentInES6.ts, 4, 9)) + + static b = true; +>b : Symbol(D.b, Decl(emitClassDeclarationWithStaticPropertyAssignmentInES6.ts, 5, 14)) +} + diff --git a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types index 6003b85b590..58d328e3e5d 100644 --- a/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithStaticPropertyAssignmentInES6.types @@ -4,6 +4,7 @@ class C { static z: string = "Foo"; >z : string +>"Foo" : string } class D { @@ -11,8 +12,10 @@ class D { x = 20000; >x : number +>20000 : number static b = true; >b : boolean +>true : boolean } diff --git a/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.symbols b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.symbols new file mode 100644 index 00000000000..13ce54e0641 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithSuperMethodCall01.symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithSuperMethodCall01.ts === + +class Parent { +>Parent : Symbol(Parent, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 1, 14)) + } +} + +class Foo extends Parent { +>Foo : Symbol(Foo, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 4, 1)) +>Parent : Symbol(Parent, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 6, 26)) + + var x = () => super.foo(); +>x : Symbol(x, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 8, 11)) +>super.foo : Symbol(Parent.foo, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 1, 14)) +>super : Symbol(Parent, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 0, 0)) +>foo : Symbol(Parent.foo, Decl(emitClassDeclarationWithSuperMethodCall01.ts, 1, 14)) + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.symbols new file mode 100644 index 00000000000..32220451b9c --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.symbols @@ -0,0 +1,49 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithThisKeywordInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) + + x = 10; +>x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) + + constructor() { + this.x = 10; +>this.x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) + } + static log(a: number) { } +>log : Symbol(B.log, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 4, 5)) +>a : Symbol(a, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 5, 15)) + + foo() { +>foo : Symbol(foo, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 5, 29)) + + B.log(this.x); +>B.log : Symbol(B.log, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 4, 5)) +>B : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) +>log : Symbol(B.log, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 4, 5)) +>this.x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) + } + + get X() { +>X : Symbol(X, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 8, 5)) + + return this.x; +>this.x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) + } + + set bX(y: number) { +>bX : Symbol(bX, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 12, 5)) +>y : Symbol(y, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 14, 11)) + + this.x = y; +>this.x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 0, 9)) +>y : Symbol(y, Decl(emitClassDeclarationWithThisKeywordInES6.ts, 14, 11)) + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types index bb0f7e99939..14c57a60bc4 100644 --- a/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithThisKeywordInES6.types @@ -4,6 +4,7 @@ class B { x = 10; >x : number +>10 : number constructor() { this.x = 10; @@ -11,6 +12,7 @@ class B { >this.x : number >this : B >x : number +>10 : number } static log(a: number) { } >log : (a: number) => void diff --git a/tests/baselines/reference/emitClassDeclarationWithTypeArgumentAndOverloadInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentAndOverloadInES6.symbols new file mode 100644 index 00000000000..092dbf10c7b --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentAndOverloadInES6.symbols @@ -0,0 +1,73 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 0)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + x: T; +>x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 12)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + B: T; +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + constructor(a: any) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 4, 16)) + + constructor(a: any,b: T) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 5, 16)) +>b : Symbol(b, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 5, 23)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + constructor(a: T) { this.B = a;} +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 16)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 16)) + + foo(a: T) +>foo : Symbol(foo, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 36), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 8, 13), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 9, 15), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 10, 18)) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 8, 8)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + foo(a: any) +>foo : Symbol(foo, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 36), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 8, 13), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 9, 15), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 10, 18)) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 9, 8)) + + foo(b: string) +>foo : Symbol(foo, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 36), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 8, 13), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 9, 15), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 10, 18)) +>b : Symbol(b, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 10, 8)) + + foo(): T { +>foo : Symbol(foo, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 6, 36), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 8, 13), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 9, 15), Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 10, 18)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + return this.x; +>this.x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 12)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 12)) + } + + get BB(): T { +>BB : Symbol(BB, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 13, 5)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + return this.B; +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) + } + set BBWith(c: T) { +>BBWith : Symbol(BBWith, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 17, 5)) +>c : Symbol(c, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 18, 15)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 8)) + + this.B = c; +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 1, 9)) +>c : Symbol(c, Decl(emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts, 18, 15)) + } +} diff --git a/tests/baselines/reference/emitClassDeclarationWithTypeArgumentInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentInES6.symbols new file mode 100644 index 00000000000..58f44b69f01 --- /dev/null +++ b/tests/baselines/reference/emitClassDeclarationWithTypeArgumentInES6.symbols @@ -0,0 +1,51 @@ +=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithTypeArgumentInES6.ts === +class B { +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 0)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + x: T; +>x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 12)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + B: T; +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + constructor(a: T) { this.B = a;} +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 3, 16)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>a : Symbol(a, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 3, 16)) + + foo(): T { +>foo : Symbol(foo, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 3, 36)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + return this.x; +>this.x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 12)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 12)) + } + get BB(): T { +>BB : Symbol(BB, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 6, 5)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + return this.B; +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) + } + set BBWith(c: T) { +>BBWith : Symbol(BBWith, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 9, 5)) +>c : Symbol(c, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 10, 15)) +>T : Symbol(T, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 8)) + + this.B = c; +>this.B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>this : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 0, 0)) +>B : Symbol(B, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 1, 9)) +>c : Symbol(c, Decl(emitClassDeclarationWithTypeArgumentInES6.ts, 10, 15)) + } +} diff --git a/tests/baselines/reference/emitCommentsOnlyFile.symbols b/tests/baselines/reference/emitCommentsOnlyFile.symbols new file mode 100644 index 00000000000..38b23eb128d --- /dev/null +++ b/tests/baselines/reference/emitCommentsOnlyFile.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/emitCommentsOnlyFile.ts === + +No type information for this code./** +No type information for this code.* @name Foo +No type information for this code.* @class +No type information for this code.*/ +No type information for this code./**#@+ +No type information for this code.* @memberOf Foo# +No type information for this code.* @field +No type information for this code.*/ +No type information for this code./** +No type information for this code.* @name bar +No type information for this code.* @type Object[] +No type information for this code.*/ +No type information for this code./**#@-*/ +No type information for this code./** +No type information for this code.* @name Foo2 +No type information for this code.* @class +No type information for this code.*/ +No type information for this code./**#@+ +No type information for this code.* @memberOf Foo2# +No type information for this code.* @field +No type information for this code.*/ +No type information for this code./** +No type information for this code.* @name bar +No type information for this code.* @type Object[] +No type information for this code.*/ +No type information for this code./**#@-*/ +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emitDefaultParametersFunction.symbols b/tests/baselines/reference/emitDefaultParametersFunction.symbols new file mode 100644 index 00000000000..c6c68ca1c70 --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunction.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunction.ts === +function foo(x: string, y = 10) { } +>foo : Symbol(foo, Decl(emitDefaultParametersFunction.ts, 0, 0)) +>x : Symbol(x, Decl(emitDefaultParametersFunction.ts, 0, 13)) +>y : Symbol(y, Decl(emitDefaultParametersFunction.ts, 0, 23)) + +function baz(x: string, y = 5, ...rest) { } +>baz : Symbol(baz, Decl(emitDefaultParametersFunction.ts, 0, 35)) +>x : Symbol(x, Decl(emitDefaultParametersFunction.ts, 1, 13)) +>y : Symbol(y, Decl(emitDefaultParametersFunction.ts, 1, 23)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunction.ts, 1, 30)) + +function bar(y = 10) { } +>bar : Symbol(bar, Decl(emitDefaultParametersFunction.ts, 1, 43)) +>y : Symbol(y, Decl(emitDefaultParametersFunction.ts, 2, 13)) + +function bar1(y = 10, ...rest) { } +>bar1 : Symbol(bar1, Decl(emitDefaultParametersFunction.ts, 2, 24)) +>y : Symbol(y, Decl(emitDefaultParametersFunction.ts, 3, 14)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunction.ts, 3, 21)) + diff --git a/tests/baselines/reference/emitDefaultParametersFunction.types b/tests/baselines/reference/emitDefaultParametersFunction.types index a8dec6335a9..5c27d3ddf3d 100644 --- a/tests/baselines/reference/emitDefaultParametersFunction.types +++ b/tests/baselines/reference/emitDefaultParametersFunction.types @@ -3,19 +3,23 @@ function foo(x: string, y = 10) { } >foo : (x: string, y?: number) => void >x : string >y : number +>10 : number function baz(x: string, y = 5, ...rest) { } >baz : (x: string, y?: number, ...rest: any[]) => void >x : string >y : number +>5 : number >rest : any[] function bar(y = 10) { } >bar : (y?: number) => void >y : number +>10 : number function bar1(y = 10, ...rest) { } >bar1 : (y?: number, ...rest: any[]) => void >y : number +>10 : number >rest : any[] diff --git a/tests/baselines/reference/emitDefaultParametersFunctionES6.symbols b/tests/baselines/reference/emitDefaultParametersFunctionES6.symbols new file mode 100644 index 00000000000..49e1cad020e --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunctionES6.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunctionES6.ts === +function foo(x: string, y = 10) { } +>foo : Symbol(foo, Decl(emitDefaultParametersFunctionES6.ts, 0, 0)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionES6.ts, 0, 13)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionES6.ts, 0, 23)) + +function baz(x: string, y = 5, ...rest) { } +>baz : Symbol(baz, Decl(emitDefaultParametersFunctionES6.ts, 0, 35)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionES6.ts, 1, 13)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionES6.ts, 1, 23)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionES6.ts, 1, 30)) + +function bar(y = 10) { } +>bar : Symbol(bar, Decl(emitDefaultParametersFunctionES6.ts, 1, 43)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionES6.ts, 2, 13)) + +function bar1(y = 10, ...rest) { } +>bar1 : Symbol(bar1, Decl(emitDefaultParametersFunctionES6.ts, 2, 24)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionES6.ts, 3, 14)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionES6.ts, 3, 21)) + diff --git a/tests/baselines/reference/emitDefaultParametersFunctionES6.types b/tests/baselines/reference/emitDefaultParametersFunctionES6.types index 1c67032264f..e3124c75333 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionES6.types @@ -3,19 +3,23 @@ function foo(x: string, y = 10) { } >foo : (x: string, y?: number) => void >x : string >y : number +>10 : number function baz(x: string, y = 5, ...rest) { } >baz : (x: string, y?: number, ...rest: any[]) => void >x : string >y : number +>5 : number >rest : any[] function bar(y = 10) { } >bar : (y?: number) => void >y : number +>10 : number function bar1(y = 10, ...rest) { } >bar1 : (y?: number, ...rest: any[]) => void >y : number +>10 : number >rest : any[] diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpression.symbols b/tests/baselines/reference/emitDefaultParametersFunctionExpression.symbols new file mode 100644 index 00000000000..59c9c220787 --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpression.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunctionExpression.ts === +var lambda1 = (y = "hello") => { } +>lambda1 : Symbol(lambda1, Decl(emitDefaultParametersFunctionExpression.ts, 0, 3)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpression.ts, 0, 15)) + +var lambda2 = (x: number, y = "hello") => { } +>lambda2 : Symbol(lambda2, Decl(emitDefaultParametersFunctionExpression.ts, 1, 3)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpression.ts, 1, 15)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpression.ts, 1, 25)) + +var lambda3 = (x: number, y = "hello", ...rest) => { } +>lambda3 : Symbol(lambda3, Decl(emitDefaultParametersFunctionExpression.ts, 2, 3)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpression.ts, 2, 15)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpression.ts, 2, 25)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpression.ts, 2, 38)) + +var lambda4 = (y = "hello", ...rest) => { } +>lambda4 : Symbol(lambda4, Decl(emitDefaultParametersFunctionExpression.ts, 3, 3)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpression.ts, 3, 15)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpression.ts, 3, 27)) + +var x = function (str = "hello", ...rest) { } +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpression.ts, 5, 3)) +>str : Symbol(str, Decl(emitDefaultParametersFunctionExpression.ts, 5, 18)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpression.ts, 5, 32)) + +var y = (function (num = 10, boo = false, ...rest) { })() +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpression.ts, 6, 3)) +>num : Symbol(num, Decl(emitDefaultParametersFunctionExpression.ts, 6, 19)) +>boo : Symbol(boo, Decl(emitDefaultParametersFunctionExpression.ts, 6, 28)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpression.ts, 6, 41)) + +var z = (function (num: number, boo = false, ...rest) { })(10) +>z : Symbol(z, Decl(emitDefaultParametersFunctionExpression.ts, 7, 3)) +>num : Symbol(num, Decl(emitDefaultParametersFunctionExpression.ts, 7, 19)) +>boo : Symbol(boo, Decl(emitDefaultParametersFunctionExpression.ts, 7, 31)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpression.ts, 7, 44)) + diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpression.types b/tests/baselines/reference/emitDefaultParametersFunctionExpression.types index 5c223ff1344..61ba3200e36 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionExpression.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpression.types @@ -3,30 +3,35 @@ var lambda1 = (y = "hello") => { } >lambda1 : (y?: string) => void >(y = "hello") => { } : (y?: string) => void >y : string +>"hello" : string var lambda2 = (x: number, y = "hello") => { } >lambda2 : (x: number, y?: string) => void >(x: number, y = "hello") => { } : (x: number, y?: string) => void >x : number >y : string +>"hello" : string var lambda3 = (x: number, y = "hello", ...rest) => { } >lambda3 : (x: number, y?: string, ...rest: any[]) => void >(x: number, y = "hello", ...rest) => { } : (x: number, y?: string, ...rest: any[]) => void >x : number >y : string +>"hello" : string >rest : any[] var lambda4 = (y = "hello", ...rest) => { } >lambda4 : (y?: string, ...rest: any[]) => void >(y = "hello", ...rest) => { } : (y?: string, ...rest: any[]) => void >y : string +>"hello" : string >rest : any[] var x = function (str = "hello", ...rest) { } >x : (str?: string, ...rest: any[]) => void >function (str = "hello", ...rest) { } : (str?: string, ...rest: any[]) => void >str : string +>"hello" : string >rest : any[] var y = (function (num = 10, boo = false, ...rest) { })() @@ -35,7 +40,9 @@ var y = (function (num = 10, boo = false, ...rest) { })() >(function (num = 10, boo = false, ...rest) { }) : (num?: number, boo?: boolean, ...rest: any[]) => void >function (num = 10, boo = false, ...rest) { } : (num?: number, boo?: boolean, ...rest: any[]) => void >num : number +>10 : number >boo : boolean +>false : boolean >rest : any[] var z = (function (num: number, boo = false, ...rest) { })(10) @@ -45,5 +52,7 @@ var z = (function (num: number, boo = false, ...rest) { })(10) >function (num: number, boo = false, ...rest) { } : (num: number, boo?: boolean, ...rest: any[]) => void >num : number >boo : boolean +>false : boolean >rest : any[] +>10 : number diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.symbols b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.symbols new file mode 100644 index 00000000000..36eef9b9a1d --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunctionExpressionES6.ts === +var lambda1 = (y = "hello") => { } +>lambda1 : Symbol(lambda1, Decl(emitDefaultParametersFunctionExpressionES6.ts, 0, 3)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpressionES6.ts, 0, 15)) + +var lambda2 = (x: number, y = "hello") => { } +>lambda2 : Symbol(lambda2, Decl(emitDefaultParametersFunctionExpressionES6.ts, 1, 3)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpressionES6.ts, 1, 15)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpressionES6.ts, 1, 25)) + +var lambda3 = (x: number, y = "hello", ...rest) => { } +>lambda3 : Symbol(lambda3, Decl(emitDefaultParametersFunctionExpressionES6.ts, 2, 3)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpressionES6.ts, 2, 15)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpressionES6.ts, 2, 25)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpressionES6.ts, 2, 38)) + +var lambda4 = (y = "hello", ...rest) => { } +>lambda4 : Symbol(lambda4, Decl(emitDefaultParametersFunctionExpressionES6.ts, 3, 3)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpressionES6.ts, 3, 15)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpressionES6.ts, 3, 27)) + +var x = function (str = "hello", ...rest) { } +>x : Symbol(x, Decl(emitDefaultParametersFunctionExpressionES6.ts, 5, 3)) +>str : Symbol(str, Decl(emitDefaultParametersFunctionExpressionES6.ts, 5, 18)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpressionES6.ts, 5, 32)) + +var y = (function (num = 10, boo = false, ...rest) { })() +>y : Symbol(y, Decl(emitDefaultParametersFunctionExpressionES6.ts, 6, 3)) +>num : Symbol(num, Decl(emitDefaultParametersFunctionExpressionES6.ts, 6, 19)) +>boo : Symbol(boo, Decl(emitDefaultParametersFunctionExpressionES6.ts, 6, 28)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpressionES6.ts, 6, 41)) + +var z = (function (num: number, boo = false, ...rest) { })(10) +>z : Symbol(z, Decl(emitDefaultParametersFunctionExpressionES6.ts, 7, 3)) +>num : Symbol(num, Decl(emitDefaultParametersFunctionExpressionES6.ts, 7, 19)) +>boo : Symbol(boo, Decl(emitDefaultParametersFunctionExpressionES6.ts, 7, 31)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionExpressionES6.ts, 7, 44)) + diff --git a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types index 9b8805dfa2b..76f2c863a26 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionExpressionES6.types @@ -3,30 +3,35 @@ var lambda1 = (y = "hello") => { } >lambda1 : (y?: string) => void >(y = "hello") => { } : (y?: string) => void >y : string +>"hello" : string var lambda2 = (x: number, y = "hello") => { } >lambda2 : (x: number, y?: string) => void >(x: number, y = "hello") => { } : (x: number, y?: string) => void >x : number >y : string +>"hello" : string var lambda3 = (x: number, y = "hello", ...rest) => { } >lambda3 : (x: number, y?: string, ...rest: any[]) => void >(x: number, y = "hello", ...rest) => { } : (x: number, y?: string, ...rest: any[]) => void >x : number >y : string +>"hello" : string >rest : any[] var lambda4 = (y = "hello", ...rest) => { } >lambda4 : (y?: string, ...rest: any[]) => void >(y = "hello", ...rest) => { } : (y?: string, ...rest: any[]) => void >y : string +>"hello" : string >rest : any[] var x = function (str = "hello", ...rest) { } >x : (str?: string, ...rest: any[]) => void >function (str = "hello", ...rest) { } : (str?: string, ...rest: any[]) => void >str : string +>"hello" : string >rest : any[] var y = (function (num = 10, boo = false, ...rest) { })() @@ -35,7 +40,9 @@ var y = (function (num = 10, boo = false, ...rest) { })() >(function (num = 10, boo = false, ...rest) { }) : (num?: number, boo?: boolean, ...rest: any[]) => void >function (num = 10, boo = false, ...rest) { } : (num?: number, boo?: boolean, ...rest: any[]) => void >num : number +>10 : number >boo : boolean +>false : boolean >rest : any[] var z = (function (num: number, boo = false, ...rest) { })(10) @@ -45,5 +52,7 @@ var z = (function (num: number, boo = false, ...rest) { })(10) >function (num: number, boo = false, ...rest) { } : (num: number, boo?: boolean, ...rest: any[]) => void >num : number >boo : boolean +>false : boolean >rest : any[] +>10 : number diff --git a/tests/baselines/reference/emitDefaultParametersFunctionProperty.symbols b/tests/baselines/reference/emitDefaultParametersFunctionProperty.symbols new file mode 100644 index 00000000000..f377e8bd696 --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunctionProperty.symbols @@ -0,0 +1,27 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunctionProperty.ts === +var obj2 = { +>obj2 : Symbol(obj2, Decl(emitDefaultParametersFunctionProperty.ts, 0, 3)) + + func1(y = 10, ...rest) { }, +>func1 : Symbol(func1, Decl(emitDefaultParametersFunctionProperty.ts, 0, 12)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionProperty.ts, 1, 10)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionProperty.ts, 1, 17)) + + func2(x = "hello") { }, +>func2 : Symbol(func2, Decl(emitDefaultParametersFunctionProperty.ts, 1, 31)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionProperty.ts, 2, 10)) + + func3(x: string, z: number, y = "hello") { }, +>func3 : Symbol(func3, Decl(emitDefaultParametersFunctionProperty.ts, 2, 27)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionProperty.ts, 3, 10)) +>z : Symbol(z, Decl(emitDefaultParametersFunctionProperty.ts, 3, 20)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionProperty.ts, 3, 31)) + + func4(x: string, z: number, y = "hello", ...rest) { }, +>func4 : Symbol(func4, Decl(emitDefaultParametersFunctionProperty.ts, 3, 49)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionProperty.ts, 4, 10)) +>z : Symbol(z, Decl(emitDefaultParametersFunctionProperty.ts, 4, 20)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionProperty.ts, 4, 31)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionProperty.ts, 4, 44)) +} + diff --git a/tests/baselines/reference/emitDefaultParametersFunctionProperty.types b/tests/baselines/reference/emitDefaultParametersFunctionProperty.types index 7c1ea6a5da3..8a703fd114f 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionProperty.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionProperty.types @@ -6,23 +6,27 @@ var obj2 = { func1(y = 10, ...rest) { }, >func1 : (y?: number, ...rest: any[]) => void >y : number +>10 : number >rest : any[] func2(x = "hello") { }, >func2 : (x?: string) => void >x : string +>"hello" : string func3(x: string, z: number, y = "hello") { }, >func3 : (x: string, z: number, y?: string) => void >x : string >z : number >y : string +>"hello" : string func4(x: string, z: number, y = "hello", ...rest) { }, >func4 : (x: string, z: number, y?: string, ...rest: any[]) => void >x : string >z : number >y : string +>"hello" : string >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.symbols b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.symbols new file mode 100644 index 00000000000..88bad28bbf8 --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersFunctionPropertyES6.ts === +var obj2 = { +>obj2 : Symbol(obj2, Decl(emitDefaultParametersFunctionPropertyES6.ts, 0, 3)) + + func1(y = 10, ...rest) { }, +>func1 : Symbol(func1, Decl(emitDefaultParametersFunctionPropertyES6.ts, 0, 12)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionPropertyES6.ts, 1, 10)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionPropertyES6.ts, 1, 17)) + + func2(x = "hello") { }, +>func2 : Symbol(func2, Decl(emitDefaultParametersFunctionPropertyES6.ts, 1, 31)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionPropertyES6.ts, 2, 10)) + + func3(x: string, z: number, y = "hello") { }, +>func3 : Symbol(func3, Decl(emitDefaultParametersFunctionPropertyES6.ts, 2, 27)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionPropertyES6.ts, 3, 10)) +>z : Symbol(z, Decl(emitDefaultParametersFunctionPropertyES6.ts, 3, 20)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionPropertyES6.ts, 3, 31)) + + func4(x: string, z: number, y = "hello", ...rest) { }, +>func4 : Symbol(func4, Decl(emitDefaultParametersFunctionPropertyES6.ts, 3, 49)) +>x : Symbol(x, Decl(emitDefaultParametersFunctionPropertyES6.ts, 4, 10)) +>z : Symbol(z, Decl(emitDefaultParametersFunctionPropertyES6.ts, 4, 20)) +>y : Symbol(y, Decl(emitDefaultParametersFunctionPropertyES6.ts, 4, 31)) +>rest : Symbol(rest, Decl(emitDefaultParametersFunctionPropertyES6.ts, 4, 44)) +} diff --git a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types index ed80158ffd1..1edd505c0b5 100644 --- a/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types +++ b/tests/baselines/reference/emitDefaultParametersFunctionPropertyES6.types @@ -6,22 +6,26 @@ var obj2 = { func1(y = 10, ...rest) { }, >func1 : (y?: number, ...rest: any[]) => void >y : number +>10 : number >rest : any[] func2(x = "hello") { }, >func2 : (x?: string) => void >x : string +>"hello" : string func3(x: string, z: number, y = "hello") { }, >func3 : (x: string, z: number, y?: string) => void >x : string >z : number >y : string +>"hello" : string func4(x: string, z: number, y = "hello", ...rest) { }, >func4 : (x: string, z: number, y?: string, ...rest: any[]) => void >x : string >z : number >y : string +>"hello" : string >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersMethod.symbols b/tests/baselines/reference/emitDefaultParametersMethod.symbols new file mode 100644 index 00000000000..866380e2dd5 --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersMethod.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersMethod.ts === +class C { +>C : Symbol(C, Decl(emitDefaultParametersMethod.ts, 0, 0)) + + constructor(t: boolean, z: string, x: number, y = "hello") { } +>t : Symbol(t, Decl(emitDefaultParametersMethod.ts, 1, 16)) +>z : Symbol(z, Decl(emitDefaultParametersMethod.ts, 1, 27)) +>x : Symbol(x, Decl(emitDefaultParametersMethod.ts, 1, 38)) +>y : Symbol(y, Decl(emitDefaultParametersMethod.ts, 1, 49)) + + public foo(x: string, t = false) { } +>foo : Symbol(foo, Decl(emitDefaultParametersMethod.ts, 1, 66)) +>x : Symbol(x, Decl(emitDefaultParametersMethod.ts, 3, 15)) +>t : Symbol(t, Decl(emitDefaultParametersMethod.ts, 3, 25)) + + public foo1(x: string, t = false, ...rest) { } +>foo1 : Symbol(foo1, Decl(emitDefaultParametersMethod.ts, 3, 40)) +>x : Symbol(x, Decl(emitDefaultParametersMethod.ts, 4, 16)) +>t : Symbol(t, Decl(emitDefaultParametersMethod.ts, 4, 26)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethod.ts, 4, 37)) + + public bar(t = false) { } +>bar : Symbol(bar, Decl(emitDefaultParametersMethod.ts, 4, 50)) +>t : Symbol(t, Decl(emitDefaultParametersMethod.ts, 5, 15)) + + public boo(t = false, ...rest) { } +>boo : Symbol(boo, Decl(emitDefaultParametersMethod.ts, 5, 29)) +>t : Symbol(t, Decl(emitDefaultParametersMethod.ts, 6, 15)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethod.ts, 6, 25)) +} + +class D { +>D : Symbol(D, Decl(emitDefaultParametersMethod.ts, 7, 1)) + + constructor(y = "hello") { } +>y : Symbol(y, Decl(emitDefaultParametersMethod.ts, 10, 16)) +} + +class E { +>E : Symbol(E, Decl(emitDefaultParametersMethod.ts, 11, 1)) + + constructor(y = "hello", ...rest) { } +>y : Symbol(y, Decl(emitDefaultParametersMethod.ts, 14, 16)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethod.ts, 14, 28)) +} + diff --git a/tests/baselines/reference/emitDefaultParametersMethod.types b/tests/baselines/reference/emitDefaultParametersMethod.types index 5b2f08d4f70..ce7dd2542fa 100644 --- a/tests/baselines/reference/emitDefaultParametersMethod.types +++ b/tests/baselines/reference/emitDefaultParametersMethod.types @@ -7,25 +7,30 @@ class C { >z : string >x : number >y : string +>"hello" : string public foo(x: string, t = false) { } >foo : (x: string, t?: boolean) => void >x : string >t : boolean +>false : boolean public foo1(x: string, t = false, ...rest) { } >foo1 : (x: string, t?: boolean, ...rest: any[]) => void >x : string >t : boolean +>false : boolean >rest : any[] public bar(t = false) { } >bar : (t?: boolean) => void >t : boolean +>false : boolean public boo(t = false, ...rest) { } >boo : (t?: boolean, ...rest: any[]) => void >t : boolean +>false : boolean >rest : any[] } @@ -34,6 +39,7 @@ class D { constructor(y = "hello") { } >y : string +>"hello" : string } class E { @@ -41,6 +47,7 @@ class E { constructor(y = "hello", ...rest) { } >y : string +>"hello" : string >rest : any[] } diff --git a/tests/baselines/reference/emitDefaultParametersMethodES6.symbols b/tests/baselines/reference/emitDefaultParametersMethodES6.symbols new file mode 100644 index 00000000000..ce23b016bcf --- /dev/null +++ b/tests/baselines/reference/emitDefaultParametersMethodES6.symbols @@ -0,0 +1,45 @@ +=== tests/cases/conformance/es6/defaultParameters/emitDefaultParametersMethodES6.ts === +class C { +>C : Symbol(C, Decl(emitDefaultParametersMethodES6.ts, 0, 0)) + + constructor(t: boolean, z: string, x: number, y = "hello") { } +>t : Symbol(t, Decl(emitDefaultParametersMethodES6.ts, 1, 16)) +>z : Symbol(z, Decl(emitDefaultParametersMethodES6.ts, 1, 27)) +>x : Symbol(x, Decl(emitDefaultParametersMethodES6.ts, 1, 38)) +>y : Symbol(y, Decl(emitDefaultParametersMethodES6.ts, 1, 49)) + + public foo(x: string, t = false) { } +>foo : Symbol(foo, Decl(emitDefaultParametersMethodES6.ts, 1, 66)) +>x : Symbol(x, Decl(emitDefaultParametersMethodES6.ts, 3, 15)) +>t : Symbol(t, Decl(emitDefaultParametersMethodES6.ts, 3, 25)) + + public foo1(x: string, t = false, ...rest) { } +>foo1 : Symbol(foo1, Decl(emitDefaultParametersMethodES6.ts, 3, 40)) +>x : Symbol(x, Decl(emitDefaultParametersMethodES6.ts, 4, 16)) +>t : Symbol(t, Decl(emitDefaultParametersMethodES6.ts, 4, 26)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethodES6.ts, 4, 37)) + + public bar(t = false) { } +>bar : Symbol(bar, Decl(emitDefaultParametersMethodES6.ts, 4, 50)) +>t : Symbol(t, Decl(emitDefaultParametersMethodES6.ts, 5, 15)) + + public boo(t = false, ...rest) { } +>boo : Symbol(boo, Decl(emitDefaultParametersMethodES6.ts, 5, 29)) +>t : Symbol(t, Decl(emitDefaultParametersMethodES6.ts, 6, 15)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethodES6.ts, 6, 25)) +} + +class D { +>D : Symbol(D, Decl(emitDefaultParametersMethodES6.ts, 7, 1)) + + constructor(y = "hello") { } +>y : Symbol(y, Decl(emitDefaultParametersMethodES6.ts, 10, 16)) +} + +class E { +>E : Symbol(E, Decl(emitDefaultParametersMethodES6.ts, 11, 1)) + + constructor(y = "hello", ...rest) { } +>y : Symbol(y, Decl(emitDefaultParametersMethodES6.ts, 14, 16)) +>rest : Symbol(rest, Decl(emitDefaultParametersMethodES6.ts, 14, 28)) +} diff --git a/tests/baselines/reference/emitDefaultParametersMethodES6.types b/tests/baselines/reference/emitDefaultParametersMethodES6.types index 54312714b1d..09096d153bf 100644 --- a/tests/baselines/reference/emitDefaultParametersMethodES6.types +++ b/tests/baselines/reference/emitDefaultParametersMethodES6.types @@ -7,25 +7,30 @@ class C { >z : string >x : number >y : string +>"hello" : string public foo(x: string, t = false) { } >foo : (x: string, t?: boolean) => void >x : string >t : boolean +>false : boolean public foo1(x: string, t = false, ...rest) { } >foo1 : (x: string, t?: boolean, ...rest: any[]) => void >x : string >t : boolean +>false : boolean >rest : any[] public bar(t = false) { } >bar : (t?: boolean) => void >t : boolean +>false : boolean public boo(t = false, ...rest) { } >boo : (t?: boolean, ...rest: any[]) => void >t : boolean +>false : boolean >rest : any[] } @@ -34,6 +39,7 @@ class D { constructor(y = "hello") { } >y : string +>"hello" : string } class E { @@ -41,5 +47,6 @@ class E { constructor(y = "hello", ...rest) { } >y : string +>"hello" : string >rest : any[] } diff --git a/tests/baselines/reference/emitMemberAccessExpression.symbols b/tests/baselines/reference/emitMemberAccessExpression.symbols new file mode 100644 index 00000000000..64302521706 --- /dev/null +++ b/tests/baselines/reference/emitMemberAccessExpression.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/emitMemberAccessExpression_file3.ts === +/// +/// +declare var OData: any; +>OData : Symbol(OData, Decl(emitMemberAccessExpression_file3.ts, 2, 11)) + +module Microsoft.PeopleAtWork.Model { +>Microsoft : Symbol(Microsoft, Decl(emitMemberAccessExpression_file2.ts, 1, 13), Decl(emitMemberAccessExpression_file3.ts, 2, 23)) +>PeopleAtWork : Symbol(PeopleAtWork, Decl(emitMemberAccessExpression_file2.ts, 2, 17), Decl(emitMemberAccessExpression_file3.ts, 3, 17)) +>Model : Symbol(Model, Decl(emitMemberAccessExpression_file2.ts, 2, 30), Decl(emitMemberAccessExpression_file3.ts, 3, 30)) + + export class KnockoutExtentions { +>KnockoutExtentions : Symbol(KnockoutExtentions, Decl(emitMemberAccessExpression_file3.ts, 3, 37)) + } +} +=== tests/cases/compiler/emitMemberAccessExpression_file1.ts === +/// +No type information for this code."use strict"; +No type information for this code. +No type information for this code.=== tests/cases/compiler/emitMemberAccessExpression_file2.ts === +/// +"use strict"; +module Microsoft.PeopleAtWork.Model { +>Microsoft : Symbol(Microsoft, Decl(emitMemberAccessExpression_file2.ts, 1, 13), Decl(emitMemberAccessExpression_file3.ts, 2, 23)) +>PeopleAtWork : Symbol(PeopleAtWork, Decl(emitMemberAccessExpression_file2.ts, 2, 17), Decl(emitMemberAccessExpression_file3.ts, 3, 17)) +>Model : Symbol(Model, Decl(emitMemberAccessExpression_file2.ts, 2, 30), Decl(emitMemberAccessExpression_file3.ts, 3, 30)) + + export class _Person { +>_Person : Symbol(_Person, Decl(emitMemberAccessExpression_file2.ts, 2, 37)) + + public populate(raw: any) { +>populate : Symbol(populate, Decl(emitMemberAccessExpression_file2.ts, 3, 26)) +>raw : Symbol(raw, Decl(emitMemberAccessExpression_file2.ts, 4, 24)) + + var res = Model.KnockoutExtentions; +>res : Symbol(res, Decl(emitMemberAccessExpression_file2.ts, 5, 15)) +>Model.KnockoutExtentions : Symbol(KnockoutExtentions, Decl(emitMemberAccessExpression_file3.ts, 3, 37)) +>Model : Symbol(Model, Decl(emitMemberAccessExpression_file2.ts, 2, 30), Decl(emitMemberAccessExpression_file3.ts, 3, 30)) +>KnockoutExtentions : Symbol(KnockoutExtentions, Decl(emitMemberAccessExpression_file3.ts, 3, 37)) + } + } +} + diff --git a/tests/baselines/reference/emitMemberAccessExpression.types b/tests/baselines/reference/emitMemberAccessExpression.types index 9f7c98332e9..7a32e452aec 100644 --- a/tests/baselines/reference/emitMemberAccessExpression.types +++ b/tests/baselines/reference/emitMemberAccessExpression.types @@ -15,11 +15,14 @@ module Microsoft.PeopleAtWork.Model { } === tests/cases/compiler/emitMemberAccessExpression_file1.ts === /// -No type information for this code."use strict"; -No type information for this code. -No type information for this code.=== tests/cases/compiler/emitMemberAccessExpression_file2.ts === +"use strict"; +>"use strict" : string + +=== tests/cases/compiler/emitMemberAccessExpression_file2.ts === /// "use strict"; +>"use strict" : string + module Microsoft.PeopleAtWork.Model { >Microsoft : typeof Microsoft >PeopleAtWork : typeof PeopleAtWork diff --git a/tests/baselines/reference/emitPostComments.symbols b/tests/baselines/reference/emitPostComments.symbols new file mode 100644 index 00000000000..296d8081058 --- /dev/null +++ b/tests/baselines/reference/emitPostComments.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/emitPostComments.ts === + +var y = 10; +>y : Symbol(y, Decl(emitPostComments.ts, 1, 3)) + +/** +* @name Foo +* @class +*/ +/**#@+ +* @memberOf Foo# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ +/** +* @name Foo2 +* @class +*/ +/**#@+ +* @memberOf Foo2# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ + diff --git a/tests/baselines/reference/emitPostComments.types b/tests/baselines/reference/emitPostComments.types index 4173e584031..5b5a05931d4 100644 --- a/tests/baselines/reference/emitPostComments.types +++ b/tests/baselines/reference/emitPostComments.types @@ -2,6 +2,7 @@ var y = 10; >y : number +>10 : number /** * @name Foo diff --git a/tests/baselines/reference/emitPreComments.symbols b/tests/baselines/reference/emitPreComments.symbols new file mode 100644 index 00000000000..c90547bb6b8 --- /dev/null +++ b/tests/baselines/reference/emitPreComments.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/emitPreComments.ts === + +// This is pre comment +var y = 10; +>y : Symbol(y, Decl(emitPreComments.ts, 2, 3)) + +/** +* @name Foo +* @class +*/ +/**#@+ +* @memberOf Foo# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ +/** +* @name Foo2 +* @class +*/ +/**#@+ +* @memberOf Foo2# +* @field +*/ +/** +* @name bar +* @type Object[] +*/ +/**#@-*/ + diff --git a/tests/baselines/reference/emitPreComments.types b/tests/baselines/reference/emitPreComments.types index 6ab0c7b1bf9..c0378350de3 100644 --- a/tests/baselines/reference/emitPreComments.types +++ b/tests/baselines/reference/emitPreComments.types @@ -3,6 +3,7 @@ // This is pre comment var y = 10; >y : number +>10 : number /** * @name Foo diff --git a/tests/baselines/reference/emitRestParametersFunction.symbols b/tests/baselines/reference/emitRestParametersFunction.symbols new file mode 100644 index 00000000000..c9f9587d805 --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunction.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunction.ts === +function bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersFunction.ts, 0, 0)) +>rest : Symbol(rest, Decl(emitRestParametersFunction.ts, 0, 13)) + +function foo(x: number, y: string, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersFunction.ts, 0, 25)) +>x : Symbol(x, Decl(emitRestParametersFunction.ts, 1, 13)) +>y : Symbol(y, Decl(emitRestParametersFunction.ts, 1, 23)) +>rest : Symbol(rest, Decl(emitRestParametersFunction.ts, 1, 34)) + diff --git a/tests/baselines/reference/emitRestParametersFunctionES6.symbols b/tests/baselines/reference/emitRestParametersFunctionES6.symbols new file mode 100644 index 00000000000..efe743eb316 --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunctionES6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunctionES6.ts === +function bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersFunctionES6.ts, 0, 0)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionES6.ts, 0, 13)) + +function foo(x: number, y: string, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersFunctionES6.ts, 0, 25)) +>x : Symbol(x, Decl(emitRestParametersFunctionES6.ts, 1, 13)) +>y : Symbol(y, Decl(emitRestParametersFunctionES6.ts, 1, 23)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionES6.ts, 1, 34)) + diff --git a/tests/baselines/reference/emitRestParametersFunctionExpression.symbols b/tests/baselines/reference/emitRestParametersFunctionExpression.symbols new file mode 100644 index 00000000000..8a42e7b5296 --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunctionExpression.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunctionExpression.ts === +var funcExp = (...rest) => { } +>funcExp : Symbol(funcExp, Decl(emitRestParametersFunctionExpression.ts, 0, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpression.ts, 0, 15)) + +var funcExp1 = (X: number, ...rest) => { } +>funcExp1 : Symbol(funcExp1, Decl(emitRestParametersFunctionExpression.ts, 1, 3)) +>X : Symbol(X, Decl(emitRestParametersFunctionExpression.ts, 1, 16)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpression.ts, 1, 26)) + +var funcExp2 = function (...rest) { } +>funcExp2 : Symbol(funcExp2, Decl(emitRestParametersFunctionExpression.ts, 2, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpression.ts, 2, 25)) + +var funcExp3 = (function (...rest) { })() +>funcExp3 : Symbol(funcExp3, Decl(emitRestParametersFunctionExpression.ts, 3, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpression.ts, 3, 26)) + diff --git a/tests/baselines/reference/emitRestParametersFunctionExpressionES6.symbols b/tests/baselines/reference/emitRestParametersFunctionExpressionES6.symbols new file mode 100644 index 00000000000..cf39ed21a88 --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunctionExpressionES6.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunctionExpressionES6.ts === +var funcExp = (...rest) => { } +>funcExp : Symbol(funcExp, Decl(emitRestParametersFunctionExpressionES6.ts, 0, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpressionES6.ts, 0, 15)) + +var funcExp1 = (X: number, ...rest) => { } +>funcExp1 : Symbol(funcExp1, Decl(emitRestParametersFunctionExpressionES6.ts, 1, 3)) +>X : Symbol(X, Decl(emitRestParametersFunctionExpressionES6.ts, 1, 16)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpressionES6.ts, 1, 26)) + +var funcExp2 = function (...rest) { } +>funcExp2 : Symbol(funcExp2, Decl(emitRestParametersFunctionExpressionES6.ts, 2, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpressionES6.ts, 2, 25)) + +var funcExp3 = (function (...rest) { })() +>funcExp3 : Symbol(funcExp3, Decl(emitRestParametersFunctionExpressionES6.ts, 3, 3)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionExpressionES6.ts, 3, 26)) + diff --git a/tests/baselines/reference/emitRestParametersFunctionProperty.symbols b/tests/baselines/reference/emitRestParametersFunctionProperty.symbols new file mode 100644 index 00000000000..2a0505831b9 --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunctionProperty.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunctionProperty.ts === +var obj: { +>obj : Symbol(obj, Decl(emitRestParametersFunctionProperty.ts, 0, 3)) + + func1: (...rest) => void +>func1 : Symbol(func1, Decl(emitRestParametersFunctionProperty.ts, 0, 10)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionProperty.ts, 1, 12)) +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(emitRestParametersFunctionProperty.ts, 4, 3)) + + func(...rest) { } +>func : Symbol(func, Decl(emitRestParametersFunctionProperty.ts, 4, 12)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionProperty.ts, 5, 9)) +} diff --git a/tests/baselines/reference/emitRestParametersFunctionPropertyES6.symbols b/tests/baselines/reference/emitRestParametersFunctionPropertyES6.symbols new file mode 100644 index 00000000000..a6b00757eec --- /dev/null +++ b/tests/baselines/reference/emitRestParametersFunctionPropertyES6.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersFunctionPropertyES6.ts === +var obj: { +>obj : Symbol(obj, Decl(emitRestParametersFunctionPropertyES6.ts, 0, 3)) + + func1: (...rest) => void +>func1 : Symbol(func1, Decl(emitRestParametersFunctionPropertyES6.ts, 0, 10)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionPropertyES6.ts, 1, 12)) +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(emitRestParametersFunctionPropertyES6.ts, 4, 3)) + + func(...rest) { } +>func : Symbol(func, Decl(emitRestParametersFunctionPropertyES6.ts, 4, 12)) +>rest : Symbol(rest, Decl(emitRestParametersFunctionPropertyES6.ts, 5, 9)) +} diff --git a/tests/baselines/reference/emitRestParametersMethod.symbols b/tests/baselines/reference/emitRestParametersMethod.symbols new file mode 100644 index 00000000000..2bfbda925bf --- /dev/null +++ b/tests/baselines/reference/emitRestParametersMethod.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersMethod.ts === +class C { +>C : Symbol(C, Decl(emitRestParametersMethod.ts, 0, 0)) + + constructor(name: string, ...rest) { } +>name : Symbol(name, Decl(emitRestParametersMethod.ts, 1, 16)) +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 1, 29)) + + public bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersMethod.ts, 1, 42)) +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 3, 15)) + + public foo(x: number, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersMethod.ts, 3, 27)) +>x : Symbol(x, Decl(emitRestParametersMethod.ts, 4, 15)) +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 4, 25)) +} + +class D { +>D : Symbol(D, Decl(emitRestParametersMethod.ts, 5, 1)) + + constructor(...rest) { } +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 8, 16)) + + public bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersMethod.ts, 8, 28)) +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 10, 15)) + + public foo(x: number, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersMethod.ts, 10, 27)) +>x : Symbol(x, Decl(emitRestParametersMethod.ts, 11, 15)) +>rest : Symbol(rest, Decl(emitRestParametersMethod.ts, 11, 25)) +} diff --git a/tests/baselines/reference/emitRestParametersMethodES6.symbols b/tests/baselines/reference/emitRestParametersMethodES6.symbols new file mode 100644 index 00000000000..e79ab9bb26e --- /dev/null +++ b/tests/baselines/reference/emitRestParametersMethodES6.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/es6/restParameters/emitRestParametersMethodES6.ts === +class C { +>C : Symbol(C, Decl(emitRestParametersMethodES6.ts, 0, 0)) + + constructor(name: string, ...rest) { } +>name : Symbol(name, Decl(emitRestParametersMethodES6.ts, 1, 16)) +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 1, 29)) + + public bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersMethodES6.ts, 1, 42)) +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 3, 15)) + + public foo(x: number, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersMethodES6.ts, 3, 27)) +>x : Symbol(x, Decl(emitRestParametersMethodES6.ts, 4, 15)) +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 4, 25)) +} + +class D { +>D : Symbol(D, Decl(emitRestParametersMethodES6.ts, 5, 1)) + + constructor(...rest) { } +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 8, 16)) + + public bar(...rest) { } +>bar : Symbol(bar, Decl(emitRestParametersMethodES6.ts, 8, 28)) +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 10, 15)) + + public foo(x: number, ...rest) { } +>foo : Symbol(foo, Decl(emitRestParametersMethodES6.ts, 10, 27)) +>x : Symbol(x, Decl(emitRestParametersMethodES6.ts, 11, 15)) +>rest : Symbol(rest, Decl(emitRestParametersMethodES6.ts, 11, 25)) +} + diff --git a/tests/baselines/reference/emptyEnum.symbols b/tests/baselines/reference/emptyEnum.symbols new file mode 100644 index 00000000000..c586c8879f5 --- /dev/null +++ b/tests/baselines/reference/emptyEnum.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/emptyEnum.ts === +enum E { +>E : Symbol(E, Decl(emptyEnum.ts, 0, 0)) +} diff --git a/tests/baselines/reference/emptyExpr.symbols b/tests/baselines/reference/emptyExpr.symbols new file mode 100644 index 00000000000..e699404332f --- /dev/null +++ b/tests/baselines/reference/emptyExpr.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/emptyExpr.ts === +[{},] +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile-declaration.symbols b/tests/baselines/reference/emptyFile-declaration.symbols new file mode 100644 index 00000000000..496fbbb807d --- /dev/null +++ b/tests/baselines/reference/emptyFile-declaration.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/emptyFile-declaration.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile-souremap.symbols b/tests/baselines/reference/emptyFile-souremap.symbols new file mode 100644 index 00000000000..5c7f48cfb49 --- /dev/null +++ b/tests/baselines/reference/emptyFile-souremap.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/emptyFile-souremap.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emptyFile.symbols b/tests/baselines/reference/emptyFile.symbols new file mode 100644 index 00000000000..95478466b8a --- /dev/null +++ b/tests/baselines/reference/emptyFile.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/emptyFile.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/emptyIndexer.symbols b/tests/baselines/reference/emptyIndexer.symbols new file mode 100644 index 00000000000..6c3bad02349 --- /dev/null +++ b/tests/baselines/reference/emptyIndexer.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/emptyIndexer.ts === +interface I1 { +>I1 : Symbol(I1, Decl(emptyIndexer.ts, 0, 0)) + + m(): number; +>m : Symbol(m, Decl(emptyIndexer.ts, 0, 14)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(emptyIndexer.ts, 2, 1)) + + [s:string]: I1; +>s : Symbol(s, Decl(emptyIndexer.ts, 5, 2)) +>I1 : Symbol(I1, Decl(emptyIndexer.ts, 0, 0)) +} + + +var x: I2; +>x : Symbol(x, Decl(emptyIndexer.ts, 9, 3)) +>I2 : Symbol(I2, Decl(emptyIndexer.ts, 2, 1)) + +var n = x[''].m(); // should not crash compiler +>n : Symbol(n, Decl(emptyIndexer.ts, 11, 3)) +>x[''].m : Symbol(I1.m, Decl(emptyIndexer.ts, 0, 14)) +>x : Symbol(x, Decl(emptyIndexer.ts, 9, 3)) +>m : Symbol(I1.m, Decl(emptyIndexer.ts, 0, 14)) + diff --git a/tests/baselines/reference/emptyIndexer.types b/tests/baselines/reference/emptyIndexer.types index 949e7370e78..5361ed4d7f4 100644 --- a/tests/baselines/reference/emptyIndexer.types +++ b/tests/baselines/reference/emptyIndexer.types @@ -25,5 +25,6 @@ var n = x[''].m(); // should not crash compiler >x[''].m : () => number >x[''] : I1 >x : I2 +>'' : string >m : () => number diff --git a/tests/baselines/reference/enumBasics.symbols b/tests/baselines/reference/enumBasics.symbols new file mode 100644 index 00000000000..32bbfc3124e --- /dev/null +++ b/tests/baselines/reference/enumBasics.symbols @@ -0,0 +1,210 @@ +=== tests/cases/conformance/enums/enumBasics.ts === +// Enum without initializers have first member = 0 and successive members = N + 1 +enum E1 { +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + + A, +>A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9)) + + B, +>B : Symbol(E1.B, Decl(enumBasics.ts, 2, 6)) + + C +>C : Symbol(E1.C, Decl(enumBasics.ts, 3, 6)) +} + +// Enum type is a subtype of Number +var x: number = E1.A; +>x : Symbol(x, Decl(enumBasics.ts, 8, 3)) +>E1.A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) +>A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9)) + +// Enum object type is anonymous with properties of the enum type and numeric indexer +var e = E1; +>e : Symbol(e, Decl(enumBasics.ts, 11, 3), Decl(enumBasics.ts, 12, 3), Decl(enumBasics.ts, 18, 3)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + +var e: { +>e : Symbol(e, Decl(enumBasics.ts, 11, 3), Decl(enumBasics.ts, 12, 3), Decl(enumBasics.ts, 18, 3)) + + A: E1; +>A : Symbol(A, Decl(enumBasics.ts, 12, 8)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + + B: E1; +>B : Symbol(B, Decl(enumBasics.ts, 13, 10)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + + C: E1; +>C : Symbol(C, Decl(enumBasics.ts, 14, 10)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + + [n: number]: string; +>n : Symbol(n, Decl(enumBasics.ts, 16, 5)) + +}; +var e: typeof E1; +>e : Symbol(e, Decl(enumBasics.ts, 11, 3), Decl(enumBasics.ts, 12, 3), Decl(enumBasics.ts, 18, 3)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) + +// Reverse mapping of enum returns string name of property +var s = E1[e.A]; +>s : Symbol(s, Decl(enumBasics.ts, 21, 3), Decl(enumBasics.ts, 22, 3)) +>E1 : Symbol(E1, Decl(enumBasics.ts, 0, 0)) +>e.A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9)) +>e : Symbol(e, Decl(enumBasics.ts, 11, 3), Decl(enumBasics.ts, 12, 3), Decl(enumBasics.ts, 18, 3)) +>A : Symbol(E1.A, Decl(enumBasics.ts, 1, 9)) + +var s: string; +>s : Symbol(s, Decl(enumBasics.ts, 21, 3), Decl(enumBasics.ts, 22, 3)) + + +// Enum with only constant members +enum E2 { +>E2 : Symbol(E2, Decl(enumBasics.ts, 22, 14)) + + A = 1, B = 2, C = 3 +>A : Symbol(E2.A, Decl(enumBasics.ts, 26, 9)) +>B : Symbol(E2.B, Decl(enumBasics.ts, 27, 10)) +>C : Symbol(E2.C, Decl(enumBasics.ts, 27, 17)) +} + +// Enum with only computed members +enum E3 { +>E3 : Symbol(E3, Decl(enumBasics.ts, 28, 1)) + + X = 'foo'.length, Y = 4 + 3, Z = +'foo' +>X : Symbol(E3.X, Decl(enumBasics.ts, 31, 9)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>Y : Symbol(E3.Y, Decl(enumBasics.ts, 32, 21)) +>Z : Symbol(E3.Z, Decl(enumBasics.ts, 32, 32)) +} + +// Enum with constant members followed by computed members +enum E4 { +>E4 : Symbol(E4, Decl(enumBasics.ts, 33, 1)) + + X = 0, Y, Z = 'foo'.length +>X : Symbol(E4.X, Decl(enumBasics.ts, 36, 9)) +>Y : Symbol(E4.Y, Decl(enumBasics.ts, 37, 10)) +>Z : Symbol(E4.Z, Decl(enumBasics.ts, 37, 13)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +} + +// Enum with > 2 constant members with no initializer for first member, non zero initializer for second element +enum E5 { +>E5 : Symbol(E5, Decl(enumBasics.ts, 38, 1)) + + A, +>A : Symbol(E5.A, Decl(enumBasics.ts, 41, 9)) + + B = 3, +>B : Symbol(E5.B, Decl(enumBasics.ts, 42, 6)) + + C // 4 +>C : Symbol(E5.C, Decl(enumBasics.ts, 43, 10)) +} + +enum E6 { +>E6 : Symbol(E6, Decl(enumBasics.ts, 45, 1)) + + A, +>A : Symbol(E6.A, Decl(enumBasics.ts, 47, 9)) + + B = 0, +>B : Symbol(E6.B, Decl(enumBasics.ts, 48, 6)) + + C // 1 +>C : Symbol(E6.C, Decl(enumBasics.ts, 49, 10)) +} + +// Enum with computed member initializer of type 'any' +enum E7 { +>E7 : Symbol(E7, Decl(enumBasics.ts, 51, 1)) + + A = 'foo'['foo'] +>A : Symbol(E7.A, Decl(enumBasics.ts, 54, 9)) +} + +// Enum with computed member initializer of type number +enum E8 { +>E8 : Symbol(E8, Decl(enumBasics.ts, 56, 1)) + + B = 'foo'['foo'] +>B : Symbol(E8.B, Decl(enumBasics.ts, 59, 9)) +} + +//Enum with computed member intializer of same enum type +enum E9 { +>E9 : Symbol(E9, Decl(enumBasics.ts, 61, 1)) + + A, +>A : Symbol(E9.A, Decl(enumBasics.ts, 64, 9)) + + B = A +>B : Symbol(E9.B, Decl(enumBasics.ts, 65, 6)) +>A : Symbol(E9.A, Decl(enumBasics.ts, 64, 9)) +} + +// (refer to .js to validate) +// Enum constant members are propagated +var doNotPropagate = [ +>doNotPropagate : Symbol(doNotPropagate, Decl(enumBasics.ts, 71, 3)) + + E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z +>E8.B : Symbol(E8.B, Decl(enumBasics.ts, 59, 9)) +>E8 : Symbol(E8, Decl(enumBasics.ts, 56, 1)) +>B : Symbol(E8.B, Decl(enumBasics.ts, 59, 9)) +>E7.A : Symbol(E7.A, Decl(enumBasics.ts, 54, 9)) +>E7 : Symbol(E7, Decl(enumBasics.ts, 51, 1)) +>A : Symbol(E7.A, Decl(enumBasics.ts, 54, 9)) +>E4.Z : Symbol(E4.Z, Decl(enumBasics.ts, 37, 13)) +>E4 : Symbol(E4, Decl(enumBasics.ts, 33, 1)) +>Z : Symbol(E4.Z, Decl(enumBasics.ts, 37, 13)) +>E3.X : Symbol(E3.X, Decl(enumBasics.ts, 31, 9)) +>E3 : Symbol(E3, Decl(enumBasics.ts, 28, 1)) +>X : Symbol(E3.X, Decl(enumBasics.ts, 31, 9)) +>E3.Y : Symbol(E3.Y, Decl(enumBasics.ts, 32, 21)) +>E3 : Symbol(E3, Decl(enumBasics.ts, 28, 1)) +>Y : Symbol(E3.Y, Decl(enumBasics.ts, 32, 21)) +>E3.Z : Symbol(E3.Z, Decl(enumBasics.ts, 32, 32)) +>E3 : Symbol(E3, Decl(enumBasics.ts, 28, 1)) +>Z : Symbol(E3.Z, Decl(enumBasics.ts, 32, 32)) + +]; +// Enum computed members are not propagated +var doPropagate = [ +>doPropagate : Symbol(doPropagate, Decl(enumBasics.ts, 75, 3)) + + E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C +>E9.A : Symbol(E9.A, Decl(enumBasics.ts, 64, 9)) +>E9 : Symbol(E9, Decl(enumBasics.ts, 61, 1)) +>A : Symbol(E9.A, Decl(enumBasics.ts, 64, 9)) +>E9.B : Symbol(E9.B, Decl(enumBasics.ts, 65, 6)) +>E9 : Symbol(E9, Decl(enumBasics.ts, 61, 1)) +>B : Symbol(E9.B, Decl(enumBasics.ts, 65, 6)) +>E6.B : Symbol(E6.B, Decl(enumBasics.ts, 48, 6)) +>E6 : Symbol(E6, Decl(enumBasics.ts, 45, 1)) +>B : Symbol(E6.B, Decl(enumBasics.ts, 48, 6)) +>E6.C : Symbol(E6.C, Decl(enumBasics.ts, 49, 10)) +>E6 : Symbol(E6, Decl(enumBasics.ts, 45, 1)) +>C : Symbol(E6.C, Decl(enumBasics.ts, 49, 10)) +>E6.A : Symbol(E6.A, Decl(enumBasics.ts, 47, 9)) +>E6 : Symbol(E6, Decl(enumBasics.ts, 45, 1)) +>A : Symbol(E6.A, Decl(enumBasics.ts, 47, 9)) +>E5.A : Symbol(E5.A, Decl(enumBasics.ts, 41, 9)) +>E5 : Symbol(E5, Decl(enumBasics.ts, 38, 1)) +>A : Symbol(E5.A, Decl(enumBasics.ts, 41, 9)) +>E5.B : Symbol(E5.B, Decl(enumBasics.ts, 42, 6)) +>E5 : Symbol(E5, Decl(enumBasics.ts, 38, 1)) +>B : Symbol(E5.B, Decl(enumBasics.ts, 42, 6)) +>E5.C : Symbol(E5.C, Decl(enumBasics.ts, 43, 10)) +>E5 : Symbol(E5, Decl(enumBasics.ts, 38, 1)) +>C : Symbol(E5.C, Decl(enumBasics.ts, 43, 10)) + +]; + + diff --git a/tests/baselines/reference/enumBasics.types b/tests/baselines/reference/enumBasics.types index c0d7fb9bed1..6a147f01062 100644 --- a/tests/baselines/reference/enumBasics.types +++ b/tests/baselines/reference/enumBasics.types @@ -67,8 +67,11 @@ enum E2 { A = 1, B = 2, C = 3 >A : E2 +>1 : number >B : E2 +>2 : number >C : E2 +>3 : number } // Enum with only computed members @@ -78,11 +81,15 @@ enum E3 { X = 'foo'.length, Y = 4 + 3, Z = +'foo' >X : E3 >'foo'.length : number +>'foo' : string >length : number >Y : E3 >4 + 3 : number +>4 : number +>3 : number >Z : E3 >+'foo' : number +>'foo' : string } // Enum with constant members followed by computed members @@ -91,9 +98,11 @@ enum E4 { X = 0, Y, Z = 'foo'.length >X : E4 +>0 : number >Y : E4 >Z : E4 >'foo'.length : number +>'foo' : string >length : number } @@ -106,6 +115,7 @@ enum E5 { B = 3, >B : E5 +>3 : number C // 4 >C : E5 @@ -119,6 +129,7 @@ enum E6 { B = 0, >B : E6 +>0 : number C // 1 >C : E6 @@ -131,6 +142,8 @@ enum E7 { A = 'foo'['foo'] >A : E7 >'foo'['foo'] : any +>'foo' : string +>'foo' : string } // Enum with computed member initializer of type number @@ -140,6 +153,8 @@ enum E8 { B = 'foo'['foo'] >B : E8 >'foo'['foo'] : any +>'foo' : string +>'foo' : string } //Enum with computed member intializer of same enum type diff --git a/tests/baselines/reference/enumCodeGenNewLines1.symbols b/tests/baselines/reference/enumCodeGenNewLines1.symbols new file mode 100644 index 00000000000..c995cd60f75 --- /dev/null +++ b/tests/baselines/reference/enumCodeGenNewLines1.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/enumCodeGenNewLines1.ts === +enum foo { +>foo : Symbol(foo, Decl(enumCodeGenNewLines1.ts, 0, 0)) + + b = 1, +>b : Symbol(foo.b, Decl(enumCodeGenNewLines1.ts, 0, 10)) + + c = 2, +>c : Symbol(foo.c, Decl(enumCodeGenNewLines1.ts, 1, 8)) + + d = 3 +>d : Symbol(foo.d, Decl(enumCodeGenNewLines1.ts, 2, 8)) +} + diff --git a/tests/baselines/reference/enumCodeGenNewLines1.types b/tests/baselines/reference/enumCodeGenNewLines1.types index 51c09daa0ff..6321511ef2d 100644 --- a/tests/baselines/reference/enumCodeGenNewLines1.types +++ b/tests/baselines/reference/enumCodeGenNewLines1.types @@ -4,11 +4,14 @@ enum foo { b = 1, >b : foo +>1 : number c = 2, >c : foo +>2 : number d = 3 >d : foo +>3 : number } diff --git a/tests/baselines/reference/enumDecl1.symbols b/tests/baselines/reference/enumDecl1.symbols new file mode 100644 index 00000000000..fc8d900ff04 --- /dev/null +++ b/tests/baselines/reference/enumDecl1.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/enumDecl1.ts === + +declare module mAmbient { +>mAmbient : Symbol(mAmbient, Decl(enumDecl1.ts, 0, 0)) + + enum e { +>e : Symbol(e, Decl(enumDecl1.ts, 1, 25)) + + x, +>x : Symbol(e.x, Decl(enumDecl1.ts, 2, 12)) + + y, +>y : Symbol(e.y, Decl(enumDecl1.ts, 3, 10)) + + z +>z : Symbol(e.z, Decl(enumDecl1.ts, 4, 10)) + } +} + diff --git a/tests/baselines/reference/enumFromExternalModule.symbols b/tests/baselines/reference/enumFromExternalModule.symbols new file mode 100644 index 00000000000..90ff7cd7aac --- /dev/null +++ b/tests/baselines/reference/enumFromExternalModule.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/enumFromExternalModule_1.ts === +/// +import f = require('enumFromExternalModule_0'); +>f : Symbol(f, Decl(enumFromExternalModule_1.ts, 0, 0)) + +var x = f.Mode.Open; +>x : Symbol(x, Decl(enumFromExternalModule_1.ts, 3, 3)) +>f.Mode.Open : Symbol(f.Mode.Open, Decl(enumFromExternalModule_0.ts, 0, 18)) +>f.Mode : Symbol(f.Mode, Decl(enumFromExternalModule_0.ts, 0, 0)) +>f : Symbol(f, Decl(enumFromExternalModule_1.ts, 0, 0)) +>Mode : Symbol(f.Mode, Decl(enumFromExternalModule_0.ts, 0, 0)) +>Open : Symbol(f.Mode.Open, Decl(enumFromExternalModule_0.ts, 0, 18)) + +=== tests/cases/compiler/enumFromExternalModule_0.ts === +export enum Mode { Open } +>Mode : Symbol(Mode, Decl(enumFromExternalModule_0.ts, 0, 0)) +>Open : Symbol(Mode.Open, Decl(enumFromExternalModule_0.ts, 0, 18)) + diff --git a/tests/baselines/reference/enumIndexer.symbols b/tests/baselines/reference/enumIndexer.symbols new file mode 100644 index 00000000000..3f65044c2ec --- /dev/null +++ b/tests/baselines/reference/enumIndexer.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/enumIndexer.ts === +enum MyEnumType { +>MyEnumType : Symbol(MyEnumType, Decl(enumIndexer.ts, 0, 0)) + + foo, bar +>foo : Symbol(MyEnumType.foo, Decl(enumIndexer.ts, 0, 17)) +>bar : Symbol(MyEnumType.bar, Decl(enumIndexer.ts, 1, 8)) +} +var _arr = [{ key: 'foo' }, { key: 'bar' }] +>_arr : Symbol(_arr, Decl(enumIndexer.ts, 3, 3)) +>key : Symbol(key, Decl(enumIndexer.ts, 3, 13)) +>key : Symbol(key, Decl(enumIndexer.ts, 3, 29)) + +var enumValue = MyEnumType.foo; +>enumValue : Symbol(enumValue, Decl(enumIndexer.ts, 4, 3)) +>MyEnumType.foo : Symbol(MyEnumType.foo, Decl(enumIndexer.ts, 0, 17)) +>MyEnumType : Symbol(MyEnumType, Decl(enumIndexer.ts, 0, 0)) +>foo : Symbol(MyEnumType.foo, Decl(enumIndexer.ts, 0, 17)) + +var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type +>x : Symbol(x, Decl(enumIndexer.ts, 5, 3)) +>_arr.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>_arr : Symbol(_arr, Decl(enumIndexer.ts, 3, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>o : Symbol(o, Decl(enumIndexer.ts, 5, 17)) +>MyEnumType : Symbol(MyEnumType, Decl(enumIndexer.ts, 0, 0)) +>o.key : Symbol(key, Decl(enumIndexer.ts, 3, 13)) +>o : Symbol(o, Decl(enumIndexer.ts, 5, 17)) +>key : Symbol(key, Decl(enumIndexer.ts, 3, 13)) +>enumValue : Symbol(enumValue, Decl(enumIndexer.ts, 4, 3)) + diff --git a/tests/baselines/reference/enumIndexer.types b/tests/baselines/reference/enumIndexer.types index cbd7c3274a6..cbc43176b01 100644 --- a/tests/baselines/reference/enumIndexer.types +++ b/tests/baselines/reference/enumIndexer.types @@ -11,8 +11,10 @@ var _arr = [{ key: 'foo' }, { key: 'bar' }] >[{ key: 'foo' }, { key: 'bar' }] : { key: string; }[] >{ key: 'foo' } : { key: string; } >key : string +>'foo' : string >{ key: 'bar' } : { key: string; } >key : string +>'bar' : string var enumValue = MyEnumType.foo; >enumValue : MyEnumType diff --git a/tests/baselines/reference/enumMapBackIntoItself.symbols b/tests/baselines/reference/enumMapBackIntoItself.symbols new file mode 100644 index 00000000000..49464c5522d --- /dev/null +++ b/tests/baselines/reference/enumMapBackIntoItself.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/enumMapBackIntoItself.ts === +enum TShirtSize { +>TShirtSize : Symbol(TShirtSize, Decl(enumMapBackIntoItself.ts, 0, 0)) + + Small, +>Small : Symbol(TShirtSize.Small, Decl(enumMapBackIntoItself.ts, 0, 17)) + + Medium, +>Medium : Symbol(TShirtSize.Medium, Decl(enumMapBackIntoItself.ts, 1, 9)) + + Large +>Large : Symbol(TShirtSize.Large, Decl(enumMapBackIntoItself.ts, 2, 10)) +} +var mySize = TShirtSize.Large; +>mySize : Symbol(mySize, Decl(enumMapBackIntoItself.ts, 5, 3)) +>TShirtSize.Large : Symbol(TShirtSize.Large, Decl(enumMapBackIntoItself.ts, 2, 10)) +>TShirtSize : Symbol(TShirtSize, Decl(enumMapBackIntoItself.ts, 0, 0)) +>Large : Symbol(TShirtSize.Large, Decl(enumMapBackIntoItself.ts, 2, 10)) + +var test = TShirtSize[mySize]; +>test : Symbol(test, Decl(enumMapBackIntoItself.ts, 6, 3)) +>TShirtSize : Symbol(TShirtSize, Decl(enumMapBackIntoItself.ts, 0, 0)) +>mySize : Symbol(mySize, Decl(enumMapBackIntoItself.ts, 5, 3)) + +// specifically checking output here, bug was that test used to be undefined at runtime +test + '' +>test : Symbol(test, Decl(enumMapBackIntoItself.ts, 6, 3)) + diff --git a/tests/baselines/reference/enumMapBackIntoItself.types b/tests/baselines/reference/enumMapBackIntoItself.types index d97dbcf85db..ab26094512b 100644 --- a/tests/baselines/reference/enumMapBackIntoItself.types +++ b/tests/baselines/reference/enumMapBackIntoItself.types @@ -27,4 +27,5 @@ var test = TShirtSize[mySize]; test + '' >test + '' : string >test : string +>'' : string diff --git a/tests/baselines/reference/enumMerging.symbols b/tests/baselines/reference/enumMerging.symbols new file mode 100644 index 00000000000..414dd839952 --- /dev/null +++ b/tests/baselines/reference/enumMerging.symbols @@ -0,0 +1,201 @@ +=== tests/cases/conformance/enums/enumMerging.ts === +// Enum with only constant members across 2 declarations with the same root module +// Enum with initializer in all declarations with constant members with the same root module +module M1 { +>M1 : Symbol(M1, Decl(enumMerging.ts, 0, 0)) + + enum EImpl1 { +>EImpl1 : Symbol(EImpl1, Decl(enumMerging.ts, 2, 11), Decl(enumMerging.ts, 5, 5)) + + A, B, C +>A : Symbol(EImpl1.A, Decl(enumMerging.ts, 3, 17)) +>B : Symbol(EImpl1.B, Decl(enumMerging.ts, 4, 10)) +>C : Symbol(EImpl1.C, Decl(enumMerging.ts, 4, 13)) + } + + enum EImpl1 { +>EImpl1 : Symbol(EImpl1, Decl(enumMerging.ts, 2, 11), Decl(enumMerging.ts, 5, 5)) + + D = 1, E, F +>D : Symbol(EImpl1.D, Decl(enumMerging.ts, 7, 17)) +>E : Symbol(EImpl1.E, Decl(enumMerging.ts, 8, 14)) +>F : Symbol(EImpl1.F, Decl(enumMerging.ts, 8, 17)) + } + + export enum EConst1 { +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) + + A = 3, B = 2, C = 1 +>A : Symbol(EConst1.A, Decl(enumMerging.ts, 11, 25)) +>B : Symbol(EConst1.B, Decl(enumMerging.ts, 12, 14)) +>C : Symbol(EConst1.C, Decl(enumMerging.ts, 12, 21)) + } + + export enum EConst1 { +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) + + D = 7, E = 9, F = 8 +>D : Symbol(EConst1.D, Decl(enumMerging.ts, 15, 25)) +>E : Symbol(EConst1.E, Decl(enumMerging.ts, 16, 14)) +>F : Symbol(EConst1.F, Decl(enumMerging.ts, 16, 21)) + } + + var x = [EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F]; +>x : Symbol(x, Decl(enumMerging.ts, 19, 7)) +>EConst1.A : Symbol(EConst1.A, Decl(enumMerging.ts, 11, 25)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>A : Symbol(EConst1.A, Decl(enumMerging.ts, 11, 25)) +>EConst1.B : Symbol(EConst1.B, Decl(enumMerging.ts, 12, 14)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>B : Symbol(EConst1.B, Decl(enumMerging.ts, 12, 14)) +>EConst1.C : Symbol(EConst1.C, Decl(enumMerging.ts, 12, 21)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>C : Symbol(EConst1.C, Decl(enumMerging.ts, 12, 21)) +>EConst1.D : Symbol(EConst1.D, Decl(enumMerging.ts, 15, 25)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>D : Symbol(EConst1.D, Decl(enumMerging.ts, 15, 25)) +>EConst1.E : Symbol(EConst1.E, Decl(enumMerging.ts, 16, 14)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>E : Symbol(EConst1.E, Decl(enumMerging.ts, 16, 14)) +>EConst1.F : Symbol(EConst1.F, Decl(enumMerging.ts, 16, 21)) +>EConst1 : Symbol(EConst1, Decl(enumMerging.ts, 9, 5), Decl(enumMerging.ts, 13, 5)) +>F : Symbol(EConst1.F, Decl(enumMerging.ts, 16, 21)) +} + +// Enum with only computed members across 2 declarations with the same root module +module M2 { +>M2 : Symbol(M2, Decl(enumMerging.ts, 20, 1)) + + export enum EComp2 { +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) + + A = 'foo'.length, B = 'foo'.length, C = 'foo'.length +>A : Symbol(EComp2.A, Decl(enumMerging.ts, 24, 24)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>B : Symbol(EComp2.B, Decl(enumMerging.ts, 25, 25)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>C : Symbol(EComp2.C, Decl(enumMerging.ts, 25, 43)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + } + + export enum EComp2 { +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) + + D = 'foo'.length, E = 'foo'.length, F = 'foo'.length +>D : Symbol(EComp2.D, Decl(enumMerging.ts, 28, 24)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>E : Symbol(EComp2.E, Decl(enumMerging.ts, 29, 25)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>F : Symbol(EComp2.F, Decl(enumMerging.ts, 29, 43)) +>'foo'.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + } + + var x = [EComp2.A, EComp2.B, EComp2.C, EComp2.D, EComp2.E, EComp2.F]; +>x : Symbol(x, Decl(enumMerging.ts, 32, 7)) +>EComp2.A : Symbol(EComp2.A, Decl(enumMerging.ts, 24, 24)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>A : Symbol(EComp2.A, Decl(enumMerging.ts, 24, 24)) +>EComp2.B : Symbol(EComp2.B, Decl(enumMerging.ts, 25, 25)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>B : Symbol(EComp2.B, Decl(enumMerging.ts, 25, 25)) +>EComp2.C : Symbol(EComp2.C, Decl(enumMerging.ts, 25, 43)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>C : Symbol(EComp2.C, Decl(enumMerging.ts, 25, 43)) +>EComp2.D : Symbol(EComp2.D, Decl(enumMerging.ts, 28, 24)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>D : Symbol(EComp2.D, Decl(enumMerging.ts, 28, 24)) +>EComp2.E : Symbol(EComp2.E, Decl(enumMerging.ts, 29, 25)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>E : Symbol(EComp2.E, Decl(enumMerging.ts, 29, 25)) +>EComp2.F : Symbol(EComp2.F, Decl(enumMerging.ts, 29, 43)) +>EComp2 : Symbol(EComp2, Decl(enumMerging.ts, 23, 11), Decl(enumMerging.ts, 26, 5)) +>F : Symbol(EComp2.F, Decl(enumMerging.ts, 29, 43)) +} + +// Enum with initializer in only one of two declarations with constant members with the same root module +module M3 { +>M3 : Symbol(M3, Decl(enumMerging.ts, 33, 1)) + + enum EInit { +>EInit : Symbol(EInit, Decl(enumMerging.ts, 36, 11), Decl(enumMerging.ts, 40, 5)) + + A, +>A : Symbol(EInit.A, Decl(enumMerging.ts, 37, 16)) + + B +>B : Symbol(EInit.B, Decl(enumMerging.ts, 38, 10)) + } + + enum EInit { +>EInit : Symbol(EInit, Decl(enumMerging.ts, 36, 11), Decl(enumMerging.ts, 40, 5)) + + C = 1, D, E +>C : Symbol(EInit.C, Decl(enumMerging.ts, 42, 16)) +>D : Symbol(EInit.D, Decl(enumMerging.ts, 43, 14)) +>E : Symbol(EInit.E, Decl(enumMerging.ts, 43, 17)) + } +} + +// Enums with same name but different root module +module M4 { +>M4 : Symbol(M4, Decl(enumMerging.ts, 45, 1)) + + export enum Color { Red, Green, Blue } +>Color : Symbol(Color, Decl(enumMerging.ts, 48, 11)) +>Red : Symbol(Color.Red, Decl(enumMerging.ts, 49, 23)) +>Green : Symbol(Color.Green, Decl(enumMerging.ts, 49, 28)) +>Blue : Symbol(Color.Blue, Decl(enumMerging.ts, 49, 35)) +} +module M5 { +>M5 : Symbol(M5, Decl(enumMerging.ts, 50, 1)) + + export enum Color { Red, Green, Blue } +>Color : Symbol(Color, Decl(enumMerging.ts, 51, 11)) +>Red : Symbol(Color.Red, Decl(enumMerging.ts, 52, 23)) +>Green : Symbol(Color.Green, Decl(enumMerging.ts, 52, 28)) +>Blue : Symbol(Color.Blue, Decl(enumMerging.ts, 52, 35)) +} + +module M6.A { +>M6 : Symbol(M6, Decl(enumMerging.ts, 53, 1), Decl(enumMerging.ts, 57, 1)) +>A : Symbol(A, Decl(enumMerging.ts, 55, 10), Decl(enumMerging.ts, 58, 11)) + + export enum Color { Red, Green, Blue } +>Color : Symbol(Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>Red : Symbol(Color.Red, Decl(enumMerging.ts, 56, 23)) +>Green : Symbol(Color.Green, Decl(enumMerging.ts, 56, 28)) +>Blue : Symbol(Color.Blue, Decl(enumMerging.ts, 56, 35)) +} +module M6 { +>M6 : Symbol(M6, Decl(enumMerging.ts, 53, 1), Decl(enumMerging.ts, 57, 1)) + + export module A { +>A : Symbol(A, Decl(enumMerging.ts, 55, 10), Decl(enumMerging.ts, 58, 11)) + + export enum Color { Yellow = 1 } +>Color : Symbol(Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>Yellow : Symbol(Color.Yellow, Decl(enumMerging.ts, 60, 27)) + } + var t = A.Color.Yellow; +>t : Symbol(t, Decl(enumMerging.ts, 62, 7)) +>A.Color.Yellow : Symbol(A.Color.Yellow, Decl(enumMerging.ts, 60, 27)) +>A.Color : Symbol(A.Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>A : Symbol(A, Decl(enumMerging.ts, 55, 10), Decl(enumMerging.ts, 58, 11)) +>Color : Symbol(A.Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>Yellow : Symbol(A.Color.Yellow, Decl(enumMerging.ts, 60, 27)) + + t = A.Color.Red; +>t : Symbol(t, Decl(enumMerging.ts, 62, 7)) +>A.Color.Red : Symbol(A.Color.Red, Decl(enumMerging.ts, 56, 23)) +>A.Color : Symbol(A.Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>A : Symbol(A, Decl(enumMerging.ts, 55, 10), Decl(enumMerging.ts, 58, 11)) +>Color : Symbol(A.Color, Decl(enumMerging.ts, 55, 13), Decl(enumMerging.ts, 59, 21)) +>Red : Symbol(A.Color.Red, Decl(enumMerging.ts, 56, 23)) +} + diff --git a/tests/baselines/reference/enumMerging.types b/tests/baselines/reference/enumMerging.types index c61f9e17739..85eb360249f 100644 --- a/tests/baselines/reference/enumMerging.types +++ b/tests/baselines/reference/enumMerging.types @@ -18,6 +18,7 @@ module M1 { D = 1, E, F >D : EImpl1 +>1 : number >E : EImpl1 >F : EImpl1 } @@ -27,8 +28,11 @@ module M1 { A = 3, B = 2, C = 1 >A : EConst1 +>3 : number >B : EConst1 +>2 : number >C : EConst1 +>1 : number } export enum EConst1 { @@ -36,8 +40,11 @@ module M1 { D = 7, E = 9, F = 8 >D : EConst1 +>7 : number >E : EConst1 +>9 : number >F : EConst1 +>8 : number } var x = [EConst1.A, EConst1.B, EConst1.C, EConst1.D, EConst1.E, EConst1.F]; @@ -73,12 +80,15 @@ module M2 { A = 'foo'.length, B = 'foo'.length, C = 'foo'.length >A : EComp2 >'foo'.length : number +>'foo' : string >length : number >B : EComp2 >'foo'.length : number +>'foo' : string >length : number >C : EComp2 >'foo'.length : number +>'foo' : string >length : number } @@ -88,12 +98,15 @@ module M2 { D = 'foo'.length, E = 'foo'.length, F = 'foo'.length >D : EComp2 >'foo'.length : number +>'foo' : string >length : number >E : EComp2 >'foo'.length : number +>'foo' : string >length : number >F : EComp2 >'foo'.length : number +>'foo' : string >length : number } @@ -139,6 +152,7 @@ module M3 { C = 1, D, E >C : EInit +>1 : number >D : EInit >E : EInit } @@ -183,6 +197,7 @@ module M6 { export enum Color { Yellow = 1 } >Color : Color >Yellow : Color +>1 : number } var t = A.Color.Yellow; >t : A.Color diff --git a/tests/baselines/reference/enumNegativeLiteral1.symbols b/tests/baselines/reference/enumNegativeLiteral1.symbols new file mode 100644 index 00000000000..cfb7c52ecb2 --- /dev/null +++ b/tests/baselines/reference/enumNegativeLiteral1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/enumNegativeLiteral1.ts === +enum E { +>E : Symbol(E, Decl(enumNegativeLiteral1.ts, 0, 0)) + + a = -5, b, c +>a : Symbol(E.a, Decl(enumNegativeLiteral1.ts, 0, 8)) +>b : Symbol(E.b, Decl(enumNegativeLiteral1.ts, 1, 11)) +>c : Symbol(E.c, Decl(enumNegativeLiteral1.ts, 1, 14)) +} + diff --git a/tests/baselines/reference/enumNegativeLiteral1.types b/tests/baselines/reference/enumNegativeLiteral1.types index 329c54e276b..31ecbc11aa2 100644 --- a/tests/baselines/reference/enumNegativeLiteral1.types +++ b/tests/baselines/reference/enumNegativeLiteral1.types @@ -5,6 +5,7 @@ enum E { a = -5, b, c >a : E >-5 : number +>5 : number >b : E >c : E } diff --git a/tests/baselines/reference/enumNumbering1.symbols b/tests/baselines/reference/enumNumbering1.symbols new file mode 100644 index 00000000000..7722b5bad78 --- /dev/null +++ b/tests/baselines/reference/enumNumbering1.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/enumNumbering1.ts === +enum Test { +>Test : Symbol(Test, Decl(enumNumbering1.ts, 0, 0)) + + A, +>A : Symbol(Test.A, Decl(enumNumbering1.ts, 0, 11)) + + B, +>B : Symbol(Test.B, Decl(enumNumbering1.ts, 1, 6)) + + C = Math.floor(Math.random() * 1000), +>C : Symbol(Test.C, Decl(enumNumbering1.ts, 2, 6)) +>Math.floor : Symbol(Math.floor, Decl(lib.d.ts, 582, 27)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>floor : Symbol(Math.floor, Decl(lib.d.ts, 582, 27)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) + + D = 10, +>D : Symbol(Test.D, Decl(enumNumbering1.ts, 3, 41)) + + E // Error but shouldn't be +>E : Symbol(Test.E, Decl(enumNumbering1.ts, 4, 11)) +} + diff --git a/tests/baselines/reference/enumNumbering1.types b/tests/baselines/reference/enumNumbering1.types index 00e8eb95da9..81bb0325b7a 100644 --- a/tests/baselines/reference/enumNumbering1.types +++ b/tests/baselines/reference/enumNumbering1.types @@ -19,9 +19,11 @@ enum Test { >Math.random : () => number >Math : Math >random : () => number +>1000 : number D = 10, >D : Test +>10 : number E // Error but shouldn't be >E : Test diff --git a/tests/baselines/reference/enumOperations.symbols b/tests/baselines/reference/enumOperations.symbols new file mode 100644 index 00000000000..392b8bd648f --- /dev/null +++ b/tests/baselines/reference/enumOperations.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/enumOperations.ts === +enum Enum { None = 0 } +>Enum : Symbol(Enum, Decl(enumOperations.ts, 0, 0)) +>None : Symbol(Enum.None, Decl(enumOperations.ts, 0, 11)) + +var enumType: Enum = Enum.None; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>Enum : Symbol(Enum, Decl(enumOperations.ts, 0, 0)) +>Enum.None : Symbol(Enum.None, Decl(enumOperations.ts, 0, 11)) +>Enum : Symbol(Enum, Decl(enumOperations.ts, 0, 0)) +>None : Symbol(Enum.None, Decl(enumOperations.ts, 0, 11)) + +var numberType: number = 0; +>numberType : Symbol(numberType, Decl(enumOperations.ts, 2, 3)) + +var anyType: any = 0; +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType ^ numberType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>numberType : Symbol(numberType, Decl(enumOperations.ts, 2, 3)) + +numberType ^ anyType; +>numberType : Symbol(numberType, Decl(enumOperations.ts, 2, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType & anyType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType | anyType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType ^ anyType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +~anyType; +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType <enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType >>anyType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + +enumType >>>anyType; +>enumType : Symbol(enumType, Decl(enumOperations.ts, 1, 3)) +>anyType : Symbol(anyType, Decl(enumOperations.ts, 3, 3)) + diff --git a/tests/baselines/reference/enumOperations.types b/tests/baselines/reference/enumOperations.types index df36d293cf3..232ecc5e71b 100644 --- a/tests/baselines/reference/enumOperations.types +++ b/tests/baselines/reference/enumOperations.types @@ -2,6 +2,7 @@ enum Enum { None = 0 } >Enum : Enum >None : Enum +>0 : number var enumType: Enum = Enum.None; >enumType : Enum @@ -12,9 +13,11 @@ var enumType: Enum = Enum.None; var numberType: number = 0; >numberType : number +>0 : number var anyType: any = 0; >anyType : any +>0 : number enumType ^ numberType; >enumType ^ numberType : number diff --git a/tests/baselines/reference/enumWithQuotedElementName1.symbols b/tests/baselines/reference/enumWithQuotedElementName1.symbols new file mode 100644 index 00000000000..48f861f9726 --- /dev/null +++ b/tests/baselines/reference/enumWithQuotedElementName1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/enumWithQuotedElementName1.ts === +enum E { +>E : Symbol(E, Decl(enumWithQuotedElementName1.ts, 0, 0)) + + 'fo"o', +} diff --git a/tests/baselines/reference/enumWithQuotedElementName2.symbols b/tests/baselines/reference/enumWithQuotedElementName2.symbols new file mode 100644 index 00000000000..245eaa55748 --- /dev/null +++ b/tests/baselines/reference/enumWithQuotedElementName2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/enumWithQuotedElementName2.ts === +enum E { +>E : Symbol(E, Decl(enumWithQuotedElementName2.ts, 0, 0)) + + "fo'o", +} diff --git a/tests/baselines/reference/enumWithUnicodeEscape1.symbols b/tests/baselines/reference/enumWithUnicodeEscape1.symbols new file mode 100644 index 00000000000..a146f87247d --- /dev/null +++ b/tests/baselines/reference/enumWithUnicodeEscape1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/enumWithUnicodeEscape1.ts === +enum E { +>E : Symbol(E, Decl(enumWithUnicodeEscape1.ts, 0, 0)) + + 'gold \u2730' +} + diff --git a/tests/baselines/reference/enumsWithMultipleDeclarations3.symbols b/tests/baselines/reference/enumsWithMultipleDeclarations3.symbols new file mode 100644 index 00000000000..b9e575db9c1 --- /dev/null +++ b/tests/baselines/reference/enumsWithMultipleDeclarations3.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/enumsWithMultipleDeclarations3.ts === +module E { +>E : Symbol(E, Decl(enumsWithMultipleDeclarations3.ts, 0, 0), Decl(enumsWithMultipleDeclarations3.ts, 1, 1)) +} + +enum E { +>E : Symbol(E, Decl(enumsWithMultipleDeclarations3.ts, 0, 0), Decl(enumsWithMultipleDeclarations3.ts, 1, 1)) + + A +>A : Symbol(E.A, Decl(enumsWithMultipleDeclarations3.ts, 3, 8)) +} diff --git a/tests/baselines/reference/es3-amd.symbols b/tests/baselines/reference/es3-amd.symbols new file mode 100644 index 00000000000..f6d1211ad4e --- /dev/null +++ b/tests/baselines/reference/es3-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es3-amd.ts === + +class A +>A : Symbol(A, Decl(es3-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es3-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es3-amd.types b/tests/baselines/reference/es3-amd.types index c43d29ac6dc..1e9fdbd582f 100644 --- a/tests/baselines/reference/es3-amd.types +++ b/tests/baselines/reference/es3-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es3-declaration-amd.symbols b/tests/baselines/reference/es3-declaration-amd.symbols new file mode 100644 index 00000000000..aec4af2bb60 --- /dev/null +++ b/tests/baselines/reference/es3-declaration-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es3-declaration-amd.ts === + +class A +>A : Symbol(A, Decl(es3-declaration-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es3-declaration-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es3-declaration-amd.types b/tests/baselines/reference/es3-declaration-amd.types index 0ee63040166..daf0bb5d74e 100644 --- a/tests/baselines/reference/es3-declaration-amd.types +++ b/tests/baselines/reference/es3-declaration-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es3-sourcemap-amd.symbols b/tests/baselines/reference/es3-sourcemap-amd.symbols new file mode 100644 index 00000000000..ca20348a0f5 --- /dev/null +++ b/tests/baselines/reference/es3-sourcemap-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es3-sourcemap-amd.ts === + +class A +>A : Symbol(A, Decl(es3-sourcemap-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es3-sourcemap-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es3-sourcemap-amd.types b/tests/baselines/reference/es3-sourcemap-amd.types index 5301120e2df..d3f712211e4 100644 --- a/tests/baselines/reference/es3-sourcemap-amd.types +++ b/tests/baselines/reference/es3-sourcemap-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es5-amd.symbols b/tests/baselines/reference/es5-amd.symbols new file mode 100644 index 00000000000..cf99349fc1d --- /dev/null +++ b/tests/baselines/reference/es5-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es5-amd.ts === + +class A +>A : Symbol(A, Decl(es5-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es5-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es5-amd.types b/tests/baselines/reference/es5-amd.types index 289289d3c0b..7dd9e8b281a 100644 --- a/tests/baselines/reference/es5-amd.types +++ b/tests/baselines/reference/es5-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es5-declaration-amd.symbols b/tests/baselines/reference/es5-declaration-amd.symbols new file mode 100644 index 00000000000..a2504a0ea84 --- /dev/null +++ b/tests/baselines/reference/es5-declaration-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es5-declaration-amd.ts === + +class A +>A : Symbol(A, Decl(es5-declaration-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es5-declaration-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es5-declaration-amd.types b/tests/baselines/reference/es5-declaration-amd.types index 50815e8e6bc..ead96c35de1 100644 --- a/tests/baselines/reference/es5-declaration-amd.types +++ b/tests/baselines/reference/es5-declaration-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es5-souremap-amd.symbols b/tests/baselines/reference/es5-souremap-amd.symbols new file mode 100644 index 00000000000..14b22cc74c6 --- /dev/null +++ b/tests/baselines/reference/es5-souremap-amd.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es5-souremap-amd.ts === + +class A +>A : Symbol(A, Decl(es5-souremap-amd.ts, 0, 0)) +{ + constructor () + { + + } + + public B() +>B : Symbol(B, Decl(es5-souremap-amd.ts, 6, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es5-souremap-amd.types b/tests/baselines/reference/es5-souremap-amd.types index 242e6508026..67606d7f1ff 100644 --- a/tests/baselines/reference/es5-souremap-amd.types +++ b/tests/baselines/reference/es5-souremap-amd.types @@ -12,5 +12,6 @@ class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration.symbols b/tests/baselines/reference/es5ExportDefaultClassDeclaration.symbols new file mode 100644 index 00000000000..24196766dfa --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/es5ExportDefaultClassDeclaration.ts === + +export default class C { +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration.ts, 0, 0)) + + method() { } +>method : Symbol(method, Decl(es5ExportDefaultClassDeclaration.ts, 1, 24)) +} + diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration2.symbols b/tests/baselines/reference/es5ExportDefaultClassDeclaration2.symbols new file mode 100644 index 00000000000..0780ff7a3c8 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/es5ExportDefaultClassDeclaration2.ts === + +export default class { + method() { } +>method : Symbol(method, Decl(es5ExportDefaultClassDeclaration2.ts, 1, 22)) +} + diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration3.symbols b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.symbols new file mode 100644 index 00000000000..b5262b94688 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/es5ExportDefaultClassDeclaration3.ts === + +var before: C = new C(); +>before : Symbol(before, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 3)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + +export default class C { +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + + method(): C { +>method : Symbol(method, Decl(es5ExportDefaultClassDeclaration3.ts, 3, 24)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + + return new C(); +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + } +} + +var after: C = new C(); +>after : Symbol(after, Decl(es5ExportDefaultClassDeclaration3.ts, 9, 3)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + +var t: typeof C = C; +>t : Symbol(t, Decl(es5ExportDefaultClassDeclaration3.ts, 11, 3)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) +>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24)) + + diff --git a/tests/baselines/reference/es5ExportDefaultExpression.symbols b/tests/baselines/reference/es5ExportDefaultExpression.symbols new file mode 100644 index 00000000000..3f9f11e283a --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultExpression.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es5ExportDefaultExpression.ts === + +No type information for this code.export default (1 + 2); +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es5ExportDefaultExpression.types b/tests/baselines/reference/es5ExportDefaultExpression.types index 2f4e2b57284..6b371a2fc73 100644 --- a/tests/baselines/reference/es5ExportDefaultExpression.types +++ b/tests/baselines/reference/es5ExportDefaultExpression.types @@ -3,4 +3,6 @@ export default (1 + 2); >(1 + 2) : number >1 + 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration.symbols b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration.symbols new file mode 100644 index 00000000000..6c80a2532e3 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es5ExportDefaultFunctionDeclaration.ts === + +export default function f() { } +>f : Symbol(f, Decl(es5ExportDefaultFunctionDeclaration.ts, 0, 0)) + diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.symbols b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.symbols new file mode 100644 index 00000000000..1b9f9d26151 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es5ExportDefaultFunctionDeclaration2.ts === + +No type information for this code.export default function () { } +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.symbols b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.symbols new file mode 100644 index 00000000000..921a3304e01 --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultFunctionDeclaration3.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/es5ExportDefaultFunctionDeclaration3.ts === + +var before: typeof func = func(); +>before : Symbol(before, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 3)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) + +export default function func(): typeof func { +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) + + return func; +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) +} + +var after: typeof func = func(); +>after : Symbol(after, Decl(es5ExportDefaultFunctionDeclaration3.ts, 7, 3)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) +>func : Symbol(func, Decl(es5ExportDefaultFunctionDeclaration3.ts, 1, 33)) + diff --git a/tests/baselines/reference/es5ExportDefaultIdentifier.symbols b/tests/baselines/reference/es5ExportDefaultIdentifier.symbols new file mode 100644 index 00000000000..78b9a54947a --- /dev/null +++ b/tests/baselines/reference/es5ExportDefaultIdentifier.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/es5ExportDefaultIdentifier.ts === + +export function f() { } +>f : Symbol(f, Decl(es5ExportDefaultIdentifier.ts, 0, 0)) + +export default f; +>f : Symbol(f, Decl(es5ExportDefaultIdentifier.ts, 0, 0)) + diff --git a/tests/baselines/reference/es5ExportEqualsDts.symbols b/tests/baselines/reference/es5ExportEqualsDts.symbols new file mode 100644 index 00000000000..52bf357d177 --- /dev/null +++ b/tests/baselines/reference/es5ExportEqualsDts.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/es5ExportEqualsDts.ts === + +class A { +>A : Symbol(A, Decl(es5ExportEqualsDts.ts, 0, 0), Decl(es5ExportEqualsDts.ts, 6, 1)) + + foo() { +>foo : Symbol(foo, Decl(es5ExportEqualsDts.ts, 1, 9)) + + var aVal: A.B; +>aVal : Symbol(aVal, Decl(es5ExportEqualsDts.ts, 3, 11)) +>A : Symbol(A, Decl(es5ExportEqualsDts.ts, 0, 0), Decl(es5ExportEqualsDts.ts, 6, 1)) +>B : Symbol(A.B, Decl(es5ExportEqualsDts.ts, 8, 10)) + + return aVal; +>aVal : Symbol(aVal, Decl(es5ExportEqualsDts.ts, 3, 11)) + } +} + +module A { +>A : Symbol(A, Decl(es5ExportEqualsDts.ts, 0, 0), Decl(es5ExportEqualsDts.ts, 6, 1)) + + export interface B { } +>B : Symbol(B, Decl(es5ExportEqualsDts.ts, 8, 10)) +} + +export = A +>A : Symbol(A, Decl(es5ExportEqualsDts.ts, 0, 0), Decl(es5ExportEqualsDts.ts, 6, 1)) + diff --git a/tests/baselines/reference/es5ExportEqualsDts.types b/tests/baselines/reference/es5ExportEqualsDts.types index 58b35a0d7ce..265fda6c76c 100644 --- a/tests/baselines/reference/es5ExportEqualsDts.types +++ b/tests/baselines/reference/es5ExportEqualsDts.types @@ -8,7 +8,7 @@ class A { var aVal: A.B; >aVal : A.B ->A : unknown +>A : any >B : A.B return aVal; diff --git a/tests/baselines/reference/es5ModuleWithModuleGenAmd.symbols b/tests/baselines/reference/es5ModuleWithModuleGenAmd.symbols new file mode 100644 index 00000000000..1a853eb37d0 --- /dev/null +++ b/tests/baselines/reference/es5ModuleWithModuleGenAmd.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/es5ModuleWithModuleGenAmd.ts === +export class A +>A : Symbol(A, Decl(es5ModuleWithModuleGenAmd.ts, 0, 0)) +{ + constructor () + { + } + + public B() +>B : Symbol(B, Decl(es5ModuleWithModuleGenAmd.ts, 4, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es5ModuleWithModuleGenAmd.types b/tests/baselines/reference/es5ModuleWithModuleGenAmd.types index e3453587a12..4ae6698d06a 100644 --- a/tests/baselines/reference/es5ModuleWithModuleGenAmd.types +++ b/tests/baselines/reference/es5ModuleWithModuleGenAmd.types @@ -10,5 +10,6 @@ export class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.symbols b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.symbols new file mode 100644 index 00000000000..a69ce05f1ae --- /dev/null +++ b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/es5ModuleWithModuleGenCommonjs.ts === +export class A +>A : Symbol(A, Decl(es5ModuleWithModuleGenCommonjs.ts, 0, 0)) +{ + constructor () + { + } + + public B() +>B : Symbol(B, Decl(es5ModuleWithModuleGenCommonjs.ts, 4, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types index 721df9afe58..425afed82d2 100644 --- a/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types +++ b/tests/baselines/reference/es5ModuleWithModuleGenCommonjs.types @@ -10,5 +10,6 @@ export class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.symbols b/tests/baselines/reference/es6ClassSuperCodegenBug.symbols new file mode 100644 index 00000000000..d520ec3ceb1 --- /dev/null +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/es6ClassSuperCodegenBug.ts === +class A { +>A : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + + constructor(str1:string, str2:string) {} +>str1 : Symbol(str1, Decl(es6ClassSuperCodegenBug.ts, 1, 13)) +>str2 : Symbol(str2, Decl(es6ClassSuperCodegenBug.ts, 1, 25)) +} +class B extends A { +>B : Symbol(B, Decl(es6ClassSuperCodegenBug.ts, 2, 1)) +>A : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + + constructor() { + if (true) { + super('a1', 'b1'); +>super : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + + } else { + super('a2', 'b2'); +>super : Symbol(A, Decl(es6ClassSuperCodegenBug.ts, 0, 0)) + } + } +} + diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.types b/tests/baselines/reference/es6ClassSuperCodegenBug.types index 7b8a4abadfe..bdf8ebde8f2 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.types +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.types @@ -12,14 +12,20 @@ class B extends A { constructor() { if (true) { +>true : boolean + super('a1', 'b1'); >super('a1', 'b1') : void >super : typeof A +>'a1' : string +>'b1' : string } else { super('a2', 'b2'); >super('a2', 'b2') : void >super : typeof A +>'a2' : string +>'b2' : string } } } diff --git a/tests/baselines/reference/es6ClassTest3.symbols b/tests/baselines/reference/es6ClassTest3.symbols new file mode 100644 index 00000000000..cf2284e95ee --- /dev/null +++ b/tests/baselines/reference/es6ClassTest3.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/es6ClassTest3.ts === +module M { +>M : Symbol(M, Decl(es6ClassTest3.ts, 0, 0)) + + class Visibility { +>Visibility : Symbol(Visibility, Decl(es6ClassTest3.ts, 0, 10)) + + public foo() { }; +>foo : Symbol(foo, Decl(es6ClassTest3.ts, 1, 19)) + + private bar() { }; +>bar : Symbol(bar, Decl(es6ClassTest3.ts, 2, 22)) + + private x: number; +>x : Symbol(x, Decl(es6ClassTest3.ts, 3, 23)) + + public y: number; +>y : Symbol(y, Decl(es6ClassTest3.ts, 4, 26)) + + public z: number; +>z : Symbol(z, Decl(es6ClassTest3.ts, 5, 22)) + + constructor() { + this.x = 1; +>this.x : Symbol(x, Decl(es6ClassTest3.ts, 3, 23)) +>this : Symbol(Visibility, Decl(es6ClassTest3.ts, 0, 10)) +>x : Symbol(x, Decl(es6ClassTest3.ts, 3, 23)) + + this.y = 2; +>this.y : Symbol(y, Decl(es6ClassTest3.ts, 4, 26)) +>this : Symbol(Visibility, Decl(es6ClassTest3.ts, 0, 10)) +>y : Symbol(y, Decl(es6ClassTest3.ts, 4, 26)) + } + } +} diff --git a/tests/baselines/reference/es6ClassTest3.types b/tests/baselines/reference/es6ClassTest3.types index ba0f2036f0e..d73007f211b 100644 --- a/tests/baselines/reference/es6ClassTest3.types +++ b/tests/baselines/reference/es6ClassTest3.types @@ -26,12 +26,14 @@ module M { >this.x : number >this : Visibility >x : number +>1 : number this.y = 2; >this.y = 2 : number >this.y : number >this : Visibility >y : number +>2 : number } } } diff --git a/tests/baselines/reference/es6ClassTest4.symbols b/tests/baselines/reference/es6ClassTest4.symbols new file mode 100644 index 00000000000..41a329a3d51 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest4.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/es6ClassTest4.ts === +declare class Point +>Point : Symbol(Point, Decl(es6ClassTest4.ts, 0, 0)) +{ + x: number; +>x : Symbol(x, Decl(es6ClassTest4.ts, 1, 1)) + + y: number; +>y : Symbol(y, Decl(es6ClassTest4.ts, 2, 14)) + + add(dx: number, dy: number): Point; +>add : Symbol(add, Decl(es6ClassTest4.ts, 3, 14)) +>dx : Symbol(dx, Decl(es6ClassTest4.ts, 4, 8)) +>dy : Symbol(dy, Decl(es6ClassTest4.ts, 4, 19)) +>Point : Symbol(Point, Decl(es6ClassTest4.ts, 0, 0)) + + mult(p: Point): Point; +>mult : Symbol(mult, Decl(es6ClassTest4.ts, 4, 39)) +>p : Symbol(p, Decl(es6ClassTest4.ts, 5, 9)) +>Point : Symbol(Point, Decl(es6ClassTest4.ts, 0, 0)) +>Point : Symbol(Point, Decl(es6ClassTest4.ts, 0, 0)) + + static origin: Point; +>origin : Symbol(Point.origin, Decl(es6ClassTest4.ts, 5, 26)) +>Point : Symbol(Point, Decl(es6ClassTest4.ts, 0, 0)) + + constructor(x: number, y: number); +>x : Symbol(x, Decl(es6ClassTest4.ts, 7, 16)) +>y : Symbol(y, Decl(es6ClassTest4.ts, 7, 26)) +} + diff --git a/tests/baselines/reference/es6ClassTest5.symbols b/tests/baselines/reference/es6ClassTest5.symbols new file mode 100644 index 00000000000..89c6921e163 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest5.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/es6ClassTest5.ts === +class C1T5 { +>C1T5 : Symbol(C1T5, Decl(es6ClassTest5.ts, 0, 0)) + + foo: (i: number, s: string) => number = +>foo : Symbol(foo, Decl(es6ClassTest5.ts, 0, 12)) +>i : Symbol(i, Decl(es6ClassTest5.ts, 1, 10)) +>s : Symbol(s, Decl(es6ClassTest5.ts, 1, 20)) + + (i) => { +>i : Symbol(i, Decl(es6ClassTest5.ts, 2, 6)) + + return i; +>i : Symbol(i, Decl(es6ClassTest5.ts, 2, 6)) + } +} +module C2T5 {} +>C2T5 : Symbol(C2T5, Decl(es6ClassTest5.ts, 5, 1)) + +class bigClass { +>bigClass : Symbol(bigClass, Decl(es6ClassTest5.ts, 6, 14)) + + public break = 1; +>break : Symbol(break, Decl(es6ClassTest5.ts, 8, 17)) +} + diff --git a/tests/baselines/reference/es6ClassTest5.types b/tests/baselines/reference/es6ClassTest5.types index e04be3e8c43..087a80170ed 100644 --- a/tests/baselines/reference/es6ClassTest5.types +++ b/tests/baselines/reference/es6ClassTest5.types @@ -16,12 +16,13 @@ class C1T5 { } } module C2T5 {} ->C2T5 : unknown +>C2T5 : any class bigClass { >bigClass : bigClass public break = 1; >break : number +>1 : number } diff --git a/tests/baselines/reference/es6ClassTest7.symbols b/tests/baselines/reference/es6ClassTest7.symbols new file mode 100644 index 00000000000..02ba6e43186 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest7.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/es6ClassTest7.ts === +declare module M { +>M : Symbol(M, Decl(es6ClassTest7.ts, 0, 0)) + + export class Foo { +>Foo : Symbol(Foo, Decl(es6ClassTest7.ts, 0, 18)) + } +} + +class Bar extends M.Foo { +>Bar : Symbol(Bar, Decl(es6ClassTest7.ts, 3, 1)) +>M.Foo : Symbol(M.Foo, Decl(es6ClassTest7.ts, 0, 18)) +>M : Symbol(M, Decl(es6ClassTest7.ts, 0, 0)) +>Foo : Symbol(M.Foo, Decl(es6ClassTest7.ts, 0, 18)) +} + diff --git a/tests/baselines/reference/es6ClassTest7.types b/tests/baselines/reference/es6ClassTest7.types index 2ad5e88179c..f92ddad6e82 100644 --- a/tests/baselines/reference/es6ClassTest7.types +++ b/tests/baselines/reference/es6ClassTest7.types @@ -9,6 +9,7 @@ declare module M { class Bar extends M.Foo { >Bar : Bar +>M.Foo : any >M : typeof M >Foo : M.Foo } diff --git a/tests/baselines/reference/es6ClassTest8.symbols b/tests/baselines/reference/es6ClassTest8.symbols new file mode 100644 index 00000000000..b02b80e7017 --- /dev/null +++ b/tests/baselines/reference/es6ClassTest8.symbols @@ -0,0 +1,162 @@ +=== tests/cases/compiler/es6ClassTest8.ts === +function f1(x:any) {return x;} +>f1 : Symbol(f1, Decl(es6ClassTest8.ts, 0, 0)) +>x : Symbol(x, Decl(es6ClassTest8.ts, 0, 12)) +>x : Symbol(x, Decl(es6ClassTest8.ts, 0, 12)) + +class C { +>C : Symbol(C, Decl(es6ClassTest8.ts, 0, 30)) + + constructor() { + var bar:any = (function() { +>bar : Symbol(bar, Decl(es6ClassTest8.ts, 4, 11)) + + return bar; // 'bar' should be resolvable +>bar : Symbol(bar, Decl(es6ClassTest8.ts, 4, 11)) + + }); + var b = f1(f1(bar)); +>b : Symbol(b, Decl(es6ClassTest8.ts, 7, 11)) +>f1 : Symbol(f1, Decl(es6ClassTest8.ts, 0, 0)) +>f1 : Symbol(f1, Decl(es6ClassTest8.ts, 0, 0)) +>bar : Symbol(bar, Decl(es6ClassTest8.ts, 4, 11)) + } + +} + +class Vector { +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + static norm(v:Vector):Vector {return null;} +>norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>v : Symbol(v, Decl(es6ClassTest8.ts, 13, 16)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + static minus(v1:Vector, v2:Vector):Vector {return null;} +>minus : Symbol(Vector.minus, Decl(es6ClassTest8.ts, 13, 47)) +>v1 : Symbol(v1, Decl(es6ClassTest8.ts, 14, 17)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>v2 : Symbol(v2, Decl(es6ClassTest8.ts, 14, 27)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + static times(v1:Vector, v2:Vector):Vector {return null;} +>times : Symbol(Vector.times, Decl(es6ClassTest8.ts, 14, 60)) +>v1 : Symbol(v1, Decl(es6ClassTest8.ts, 15, 17)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>v2 : Symbol(v2, Decl(es6ClassTest8.ts, 15, 27)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + static cross(v1:Vector, v2:Vector):Vector {return null;} +>cross : Symbol(Vector.cross, Decl(es6ClassTest8.ts, 15, 60)) +>v1 : Symbol(v1, Decl(es6ClassTest8.ts, 16, 17)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>v2 : Symbol(v2, Decl(es6ClassTest8.ts, 16, 27)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + constructor(public x: number, +>x : Symbol(x, Decl(es6ClassTest8.ts, 18, 16)) + + public y: number, +>y : Symbol(y, Decl(es6ClassTest8.ts, 18, 33)) + + public z: number) { +>z : Symbol(z, Decl(es6ClassTest8.ts, 19, 33)) + } + + static dot(v1:Vector, v2:Vector):Vector {return null;} +>dot : Symbol(Vector.dot, Decl(es6ClassTest8.ts, 21, 5)) +>v1 : Symbol(v1, Decl(es6ClassTest8.ts, 23, 15)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>v2 : Symbol(v2, Decl(es6ClassTest8.ts, 23, 25)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + +} + +class Camera { +>Camera : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) + + public forward: Vector; +>forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + public right: Vector; +>right : Symbol(right, Decl(es6ClassTest8.ts, 28, 27)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + public up: Vector; +>up : Symbol(up, Decl(es6ClassTest8.ts, 29, 25)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + constructor(public pos: Vector, lookAt: Vector) { +>pos : Symbol(pos, Decl(es6ClassTest8.ts, 31, 16)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>lookAt : Symbol(lookAt, Decl(es6ClassTest8.ts, 31, 35)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + var down = new Vector(0.0, -1.0, 0.0); +>down : Symbol(down, Decl(es6ClassTest8.ts, 32, 11)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) + + this.forward = Vector.norm(Vector.minus(lookAt,this.pos)); +>this.forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>Vector.norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector.minus : Symbol(Vector.minus, Decl(es6ClassTest8.ts, 13, 47)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>minus : Symbol(Vector.minus, Decl(es6ClassTest8.ts, 13, 47)) +>lookAt : Symbol(lookAt, Decl(es6ClassTest8.ts, 31, 35)) +>this.pos : Symbol(pos, Decl(es6ClassTest8.ts, 31, 16)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>pos : Symbol(pos, Decl(es6ClassTest8.ts, 31, 16)) + + this.right = Vector.times(down, Vector.norm(Vector.cross(this.forward, down))); +>this.right : Symbol(right, Decl(es6ClassTest8.ts, 28, 27)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>right : Symbol(right, Decl(es6ClassTest8.ts, 28, 27)) +>Vector.times : Symbol(Vector.times, Decl(es6ClassTest8.ts, 14, 60)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>times : Symbol(Vector.times, Decl(es6ClassTest8.ts, 14, 60)) +>down : Symbol(down, Decl(es6ClassTest8.ts, 32, 11)) +>Vector.norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector.cross : Symbol(Vector.cross, Decl(es6ClassTest8.ts, 15, 60)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>cross : Symbol(Vector.cross, Decl(es6ClassTest8.ts, 15, 60)) +>this.forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>down : Symbol(down, Decl(es6ClassTest8.ts, 32, 11)) + + this.up = Vector.times(down, Vector.norm(Vector.cross(this.forward, this.right))); +>this.up : Symbol(up, Decl(es6ClassTest8.ts, 29, 25)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>up : Symbol(up, Decl(es6ClassTest8.ts, 29, 25)) +>Vector.times : Symbol(Vector.times, Decl(es6ClassTest8.ts, 14, 60)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>times : Symbol(Vector.times, Decl(es6ClassTest8.ts, 14, 60)) +>down : Symbol(down, Decl(es6ClassTest8.ts, 32, 11)) +>Vector.norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>norm : Symbol(Vector.norm, Decl(es6ClassTest8.ts, 12, 14)) +>Vector.cross : Symbol(Vector.cross, Decl(es6ClassTest8.ts, 15, 60)) +>Vector : Symbol(Vector, Decl(es6ClassTest8.ts, 10, 1)) +>cross : Symbol(Vector.cross, Decl(es6ClassTest8.ts, 15, 60)) +>this.forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>forward : Symbol(forward, Decl(es6ClassTest8.ts, 27, 14)) +>this.right : Symbol(right, Decl(es6ClassTest8.ts, 28, 27)) +>this : Symbol(Camera, Decl(es6ClassTest8.ts, 25, 1)) +>right : Symbol(right, Decl(es6ClassTest8.ts, 28, 27)) + } +} + + diff --git a/tests/baselines/reference/es6ClassTest8.types b/tests/baselines/reference/es6ClassTest8.types index e5133c88d7e..622f81f1d10 100644 --- a/tests/baselines/reference/es6ClassTest8.types +++ b/tests/baselines/reference/es6ClassTest8.types @@ -36,6 +36,7 @@ class Vector { >v : Vector >Vector : Vector >Vector : Vector +>null : null static minus(v1:Vector, v2:Vector):Vector {return null;} >minus : (v1: Vector, v2: Vector) => Vector @@ -44,6 +45,7 @@ class Vector { >v2 : Vector >Vector : Vector >Vector : Vector +>null : null static times(v1:Vector, v2:Vector):Vector {return null;} >times : (v1: Vector, v2: Vector) => Vector @@ -52,6 +54,7 @@ class Vector { >v2 : Vector >Vector : Vector >Vector : Vector +>null : null static cross(v1:Vector, v2:Vector):Vector {return null;} >cross : (v1: Vector, v2: Vector) => Vector @@ -60,6 +63,7 @@ class Vector { >v2 : Vector >Vector : Vector >Vector : Vector +>null : null constructor(public x: number, >x : number @@ -78,6 +82,7 @@ class Vector { >v2 : Vector >Vector : Vector >Vector : Vector +>null : null } @@ -106,7 +111,10 @@ class Camera { >down : Vector >new Vector(0.0, -1.0, 0.0) : Vector >Vector : typeof Vector +>0.0 : number >-1.0 : number +>1.0 : number +>0.0 : number this.forward = Vector.norm(Vector.minus(lookAt,this.pos)); >this.forward = Vector.norm(Vector.minus(lookAt,this.pos)) : Vector diff --git a/tests/baselines/reference/es6ExportAll.symbols b/tests/baselines/reference/es6ExportAll.symbols new file mode 100644 index 00000000000..c2a575f5e5c --- /dev/null +++ b/tests/baselines/reference/es6ExportAll.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/server.ts === + +export class c { +>c : Symbol(c, Decl(server.ts, 0, 0)) +} +export interface i { +>i : Symbol(i, Decl(server.ts, 2, 1)) +} +export module m { +>m : Symbol(m, Decl(server.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(server.ts, 6, 14)) +} +export var x = 10; +>x : Symbol(x, Decl(server.ts, 8, 10)) + +export module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 8, 18)) +} + +=== tests/cases/compiler/client.ts === +export * from "server"; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportAll.types b/tests/baselines/reference/es6ExportAll.types index 99e8fde9d40..876ff152e2c 100644 --- a/tests/baselines/reference/es6ExportAll.types +++ b/tests/baselines/reference/es6ExportAll.types @@ -11,12 +11,14 @@ export module m { export var x = 10; >x : number +>10 : number } export var x = 10; >x : number +>10 : number export module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } === tests/cases/compiler/client.ts === diff --git a/tests/baselines/reference/es6ExportAllInEs5.symbols b/tests/baselines/reference/es6ExportAllInEs5.symbols new file mode 100644 index 00000000000..c2a575f5e5c --- /dev/null +++ b/tests/baselines/reference/es6ExportAllInEs5.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/server.ts === + +export class c { +>c : Symbol(c, Decl(server.ts, 0, 0)) +} +export interface i { +>i : Symbol(i, Decl(server.ts, 2, 1)) +} +export module m { +>m : Symbol(m, Decl(server.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(server.ts, 6, 14)) +} +export var x = 10; +>x : Symbol(x, Decl(server.ts, 8, 10)) + +export module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 8, 18)) +} + +=== tests/cases/compiler/client.ts === +export * from "server"; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportAllInEs5.types b/tests/baselines/reference/es6ExportAllInEs5.types index 99e8fde9d40..876ff152e2c 100644 --- a/tests/baselines/reference/es6ExportAllInEs5.types +++ b/tests/baselines/reference/es6ExportAllInEs5.types @@ -11,12 +11,14 @@ export module m { export var x = 10; >x : number +>10 : number } export var x = 10; >x : number +>10 : number export module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } === tests/cases/compiler/client.ts === diff --git a/tests/baselines/reference/es6ExportClause.symbols b/tests/baselines/reference/es6ExportClause.symbols new file mode 100644 index 00000000000..fe4de21a00f --- /dev/null +++ b/tests/baselines/reference/es6ExportClause.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/es6ExportClause.ts === + +class c { +>c : Symbol(c, Decl(es6ExportClause.ts, 0, 0)) +} +interface i { +>i : Symbol(i, Decl(es6ExportClause.ts, 2, 1)) +} +module m { +>m : Symbol(m, Decl(es6ExportClause.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(es6ExportClause.ts, 6, 14)) +} +var x = 10; +>x : Symbol(x, Decl(es6ExportClause.ts, 8, 3)) + +module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(es6ExportClause.ts, 8, 11)) +} +export { c }; +>c : Symbol(c, Decl(es6ExportClause.ts, 11, 8)) + +export { c as c2 }; +>c : Symbol(c2, Decl(es6ExportClause.ts, 12, 8)) +>c2 : Symbol(c2, Decl(es6ExportClause.ts, 12, 8)) + +export { i, m as instantiatedModule }; +>i : Symbol(i, Decl(es6ExportClause.ts, 13, 8)) +>m : Symbol(instantiatedModule, Decl(es6ExportClause.ts, 13, 11)) +>instantiatedModule : Symbol(instantiatedModule, Decl(es6ExportClause.ts, 13, 11)) + +export { uninstantiated }; +>uninstantiated : Symbol(uninstantiated, Decl(es6ExportClause.ts, 14, 8)) + +export { x }; +>x : Symbol(x, Decl(es6ExportClause.ts, 15, 8)) + diff --git a/tests/baselines/reference/es6ExportClause.types b/tests/baselines/reference/es6ExportClause.types index 24b9859e0e8..b0d544201a4 100644 --- a/tests/baselines/reference/es6ExportClause.types +++ b/tests/baselines/reference/es6ExportClause.types @@ -11,12 +11,14 @@ module m { export var x = 10; >x : number +>10 : number } var x = 10; >x : number +>10 : number module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } export { c }; >c : typeof c @@ -26,12 +28,12 @@ export { c as c2 }; >c2 : typeof c export { i, m as instantiatedModule }; ->i : unknown +>i : any >m : typeof m >instantiatedModule : typeof m export { uninstantiated }; ->uninstantiated : unknown +>uninstantiated : any export { x }; >x : number diff --git a/tests/baselines/reference/es6ExportClauseInEs5.symbols b/tests/baselines/reference/es6ExportClauseInEs5.symbols new file mode 100644 index 00000000000..5590b907eec --- /dev/null +++ b/tests/baselines/reference/es6ExportClauseInEs5.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/es6ExportClauseInEs5.ts === + +class c { +>c : Symbol(c, Decl(es6ExportClauseInEs5.ts, 0, 0)) +} +interface i { +>i : Symbol(i, Decl(es6ExportClauseInEs5.ts, 2, 1)) +} +module m { +>m : Symbol(m, Decl(es6ExportClauseInEs5.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(es6ExportClauseInEs5.ts, 6, 14)) +} +var x = 10; +>x : Symbol(x, Decl(es6ExportClauseInEs5.ts, 8, 3)) + +module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(es6ExportClauseInEs5.ts, 8, 11)) +} +export { c }; +>c : Symbol(c, Decl(es6ExportClauseInEs5.ts, 11, 8)) + +export { c as c2 }; +>c : Symbol(c2, Decl(es6ExportClauseInEs5.ts, 12, 8)) +>c2 : Symbol(c2, Decl(es6ExportClauseInEs5.ts, 12, 8)) + +export { i, m as instantiatedModule }; +>i : Symbol(i, Decl(es6ExportClauseInEs5.ts, 13, 8)) +>m : Symbol(instantiatedModule, Decl(es6ExportClauseInEs5.ts, 13, 11)) +>instantiatedModule : Symbol(instantiatedModule, Decl(es6ExportClauseInEs5.ts, 13, 11)) + +export { uninstantiated }; +>uninstantiated : Symbol(uninstantiated, Decl(es6ExportClauseInEs5.ts, 14, 8)) + +export { x }; +>x : Symbol(x, Decl(es6ExportClauseInEs5.ts, 15, 8)) + diff --git a/tests/baselines/reference/es6ExportClauseInEs5.types b/tests/baselines/reference/es6ExportClauseInEs5.types index 8caedfa5ceb..c6ef9033bf1 100644 --- a/tests/baselines/reference/es6ExportClauseInEs5.types +++ b/tests/baselines/reference/es6ExportClauseInEs5.types @@ -11,12 +11,14 @@ module m { export var x = 10; >x : number +>10 : number } var x = 10; >x : number +>10 : number module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } export { c }; >c : typeof c @@ -26,12 +28,12 @@ export { c as c2 }; >c2 : typeof c export { i, m as instantiatedModule }; ->i : unknown +>i : any >m : typeof m >instantiatedModule : typeof m export { uninstantiated }; ->uninstantiated : unknown +>uninstantiated : any export { x }; >x : number diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.symbols b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.symbols new file mode 100644 index 00000000000..731a0fdcc30 --- /dev/null +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/server.ts === + +export class c { +>c : Symbol(c, Decl(server.ts, 0, 0)) +} +export interface i { +>i : Symbol(i, Decl(server.ts, 2, 1)) +} +export module m { +>m : Symbol(m, Decl(server.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(server.ts, 6, 14)) +} +export var x = 10; +>x : Symbol(x, Decl(server.ts, 8, 10)) + +export module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 8, 18)) +} + +=== tests/cases/compiler/client.ts === +export { c } from "server"; +>c : Symbol(c, Decl(client.ts, 0, 8)) + +export { c as c2 } from "server"; +>c : Symbol(c2, Decl(client.ts, 1, 8)) +>c2 : Symbol(c2, Decl(client.ts, 1, 8)) + +export { i, m as instantiatedModule } from "server"; +>i : Symbol(i, Decl(client.ts, 2, 8)) +>m : Symbol(instantiatedModule, Decl(client.ts, 2, 11)) +>instantiatedModule : Symbol(instantiatedModule, Decl(client.ts, 2, 11)) + +export { uninstantiated } from "server"; +>uninstantiated : Symbol(uninstantiated, Decl(client.ts, 3, 8)) + +export { x } from "server"; +>x : Symbol(x, Decl(client.ts, 4, 8)) + diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types index c0087dccd94..9d87ec9925d 100644 --- a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.types @@ -11,12 +11,14 @@ export module m { export var x = 10; >x : number +>10 : number } export var x = 10; >x : number +>10 : number export module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } === tests/cases/compiler/client.ts === @@ -28,12 +30,12 @@ export { c as c2 } from "server"; >c2 : typeof c export { i, m as instantiatedModule } from "server"; ->i : unknown +>i : any >m : typeof instantiatedModule >instantiatedModule : typeof instantiatedModule export { uninstantiated } from "server"; ->uninstantiated : unknown +>uninstantiated : any export { x } from "server"; >x : number diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.symbols b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.symbols new file mode 100644 index 00000000000..731a0fdcc30 --- /dev/null +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/server.ts === + +export class c { +>c : Symbol(c, Decl(server.ts, 0, 0)) +} +export interface i { +>i : Symbol(i, Decl(server.ts, 2, 1)) +} +export module m { +>m : Symbol(m, Decl(server.ts, 4, 1)) + + export var x = 10; +>x : Symbol(x, Decl(server.ts, 6, 14)) +} +export var x = 10; +>x : Symbol(x, Decl(server.ts, 8, 10)) + +export module uninstantiated { +>uninstantiated : Symbol(uninstantiated, Decl(server.ts, 8, 18)) +} + +=== tests/cases/compiler/client.ts === +export { c } from "server"; +>c : Symbol(c, Decl(client.ts, 0, 8)) + +export { c as c2 } from "server"; +>c : Symbol(c2, Decl(client.ts, 1, 8)) +>c2 : Symbol(c2, Decl(client.ts, 1, 8)) + +export { i, m as instantiatedModule } from "server"; +>i : Symbol(i, Decl(client.ts, 2, 8)) +>m : Symbol(instantiatedModule, Decl(client.ts, 2, 11)) +>instantiatedModule : Symbol(instantiatedModule, Decl(client.ts, 2, 11)) + +export { uninstantiated } from "server"; +>uninstantiated : Symbol(uninstantiated, Decl(client.ts, 3, 8)) + +export { x } from "server"; +>x : Symbol(x, Decl(client.ts, 4, 8)) + diff --git a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types index c0087dccd94..9d87ec9925d 100644 --- a/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types +++ b/tests/baselines/reference/es6ExportClauseWithoutModuleSpecifierInEs5.types @@ -11,12 +11,14 @@ export module m { export var x = 10; >x : number +>10 : number } export var x = 10; >x : number +>10 : number export module uninstantiated { ->uninstantiated : unknown +>uninstantiated : any } === tests/cases/compiler/client.ts === @@ -28,12 +30,12 @@ export { c as c2 } from "server"; >c2 : typeof c export { i, m as instantiatedModule } from "server"; ->i : unknown +>i : any >m : typeof instantiatedModule >instantiatedModule : typeof instantiatedModule export { uninstantiated } from "server"; ->uninstantiated : unknown +>uninstantiated : any export { x } from "server"; >x : number diff --git a/tests/baselines/reference/es6ExportDefaultClassDeclaration.symbols b/tests/baselines/reference/es6ExportDefaultClassDeclaration.symbols new file mode 100644 index 00000000000..02aa5575190 --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultClassDeclaration.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/es6ExportDefaultClassDeclaration.ts === + +export default class C { +>C : Symbol(C, Decl(es6ExportDefaultClassDeclaration.ts, 0, 0)) + + method() { } +>method : Symbol(method, Decl(es6ExportDefaultClassDeclaration.ts, 1, 24)) +} + diff --git a/tests/baselines/reference/es6ExportDefaultClassDeclaration2.symbols b/tests/baselines/reference/es6ExportDefaultClassDeclaration2.symbols new file mode 100644 index 00000000000..168c402d3e4 --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultClassDeclaration2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/es6ExportDefaultClassDeclaration2.ts === + +export default class { + method() { } +>method : Symbol(method, Decl(es6ExportDefaultClassDeclaration2.ts, 1, 22)) +} + diff --git a/tests/baselines/reference/es6ExportDefaultExpression.symbols b/tests/baselines/reference/es6ExportDefaultExpression.symbols new file mode 100644 index 00000000000..f80acc12900 --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultExpression.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es6ExportDefaultExpression.ts === + +No type information for this code.export default (1 + 2); +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportDefaultExpression.types b/tests/baselines/reference/es6ExportDefaultExpression.types index 3b056b8d9f9..6f7665c2800 100644 --- a/tests/baselines/reference/es6ExportDefaultExpression.types +++ b/tests/baselines/reference/es6ExportDefaultExpression.types @@ -3,4 +3,6 @@ export default (1 + 2); >(1 + 2) : number >1 + 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/es6ExportDefaultFunctionDeclaration.symbols b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration.symbols new file mode 100644 index 00000000000..4050ac97545 --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es6ExportDefaultFunctionDeclaration.ts === + +export default function f() { } +>f : Symbol(f, Decl(es6ExportDefaultFunctionDeclaration.ts, 0, 0)) + diff --git a/tests/baselines/reference/es6ExportDefaultFunctionDeclaration2.symbols b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration2.symbols new file mode 100644 index 00000000000..3cb2fc9b1cd --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultFunctionDeclaration2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/es6ExportDefaultFunctionDeclaration2.ts === + +No type information for this code.export default function () { } +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ExportDefaultIdentifier.symbols b/tests/baselines/reference/es6ExportDefaultIdentifier.symbols new file mode 100644 index 00000000000..29b932aaeda --- /dev/null +++ b/tests/baselines/reference/es6ExportDefaultIdentifier.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/es6ExportDefaultIdentifier.ts === + +export function f() { } +>f : Symbol(f, Decl(es6ExportDefaultIdentifier.ts, 0, 0)) + +export default f; +>f : Symbol(f, Decl(es6ExportDefaultIdentifier.ts, 0, 0)) + diff --git a/tests/baselines/reference/es6ImportDefaultBinding.symbols b/tests/baselines/reference/es6ImportDefaultBinding.symbols new file mode 100644 index 00000000000..d1e76d7075a --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBinding.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/es6ImportDefaultBinding_0.ts === + +var a = 10; +>a : Symbol(a, Decl(es6ImportDefaultBinding_0.ts, 1, 3)) + +export default a; +>a : Symbol(a, Decl(es6ImportDefaultBinding_0.ts, 1, 3)) + +=== tests/cases/compiler/es6ImportDefaultBinding_1.ts === +import defaultBinding from "es6ImportDefaultBinding_0"; +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBinding_1.ts, 0, 6)) + +var x = defaultBinding; +>x : Symbol(x, Decl(es6ImportDefaultBinding_1.ts, 1, 3)) +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBinding_1.ts, 0, 6)) + +import defaultBinding2 from "es6ImportDefaultBinding_0"; // elide this import since defaultBinding2 is not used +>defaultBinding2 : Symbol(defaultBinding2, Decl(es6ImportDefaultBinding_1.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportDefaultBinding.types b/tests/baselines/reference/es6ImportDefaultBinding.types index 13504101a2c..6aa71ddf6ff 100644 --- a/tests/baselines/reference/es6ImportDefaultBinding.types +++ b/tests/baselines/reference/es6ImportDefaultBinding.types @@ -2,6 +2,7 @@ var a = 10; >a : number +>10 : number export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingAmd.symbols b/tests/baselines/reference/es6ImportDefaultBindingAmd.symbols new file mode 100644 index 00000000000..cab731104bd --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingAmd.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/es6ImportDefaultBindingAmd_0.ts === + +var a = 10; +>a : Symbol(a, Decl(es6ImportDefaultBindingAmd_0.ts, 1, 3)) + +export default a; +>a : Symbol(a, Decl(es6ImportDefaultBindingAmd_0.ts, 1, 3)) + +=== tests/cases/compiler/es6ImportDefaultBindingAmd_1.ts === +import defaultBinding from "es6ImportDefaultBindingAmd_0"; +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingAmd_1.ts, 0, 6)) + +var x = defaultBinding; +>x : Symbol(x, Decl(es6ImportDefaultBindingAmd_1.ts, 1, 3)) +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingAmd_1.ts, 0, 6)) + +import defaultBinding2 from "es6ImportDefaultBindingAmd_0"; // elide this import since defaultBinding2 is not used +>defaultBinding2 : Symbol(defaultBinding2, Decl(es6ImportDefaultBindingAmd_1.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportDefaultBindingAmd.types b/tests/baselines/reference/es6ImportDefaultBindingAmd.types index 323ed557d8b..740ff2c0e14 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingAmd.types +++ b/tests/baselines/reference/es6ImportDefaultBindingAmd.types @@ -2,6 +2,7 @@ var a = 10; >a : number +>10 : number export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingDts.symbols b/tests/baselines/reference/es6ImportDefaultBindingDts.symbols new file mode 100644 index 00000000000..1ca93aa6641 --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingDts.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/server.ts === + +class c { } +>c : Symbol(c, Decl(server.ts, 0, 0)) + +export default c; +>c : Symbol(c, Decl(server.ts, 0, 0)) + +=== tests/cases/compiler/client.ts === +import defaultBinding from "server"; +>defaultBinding : Symbol(defaultBinding, Decl(client.ts, 0, 6)) + +export var x = new defaultBinding(); +>x : Symbol(x, Decl(client.ts, 1, 10)) +>defaultBinding : Symbol(defaultBinding, Decl(client.ts, 0, 6)) + +import defaultBinding2 from "server"; // elide this import since defaultBinding2 is not used +>defaultBinding2 : Symbol(defaultBinding2, Decl(client.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.symbols b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.symbols new file mode 100644 index 00000000000..a62cdfec873 --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts === + +var a = 10; +>a : Symbol(a, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts, 1, 3)) + +export default a; +>a : Symbol(a, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts, 1, 3)) + +=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts === +import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0"; +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts, 0, 6)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts, 0, 22)) + +var x: number = defaultBinding; +>x : Symbol(x, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts, 1, 3)) +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts, 0, 6)) + diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types index c0c3f891c9e..6d3f015c783 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1.types @@ -2,6 +2,7 @@ var a = 10; >a : number +>10 : number export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.symbols b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.symbols new file mode 100644 index 00000000000..d4a9c289e60 --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.ts === + +var a = 10; +>a : Symbol(a, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.ts, 1, 3)) + +export default a; +>a : Symbol(a, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0.ts, 1, 3)) + +=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts === +import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0"; +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts, 0, 6)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts, 0, 22)) + +var x: number = defaultBinding; +>x : Symbol(x, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts, 1, 3)) +>defaultBinding : Symbol(defaultBinding, Decl(es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts, 0, 6)) + diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types index ad2b865bc01..4a05b57e304 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding1InEs5.types @@ -2,6 +2,7 @@ var a = 10; >a : number +>10 : number export default a; >a : number diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.symbols b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.symbols new file mode 100644 index 00000000000..28f1e4cc4d7 --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/server.ts === + +class a { } +>a : Symbol(a, Decl(server.ts, 0, 0)) + +export default a; +>a : Symbol(a, Decl(server.ts, 0, 0)) + +=== tests/cases/compiler/client.ts === +import defaultBinding, * as nameSpaceBinding from "server"; +>defaultBinding : Symbol(defaultBinding, Decl(client.ts, 0, 6)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(client.ts, 0, 22)) + +export var x = new defaultBinding(); +>x : Symbol(x, Decl(client.ts, 1, 10)) +>defaultBinding : Symbol(defaultBinding, Decl(client.ts, 0, 6)) + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportAmd.symbols b/tests/baselines/reference/es6ImportNameSpaceImportAmd.symbols new file mode 100644 index 00000000000..24c67cd6f47 --- /dev/null +++ b/tests/baselines/reference/es6ImportNameSpaceImportAmd.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/es6ImportNameSpaceImportAmd_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportNameSpaceImportAmd_0.ts, 1, 10)) + +=== tests/cases/compiler/es6ImportNameSpaceImportAmd_1.ts === +import * as nameSpaceBinding from "es6ImportNameSpaceImportAmd_0"; +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportNameSpaceImportAmd_1.ts, 0, 6)) + +var x = nameSpaceBinding.a; +>x : Symbol(x, Decl(es6ImportNameSpaceImportAmd_1.ts, 1, 3)) +>nameSpaceBinding.a : Symbol(nameSpaceBinding.a, Decl(es6ImportNameSpaceImportAmd_0.ts, 1, 10)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportNameSpaceImportAmd_1.ts, 0, 6)) +>a : Symbol(nameSpaceBinding.a, Decl(es6ImportNameSpaceImportAmd_0.ts, 1, 10)) + +import * as nameSpaceBinding2 from "es6ImportNameSpaceImportAmd_0"; // elide this +>nameSpaceBinding2 : Symbol(nameSpaceBinding2, Decl(es6ImportNameSpaceImportAmd_1.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportAmd.types b/tests/baselines/reference/es6ImportNameSpaceImportAmd.types index 623a7e8e160..beb6860c73e 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportAmd.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportAmd.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number === tests/cases/compiler/es6ImportNameSpaceImportAmd_1.ts === import * as nameSpaceBinding from "es6ImportNameSpaceImportAmd_0"; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportDts.symbols b/tests/baselines/reference/es6ImportNameSpaceImportDts.symbols new file mode 100644 index 00000000000..8104cbcce50 --- /dev/null +++ b/tests/baselines/reference/es6ImportNameSpaceImportDts.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/server.ts === + +export class c { }; +>c : Symbol(c, Decl(server.ts, 0, 0)) + +=== tests/cases/compiler/client.ts === +import * as nameSpaceBinding from "server"; +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(client.ts, 0, 6)) + +export var x = new nameSpaceBinding.c(); +>x : Symbol(x, Decl(client.ts, 1, 10)) +>nameSpaceBinding.c : Symbol(nameSpaceBinding.c, Decl(server.ts, 0, 0)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(client.ts, 0, 6)) +>c : Symbol(nameSpaceBinding.c, Decl(server.ts, 0, 0)) + +import * as nameSpaceBinding2 from "server"; // unreferenced +>nameSpaceBinding2 : Symbol(nameSpaceBinding2, Decl(client.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.symbols b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.symbols new file mode 100644 index 00000000000..119787de817 --- /dev/null +++ b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/es6ImportNameSpaceImportInEs5_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportNameSpaceImportInEs5_0.ts, 1, 10)) + +=== tests/cases/compiler/es6ImportNameSpaceImportInEs5_1.ts === +import * as nameSpaceBinding from "es6ImportNameSpaceImportInEs5_0"; +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportNameSpaceImportInEs5_1.ts, 0, 6)) + +var x = nameSpaceBinding.a; +>x : Symbol(x, Decl(es6ImportNameSpaceImportInEs5_1.ts, 1, 3)) +>nameSpaceBinding.a : Symbol(nameSpaceBinding.a, Decl(es6ImportNameSpaceImportInEs5_0.ts, 1, 10)) +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportNameSpaceImportInEs5_1.ts, 0, 6)) +>a : Symbol(nameSpaceBinding.a, Decl(es6ImportNameSpaceImportInEs5_0.ts, 1, 10)) + +import * as nameSpaceBinding2 from "es6ImportNameSpaceImportInEs5_0"; // elide this +>nameSpaceBinding2 : Symbol(nameSpaceBinding2, Decl(es6ImportNameSpaceImportInEs5_1.ts, 2, 6)) + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types index 6ba725f2494..01531cd233d 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number === tests/cases/compiler/es6ImportNameSpaceImportInEs5_1.ts === import * as nameSpaceBinding from "es6ImportNameSpaceImportInEs5_0"; diff --git a/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.symbols b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.symbols new file mode 100644 index 00000000000..6a443d1fa00 --- /dev/null +++ b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/es6ImportNameSpaceImportNoNamedExports_0.ts === + +var a = 10; +>a : Symbol(a, Decl(es6ImportNameSpaceImportNoNamedExports_0.ts, 1, 3)) + +export = a; +>a : Symbol(a, Decl(es6ImportNameSpaceImportNoNamedExports_0.ts, 1, 3)) + +=== tests/cases/compiler/es6ImportNameSpaceImportNoNamedExports_1.ts === +import * as nameSpaceBinding from "es6ImportNameSpaceImportNoNamedExports_0"; // error +>nameSpaceBinding : Symbol(nameSpaceBinding, Decl(es6ImportNameSpaceImportNoNamedExports_1.ts, 0, 6)) + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types index e1f2e89bbd8..2cc4844dd42 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportNoNamedExports.types @@ -2,6 +2,7 @@ var a = 10; >a : number +>10 : number export = a; >a : number diff --git a/tests/baselines/reference/es6ImportNamedImportAmd.symbols b/tests/baselines/reference/es6ImportNamedImportAmd.symbols new file mode 100644 index 00000000000..2feaf603f40 --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportAmd.symbols @@ -0,0 +1,123 @@ +=== tests/cases/compiler/es6ImportNamedImportAmd_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportNamedImportAmd_0.ts, 1, 10)) + +export var x = a; +>x : Symbol(x, Decl(es6ImportNamedImportAmd_0.ts, 2, 10)) +>a : Symbol(a, Decl(es6ImportNamedImportAmd_0.ts, 1, 10)) + +export var m = a; +>m : Symbol(m, Decl(es6ImportNamedImportAmd_0.ts, 3, 10)) +>a : Symbol(a, Decl(es6ImportNamedImportAmd_0.ts, 1, 10)) + +export var a1 = 10; +>a1 : Symbol(a1, Decl(es6ImportNamedImportAmd_0.ts, 4, 10)) + +export var x1 = 10; +>x1 : Symbol(x1, Decl(es6ImportNamedImportAmd_0.ts, 5, 10)) + +export var z1 = 10; +>z1 : Symbol(z1, Decl(es6ImportNamedImportAmd_0.ts, 6, 10)) + +export var z2 = 10; +>z2 : Symbol(z2, Decl(es6ImportNamedImportAmd_0.ts, 7, 10)) + +export var aaaa = 10; +>aaaa : Symbol(aaaa, Decl(es6ImportNamedImportAmd_0.ts, 8, 10)) + +=== tests/cases/compiler/es6ImportNamedImportAmd_1.ts === +import { } from "es6ImportNamedImportAmd_0"; +import { a } from "es6ImportNamedImportAmd_0"; +>a : Symbol(a, Decl(es6ImportNamedImportAmd_1.ts, 1, 8)) + +var xxxx = a; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>a : Symbol(a, Decl(es6ImportNamedImportAmd_1.ts, 1, 8)) + +import { a as b } from "es6ImportNamedImportAmd_0"; +>a : Symbol(b, Decl(es6ImportNamedImportAmd_1.ts, 3, 8)) +>b : Symbol(b, Decl(es6ImportNamedImportAmd_1.ts, 3, 8)) + +var xxxx = b; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>b : Symbol(b, Decl(es6ImportNamedImportAmd_1.ts, 3, 8)) + +import { x, a as y } from "es6ImportNamedImportAmd_0"; +>x : Symbol(x, Decl(es6ImportNamedImportAmd_1.ts, 5, 8)) +>a : Symbol(y, Decl(es6ImportNamedImportAmd_1.ts, 5, 11)) +>y : Symbol(y, Decl(es6ImportNamedImportAmd_1.ts, 5, 11)) + +var xxxx = x; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>x : Symbol(x, Decl(es6ImportNamedImportAmd_1.ts, 5, 8)) + +var xxxx = y; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>y : Symbol(y, Decl(es6ImportNamedImportAmd_1.ts, 5, 11)) + +import { x as z, } from "es6ImportNamedImportAmd_0"; +>x : Symbol(z, Decl(es6ImportNamedImportAmd_1.ts, 8, 8)) +>z : Symbol(z, Decl(es6ImportNamedImportAmd_1.ts, 8, 8)) + +var xxxx = z; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>z : Symbol(z, Decl(es6ImportNamedImportAmd_1.ts, 8, 8)) + +import { m, } from "es6ImportNamedImportAmd_0"; +>m : Symbol(m, Decl(es6ImportNamedImportAmd_1.ts, 10, 8)) + +var xxxx = m; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>m : Symbol(m, Decl(es6ImportNamedImportAmd_1.ts, 10, 8)) + +import { a1, x1 } from "es6ImportNamedImportAmd_0"; +>a1 : Symbol(a1, Decl(es6ImportNamedImportAmd_1.ts, 12, 8)) +>x1 : Symbol(x1, Decl(es6ImportNamedImportAmd_1.ts, 12, 12)) + +var xxxx = a1; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>a1 : Symbol(a1, Decl(es6ImportNamedImportAmd_1.ts, 12, 8)) + +var xxxx = x1; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>x1 : Symbol(x1, Decl(es6ImportNamedImportAmd_1.ts, 12, 12)) + +import { a1 as a11, x1 as x11 } from "es6ImportNamedImportAmd_0"; +>a1 : Symbol(a11, Decl(es6ImportNamedImportAmd_1.ts, 15, 8)) +>a11 : Symbol(a11, Decl(es6ImportNamedImportAmd_1.ts, 15, 8)) +>x1 : Symbol(x11, Decl(es6ImportNamedImportAmd_1.ts, 15, 19)) +>x11 : Symbol(x11, Decl(es6ImportNamedImportAmd_1.ts, 15, 19)) + +var xxxx = a11; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>a11 : Symbol(a11, Decl(es6ImportNamedImportAmd_1.ts, 15, 8)) + +var xxxx = x11; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportAmd_1.ts, 2, 3), Decl(es6ImportNamedImportAmd_1.ts, 4, 3), Decl(es6ImportNamedImportAmd_1.ts, 6, 3), Decl(es6ImportNamedImportAmd_1.ts, 7, 3), Decl(es6ImportNamedImportAmd_1.ts, 9, 3), Decl(es6ImportNamedImportAmd_1.ts, 11, 3), Decl(es6ImportNamedImportAmd_1.ts, 13, 3), Decl(es6ImportNamedImportAmd_1.ts, 14, 3), Decl(es6ImportNamedImportAmd_1.ts, 16, 3), Decl(es6ImportNamedImportAmd_1.ts, 17, 3)) +>x11 : Symbol(x11, Decl(es6ImportNamedImportAmd_1.ts, 15, 19)) + +import { z1 } from "es6ImportNamedImportAmd_0"; +>z1 : Symbol(z1, Decl(es6ImportNamedImportAmd_1.ts, 18, 8)) + +var z111 = z1; +>z111 : Symbol(z111, Decl(es6ImportNamedImportAmd_1.ts, 19, 3)) +>z1 : Symbol(z1, Decl(es6ImportNamedImportAmd_1.ts, 18, 8)) + +import { z2 as z3 } from "es6ImportNamedImportAmd_0"; +>z2 : Symbol(z3, Decl(es6ImportNamedImportAmd_1.ts, 20, 8)) +>z3 : Symbol(z3, Decl(es6ImportNamedImportAmd_1.ts, 20, 8)) + +var z2 = z3; // z2 shouldn't give redeclare error +>z2 : Symbol(z2, Decl(es6ImportNamedImportAmd_1.ts, 21, 3)) +>z3 : Symbol(z3, Decl(es6ImportNamedImportAmd_1.ts, 20, 8)) + +// These are elided +import { aaaa } from "es6ImportNamedImportAmd_0"; +>aaaa : Symbol(aaaa, Decl(es6ImportNamedImportAmd_1.ts, 24, 8)) + +// These are elided +import { aaaa as bbbb } from "es6ImportNamedImportAmd_0"; +>aaaa : Symbol(bbbb, Decl(es6ImportNamedImportAmd_1.ts, 26, 8)) +>bbbb : Symbol(bbbb, Decl(es6ImportNamedImportAmd_1.ts, 26, 8)) + diff --git a/tests/baselines/reference/es6ImportNamedImportAmd.types b/tests/baselines/reference/es6ImportNamedImportAmd.types index 4a0abe853e0..45ca9c08547 100644 --- a/tests/baselines/reference/es6ImportNamedImportAmd.types +++ b/tests/baselines/reference/es6ImportNamedImportAmd.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number export var x = a; >x : number @@ -13,18 +14,23 @@ export var m = a; export var a1 = 10; >a1 : number +>10 : number export var x1 = 10; >x1 : number +>10 : number export var z1 = 10; >z1 : number +>10 : number export var z2 = 10; >z2 : number +>10 : number export var aaaa = 10; >aaaa : number +>10 : number === tests/cases/compiler/es6ImportNamedImportAmd_1.ts === import { } from "es6ImportNamedImportAmd_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportDts.symbols b/tests/baselines/reference/es6ImportNamedImportDts.symbols new file mode 100644 index 00000000000..2e3b2735b3d --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportDts.symbols @@ -0,0 +1,138 @@ +=== tests/cases/compiler/server.ts === + +export class a { } +>a : Symbol(a, Decl(server.ts, 0, 0)) + +export class a11 { } +>a11 : Symbol(a11, Decl(server.ts, 1, 18)) + +export class a12 { } +>a12 : Symbol(a12, Decl(server.ts, 2, 20)) + +export class x { } +>x : Symbol(x, Decl(server.ts, 3, 20)) + +export class x11 { } +>x11 : Symbol(x11, Decl(server.ts, 4, 18)) + +export class m { } +>m : Symbol(m, Decl(server.ts, 5, 20)) + +export class a1 { } +>a1 : Symbol(a1, Decl(server.ts, 6, 18)) + +export class x1 { } +>x1 : Symbol(x1, Decl(server.ts, 7, 19)) + +export class a111 { } +>a111 : Symbol(a111, Decl(server.ts, 8, 19)) + +export class x111 { } +>x111 : Symbol(x111, Decl(server.ts, 9, 21)) + +export class z1 { } +>z1 : Symbol(z1, Decl(server.ts, 10, 21)) + +export class z2 { } +>z2 : Symbol(z2, Decl(server.ts, 11, 19)) + +export class aaaa { } +>aaaa : Symbol(aaaa, Decl(server.ts, 12, 19)) + +export class aaaa1 { } +>aaaa1 : Symbol(aaaa1, Decl(server.ts, 13, 21)) + +=== tests/cases/compiler/client.ts === +import { } from "server"; +import { a } from "server"; +>a : Symbol(a, Decl(client.ts, 1, 8)) + +export var xxxx = new a(); +>xxxx : Symbol(xxxx, Decl(client.ts, 2, 10)) +>a : Symbol(a, Decl(client.ts, 1, 8)) + +import { a11 as b } from "server"; +>a11 : Symbol(b, Decl(client.ts, 3, 8)) +>b : Symbol(b, Decl(client.ts, 3, 8)) + +export var xxxx1 = new b(); +>xxxx1 : Symbol(xxxx1, Decl(client.ts, 4, 10)) +>b : Symbol(b, Decl(client.ts, 3, 8)) + +import { x, a12 as y } from "server"; +>x : Symbol(x, Decl(client.ts, 5, 8)) +>a12 : Symbol(y, Decl(client.ts, 5, 11)) +>y : Symbol(y, Decl(client.ts, 5, 11)) + +export var xxxx2 = new x(); +>xxxx2 : Symbol(xxxx2, Decl(client.ts, 6, 10)) +>x : Symbol(x, Decl(client.ts, 5, 8)) + +export var xxxx3 = new y(); +>xxxx3 : Symbol(xxxx3, Decl(client.ts, 7, 10)) +>y : Symbol(y, Decl(client.ts, 5, 11)) + +import { x11 as z, } from "server"; +>x11 : Symbol(z, Decl(client.ts, 8, 8)) +>z : Symbol(z, Decl(client.ts, 8, 8)) + +export var xxxx4 = new z(); +>xxxx4 : Symbol(xxxx4, Decl(client.ts, 9, 10)) +>z : Symbol(z, Decl(client.ts, 8, 8)) + +import { m, } from "server"; +>m : Symbol(m, Decl(client.ts, 10, 8)) + +export var xxxx5 = new m(); +>xxxx5 : Symbol(xxxx5, Decl(client.ts, 11, 10)) +>m : Symbol(m, Decl(client.ts, 10, 8)) + +import { a1, x1 } from "server"; +>a1 : Symbol(a1, Decl(client.ts, 12, 8)) +>x1 : Symbol(x1, Decl(client.ts, 12, 12)) + +export var xxxx6 = new a1(); +>xxxx6 : Symbol(xxxx6, Decl(client.ts, 13, 10)) +>a1 : Symbol(a1, Decl(client.ts, 12, 8)) + +export var xxxx7 = new x1(); +>xxxx7 : Symbol(xxxx7, Decl(client.ts, 14, 10)) +>x1 : Symbol(x1, Decl(client.ts, 12, 12)) + +import { a111 as a11, x111 as x11 } from "server"; +>a111 : Symbol(a11, Decl(client.ts, 15, 8)) +>a11 : Symbol(a11, Decl(client.ts, 15, 8)) +>x111 : Symbol(x11, Decl(client.ts, 15, 21)) +>x11 : Symbol(x11, Decl(client.ts, 15, 21)) + +export var xxxx8 = new a11(); +>xxxx8 : Symbol(xxxx8, Decl(client.ts, 16, 10)) +>a11 : Symbol(a11, Decl(client.ts, 15, 8)) + +export var xxxx9 = new x11(); +>xxxx9 : Symbol(xxxx9, Decl(client.ts, 17, 10)) +>x11 : Symbol(x11, Decl(client.ts, 15, 21)) + +import { z1 } from "server"; +>z1 : Symbol(z1, Decl(client.ts, 18, 8)) + +export var z111 = new z1(); +>z111 : Symbol(z111, Decl(client.ts, 19, 10)) +>z1 : Symbol(z1, Decl(client.ts, 18, 8)) + +import { z2 as z3 } from "server"; +>z2 : Symbol(z3, Decl(client.ts, 20, 8)) +>z3 : Symbol(z3, Decl(client.ts, 20, 8)) + +export var z2 = new z3(); // z2 shouldn't give redeclare error +>z2 : Symbol(z2, Decl(client.ts, 21, 10)) +>z3 : Symbol(z3, Decl(client.ts, 20, 8)) + +// not referenced +import { aaaa } from "server"; +>aaaa : Symbol(aaaa, Decl(client.ts, 24, 8)) + +import { aaaa1 as bbbb } from "server"; +>aaaa1 : Symbol(bbbb, Decl(client.ts, 25, 8)) +>bbbb : Symbol(bbbb, Decl(client.ts, 25, 8)) + diff --git a/tests/baselines/reference/es6ImportNamedImportInEs5.symbols b/tests/baselines/reference/es6ImportNamedImportInEs5.symbols new file mode 100644 index 00000000000..546487514ce --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportInEs5.symbols @@ -0,0 +1,123 @@ +=== tests/cases/compiler/es6ImportNamedImportInEs5_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportNamedImportInEs5_0.ts, 1, 10)) + +export var x = a; +>x : Symbol(x, Decl(es6ImportNamedImportInEs5_0.ts, 2, 10)) +>a : Symbol(a, Decl(es6ImportNamedImportInEs5_0.ts, 1, 10)) + +export var m = a; +>m : Symbol(m, Decl(es6ImportNamedImportInEs5_0.ts, 3, 10)) +>a : Symbol(a, Decl(es6ImportNamedImportInEs5_0.ts, 1, 10)) + +export var a1 = 10; +>a1 : Symbol(a1, Decl(es6ImportNamedImportInEs5_0.ts, 4, 10)) + +export var x1 = 10; +>x1 : Symbol(x1, Decl(es6ImportNamedImportInEs5_0.ts, 5, 10)) + +export var z1 = 10; +>z1 : Symbol(z1, Decl(es6ImportNamedImportInEs5_0.ts, 6, 10)) + +export var z2 = 10; +>z2 : Symbol(z2, Decl(es6ImportNamedImportInEs5_0.ts, 7, 10)) + +export var aaaa = 10; +>aaaa : Symbol(aaaa, Decl(es6ImportNamedImportInEs5_0.ts, 8, 10)) + +=== tests/cases/compiler/es6ImportNamedImportInEs5_1.ts === +import { } from "es6ImportNamedImportInEs5_0"; +import { a } from "es6ImportNamedImportInEs5_0"; +>a : Symbol(a, Decl(es6ImportNamedImportInEs5_1.ts, 1, 8)) + +var xxxx = a; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>a : Symbol(a, Decl(es6ImportNamedImportInEs5_1.ts, 1, 8)) + +import { a as b } from "es6ImportNamedImportInEs5_0"; +>a : Symbol(b, Decl(es6ImportNamedImportInEs5_1.ts, 3, 8)) +>b : Symbol(b, Decl(es6ImportNamedImportInEs5_1.ts, 3, 8)) + +var xxxx = b; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>b : Symbol(b, Decl(es6ImportNamedImportInEs5_1.ts, 3, 8)) + +import { x, a as y } from "es6ImportNamedImportInEs5_0"; +>x : Symbol(x, Decl(es6ImportNamedImportInEs5_1.ts, 5, 8)) +>a : Symbol(y, Decl(es6ImportNamedImportInEs5_1.ts, 5, 11)) +>y : Symbol(y, Decl(es6ImportNamedImportInEs5_1.ts, 5, 11)) + +var xxxx = x; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>x : Symbol(x, Decl(es6ImportNamedImportInEs5_1.ts, 5, 8)) + +var xxxx = y; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>y : Symbol(y, Decl(es6ImportNamedImportInEs5_1.ts, 5, 11)) + +import { x as z, } from "es6ImportNamedImportInEs5_0"; +>x : Symbol(z, Decl(es6ImportNamedImportInEs5_1.ts, 8, 8)) +>z : Symbol(z, Decl(es6ImportNamedImportInEs5_1.ts, 8, 8)) + +var xxxx = z; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>z : Symbol(z, Decl(es6ImportNamedImportInEs5_1.ts, 8, 8)) + +import { m, } from "es6ImportNamedImportInEs5_0"; +>m : Symbol(m, Decl(es6ImportNamedImportInEs5_1.ts, 10, 8)) + +var xxxx = m; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>m : Symbol(m, Decl(es6ImportNamedImportInEs5_1.ts, 10, 8)) + +import { a1, x1 } from "es6ImportNamedImportInEs5_0"; +>a1 : Symbol(a1, Decl(es6ImportNamedImportInEs5_1.ts, 12, 8)) +>x1 : Symbol(x1, Decl(es6ImportNamedImportInEs5_1.ts, 12, 12)) + +var xxxx = a1; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>a1 : Symbol(a1, Decl(es6ImportNamedImportInEs5_1.ts, 12, 8)) + +var xxxx = x1; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>x1 : Symbol(x1, Decl(es6ImportNamedImportInEs5_1.ts, 12, 12)) + +import { a1 as a11, x1 as x11 } from "es6ImportNamedImportInEs5_0"; +>a1 : Symbol(a11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 8)) +>a11 : Symbol(a11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 8)) +>x1 : Symbol(x11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 19)) +>x11 : Symbol(x11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 19)) + +var xxxx = a11; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>a11 : Symbol(a11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 8)) + +var xxxx = x11; +>xxxx : Symbol(xxxx, Decl(es6ImportNamedImportInEs5_1.ts, 2, 3), Decl(es6ImportNamedImportInEs5_1.ts, 4, 3), Decl(es6ImportNamedImportInEs5_1.ts, 6, 3), Decl(es6ImportNamedImportInEs5_1.ts, 7, 3), Decl(es6ImportNamedImportInEs5_1.ts, 9, 3), Decl(es6ImportNamedImportInEs5_1.ts, 11, 3), Decl(es6ImportNamedImportInEs5_1.ts, 13, 3), Decl(es6ImportNamedImportInEs5_1.ts, 14, 3), Decl(es6ImportNamedImportInEs5_1.ts, 16, 3), Decl(es6ImportNamedImportInEs5_1.ts, 17, 3)) +>x11 : Symbol(x11, Decl(es6ImportNamedImportInEs5_1.ts, 15, 19)) + +import { z1 } from "es6ImportNamedImportInEs5_0"; +>z1 : Symbol(z1, Decl(es6ImportNamedImportInEs5_1.ts, 18, 8)) + +var z111 = z1; +>z111 : Symbol(z111, Decl(es6ImportNamedImportInEs5_1.ts, 19, 3)) +>z1 : Symbol(z1, Decl(es6ImportNamedImportInEs5_1.ts, 18, 8)) + +import { z2 as z3 } from "es6ImportNamedImportInEs5_0"; +>z2 : Symbol(z3, Decl(es6ImportNamedImportInEs5_1.ts, 20, 8)) +>z3 : Symbol(z3, Decl(es6ImportNamedImportInEs5_1.ts, 20, 8)) + +var z2 = z3; // z2 shouldn't give redeclare error +>z2 : Symbol(z2, Decl(es6ImportNamedImportInEs5_1.ts, 21, 3)) +>z3 : Symbol(z3, Decl(es6ImportNamedImportInEs5_1.ts, 20, 8)) + +// These are elided +import { aaaa } from "es6ImportNamedImportInEs5_0"; +>aaaa : Symbol(aaaa, Decl(es6ImportNamedImportInEs5_1.ts, 24, 8)) + +// These are elided +import { aaaa as bbbb } from "es6ImportNamedImportInEs5_0"; +>aaaa : Symbol(bbbb, Decl(es6ImportNamedImportInEs5_1.ts, 26, 8)) +>bbbb : Symbol(bbbb, Decl(es6ImportNamedImportInEs5_1.ts, 26, 8)) + diff --git a/tests/baselines/reference/es6ImportNamedImportInEs5.types b/tests/baselines/reference/es6ImportNamedImportInEs5.types index f60644b2621..95f784c5eac 100644 --- a/tests/baselines/reference/es6ImportNamedImportInEs5.types +++ b/tests/baselines/reference/es6ImportNamedImportInEs5.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number export var x = a; >x : number @@ -13,18 +14,23 @@ export var m = a; export var a1 = 10; >a1 : number +>10 : number export var x1 = 10; >x1 : number +>10 : number export var z1 = 10; >z1 : number +>10 : number export var z2 = 10; >z2 : number +>10 : number export var aaaa = 10; >aaaa : number +>10 : number === tests/cases/compiler/es6ImportNamedImportInEs5_1.ts === import { } from "es6ImportNamedImportInEs5_0"; diff --git a/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.symbols b/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.symbols new file mode 100644 index 00000000000..2598735d6d8 --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/es6ImportNamedImportInIndirectExportAssignment_0.ts === + +export module a { +>a : Symbol(a, Decl(es6ImportNamedImportInIndirectExportAssignment_0.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(es6ImportNamedImportInIndirectExportAssignment_0.ts, 1, 17)) + } +} + +=== tests/cases/compiler/es6ImportNamedImportInIndirectExportAssignment_1.ts === +import { a } from "es6ImportNamedImportInIndirectExportAssignment_0"; +>a : Symbol(a, Decl(es6ImportNamedImportInIndirectExportAssignment_1.ts, 0, 8)) + +import x = a; +>x : Symbol(x, Decl(es6ImportNamedImportInIndirectExportAssignment_1.ts, 0, 69)) +>a : Symbol(a, Decl(es6ImportNamedImportInIndirectExportAssignment_0.ts, 0, 0)) + +export = x; +>x : Symbol(x, Decl(es6ImportNamedImportInIndirectExportAssignment_1.ts, 0, 69)) + diff --git a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.symbols b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.symbols new file mode 100644 index 00000000000..e294124c6f4 --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/server.ts === + +export interface I { +>I : Symbol(I, Decl(server.ts, 0, 0)) + + prop: string; +>prop : Symbol(prop, Decl(server.ts, 1, 20)) +} +export interface I2 { +>I2 : Symbol(I2, Decl(server.ts, 3, 1)) + + prop2: string; +>prop2 : Symbol(prop2, Decl(server.ts, 4, 21)) +} +export class C implements I { +>C : Symbol(C, Decl(server.ts, 6, 1)) +>I : Symbol(I, Decl(server.ts, 0, 0)) + + prop = "hello"; +>prop : Symbol(prop, Decl(server.ts, 7, 29)) +} +export class C2 implements I2 { +>C2 : Symbol(C2, Decl(server.ts, 9, 1)) +>I2 : Symbol(I2, Decl(server.ts, 3, 1)) + + prop2 = "world"; +>prop2 : Symbol(prop2, Decl(server.ts, 10, 31)) +} + +=== tests/cases/compiler/client.ts === +import { C, I, C2 } from "server"; // Shouldnt emit I and C2 into the js file and emit C and I in .d.ts file +>C : Symbol(C, Decl(client.ts, 0, 8)) +>I : Symbol(I, Decl(client.ts, 0, 11)) +>C2 : Symbol(C2, Decl(client.ts, 0, 14)) + +export type cValInterface = I; +>cValInterface : Symbol(cValInterface, Decl(client.ts, 0, 34)) +>I : Symbol(I, Decl(client.ts, 0, 11)) + +export var cVal = new C(); +>cVal : Symbol(cVal, Decl(client.ts, 2, 10)) +>C : Symbol(C, Decl(client.ts, 0, 8)) + diff --git a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types index 62917e5ff36..12e5271c8b0 100644 --- a/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types +++ b/tests/baselines/reference/es6ImportNamedImportWithTypesAndValues.types @@ -18,6 +18,7 @@ export class C implements I { prop = "hello"; >prop : string +>"hello" : string } export class C2 implements I2 { >C2 : C2 @@ -25,12 +26,13 @@ export class C2 implements I2 { prop2 = "world"; >prop2 : string +>"world" : string } === tests/cases/compiler/client.ts === import { C, I, C2 } from "server"; // Shouldnt emit I and C2 into the js file and emit C and I in .d.ts file >C : typeof C ->I : unknown +>I : any >C2 : typeof C2 export type cValInterface = I; diff --git a/tests/baselines/reference/es6ImportWithoutFromClause.symbols b/tests/baselines/reference/es6ImportWithoutFromClause.symbols new file mode 100644 index 00000000000..31eafdf655c --- /dev/null +++ b/tests/baselines/reference/es6ImportWithoutFromClause.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/es6ImportWithoutFromClause_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportWithoutFromClause_0.ts, 1, 10)) + +=== tests/cases/compiler/es6ImportWithoutFromClause_1.ts === +import "es6ImportWithoutFromClause_0"; +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportWithoutFromClause.types b/tests/baselines/reference/es6ImportWithoutFromClause.types index 3cc5067891a..d46a4a7487c 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClause.types +++ b/tests/baselines/reference/es6ImportWithoutFromClause.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number === tests/cases/compiler/es6ImportWithoutFromClause_1.ts === import "es6ImportWithoutFromClause_0"; diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.symbols b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.symbols new file mode 100644 index 00000000000..36e1e79f0b5 --- /dev/null +++ b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/es6ImportWithoutFromClauseAmd_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportWithoutFromClauseAmd_0.ts, 1, 10)) + +=== tests/cases/compiler/es6ImportWithoutFromClauseAmd_1.ts === +export var b = 10; +>b : Symbol(b, Decl(es6ImportWithoutFromClauseAmd_1.ts, 0, 10)) + +=== tests/cases/compiler/es6ImportWithoutFromClauseAmd_2.ts === +import "es6ImportWithoutFromClauseAmd_0"; +import "es6ImportWithoutFromClauseAmd_2"; +var _a = 10; +>_a : Symbol(_a, Decl(es6ImportWithoutFromClauseAmd_2.ts, 2, 3)) + +var _b = 10; +>_b : Symbol(_b, Decl(es6ImportWithoutFromClauseAmd_2.ts, 3, 3)) + diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types index c3d09388916..3314b12d189 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types +++ b/tests/baselines/reference/es6ImportWithoutFromClauseAmd.types @@ -2,17 +2,21 @@ export var a = 10; >a : number +>10 : number === tests/cases/compiler/es6ImportWithoutFromClauseAmd_1.ts === export var b = 10; >b : number +>10 : number === tests/cases/compiler/es6ImportWithoutFromClauseAmd_2.ts === import "es6ImportWithoutFromClauseAmd_0"; import "es6ImportWithoutFromClauseAmd_2"; var _a = 10; >_a : number +>10 : number var _b = 10; >_b : number +>10 : number diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.symbols b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.symbols new file mode 100644 index 00000000000..c8db6eff479 --- /dev/null +++ b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/es6ImportWithoutFromClauseInEs5_0.ts === + +export var a = 10; +>a : Symbol(a, Decl(es6ImportWithoutFromClauseInEs5_0.ts, 1, 10)) + +=== tests/cases/compiler/es6ImportWithoutFromClauseInEs5_1.ts === +import "es6ImportWithoutFromClauseInEs5_0"; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types index 3d674f9c22c..ee95c07bb75 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types +++ b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.types @@ -2,6 +2,7 @@ export var a = 10; >a : number +>10 : number === tests/cases/compiler/es6ImportWithoutFromClauseInEs5_1.ts === import "es6ImportWithoutFromClauseInEs5_0"; diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseNonInstantiatedModule.symbols b/tests/baselines/reference/es6ImportWithoutFromClauseNonInstantiatedModule.symbols new file mode 100644 index 00000000000..0fe8e68e1a3 --- /dev/null +++ b/tests/baselines/reference/es6ImportWithoutFromClauseNonInstantiatedModule.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/es6ImportWithoutFromClauseNonInstantiatedModule_0.ts === + +export interface i { +>i : Symbol(i, Decl(es6ImportWithoutFromClauseNonInstantiatedModule_0.ts, 0, 0)) +} + +=== tests/cases/compiler/es6ImportWithoutFromClauseNonInstantiatedModule_1.ts === +import "es6ImportWithoutFromClauseNonInstantiatedModule_0"; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6Module.symbols b/tests/baselines/reference/es6Module.symbols new file mode 100644 index 00000000000..8887adfff37 --- /dev/null +++ b/tests/baselines/reference/es6Module.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/es6Module.ts === +export class A +>A : Symbol(A, Decl(es6Module.ts, 0, 0)) +{ + constructor () + { + } + + public B() +>B : Symbol(B, Decl(es6Module.ts, 4, 5)) + { + return 42; + } +} diff --git a/tests/baselines/reference/es6Module.types b/tests/baselines/reference/es6Module.types index 93910200215..b55b58e8883 100644 --- a/tests/baselines/reference/es6Module.types +++ b/tests/baselines/reference/es6Module.types @@ -10,5 +10,6 @@ export class A >B : () => number { return 42; +>42 : number } } diff --git a/tests/baselines/reference/es6ModuleClassDeclaration.symbols b/tests/baselines/reference/es6ModuleClassDeclaration.symbols new file mode 100644 index 00000000000..5ad84b94f0a --- /dev/null +++ b/tests/baselines/reference/es6ModuleClassDeclaration.symbols @@ -0,0 +1,222 @@ +=== tests/cases/compiler/es6ModuleClassDeclaration.ts === +export class c { +>c : Symbol(c, Decl(es6ModuleClassDeclaration.ts, 0, 0)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 2, 5)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 3, 19)) + + static k = 20; +>k : Symbol(c.k, Decl(es6ModuleClassDeclaration.ts, 4, 18)) + + private static l = 30; +>l : Symbol(c.l, Decl(es6ModuleClassDeclaration.ts, 5, 18)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 6, 26)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 8, 5)) + } + static method3() { +>method3 : Symbol(c.method3, Decl(es6ModuleClassDeclaration.ts, 10, 5)) + } + private static method4() { +>method4 : Symbol(c.method4, Decl(es6ModuleClassDeclaration.ts, 12, 5)) + } +} +class c2 { +>c2 : Symbol(c2, Decl(es6ModuleClassDeclaration.ts, 15, 1)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 18, 5)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 19, 19)) + + static k = 20; +>k : Symbol(c2.k, Decl(es6ModuleClassDeclaration.ts, 20, 18)) + + private static l = 30; +>l : Symbol(c2.l, Decl(es6ModuleClassDeclaration.ts, 21, 18)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 22, 26)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 24, 5)) + } + static method3() { +>method3 : Symbol(c2.method3, Decl(es6ModuleClassDeclaration.ts, 26, 5)) + } + private static method4() { +>method4 : Symbol(c2.method4, Decl(es6ModuleClassDeclaration.ts, 28, 5)) + } +} +new c(); +>c : Symbol(c, Decl(es6ModuleClassDeclaration.ts, 0, 0)) + +new c2(); +>c2 : Symbol(c2, Decl(es6ModuleClassDeclaration.ts, 15, 1)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleClassDeclaration.ts, 33, 9)) + + export class c3 { +>c3 : Symbol(c3, Decl(es6ModuleClassDeclaration.ts, 35, 18)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 38, 9)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 39, 23)) + + static k = 20; +>k : Symbol(c3.k, Decl(es6ModuleClassDeclaration.ts, 40, 22)) + + private static l = 30; +>l : Symbol(c3.l, Decl(es6ModuleClassDeclaration.ts, 41, 22)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 42, 30)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 44, 9)) + } + static method3() { +>method3 : Symbol(c3.method3, Decl(es6ModuleClassDeclaration.ts, 46, 9)) + } + private static method4() { +>method4 : Symbol(c3.method4, Decl(es6ModuleClassDeclaration.ts, 48, 9)) + } + } + class c4 { +>c4 : Symbol(c4, Decl(es6ModuleClassDeclaration.ts, 51, 5)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 54, 9)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 55, 23)) + + static k = 20; +>k : Symbol(c4.k, Decl(es6ModuleClassDeclaration.ts, 56, 22)) + + private static l = 30; +>l : Symbol(c4.l, Decl(es6ModuleClassDeclaration.ts, 57, 22)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 58, 30)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 60, 9)) + } + static method3() { +>method3 : Symbol(c4.method3, Decl(es6ModuleClassDeclaration.ts, 62, 9)) + } + private static method4() { +>method4 : Symbol(c4.method4, Decl(es6ModuleClassDeclaration.ts, 64, 9)) + } + } + new c(); +>c : Symbol(c, Decl(es6ModuleClassDeclaration.ts, 0, 0)) + + new c2(); +>c2 : Symbol(c2, Decl(es6ModuleClassDeclaration.ts, 15, 1)) + + new c3(); +>c3 : Symbol(c3, Decl(es6ModuleClassDeclaration.ts, 35, 18)) + + new c4(); +>c4 : Symbol(c4, Decl(es6ModuleClassDeclaration.ts, 51, 5)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleClassDeclaration.ts, 72, 1)) + + export class c3 { +>c3 : Symbol(c3, Decl(es6ModuleClassDeclaration.ts, 73, 11)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 76, 9)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 77, 23)) + + static k = 20; +>k : Symbol(c3.k, Decl(es6ModuleClassDeclaration.ts, 78, 22)) + + private static l = 30; +>l : Symbol(c3.l, Decl(es6ModuleClassDeclaration.ts, 79, 22)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 80, 30)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 82, 9)) + } + static method3() { +>method3 : Symbol(c3.method3, Decl(es6ModuleClassDeclaration.ts, 84, 9)) + } + private static method4() { +>method4 : Symbol(c3.method4, Decl(es6ModuleClassDeclaration.ts, 86, 9)) + } + } + class c4 { +>c4 : Symbol(c4, Decl(es6ModuleClassDeclaration.ts, 89, 5)) + + constructor() { + } + private x = 10; +>x : Symbol(x, Decl(es6ModuleClassDeclaration.ts, 92, 9)) + + public y = 30; +>y : Symbol(y, Decl(es6ModuleClassDeclaration.ts, 93, 23)) + + static k = 20; +>k : Symbol(c4.k, Decl(es6ModuleClassDeclaration.ts, 94, 22)) + + private static l = 30; +>l : Symbol(c4.l, Decl(es6ModuleClassDeclaration.ts, 95, 22)) + + private method1() { +>method1 : Symbol(method1, Decl(es6ModuleClassDeclaration.ts, 96, 30)) + } + public method2() { +>method2 : Symbol(method2, Decl(es6ModuleClassDeclaration.ts, 98, 9)) + } + static method3() { +>method3 : Symbol(c4.method3, Decl(es6ModuleClassDeclaration.ts, 100, 9)) + } + private static method4() { +>method4 : Symbol(c4.method4, Decl(es6ModuleClassDeclaration.ts, 102, 9)) + } + } + new c(); +>c : Symbol(c, Decl(es6ModuleClassDeclaration.ts, 0, 0)) + + new c2(); +>c2 : Symbol(c2, Decl(es6ModuleClassDeclaration.ts, 15, 1)) + + new c3(); +>c3 : Symbol(c3, Decl(es6ModuleClassDeclaration.ts, 73, 11)) + + new c4(); +>c4 : Symbol(c4, Decl(es6ModuleClassDeclaration.ts, 89, 5)) + + new m1.c3(); +>m1.c3 : Symbol(m1.c3, Decl(es6ModuleClassDeclaration.ts, 35, 18)) +>m1 : Symbol(m1, Decl(es6ModuleClassDeclaration.ts, 33, 9)) +>c3 : Symbol(m1.c3, Decl(es6ModuleClassDeclaration.ts, 35, 18)) +} diff --git a/tests/baselines/reference/es6ModuleClassDeclaration.types b/tests/baselines/reference/es6ModuleClassDeclaration.types index 09d50c4e542..e354d266abe 100644 --- a/tests/baselines/reference/es6ModuleClassDeclaration.types +++ b/tests/baselines/reference/es6ModuleClassDeclaration.types @@ -6,15 +6,19 @@ export class c { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void @@ -36,15 +40,19 @@ class c2 { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void @@ -77,15 +85,19 @@ export module m1 { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void @@ -107,15 +119,19 @@ export module m1 { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void @@ -156,15 +172,19 @@ module m2 { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void @@ -186,15 +206,19 @@ module m2 { } private x = 10; >x : number +>10 : number public y = 30; >y : number +>30 : number static k = 20; >k : number +>20 : number private static l = 30; >l : number +>30 : number private method1() { >method1 : () => void diff --git a/tests/baselines/reference/es6ModuleConst.symbols b/tests/baselines/reference/es6ModuleConst.symbols new file mode 100644 index 00000000000..539188ce1cc --- /dev/null +++ b/tests/baselines/reference/es6ModuleConst.symbols @@ -0,0 +1,70 @@ +=== tests/cases/compiler/es6ModuleConst.ts === +export const a = "hello"; +>a : Symbol(a, Decl(es6ModuleConst.ts, 0, 12)) + +export const x: string = a, y = x; +>x : Symbol(x, Decl(es6ModuleConst.ts, 1, 12)) +>a : Symbol(a, Decl(es6ModuleConst.ts, 0, 12)) +>y : Symbol(y, Decl(es6ModuleConst.ts, 1, 27)) +>x : Symbol(x, Decl(es6ModuleConst.ts, 1, 12)) + +const b = y; +>b : Symbol(b, Decl(es6ModuleConst.ts, 2, 5)) +>y : Symbol(y, Decl(es6ModuleConst.ts, 1, 27)) + +const c: string = b, d = c; +>c : Symbol(c, Decl(es6ModuleConst.ts, 3, 5)) +>b : Symbol(b, Decl(es6ModuleConst.ts, 2, 5)) +>d : Symbol(d, Decl(es6ModuleConst.ts, 3, 20)) +>c : Symbol(c, Decl(es6ModuleConst.ts, 3, 5)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleConst.ts, 3, 27)) + + export const k = a; +>k : Symbol(k, Decl(es6ModuleConst.ts, 5, 16)) +>a : Symbol(a, Decl(es6ModuleConst.ts, 0, 12)) + + export const l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleConst.ts, 6, 16)) +>b : Symbol(b, Decl(es6ModuleConst.ts, 2, 5)) +>m : Symbol(m, Decl(es6ModuleConst.ts, 6, 31)) +>k : Symbol(k, Decl(es6ModuleConst.ts, 5, 16)) + + const n = m1.k; +>n : Symbol(n, Decl(es6ModuleConst.ts, 7, 9)) +>m1.k : Symbol(k, Decl(es6ModuleConst.ts, 5, 16)) +>m1 : Symbol(m1, Decl(es6ModuleConst.ts, 3, 27)) +>k : Symbol(k, Decl(es6ModuleConst.ts, 5, 16)) + + const o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleConst.ts, 8, 9)) +>n : Symbol(n, Decl(es6ModuleConst.ts, 7, 9)) +>p : Symbol(p, Decl(es6ModuleConst.ts, 8, 24)) +>k : Symbol(k, Decl(es6ModuleConst.ts, 5, 16)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleConst.ts, 9, 1)) + + export const k = a; +>k : Symbol(k, Decl(es6ModuleConst.ts, 11, 16)) +>a : Symbol(a, Decl(es6ModuleConst.ts, 0, 12)) + + export const l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleConst.ts, 12, 16)) +>b : Symbol(b, Decl(es6ModuleConst.ts, 2, 5)) +>m : Symbol(m, Decl(es6ModuleConst.ts, 12, 31)) +>k : Symbol(k, Decl(es6ModuleConst.ts, 11, 16)) + + const n = m1.k; +>n : Symbol(n, Decl(es6ModuleConst.ts, 13, 9)) +>m1.k : Symbol(m1.k, Decl(es6ModuleConst.ts, 5, 16)) +>m1 : Symbol(m1, Decl(es6ModuleConst.ts, 3, 27)) +>k : Symbol(m1.k, Decl(es6ModuleConst.ts, 5, 16)) + + const o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleConst.ts, 14, 9)) +>n : Symbol(n, Decl(es6ModuleConst.ts, 13, 9)) +>p : Symbol(p, Decl(es6ModuleConst.ts, 14, 24)) +>k : Symbol(k, Decl(es6ModuleConst.ts, 11, 16)) +} diff --git a/tests/baselines/reference/es6ModuleConst.types b/tests/baselines/reference/es6ModuleConst.types index cceb74a5e1e..99b9f7c2980 100644 --- a/tests/baselines/reference/es6ModuleConst.types +++ b/tests/baselines/reference/es6ModuleConst.types @@ -1,6 +1,7 @@ === tests/cases/compiler/es6ModuleConst.ts === export const a = "hello"; >a : string +>"hello" : string export const x: string = a, y = x; >x : string diff --git a/tests/baselines/reference/es6ModuleConstEnumDeclaration.symbols b/tests/baselines/reference/es6ModuleConstEnumDeclaration.symbols new file mode 100644 index 00000000000..391ef85c599 --- /dev/null +++ b/tests/baselines/reference/es6ModuleConstEnumDeclaration.symbols @@ -0,0 +1,147 @@ +=== tests/cases/compiler/es6ModuleConstEnumDeclaration.ts === +export const enum e1 { +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration.ts, 0, 0)) + + a, +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) + + b, +>b : Symbol(e1.b, Decl(es6ModuleConstEnumDeclaration.ts, 1, 6)) + + c +>c : Symbol(e1.c, Decl(es6ModuleConstEnumDeclaration.ts, 2, 6)) +} +const enum e2 { +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration.ts, 4, 1)) + + x, +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) + + y, +>y : Symbol(e2.y, Decl(es6ModuleConstEnumDeclaration.ts, 6, 6)) + + z +>z : Symbol(e2.z, Decl(es6ModuleConstEnumDeclaration.ts, 7, 6)) +} +var x = e1.a; +>x : Symbol(x, Decl(es6ModuleConstEnumDeclaration.ts, 10, 3)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) + +var y = e2.x; +>y : Symbol(y, Decl(es6ModuleConstEnumDeclaration.ts, 11, 3)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleConstEnumDeclaration.ts, 11, 13)) + + export const enum e3 { +>e3 : Symbol(e3, Decl(es6ModuleConstEnumDeclaration.ts, 12, 18)) + + a, +>a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration.ts, 13, 26)) + + b, +>b : Symbol(e3.b, Decl(es6ModuleConstEnumDeclaration.ts, 14, 10)) + + c +>c : Symbol(e3.c, Decl(es6ModuleConstEnumDeclaration.ts, 15, 10)) + } + const enum e4 { +>e4 : Symbol(e4, Decl(es6ModuleConstEnumDeclaration.ts, 17, 5)) + + x, +>x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration.ts, 18, 19)) + + y, +>y : Symbol(e4.y, Decl(es6ModuleConstEnumDeclaration.ts, 19, 10)) + + z +>z : Symbol(e4.z, Decl(es6ModuleConstEnumDeclaration.ts, 20, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleConstEnumDeclaration.ts, 23, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleConstEnumDeclaration.ts, 24, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) + + var x2 = e3.a; +>x2 : Symbol(x2, Decl(es6ModuleConstEnumDeclaration.ts, 25, 7)) +>e3.a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration.ts, 13, 26)) +>e3 : Symbol(e3, Decl(es6ModuleConstEnumDeclaration.ts, 12, 18)) +>a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration.ts, 13, 26)) + + var y2 = e4.x; +>y2 : Symbol(y2, Decl(es6ModuleConstEnumDeclaration.ts, 26, 7)) +>e4.x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration.ts, 18, 19)) +>e4 : Symbol(e4, Decl(es6ModuleConstEnumDeclaration.ts, 17, 5)) +>x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration.ts, 18, 19)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleConstEnumDeclaration.ts, 27, 1)) + + export const enum e5 { +>e5 : Symbol(e5, Decl(es6ModuleConstEnumDeclaration.ts, 28, 11)) + + a, +>a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration.ts, 29, 26)) + + b, +>b : Symbol(e5.b, Decl(es6ModuleConstEnumDeclaration.ts, 30, 10)) + + c +>c : Symbol(e5.c, Decl(es6ModuleConstEnumDeclaration.ts, 31, 10)) + } + const enum e6 { +>e6 : Symbol(e6, Decl(es6ModuleConstEnumDeclaration.ts, 33, 5)) + + x, +>x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration.ts, 34, 19)) + + y, +>y : Symbol(e6.y, Decl(es6ModuleConstEnumDeclaration.ts, 35, 10)) + + z +>z : Symbol(e6.z, Decl(es6ModuleConstEnumDeclaration.ts, 36, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleConstEnumDeclaration.ts, 39, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration.ts, 0, 22)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleConstEnumDeclaration.ts, 40, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration.ts, 5, 15)) + + var x2 = e5.a; +>x2 : Symbol(x2, Decl(es6ModuleConstEnumDeclaration.ts, 41, 7)) +>e5.a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration.ts, 29, 26)) +>e5 : Symbol(e5, Decl(es6ModuleConstEnumDeclaration.ts, 28, 11)) +>a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration.ts, 29, 26)) + + var y2 = e6.x; +>y2 : Symbol(y2, Decl(es6ModuleConstEnumDeclaration.ts, 42, 7)) +>e6.x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration.ts, 34, 19)) +>e6 : Symbol(e6, Decl(es6ModuleConstEnumDeclaration.ts, 33, 5)) +>x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration.ts, 34, 19)) + + var x3 = m1.e3.a; +>x3 : Symbol(x3, Decl(es6ModuleConstEnumDeclaration.ts, 43, 7)) +>m1.e3.a : Symbol(m1.e3.a, Decl(es6ModuleConstEnumDeclaration.ts, 13, 26)) +>m1.e3 : Symbol(m1.e3, Decl(es6ModuleConstEnumDeclaration.ts, 12, 18)) +>m1 : Symbol(m1, Decl(es6ModuleConstEnumDeclaration.ts, 11, 13)) +>e3 : Symbol(m1.e3, Decl(es6ModuleConstEnumDeclaration.ts, 12, 18)) +>a : Symbol(m1.e3.a, Decl(es6ModuleConstEnumDeclaration.ts, 13, 26)) +} diff --git a/tests/baselines/reference/es6ModuleConstEnumDeclaration2.symbols b/tests/baselines/reference/es6ModuleConstEnumDeclaration2.symbols new file mode 100644 index 00000000000..2e756cf2875 --- /dev/null +++ b/tests/baselines/reference/es6ModuleConstEnumDeclaration2.symbols @@ -0,0 +1,148 @@ +=== tests/cases/compiler/es6ModuleConstEnumDeclaration2.ts === + +export const enum e1 { +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration2.ts, 0, 0)) + + a, +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) + + b, +>b : Symbol(e1.b, Decl(es6ModuleConstEnumDeclaration2.ts, 2, 6)) + + c +>c : Symbol(e1.c, Decl(es6ModuleConstEnumDeclaration2.ts, 3, 6)) +} +const enum e2 { +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration2.ts, 5, 1)) + + x, +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) + + y, +>y : Symbol(e2.y, Decl(es6ModuleConstEnumDeclaration2.ts, 7, 6)) + + z +>z : Symbol(e2.z, Decl(es6ModuleConstEnumDeclaration2.ts, 8, 6)) +} +var x = e1.a; +>x : Symbol(x, Decl(es6ModuleConstEnumDeclaration2.ts, 11, 3)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration2.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) + +var y = e2.x; +>y : Symbol(y, Decl(es6ModuleConstEnumDeclaration2.ts, 12, 3)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration2.ts, 5, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleConstEnumDeclaration2.ts, 12, 13)) + + export const enum e3 { +>e3 : Symbol(e3, Decl(es6ModuleConstEnumDeclaration2.ts, 13, 18)) + + a, +>a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration2.ts, 14, 26)) + + b, +>b : Symbol(e3.b, Decl(es6ModuleConstEnumDeclaration2.ts, 15, 10)) + + c +>c : Symbol(e3.c, Decl(es6ModuleConstEnumDeclaration2.ts, 16, 10)) + } + const enum e4 { +>e4 : Symbol(e4, Decl(es6ModuleConstEnumDeclaration2.ts, 18, 5)) + + x, +>x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration2.ts, 19, 19)) + + y, +>y : Symbol(e4.y, Decl(es6ModuleConstEnumDeclaration2.ts, 20, 10)) + + z +>z : Symbol(e4.z, Decl(es6ModuleConstEnumDeclaration2.ts, 21, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleConstEnumDeclaration2.ts, 24, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration2.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleConstEnumDeclaration2.ts, 25, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration2.ts, 5, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) + + var x2 = e3.a; +>x2 : Symbol(x2, Decl(es6ModuleConstEnumDeclaration2.ts, 26, 7)) +>e3.a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration2.ts, 14, 26)) +>e3 : Symbol(e3, Decl(es6ModuleConstEnumDeclaration2.ts, 13, 18)) +>a : Symbol(e3.a, Decl(es6ModuleConstEnumDeclaration2.ts, 14, 26)) + + var y2 = e4.x; +>y2 : Symbol(y2, Decl(es6ModuleConstEnumDeclaration2.ts, 27, 7)) +>e4.x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration2.ts, 19, 19)) +>e4 : Symbol(e4, Decl(es6ModuleConstEnumDeclaration2.ts, 18, 5)) +>x : Symbol(e4.x, Decl(es6ModuleConstEnumDeclaration2.ts, 19, 19)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleConstEnumDeclaration2.ts, 28, 1)) + + export const enum e5 { +>e5 : Symbol(e5, Decl(es6ModuleConstEnumDeclaration2.ts, 29, 11)) + + a, +>a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration2.ts, 30, 26)) + + b, +>b : Symbol(e5.b, Decl(es6ModuleConstEnumDeclaration2.ts, 31, 10)) + + c +>c : Symbol(e5.c, Decl(es6ModuleConstEnumDeclaration2.ts, 32, 10)) + } + const enum e6 { +>e6 : Symbol(e6, Decl(es6ModuleConstEnumDeclaration2.ts, 34, 5)) + + x, +>x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration2.ts, 35, 19)) + + y, +>y : Symbol(e6.y, Decl(es6ModuleConstEnumDeclaration2.ts, 36, 10)) + + z +>z : Symbol(e6.z, Decl(es6ModuleConstEnumDeclaration2.ts, 37, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleConstEnumDeclaration2.ts, 40, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) +>e1 : Symbol(e1, Decl(es6ModuleConstEnumDeclaration2.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleConstEnumDeclaration2.ts, 1, 22)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleConstEnumDeclaration2.ts, 41, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) +>e2 : Symbol(e2, Decl(es6ModuleConstEnumDeclaration2.ts, 5, 1)) +>x : Symbol(e2.x, Decl(es6ModuleConstEnumDeclaration2.ts, 6, 15)) + + var x2 = e5.a; +>x2 : Symbol(x2, Decl(es6ModuleConstEnumDeclaration2.ts, 42, 7)) +>e5.a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration2.ts, 30, 26)) +>e5 : Symbol(e5, Decl(es6ModuleConstEnumDeclaration2.ts, 29, 11)) +>a : Symbol(e5.a, Decl(es6ModuleConstEnumDeclaration2.ts, 30, 26)) + + var y2 = e6.x; +>y2 : Symbol(y2, Decl(es6ModuleConstEnumDeclaration2.ts, 43, 7)) +>e6.x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration2.ts, 35, 19)) +>e6 : Symbol(e6, Decl(es6ModuleConstEnumDeclaration2.ts, 34, 5)) +>x : Symbol(e6.x, Decl(es6ModuleConstEnumDeclaration2.ts, 35, 19)) + + var x3 = m1.e3.a; +>x3 : Symbol(x3, Decl(es6ModuleConstEnumDeclaration2.ts, 44, 7)) +>m1.e3.a : Symbol(m1.e3.a, Decl(es6ModuleConstEnumDeclaration2.ts, 14, 26)) +>m1.e3 : Symbol(m1.e3, Decl(es6ModuleConstEnumDeclaration2.ts, 13, 18)) +>m1 : Symbol(m1, Decl(es6ModuleConstEnumDeclaration2.ts, 12, 13)) +>e3 : Symbol(m1.e3, Decl(es6ModuleConstEnumDeclaration2.ts, 13, 18)) +>a : Symbol(m1.e3.a, Decl(es6ModuleConstEnumDeclaration2.ts, 14, 26)) +} diff --git a/tests/baselines/reference/es6ModuleEnumDeclaration.symbols b/tests/baselines/reference/es6ModuleEnumDeclaration.symbols new file mode 100644 index 00000000000..eb7dd8bfb29 --- /dev/null +++ b/tests/baselines/reference/es6ModuleEnumDeclaration.symbols @@ -0,0 +1,147 @@ +=== tests/cases/compiler/es6ModuleEnumDeclaration.ts === +export enum e1 { +>e1 : Symbol(e1, Decl(es6ModuleEnumDeclaration.ts, 0, 0)) + + a, +>a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) + + b, +>b : Symbol(e1.b, Decl(es6ModuleEnumDeclaration.ts, 1, 6)) + + c +>c : Symbol(e1.c, Decl(es6ModuleEnumDeclaration.ts, 2, 6)) +} +enum e2 { +>e2 : Symbol(e2, Decl(es6ModuleEnumDeclaration.ts, 4, 1)) + + x, +>x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) + + y, +>y : Symbol(e2.y, Decl(es6ModuleEnumDeclaration.ts, 6, 6)) + + z +>z : Symbol(e2.z, Decl(es6ModuleEnumDeclaration.ts, 7, 6)) +} +var x = e1.a; +>x : Symbol(x, Decl(es6ModuleEnumDeclaration.ts, 10, 3)) +>e1.a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) +>e1 : Symbol(e1, Decl(es6ModuleEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) + +var y = e2.x; +>y : Symbol(y, Decl(es6ModuleEnumDeclaration.ts, 11, 3)) +>e2.x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) +>e2 : Symbol(e2, Decl(es6ModuleEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleEnumDeclaration.ts, 11, 13)) + + export enum e3 { +>e3 : Symbol(e3, Decl(es6ModuleEnumDeclaration.ts, 12, 18)) + + a, +>a : Symbol(e3.a, Decl(es6ModuleEnumDeclaration.ts, 13, 20)) + + b, +>b : Symbol(e3.b, Decl(es6ModuleEnumDeclaration.ts, 14, 10)) + + c +>c : Symbol(e3.c, Decl(es6ModuleEnumDeclaration.ts, 15, 10)) + } + enum e4 { +>e4 : Symbol(e4, Decl(es6ModuleEnumDeclaration.ts, 17, 5)) + + x, +>x : Symbol(e4.x, Decl(es6ModuleEnumDeclaration.ts, 18, 13)) + + y, +>y : Symbol(e4.y, Decl(es6ModuleEnumDeclaration.ts, 19, 10)) + + z +>z : Symbol(e4.z, Decl(es6ModuleEnumDeclaration.ts, 20, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleEnumDeclaration.ts, 23, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) +>e1 : Symbol(e1, Decl(es6ModuleEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleEnumDeclaration.ts, 24, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) +>e2 : Symbol(e2, Decl(es6ModuleEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) + + var x2 = e3.a; +>x2 : Symbol(x2, Decl(es6ModuleEnumDeclaration.ts, 25, 7)) +>e3.a : Symbol(e3.a, Decl(es6ModuleEnumDeclaration.ts, 13, 20)) +>e3 : Symbol(e3, Decl(es6ModuleEnumDeclaration.ts, 12, 18)) +>a : Symbol(e3.a, Decl(es6ModuleEnumDeclaration.ts, 13, 20)) + + var y2 = e4.x; +>y2 : Symbol(y2, Decl(es6ModuleEnumDeclaration.ts, 26, 7)) +>e4.x : Symbol(e4.x, Decl(es6ModuleEnumDeclaration.ts, 18, 13)) +>e4 : Symbol(e4, Decl(es6ModuleEnumDeclaration.ts, 17, 5)) +>x : Symbol(e4.x, Decl(es6ModuleEnumDeclaration.ts, 18, 13)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleEnumDeclaration.ts, 27, 1)) + + export enum e5 { +>e5 : Symbol(e5, Decl(es6ModuleEnumDeclaration.ts, 28, 11)) + + a, +>a : Symbol(e5.a, Decl(es6ModuleEnumDeclaration.ts, 29, 20)) + + b, +>b : Symbol(e5.b, Decl(es6ModuleEnumDeclaration.ts, 30, 10)) + + c +>c : Symbol(e5.c, Decl(es6ModuleEnumDeclaration.ts, 31, 10)) + } + enum e6 { +>e6 : Symbol(e6, Decl(es6ModuleEnumDeclaration.ts, 33, 5)) + + x, +>x : Symbol(e6.x, Decl(es6ModuleEnumDeclaration.ts, 34, 13)) + + y, +>y : Symbol(e6.y, Decl(es6ModuleEnumDeclaration.ts, 35, 10)) + + z +>z : Symbol(e6.z, Decl(es6ModuleEnumDeclaration.ts, 36, 10)) + } + var x1 = e1.a; +>x1 : Symbol(x1, Decl(es6ModuleEnumDeclaration.ts, 39, 7)) +>e1.a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) +>e1 : Symbol(e1, Decl(es6ModuleEnumDeclaration.ts, 0, 0)) +>a : Symbol(e1.a, Decl(es6ModuleEnumDeclaration.ts, 0, 16)) + + var y1 = e2.x; +>y1 : Symbol(y1, Decl(es6ModuleEnumDeclaration.ts, 40, 7)) +>e2.x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) +>e2 : Symbol(e2, Decl(es6ModuleEnumDeclaration.ts, 4, 1)) +>x : Symbol(e2.x, Decl(es6ModuleEnumDeclaration.ts, 5, 9)) + + var x2 = e5.a; +>x2 : Symbol(x2, Decl(es6ModuleEnumDeclaration.ts, 41, 7)) +>e5.a : Symbol(e5.a, Decl(es6ModuleEnumDeclaration.ts, 29, 20)) +>e5 : Symbol(e5, Decl(es6ModuleEnumDeclaration.ts, 28, 11)) +>a : Symbol(e5.a, Decl(es6ModuleEnumDeclaration.ts, 29, 20)) + + var y2 = e6.x; +>y2 : Symbol(y2, Decl(es6ModuleEnumDeclaration.ts, 42, 7)) +>e6.x : Symbol(e6.x, Decl(es6ModuleEnumDeclaration.ts, 34, 13)) +>e6 : Symbol(e6, Decl(es6ModuleEnumDeclaration.ts, 33, 5)) +>x : Symbol(e6.x, Decl(es6ModuleEnumDeclaration.ts, 34, 13)) + + var x3 = m1.e3.a; +>x3 : Symbol(x3, Decl(es6ModuleEnumDeclaration.ts, 43, 7)) +>m1.e3.a : Symbol(m1.e3.a, Decl(es6ModuleEnumDeclaration.ts, 13, 20)) +>m1.e3 : Symbol(m1.e3, Decl(es6ModuleEnumDeclaration.ts, 12, 18)) +>m1 : Symbol(m1, Decl(es6ModuleEnumDeclaration.ts, 11, 13)) +>e3 : Symbol(m1.e3, Decl(es6ModuleEnumDeclaration.ts, 12, 18)) +>a : Symbol(m1.e3.a, Decl(es6ModuleEnumDeclaration.ts, 13, 20)) +} diff --git a/tests/baselines/reference/es6ModuleFunctionDeclaration.symbols b/tests/baselines/reference/es6ModuleFunctionDeclaration.symbols new file mode 100644 index 00000000000..e58c40ed3ef --- /dev/null +++ b/tests/baselines/reference/es6ModuleFunctionDeclaration.symbols @@ -0,0 +1,60 @@ +=== tests/cases/compiler/es6ModuleFunctionDeclaration.ts === +export function foo() { +>foo : Symbol(foo, Decl(es6ModuleFunctionDeclaration.ts, 0, 0)) +} +function foo2() { +>foo2 : Symbol(foo2, Decl(es6ModuleFunctionDeclaration.ts, 1, 1)) +} +foo(); +>foo : Symbol(foo, Decl(es6ModuleFunctionDeclaration.ts, 0, 0)) + +foo2(); +>foo2 : Symbol(foo2, Decl(es6ModuleFunctionDeclaration.ts, 1, 1)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleFunctionDeclaration.ts, 5, 7)) + + export function foo3() { +>foo3 : Symbol(foo3, Decl(es6ModuleFunctionDeclaration.ts, 7, 18)) + } + function foo4() { +>foo4 : Symbol(foo4, Decl(es6ModuleFunctionDeclaration.ts, 9, 5)) + } + foo(); +>foo : Symbol(foo, Decl(es6ModuleFunctionDeclaration.ts, 0, 0)) + + foo2(); +>foo2 : Symbol(foo2, Decl(es6ModuleFunctionDeclaration.ts, 1, 1)) + + foo3(); +>foo3 : Symbol(foo3, Decl(es6ModuleFunctionDeclaration.ts, 7, 18)) + + foo4(); +>foo4 : Symbol(foo4, Decl(es6ModuleFunctionDeclaration.ts, 9, 5)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleFunctionDeclaration.ts, 16, 1)) + + export function foo3() { +>foo3 : Symbol(foo3, Decl(es6ModuleFunctionDeclaration.ts, 17, 11)) + } + function foo4() { +>foo4 : Symbol(foo4, Decl(es6ModuleFunctionDeclaration.ts, 19, 5)) + } + foo(); +>foo : Symbol(foo, Decl(es6ModuleFunctionDeclaration.ts, 0, 0)) + + foo2(); +>foo2 : Symbol(foo2, Decl(es6ModuleFunctionDeclaration.ts, 1, 1)) + + foo3(); +>foo3 : Symbol(foo3, Decl(es6ModuleFunctionDeclaration.ts, 17, 11)) + + foo4(); +>foo4 : Symbol(foo4, Decl(es6ModuleFunctionDeclaration.ts, 19, 5)) + + m1.foo3(); +>m1.foo3 : Symbol(m1.foo3, Decl(es6ModuleFunctionDeclaration.ts, 7, 18)) +>m1 : Symbol(m1, Decl(es6ModuleFunctionDeclaration.ts, 5, 7)) +>foo3 : Symbol(m1.foo3, Decl(es6ModuleFunctionDeclaration.ts, 7, 18)) +} diff --git a/tests/baselines/reference/es6ModuleInternalImport.symbols b/tests/baselines/reference/es6ModuleInternalImport.symbols new file mode 100644 index 00000000000..146549d5767 --- /dev/null +++ b/tests/baselines/reference/es6ModuleInternalImport.symbols @@ -0,0 +1,77 @@ +=== tests/cases/compiler/es6ModuleInternalImport.ts === +export module m { +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) + + export var a = 10; +>a : Symbol(a, Decl(es6ModuleInternalImport.ts, 1, 14)) +} +export import a1 = m.a; +>a1 : Symbol(a1, Decl(es6ModuleInternalImport.ts, 2, 1)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a2, Decl(es6ModuleInternalImport.ts, 1, 14)) + +import a2 = m.a; +>a2 : Symbol(a2, Decl(es6ModuleInternalImport.ts, 3, 23)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a2, Decl(es6ModuleInternalImport.ts, 1, 14)) + +var x = a1 + a2; +>x : Symbol(x, Decl(es6ModuleInternalImport.ts, 5, 3)) +>a1 : Symbol(a1, Decl(es6ModuleInternalImport.ts, 2, 1)) +>a2 : Symbol(a2, Decl(es6ModuleInternalImport.ts, 3, 23)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleInternalImport.ts, 5, 16)) + + export import a3 = m.a; +>a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 6, 18)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a4, Decl(es6ModuleInternalImport.ts, 1, 14)) + + import a4 = m.a; +>a4 : Symbol(a4, Decl(es6ModuleInternalImport.ts, 7, 27)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a4, Decl(es6ModuleInternalImport.ts, 1, 14)) + + var x = a1 + a2; +>x : Symbol(x, Decl(es6ModuleInternalImport.ts, 9, 7)) +>a1 : Symbol(a1, Decl(es6ModuleInternalImport.ts, 2, 1)) +>a2 : Symbol(a2, Decl(es6ModuleInternalImport.ts, 3, 23)) + + var x2 = a3 + a4; +>x2 : Symbol(x2, Decl(es6ModuleInternalImport.ts, 10, 7)) +>a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 6, 18)) +>a4 : Symbol(a4, Decl(es6ModuleInternalImport.ts, 7, 27)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleInternalImport.ts, 11, 1)) + + export import a3 = m.a; +>a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 12, 11)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a4, Decl(es6ModuleInternalImport.ts, 1, 14)) + + import a4 = m.a; +>a4 : Symbol(a4, Decl(es6ModuleInternalImport.ts, 13, 27)) +>m : Symbol(m, Decl(es6ModuleInternalImport.ts, 0, 0)) +>a : Symbol(a4, Decl(es6ModuleInternalImport.ts, 1, 14)) + + var x = a1 + a2; +>x : Symbol(x, Decl(es6ModuleInternalImport.ts, 15, 7)) +>a1 : Symbol(a1, Decl(es6ModuleInternalImport.ts, 2, 1)) +>a2 : Symbol(a2, Decl(es6ModuleInternalImport.ts, 3, 23)) + + var x2 = a3 + a4; +>x2 : Symbol(x2, Decl(es6ModuleInternalImport.ts, 16, 7)) +>a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 12, 11)) +>a4 : Symbol(a4, Decl(es6ModuleInternalImport.ts, 13, 27)) + + var x4 = m1.a3 + m2.a3; +>x4 : Symbol(x4, Decl(es6ModuleInternalImport.ts, 17, 7)) +>m1.a3 : Symbol(m1.a3, Decl(es6ModuleInternalImport.ts, 6, 18)) +>m1 : Symbol(m1, Decl(es6ModuleInternalImport.ts, 5, 16)) +>a3 : Symbol(m1.a3, Decl(es6ModuleInternalImport.ts, 6, 18)) +>m2.a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 12, 11)) +>m2 : Symbol(m2, Decl(es6ModuleInternalImport.ts, 11, 1)) +>a3 : Symbol(a3, Decl(es6ModuleInternalImport.ts, 12, 11)) +} diff --git a/tests/baselines/reference/es6ModuleInternalImport.types b/tests/baselines/reference/es6ModuleInternalImport.types index 50db69d8edb..5d7fd527afd 100644 --- a/tests/baselines/reference/es6ModuleInternalImport.types +++ b/tests/baselines/reference/es6ModuleInternalImport.types @@ -4,6 +4,7 @@ export module m { export var a = 10; >a : number +>10 : number } export import a1 = m.a; >a1 : number diff --git a/tests/baselines/reference/es6ModuleLet.symbols b/tests/baselines/reference/es6ModuleLet.symbols new file mode 100644 index 00000000000..f81f128e850 --- /dev/null +++ b/tests/baselines/reference/es6ModuleLet.symbols @@ -0,0 +1,70 @@ +=== tests/cases/compiler/es6ModuleLet.ts === +export let a = "hello"; +>a : Symbol(a, Decl(es6ModuleLet.ts, 0, 10)) + +export let x: string = a, y = x; +>x : Symbol(x, Decl(es6ModuleLet.ts, 1, 10)) +>a : Symbol(a, Decl(es6ModuleLet.ts, 0, 10)) +>y : Symbol(y, Decl(es6ModuleLet.ts, 1, 25)) +>x : Symbol(x, Decl(es6ModuleLet.ts, 1, 10)) + +let b = y; +>b : Symbol(b, Decl(es6ModuleLet.ts, 2, 3)) +>y : Symbol(y, Decl(es6ModuleLet.ts, 1, 25)) + +let c: string = b, d = c; +>c : Symbol(c, Decl(es6ModuleLet.ts, 3, 3)) +>b : Symbol(b, Decl(es6ModuleLet.ts, 2, 3)) +>d : Symbol(d, Decl(es6ModuleLet.ts, 3, 18)) +>c : Symbol(c, Decl(es6ModuleLet.ts, 3, 3)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleLet.ts, 3, 25)) + + export let k = a; +>k : Symbol(k, Decl(es6ModuleLet.ts, 5, 14)) +>a : Symbol(a, Decl(es6ModuleLet.ts, 0, 10)) + + export let l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleLet.ts, 6, 14)) +>b : Symbol(b, Decl(es6ModuleLet.ts, 2, 3)) +>m : Symbol(m, Decl(es6ModuleLet.ts, 6, 29)) +>k : Symbol(k, Decl(es6ModuleLet.ts, 5, 14)) + + let n = m1.k; +>n : Symbol(n, Decl(es6ModuleLet.ts, 7, 7)) +>m1.k : Symbol(k, Decl(es6ModuleLet.ts, 5, 14)) +>m1 : Symbol(m1, Decl(es6ModuleLet.ts, 3, 25)) +>k : Symbol(k, Decl(es6ModuleLet.ts, 5, 14)) + + let o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleLet.ts, 8, 7)) +>n : Symbol(n, Decl(es6ModuleLet.ts, 7, 7)) +>p : Symbol(p, Decl(es6ModuleLet.ts, 8, 22)) +>k : Symbol(k, Decl(es6ModuleLet.ts, 5, 14)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleLet.ts, 9, 1)) + + export let k = a; +>k : Symbol(k, Decl(es6ModuleLet.ts, 11, 14)) +>a : Symbol(a, Decl(es6ModuleLet.ts, 0, 10)) + + export let l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleLet.ts, 12, 14)) +>b : Symbol(b, Decl(es6ModuleLet.ts, 2, 3)) +>m : Symbol(m, Decl(es6ModuleLet.ts, 12, 29)) +>k : Symbol(k, Decl(es6ModuleLet.ts, 11, 14)) + + let n = m1.k; +>n : Symbol(n, Decl(es6ModuleLet.ts, 13, 7)) +>m1.k : Symbol(m1.k, Decl(es6ModuleLet.ts, 5, 14)) +>m1 : Symbol(m1, Decl(es6ModuleLet.ts, 3, 25)) +>k : Symbol(m1.k, Decl(es6ModuleLet.ts, 5, 14)) + + let o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleLet.ts, 14, 7)) +>n : Symbol(n, Decl(es6ModuleLet.ts, 13, 7)) +>p : Symbol(p, Decl(es6ModuleLet.ts, 14, 22)) +>k : Symbol(k, Decl(es6ModuleLet.ts, 11, 14)) +} diff --git a/tests/baselines/reference/es6ModuleLet.types b/tests/baselines/reference/es6ModuleLet.types index 4b30c89cc81..9e670c0a1e1 100644 --- a/tests/baselines/reference/es6ModuleLet.types +++ b/tests/baselines/reference/es6ModuleLet.types @@ -1,6 +1,7 @@ === tests/cases/compiler/es6ModuleLet.ts === export let a = "hello"; >a : string +>"hello" : string export let x: string = a, y = x; >x : string diff --git a/tests/baselines/reference/es6ModuleModuleDeclaration.symbols b/tests/baselines/reference/es6ModuleModuleDeclaration.symbols new file mode 100644 index 00000000000..9fb3cbb2524 --- /dev/null +++ b/tests/baselines/reference/es6ModuleModuleDeclaration.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/es6ModuleModuleDeclaration.ts === +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleModuleDeclaration.ts, 0, 0)) + + export var a = 10; +>a : Symbol(a, Decl(es6ModuleModuleDeclaration.ts, 1, 14)) + + var b = 10; +>b : Symbol(b, Decl(es6ModuleModuleDeclaration.ts, 2, 7)) + + export module innerExportedModule { +>innerExportedModule : Symbol(innerExportedModule, Decl(es6ModuleModuleDeclaration.ts, 2, 15)) + + export var k = 10; +>k : Symbol(k, Decl(es6ModuleModuleDeclaration.ts, 4, 18)) + + var l = 10; +>l : Symbol(l, Decl(es6ModuleModuleDeclaration.ts, 5, 11)) + } + export module innerNonExportedModule { +>innerNonExportedModule : Symbol(innerNonExportedModule, Decl(es6ModuleModuleDeclaration.ts, 6, 5)) + + export var x = 10; +>x : Symbol(x, Decl(es6ModuleModuleDeclaration.ts, 8, 18)) + + var y = 10; +>y : Symbol(y, Decl(es6ModuleModuleDeclaration.ts, 9, 11)) + } +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleModuleDeclaration.ts, 11, 1)) + + export var a = 10; +>a : Symbol(a, Decl(es6ModuleModuleDeclaration.ts, 13, 14)) + + var b = 10; +>b : Symbol(b, Decl(es6ModuleModuleDeclaration.ts, 14, 7)) + + export module innerExportedModule { +>innerExportedModule : Symbol(innerExportedModule, Decl(es6ModuleModuleDeclaration.ts, 14, 15)) + + export var k = 10; +>k : Symbol(k, Decl(es6ModuleModuleDeclaration.ts, 16, 18)) + + var l = 10; +>l : Symbol(l, Decl(es6ModuleModuleDeclaration.ts, 17, 11)) + } + export module innerNonExportedModule { +>innerNonExportedModule : Symbol(innerNonExportedModule, Decl(es6ModuleModuleDeclaration.ts, 18, 5)) + + export var x = 10; +>x : Symbol(x, Decl(es6ModuleModuleDeclaration.ts, 20, 18)) + + var y = 10; +>y : Symbol(y, Decl(es6ModuleModuleDeclaration.ts, 21, 11)) + } +} diff --git a/tests/baselines/reference/es6ModuleModuleDeclaration.types b/tests/baselines/reference/es6ModuleModuleDeclaration.types index c174fe6f8c7..6fb5a7c98f5 100644 --- a/tests/baselines/reference/es6ModuleModuleDeclaration.types +++ b/tests/baselines/reference/es6ModuleModuleDeclaration.types @@ -4,27 +4,33 @@ export module m1 { export var a = 10; >a : number +>10 : number var b = 10; >b : number +>10 : number export module innerExportedModule { >innerExportedModule : typeof innerExportedModule export var k = 10; >k : number +>10 : number var l = 10; >l : number +>10 : number } export module innerNonExportedModule { >innerNonExportedModule : typeof innerNonExportedModule export var x = 10; >x : number +>10 : number var y = 10; >y : number +>10 : number } } module m2 { @@ -32,26 +38,32 @@ module m2 { export var a = 10; >a : number +>10 : number var b = 10; >b : number +>10 : number export module innerExportedModule { >innerExportedModule : typeof innerExportedModule export var k = 10; >k : number +>10 : number var l = 10; >l : number +>10 : number } export module innerNonExportedModule { >innerNonExportedModule : typeof innerNonExportedModule export var x = 10; >x : number +>10 : number var y = 10; >y : number +>10 : number } } diff --git a/tests/baselines/reference/es6ModuleVariableStatement.symbols b/tests/baselines/reference/es6ModuleVariableStatement.symbols new file mode 100644 index 00000000000..744dd580ba4 --- /dev/null +++ b/tests/baselines/reference/es6ModuleVariableStatement.symbols @@ -0,0 +1,70 @@ +=== tests/cases/compiler/es6ModuleVariableStatement.ts === +export var a = "hello"; +>a : Symbol(a, Decl(es6ModuleVariableStatement.ts, 0, 10)) + +export var x: string = a, y = x; +>x : Symbol(x, Decl(es6ModuleVariableStatement.ts, 1, 10)) +>a : Symbol(a, Decl(es6ModuleVariableStatement.ts, 0, 10)) +>y : Symbol(y, Decl(es6ModuleVariableStatement.ts, 1, 25)) +>x : Symbol(x, Decl(es6ModuleVariableStatement.ts, 1, 10)) + +var b = y; +>b : Symbol(b, Decl(es6ModuleVariableStatement.ts, 2, 3)) +>y : Symbol(y, Decl(es6ModuleVariableStatement.ts, 1, 25)) + +var c: string = b, d = c; +>c : Symbol(c, Decl(es6ModuleVariableStatement.ts, 3, 3)) +>b : Symbol(b, Decl(es6ModuleVariableStatement.ts, 2, 3)) +>d : Symbol(d, Decl(es6ModuleVariableStatement.ts, 3, 18)) +>c : Symbol(c, Decl(es6ModuleVariableStatement.ts, 3, 3)) + +export module m1 { +>m1 : Symbol(m1, Decl(es6ModuleVariableStatement.ts, 3, 25)) + + export var k = a; +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 5, 14)) +>a : Symbol(a, Decl(es6ModuleVariableStatement.ts, 0, 10)) + + export var l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleVariableStatement.ts, 6, 14)) +>b : Symbol(b, Decl(es6ModuleVariableStatement.ts, 2, 3)) +>m : Symbol(m, Decl(es6ModuleVariableStatement.ts, 6, 29)) +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 5, 14)) + + var n = m1.k; +>n : Symbol(n, Decl(es6ModuleVariableStatement.ts, 7, 7)) +>m1.k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 5, 14)) +>m1 : Symbol(m1, Decl(es6ModuleVariableStatement.ts, 3, 25)) +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 5, 14)) + + var o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleVariableStatement.ts, 8, 7)) +>n : Symbol(n, Decl(es6ModuleVariableStatement.ts, 7, 7)) +>p : Symbol(p, Decl(es6ModuleVariableStatement.ts, 8, 22)) +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 5, 14)) +} +module m2 { +>m2 : Symbol(m2, Decl(es6ModuleVariableStatement.ts, 9, 1)) + + export var k = a; +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 11, 14)) +>a : Symbol(a, Decl(es6ModuleVariableStatement.ts, 0, 10)) + + export var l: string = b, m = k; +>l : Symbol(l, Decl(es6ModuleVariableStatement.ts, 12, 14)) +>b : Symbol(b, Decl(es6ModuleVariableStatement.ts, 2, 3)) +>m : Symbol(m, Decl(es6ModuleVariableStatement.ts, 12, 29)) +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 11, 14)) + + var n = m1.k; +>n : Symbol(n, Decl(es6ModuleVariableStatement.ts, 13, 7)) +>m1.k : Symbol(m1.k, Decl(es6ModuleVariableStatement.ts, 5, 14)) +>m1 : Symbol(m1, Decl(es6ModuleVariableStatement.ts, 3, 25)) +>k : Symbol(m1.k, Decl(es6ModuleVariableStatement.ts, 5, 14)) + + var o: string = n, p = k; +>o : Symbol(o, Decl(es6ModuleVariableStatement.ts, 14, 7)) +>n : Symbol(n, Decl(es6ModuleVariableStatement.ts, 13, 7)) +>p : Symbol(p, Decl(es6ModuleVariableStatement.ts, 14, 22)) +>k : Symbol(k, Decl(es6ModuleVariableStatement.ts, 11, 14)) +} diff --git a/tests/baselines/reference/es6ModuleVariableStatement.types b/tests/baselines/reference/es6ModuleVariableStatement.types index a10d8f6cacb..520430199e4 100644 --- a/tests/baselines/reference/es6ModuleVariableStatement.types +++ b/tests/baselines/reference/es6ModuleVariableStatement.types @@ -1,6 +1,7 @@ === tests/cases/compiler/es6ModuleVariableStatement.ts === export var a = "hello"; >a : string +>"hello" : string export var x: string = a, y = x; >x : string diff --git a/tests/baselines/reference/escapedIdentifiers.symbols b/tests/baselines/reference/escapedIdentifiers.symbols new file mode 100644 index 00000000000..6c84b25647f --- /dev/null +++ b/tests/baselines/reference/escapedIdentifiers.symbols @@ -0,0 +1,260 @@ +=== tests/cases/compiler/escapedIdentifiers.ts === +/* + 0 .. \u0030 + 9 .. \u0039 + + A .. \u0041 + Z .. \u005a + + a .. \u0061 + z .. \u00za +*/ + +// var decl +var \u0061 = 1; +>\u0061 : Symbol(\u0061, Decl(escapedIdentifiers.ts, 12, 3)) + +a ++; +>a : Symbol(\u0061, Decl(escapedIdentifiers.ts, 12, 3)) + +\u0061 ++; +>\u0061 : Symbol(\u0061, Decl(escapedIdentifiers.ts, 12, 3)) + +var b = 1; +>b : Symbol(b, Decl(escapedIdentifiers.ts, 16, 3)) + +b ++; +>b : Symbol(b, Decl(escapedIdentifiers.ts, 16, 3)) + +\u0062 ++; +>\u0062 : Symbol(b, Decl(escapedIdentifiers.ts, 16, 3)) + +// modules +module moduleType1 { +>moduleType1 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 18, 10)) + + export var baz1: number; +>baz1 : Symbol(baz1, Decl(escapedIdentifiers.ts, 22, 14)) +} +module moduleType\u0032 { +>moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 23, 1)) + + export var baz2: number; +>baz2 : Symbol(baz2, Decl(escapedIdentifiers.ts, 25, 14)) +} + +moduleType1.baz1 = 3; +>moduleType1.baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) +>moduleType1 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 18, 10)) +>baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) + +moduleType\u0031.baz1 = 3; +>moduleType\u0031.baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) +>moduleType\u0031 : Symbol(moduleType1, Decl(escapedIdentifiers.ts, 18, 10)) +>baz1 : Symbol(moduleType1.baz1, Decl(escapedIdentifiers.ts, 22, 14)) + +moduleType2.baz2 = 3; +>moduleType2.baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) +>moduleType2 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 23, 1)) +>baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) + +moduleType\u0032.baz2 = 3; +>moduleType\u0032.baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) +>moduleType\u0032 : Symbol(moduleType\u0032, Decl(escapedIdentifiers.ts, 23, 1)) +>baz2 : Symbol(moduleType\u0032.baz2, Decl(escapedIdentifiers.ts, 25, 14)) + +// classes + +class classType1 { +>classType1 : Symbol(classType1, Decl(escapedIdentifiers.ts, 31, 26)) + + public foo1: number; +>foo1 : Symbol(foo1, Decl(escapedIdentifiers.ts, 35, 18)) +} +class classType\u0032 { +>classType\u0032 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 37, 1)) + + public foo2: number; +>foo2 : Symbol(foo2, Decl(escapedIdentifiers.ts, 38, 23)) +} + +var classType1Object1 = new classType1(); +>classType1Object1 : Symbol(classType1Object1, Decl(escapedIdentifiers.ts, 42, 3)) +>classType1 : Symbol(classType1, Decl(escapedIdentifiers.ts, 31, 26)) + +classType1Object1.foo1 = 2; +>classType1Object1.foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) +>classType1Object1 : Symbol(classType1Object1, Decl(escapedIdentifiers.ts, 42, 3)) +>foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) + +var classType1Object2 = new classType\u0031(); +>classType1Object2 : Symbol(classType1Object2, Decl(escapedIdentifiers.ts, 44, 3)) +>classType\u0031 : Symbol(classType1, Decl(escapedIdentifiers.ts, 31, 26)) + +classType1Object2.foo1 = 2; +>classType1Object2.foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) +>classType1Object2 : Symbol(classType1Object2, Decl(escapedIdentifiers.ts, 44, 3)) +>foo1 : Symbol(classType1.foo1, Decl(escapedIdentifiers.ts, 35, 18)) + +var classType2Object1 = new classType2(); +>classType2Object1 : Symbol(classType2Object1, Decl(escapedIdentifiers.ts, 46, 3)) +>classType2 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 37, 1)) + +classType2Object1.foo2 = 2; +>classType2Object1.foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) +>classType2Object1 : Symbol(classType2Object1, Decl(escapedIdentifiers.ts, 46, 3)) +>foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) + +var classType2Object2 = new classType\u0032(); +>classType2Object2 : Symbol(classType2Object2, Decl(escapedIdentifiers.ts, 48, 3)) +>classType\u0032 : Symbol(classType\u0032, Decl(escapedIdentifiers.ts, 37, 1)) + +classType2Object2.foo2 = 2; +>classType2Object2.foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) +>classType2Object2 : Symbol(classType2Object2, Decl(escapedIdentifiers.ts, 48, 3)) +>foo2 : Symbol(classType\u0032.foo2, Decl(escapedIdentifiers.ts, 38, 23)) + +// interfaces +interface interfaceType1 { +>interfaceType1 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 49, 27)) + + bar1: number; +>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 52, 26)) +} +interface interfaceType\u0032 { +>interfaceType\u0032 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 54, 1)) + + bar2: number; +>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 55, 31)) +} + +var interfaceType1Object1 = { bar1: 0 }; +>interfaceType1Object1 : Symbol(interfaceType1Object1, Decl(escapedIdentifiers.ts, 59, 3)) +>interfaceType1 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 49, 27)) +>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 59, 45)) + +interfaceType1Object1.bar1 = 2; +>interfaceType1Object1.bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) +>interfaceType1Object1 : Symbol(interfaceType1Object1, Decl(escapedIdentifiers.ts, 59, 3)) +>bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) + +var interfaceType1Object2 = { bar1: 0 }; +>interfaceType1Object2 : Symbol(interfaceType1Object2, Decl(escapedIdentifiers.ts, 61, 3)) +>interfaceType\u0031 : Symbol(interfaceType1, Decl(escapedIdentifiers.ts, 49, 27)) +>bar1 : Symbol(bar1, Decl(escapedIdentifiers.ts, 61, 50)) + +interfaceType1Object2.bar1 = 2; +>interfaceType1Object2.bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) +>interfaceType1Object2 : Symbol(interfaceType1Object2, Decl(escapedIdentifiers.ts, 61, 3)) +>bar1 : Symbol(interfaceType1.bar1, Decl(escapedIdentifiers.ts, 52, 26)) + +var interfaceType2Object1 = { bar2: 0 }; +>interfaceType2Object1 : Symbol(interfaceType2Object1, Decl(escapedIdentifiers.ts, 63, 3)) +>interfaceType2 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 54, 1)) +>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 63, 45)) + +interfaceType2Object1.bar2 = 2; +>interfaceType2Object1.bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) +>interfaceType2Object1 : Symbol(interfaceType2Object1, Decl(escapedIdentifiers.ts, 63, 3)) +>bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) + +var interfaceType2Object2 = { bar2: 0 }; +>interfaceType2Object2 : Symbol(interfaceType2Object2, Decl(escapedIdentifiers.ts, 65, 3)) +>interfaceType\u0032 : Symbol(interfaceType\u0032, Decl(escapedIdentifiers.ts, 54, 1)) +>bar2 : Symbol(bar2, Decl(escapedIdentifiers.ts, 65, 50)) + +interfaceType2Object2.bar2 = 2; +>interfaceType2Object2.bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) +>interfaceType2Object2 : Symbol(interfaceType2Object2, Decl(escapedIdentifiers.ts, 65, 3)) +>bar2 : Symbol(interfaceType\u0032.bar2, Decl(escapedIdentifiers.ts, 55, 31)) + + +// arguments +class testClass { +>testClass : Symbol(testClass, Decl(escapedIdentifiers.ts, 66, 31)) + + public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { +>func : Symbol(func, Decl(escapedIdentifiers.ts, 70, 17)) +>arg1 : Symbol(arg1, Decl(escapedIdentifiers.ts, 71, 16)) +>arg\u0032 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 71, 29)) +>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 71, 48)) +>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 71, 68)) + + arg\u0031 = 1; +>arg\u0031 : Symbol(arg1, Decl(escapedIdentifiers.ts, 71, 16)) + + arg2 = 'string'; +>arg2 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 71, 29)) + + arg\u0033 = true; +>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 71, 48)) + + arg4 = 2; +>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 71, 68)) + } +} + +// constructors +class constructorTestClass { +>constructorTestClass : Symbol(constructorTestClass, Decl(escapedIdentifiers.ts, 77, 1)) + + constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { +>arg1 : Symbol(arg1, Decl(escapedIdentifiers.ts, 81, 17)) +>arg\u0032 : Symbol(arg\u0032, Decl(escapedIdentifiers.ts, 81, 37)) +>arg\u0033 : Symbol(arg\u0033, Decl(escapedIdentifiers.ts, 81, 62)) +>arg4 : Symbol(arg4, Decl(escapedIdentifiers.ts, 81, 88)) + } +} +var constructorTestObject = new constructorTestClass(1, 'string', true, 2); +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) +>constructorTestClass : Symbol(constructorTestClass, Decl(escapedIdentifiers.ts, 77, 1)) + +constructorTestObject.arg\u0031 = 1; +>constructorTestObject.arg\u0031 : Symbol(constructorTestClass.arg1, Decl(escapedIdentifiers.ts, 81, 17)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) +>arg\u0031 : Symbol(constructorTestClass.arg1, Decl(escapedIdentifiers.ts, 81, 17)) + +constructorTestObject.arg2 = 'string'; +>constructorTestObject.arg2 : Symbol(constructorTestClass.arg\u0032, Decl(escapedIdentifiers.ts, 81, 37)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) +>arg2 : Symbol(constructorTestClass.arg\u0032, Decl(escapedIdentifiers.ts, 81, 37)) + +constructorTestObject.arg\u0033 = true; +>constructorTestObject.arg\u0033 : Symbol(constructorTestClass.arg\u0033, Decl(escapedIdentifiers.ts, 81, 62)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) +>arg\u0033 : Symbol(constructorTestClass.arg\u0033, Decl(escapedIdentifiers.ts, 81, 62)) + +constructorTestObject.arg4 = 2; +>constructorTestObject.arg4 : Symbol(constructorTestClass.arg4, Decl(escapedIdentifiers.ts, 81, 88)) +>constructorTestObject : Symbol(constructorTestObject, Decl(escapedIdentifiers.ts, 84, 3)) +>arg4 : Symbol(constructorTestClass.arg4, Decl(escapedIdentifiers.ts, 81, 88)) + +// Lables + +l\u0061bel1: + while (false) + { + while(false) + continue label1; // it will go to next iteration of outer loop + } + +label2: + while (false) + { + while(false) + continue l\u0061bel2; // it will go to next iteration of outer loop + } + +label3: + while (false) + { + while(false) + continue label3; // it will go to next iteration of outer loop + } + +l\u0061bel4: + while (false) + { + while(false) + continue l\u0061bel4; // it will go to next iteration of outer loop + } diff --git a/tests/baselines/reference/escapedIdentifiers.types b/tests/baselines/reference/escapedIdentifiers.types index d0b6b1f5c42..b32d21a48cb 100644 --- a/tests/baselines/reference/escapedIdentifiers.types +++ b/tests/baselines/reference/escapedIdentifiers.types @@ -13,6 +13,7 @@ // var decl var \u0061 = 1; >\u0061 : number +>1 : number a ++; >a ++ : number @@ -24,6 +25,7 @@ a ++; var b = 1; >b : number +>1 : number b ++; >b ++ : number @@ -52,24 +54,28 @@ moduleType1.baz1 = 3; >moduleType1.baz1 : number >moduleType1 : typeof moduleType1 >baz1 : number +>3 : number moduleType\u0031.baz1 = 3; >moduleType\u0031.baz1 = 3 : number >moduleType\u0031.baz1 : number >moduleType\u0031 : typeof moduleType1 >baz1 : number +>3 : number moduleType2.baz2 = 3; >moduleType2.baz2 = 3 : number >moduleType2.baz2 : number >moduleType2 : typeof moduleType\u0032 >baz2 : number +>3 : number moduleType\u0032.baz2 = 3; >moduleType\u0032.baz2 = 3 : number >moduleType\u0032.baz2 : number >moduleType\u0032 : typeof moduleType\u0032 >baz2 : number +>3 : number // classes @@ -96,6 +102,7 @@ classType1Object1.foo1 = 2; >classType1Object1.foo1 : number >classType1Object1 : classType1 >foo1 : number +>2 : number var classType1Object2 = new classType\u0031(); >classType1Object2 : classType1 @@ -107,6 +114,7 @@ classType1Object2.foo1 = 2; >classType1Object2.foo1 : number >classType1Object2 : classType1 >foo1 : number +>2 : number var classType2Object1 = new classType2(); >classType2Object1 : classType\u0032 @@ -118,6 +126,7 @@ classType2Object1.foo2 = 2; >classType2Object1.foo2 : number >classType2Object1 : classType\u0032 >foo2 : number +>2 : number var classType2Object2 = new classType\u0032(); >classType2Object2 : classType\u0032 @@ -129,6 +138,7 @@ classType2Object2.foo2 = 2; >classType2Object2.foo2 : number >classType2Object2 : classType\u0032 >foo2 : number +>2 : number // interfaces interface interfaceType1 { @@ -150,12 +160,14 @@ var interfaceType1Object1 = { bar1: 0 }; >interfaceType1 : interfaceType1 >{ bar1: 0 } : { bar1: number; } >bar1 : number +>0 : number interfaceType1Object1.bar1 = 2; >interfaceType1Object1.bar1 = 2 : number >interfaceType1Object1.bar1 : number >interfaceType1Object1 : interfaceType1 >bar1 : number +>2 : number var interfaceType1Object2 = { bar1: 0 }; >interfaceType1Object2 : interfaceType1 @@ -163,12 +175,14 @@ var interfaceType1Object2 = { bar1: 0 }; >interfaceType\u0031 : interfaceType1 >{ bar1: 0 } : { bar1: number; } >bar1 : number +>0 : number interfaceType1Object2.bar1 = 2; >interfaceType1Object2.bar1 = 2 : number >interfaceType1Object2.bar1 : number >interfaceType1Object2 : interfaceType1 >bar1 : number +>2 : number var interfaceType2Object1 = { bar2: 0 }; >interfaceType2Object1 : interfaceType\u0032 @@ -176,12 +190,14 @@ var interfaceType2Object1 = { bar2: 0 }; >interfaceType2 : interfaceType\u0032 >{ bar2: 0 } : { bar2: number; } >bar2 : number +>0 : number interfaceType2Object1.bar2 = 2; >interfaceType2Object1.bar2 = 2 : number >interfaceType2Object1.bar2 : number >interfaceType2Object1 : interfaceType\u0032 >bar2 : number +>2 : number var interfaceType2Object2 = { bar2: 0 }; >interfaceType2Object2 : interfaceType\u0032 @@ -189,12 +205,14 @@ var interfaceType2Object2 = { bar2: 0 }; >interfaceType\u0032 : interfaceType\u0032 >{ bar2: 0 } : { bar2: number; } >bar2 : number +>0 : number interfaceType2Object2.bar2 = 2; >interfaceType2Object2.bar2 = 2 : number >interfaceType2Object2.bar2 : number >interfaceType2Object2 : interfaceType\u0032 >bar2 : number +>2 : number // arguments @@ -211,18 +229,22 @@ class testClass { arg\u0031 = 1; >arg\u0031 = 1 : number >arg\u0031 : number +>1 : number arg2 = 'string'; >arg2 = 'string' : string >arg2 : string +>'string' : string arg\u0033 = true; >arg\u0033 = true : boolean >arg\u0033 : boolean +>true : boolean arg4 = 2; >arg4 = 2 : number >arg4 : number +>2 : number } } @@ -241,57 +263,89 @@ var constructorTestObject = new constructorTestClass(1, 'string', true, 2); >constructorTestObject : constructorTestClass >new constructorTestClass(1, 'string', true, 2) : constructorTestClass >constructorTestClass : typeof constructorTestClass +>1 : number +>'string' : string +>true : boolean +>2 : number constructorTestObject.arg\u0031 = 1; >constructorTestObject.arg\u0031 = 1 : number >constructorTestObject.arg\u0031 : number >constructorTestObject : constructorTestClass >arg\u0031 : number +>1 : number constructorTestObject.arg2 = 'string'; >constructorTestObject.arg2 = 'string' : string >constructorTestObject.arg2 : string >constructorTestObject : constructorTestClass >arg2 : string +>'string' : string constructorTestObject.arg\u0033 = true; >constructorTestObject.arg\u0033 = true : boolean >constructorTestObject.arg\u0033 : boolean >constructorTestObject : constructorTestClass >arg\u0033 : boolean +>true : boolean constructorTestObject.arg4 = 2; >constructorTestObject.arg4 = 2 : number >constructorTestObject.arg4 : number >constructorTestObject : constructorTestClass >arg4 : number +>2 : number // Lables l\u0061bel1: +>l\u0061bel1 : any + while (false) +>false : boolean { while(false) +>false : boolean + continue label1; // it will go to next iteration of outer loop +>label1 : any } label2: +>label2 : any + while (false) +>false : boolean { while(false) +>false : boolean + continue l\u0061bel2; // it will go to next iteration of outer loop +>l\u0061bel2 : any } label3: +>label3 : any + while (false) +>false : boolean { while(false) +>false : boolean + continue label3; // it will go to next iteration of outer loop +>label3 : any } l\u0061bel4: +>l\u0061bel4 : any + while (false) +>false : boolean { while(false) +>false : boolean + continue l\u0061bel4; // it will go to next iteration of outer loop +>l\u0061bel4 : any } diff --git a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.symbols b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.symbols new file mode 100644 index 00000000000..b629c5bd875 --- /dev/null +++ b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.symbols @@ -0,0 +1,79 @@ +=== tests/cases/compiler/escapedReservedCompilerNamedIdentifier.ts === +// double underscores +var __proto__ = 10; +>__proto__ : Symbol(__proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 1, 3)) + +var o = { +>o : Symbol(o, Decl(escapedReservedCompilerNamedIdentifier.ts, 2, 3)) + + "__proto__": 0 +}; +var b = o["__proto__"]; +>b : Symbol(b, Decl(escapedReservedCompilerNamedIdentifier.ts, 5, 3)) +>o : Symbol(o, Decl(escapedReservedCompilerNamedIdentifier.ts, 2, 3)) +>"__proto__" : Symbol("__proto__", Decl(escapedReservedCompilerNamedIdentifier.ts, 2, 9)) + +var o1 = { +>o1 : Symbol(o1, Decl(escapedReservedCompilerNamedIdentifier.ts, 6, 3)) + + __proto__: 0 +>__proto__ : Symbol(__proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 6, 10)) + +}; +var b1 = o1["__proto__"]; +>b1 : Symbol(b1, Decl(escapedReservedCompilerNamedIdentifier.ts, 9, 3)) +>o1 : Symbol(o1, Decl(escapedReservedCompilerNamedIdentifier.ts, 6, 3)) +>"__proto__" : Symbol(__proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 6, 10)) + +// Triple underscores +var ___proto__ = 10; +>___proto__ : Symbol(___proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 11, 3)) + +var o2 = { +>o2 : Symbol(o2, Decl(escapedReservedCompilerNamedIdentifier.ts, 12, 3)) + + "___proto__": 0 +}; +var b2 = o2["___proto__"]; +>b2 : Symbol(b2, Decl(escapedReservedCompilerNamedIdentifier.ts, 15, 3)) +>o2 : Symbol(o2, Decl(escapedReservedCompilerNamedIdentifier.ts, 12, 3)) +>"___proto__" : Symbol("___proto__", Decl(escapedReservedCompilerNamedIdentifier.ts, 12, 10)) + +var o3 = { +>o3 : Symbol(o3, Decl(escapedReservedCompilerNamedIdentifier.ts, 16, 3)) + + ___proto__: 0 +>___proto__ : Symbol(___proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 16, 10)) + +}; +var b3 = o3["___proto__"]; +>b3 : Symbol(b3, Decl(escapedReservedCompilerNamedIdentifier.ts, 19, 3)) +>o3 : Symbol(o3, Decl(escapedReservedCompilerNamedIdentifier.ts, 16, 3)) +>"___proto__" : Symbol(___proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 16, 10)) + +// One underscore +var _proto__ = 10; +>_proto__ : Symbol(_proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 21, 3)) + +var o4 = { +>o4 : Symbol(o4, Decl(escapedReservedCompilerNamedIdentifier.ts, 22, 3)) + + "_proto__": 0 +}; +var b4 = o4["_proto__"]; +>b4 : Symbol(b4, Decl(escapedReservedCompilerNamedIdentifier.ts, 25, 3)) +>o4 : Symbol(o4, Decl(escapedReservedCompilerNamedIdentifier.ts, 22, 3)) +>"_proto__" : Symbol("_proto__", Decl(escapedReservedCompilerNamedIdentifier.ts, 22, 10)) + +var o5 = { +>o5 : Symbol(o5, Decl(escapedReservedCompilerNamedIdentifier.ts, 26, 3)) + + _proto__: 0 +>_proto__ : Symbol(_proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 26, 10)) + +}; +var b5 = o5["_proto__"]; +>b5 : Symbol(b5, Decl(escapedReservedCompilerNamedIdentifier.ts, 29, 3)) +>o5 : Symbol(o5, Decl(escapedReservedCompilerNamedIdentifier.ts, 26, 3)) +>"_proto__" : Symbol(_proto__, Decl(escapedReservedCompilerNamedIdentifier.ts, 26, 10)) + diff --git a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types index f54c7b80757..1ebbf8aedb2 100644 --- a/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types +++ b/tests/baselines/reference/escapedReservedCompilerNamedIdentifier.types @@ -2,17 +2,21 @@ // double underscores var __proto__ = 10; >__proto__ : number +>10 : number var o = { >o : { "__proto__": number; } >{ "__proto__": 0} : { "__proto__": number; } "__proto__": 0 +>0 : number + }; var b = o["__proto__"]; >b : number >o["__proto__"] : number >o : { "__proto__": number; } +>"__proto__" : string var o1 = { >o1 : { __proto__: number; } @@ -20,27 +24,33 @@ var o1 = { __proto__: 0 >__proto__ : number +>0 : number }; var b1 = o1["__proto__"]; >b1 : number >o1["__proto__"] : number >o1 : { __proto__: number; } +>"__proto__" : string // Triple underscores var ___proto__ = 10; >___proto__ : number +>10 : number var o2 = { >o2 : { "___proto__": number; } >{ "___proto__": 0} : { "___proto__": number; } "___proto__": 0 +>0 : number + }; var b2 = o2["___proto__"]; >b2 : number >o2["___proto__"] : number >o2 : { "___proto__": number; } +>"___proto__" : string var o3 = { >o3 : { ___proto__: number; } @@ -48,27 +58,33 @@ var o3 = { ___proto__: 0 >___proto__ : number +>0 : number }; var b3 = o3["___proto__"]; >b3 : number >o3["___proto__"] : number >o3 : { ___proto__: number; } +>"___proto__" : string // One underscore var _proto__ = 10; >_proto__ : number +>10 : number var o4 = { >o4 : { "_proto__": number; } >{ "_proto__": 0} : { "_proto__": number; } "_proto__": 0 +>0 : number + }; var b4 = o4["_proto__"]; >b4 : number >o4["_proto__"] : number >o4 : { "_proto__": number; } +>"_proto__" : string var o5 = { >o5 : { _proto__: number; } @@ -76,10 +92,12 @@ var o5 = { _proto__: 0 >_proto__ : number +>0 : number }; var b5 = o5["_proto__"]; >b5 : number >o5["_proto__"] : number >o5 : { _proto__: number; } +>"_proto__" : string diff --git a/tests/baselines/reference/everyTypeAssignableToAny.symbols b/tests/baselines/reference/everyTypeAssignableToAny.symbols new file mode 100644 index 00000000000..275a58641d2 --- /dev/null +++ b/tests/baselines/reference/everyTypeAssignableToAny.symbols @@ -0,0 +1,193 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/everyTypeAssignableToAny.ts === +var a: any; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) + +class C { +>C : Symbol(C, Decl(everyTypeAssignableToAny.ts, 0, 11)) + + foo: string; +>foo : Symbol(foo, Decl(everyTypeAssignableToAny.ts, 2, 9)) +} +var ac: C; +>ac : Symbol(ac, Decl(everyTypeAssignableToAny.ts, 5, 3)) +>C : Symbol(C, Decl(everyTypeAssignableToAny.ts, 0, 11)) + +interface I { +>I : Symbol(I, Decl(everyTypeAssignableToAny.ts, 5, 10)) + + foo: string; +>foo : Symbol(foo, Decl(everyTypeAssignableToAny.ts, 6, 13)) +} +var ai: I; +>ai : Symbol(ai, Decl(everyTypeAssignableToAny.ts, 9, 3)) +>I : Symbol(I, Decl(everyTypeAssignableToAny.ts, 5, 10)) + +enum E { A } +>E : Symbol(E, Decl(everyTypeAssignableToAny.ts, 9, 10)) +>A : Symbol(E.A, Decl(everyTypeAssignableToAny.ts, 11, 8)) + +var ae: E; +>ae : Symbol(ae, Decl(everyTypeAssignableToAny.ts, 12, 3)) +>E : Symbol(E, Decl(everyTypeAssignableToAny.ts, 9, 10)) + +var b: number; +>b : Symbol(b, Decl(everyTypeAssignableToAny.ts, 14, 3)) + +var c: string; +>c : Symbol(c, Decl(everyTypeAssignableToAny.ts, 15, 3)) + +var d: boolean; +>d : Symbol(d, Decl(everyTypeAssignableToAny.ts, 16, 3)) + +var e: Date; +>e : Symbol(e, Decl(everyTypeAssignableToAny.ts, 17, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var f: any; +>f : Symbol(f, Decl(everyTypeAssignableToAny.ts, 18, 3)) + +var g: void; +>g : Symbol(g, Decl(everyTypeAssignableToAny.ts, 19, 3)) + +var h: Object; +>h : Symbol(h, Decl(everyTypeAssignableToAny.ts, 20, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var i: {}; +>i : Symbol(i, Decl(everyTypeAssignableToAny.ts, 21, 3)) + +var j: () => {}; +>j : Symbol(j, Decl(everyTypeAssignableToAny.ts, 22, 3)) + +var k: Function; +>k : Symbol(k, Decl(everyTypeAssignableToAny.ts, 23, 3)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var l: (x: number) => string; +>l : Symbol(l, Decl(everyTypeAssignableToAny.ts, 24, 3)) +>x : Symbol(x, Decl(everyTypeAssignableToAny.ts, 24, 8)) + +var m: number[]; +>m : Symbol(m, Decl(everyTypeAssignableToAny.ts, 25, 3)) + +var n: { foo: string }; +>n : Symbol(n, Decl(everyTypeAssignableToAny.ts, 26, 3)) +>foo : Symbol(foo, Decl(everyTypeAssignableToAny.ts, 26, 8)) + +var o: (x: T) => T; +>o : Symbol(o, Decl(everyTypeAssignableToAny.ts, 27, 3)) +>T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 27, 8)) +>x : Symbol(x, Decl(everyTypeAssignableToAny.ts, 27, 11)) +>T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 27, 8)) +>T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 27, 8)) + +var p: Number; +>p : Symbol(p, Decl(everyTypeAssignableToAny.ts, 28, 3)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +var q: String; +>q : Symbol(q, Decl(everyTypeAssignableToAny.ts, 29, 3)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +a = b; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>b : Symbol(b, Decl(everyTypeAssignableToAny.ts, 14, 3)) + +a = c; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>c : Symbol(c, Decl(everyTypeAssignableToAny.ts, 15, 3)) + +a = d; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>d : Symbol(d, Decl(everyTypeAssignableToAny.ts, 16, 3)) + +a = e; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>e : Symbol(e, Decl(everyTypeAssignableToAny.ts, 17, 3)) + +a = f; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>f : Symbol(f, Decl(everyTypeAssignableToAny.ts, 18, 3)) + +a = g; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>g : Symbol(g, Decl(everyTypeAssignableToAny.ts, 19, 3)) + +a = h; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>h : Symbol(h, Decl(everyTypeAssignableToAny.ts, 20, 3)) + +a = i; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>i : Symbol(i, Decl(everyTypeAssignableToAny.ts, 21, 3)) + +a = j; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>j : Symbol(j, Decl(everyTypeAssignableToAny.ts, 22, 3)) + +a = k; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>k : Symbol(k, Decl(everyTypeAssignableToAny.ts, 23, 3)) + +a = l; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>l : Symbol(l, Decl(everyTypeAssignableToAny.ts, 24, 3)) + +a = m; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>m : Symbol(m, Decl(everyTypeAssignableToAny.ts, 25, 3)) + +a = o; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>o : Symbol(o, Decl(everyTypeAssignableToAny.ts, 27, 3)) + +a = p; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>p : Symbol(p, Decl(everyTypeAssignableToAny.ts, 28, 3)) + +a = q; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>q : Symbol(q, Decl(everyTypeAssignableToAny.ts, 29, 3)) + +a = ac; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>ac : Symbol(ac, Decl(everyTypeAssignableToAny.ts, 5, 3)) + +a = ai; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>ai : Symbol(ai, Decl(everyTypeAssignableToAny.ts, 9, 3)) + +a = ae; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>ae : Symbol(ae, Decl(everyTypeAssignableToAny.ts, 12, 3)) + +function foo(x: T, y: U, z: V) { +>foo : Symbol(foo, Decl(everyTypeAssignableToAny.ts, 48, 7)) +>T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 50, 13)) +>U : Symbol(U, Decl(everyTypeAssignableToAny.ts, 50, 15)) +>V : Symbol(V, Decl(everyTypeAssignableToAny.ts, 50, 32)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(everyTypeAssignableToAny.ts, 50, 49)) +>T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 50, 13)) +>y : Symbol(y, Decl(everyTypeAssignableToAny.ts, 50, 54)) +>U : Symbol(U, Decl(everyTypeAssignableToAny.ts, 50, 15)) +>z : Symbol(z, Decl(everyTypeAssignableToAny.ts, 50, 60)) +>V : Symbol(V, Decl(everyTypeAssignableToAny.ts, 50, 32)) + + a = x; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>x : Symbol(x, Decl(everyTypeAssignableToAny.ts, 50, 49)) + + a = y; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>y : Symbol(y, Decl(everyTypeAssignableToAny.ts, 50, 54)) + + a = z; +>a : Symbol(a, Decl(everyTypeAssignableToAny.ts, 0, 3)) +>z : Symbol(z, Decl(everyTypeAssignableToAny.ts, 50, 60)) +} +//function foo(x: T, y: U, z: V) { +// a = x; +// a = y; +// a = z; +//} diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.symbols b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.symbols new file mode 100644 index 00000000000..489903750f5 --- /dev/null +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.symbols @@ -0,0 +1,146 @@ +=== tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInitializer.ts === +interface I { +>I : Symbol(I, Decl(everyTypeWithAnnotationAndInitializer.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(everyTypeWithAnnotationAndInitializer.ts, 0, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(everyTypeWithAnnotationAndInitializer.ts, 2, 1)) +>I : Symbol(I, Decl(everyTypeWithAnnotationAndInitializer.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(everyTypeWithAnnotationAndInitializer.ts, 4, 22)) +} + +class D{ +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithAnnotationAndInitializer.ts, 8, 8)) + + source: T; +>source : Symbol(source, Decl(everyTypeWithAnnotationAndInitializer.ts, 8, 11)) +>T : Symbol(T, Decl(everyTypeWithAnnotationAndInitializer.ts, 8, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(everyTypeWithAnnotationAndInitializer.ts, 9, 14)) +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithAnnotationAndInitializer.ts, 8, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(everyTypeWithAnnotationAndInitializer.ts, 10, 18)) +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithAnnotationAndInitializer.ts, 8, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(everyTypeWithAnnotationAndInitializer.ts, 12, 1)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 11)) + +module M { +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) + + export class A { +>A : Symbol(A, Decl(everyTypeWithAnnotationAndInitializer.ts, 16, 10)) + + name: string; +>name : Symbol(name, Decl(everyTypeWithAnnotationAndInitializer.ts, 17, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(everyTypeWithAnnotationAndInitializer.ts, 19, 5)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 21, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 21, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} + +var aNumber: number = 9.9; +>aNumber : Symbol(aNumber, Decl(everyTypeWithAnnotationAndInitializer.ts, 24, 3)) + +var aString: string = 'this is a string'; +>aString : Symbol(aString, Decl(everyTypeWithAnnotationAndInitializer.ts, 25, 3)) + +var aDate: Date = new Date(12); +>aDate : Symbol(aDate, Decl(everyTypeWithAnnotationAndInitializer.ts, 26, 3)) +>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)) + +var anObject: Object = new Object(); +>anObject : Symbol(anObject, Decl(everyTypeWithAnnotationAndInitializer.ts, 27, 3)) +>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)) + +var anAny: any = null; +>anAny : Symbol(anAny, Decl(everyTypeWithAnnotationAndInitializer.ts, 29, 3)) + +var aSecondAny: any = undefined; +>aSecondAny : Symbol(aSecondAny, Decl(everyTypeWithAnnotationAndInitializer.ts, 30, 3)) +>undefined : Symbol(undefined) + +var aVoid: void = undefined; +>aVoid : Symbol(aVoid, Decl(everyTypeWithAnnotationAndInitializer.ts, 31, 3)) +>undefined : Symbol(undefined) + +var anInterface: I = new C(); +>anInterface : Symbol(anInterface, Decl(everyTypeWithAnnotationAndInitializer.ts, 33, 3)) +>I : Symbol(I, Decl(everyTypeWithAnnotationAndInitializer.ts, 0, 0)) +>C : Symbol(C, Decl(everyTypeWithAnnotationAndInitializer.ts, 2, 1)) + +var aClass: C = new C(); +>aClass : Symbol(aClass, Decl(everyTypeWithAnnotationAndInitializer.ts, 34, 3)) +>C : Symbol(C, Decl(everyTypeWithAnnotationAndInitializer.ts, 2, 1)) +>C : Symbol(C, Decl(everyTypeWithAnnotationAndInitializer.ts, 2, 1)) + +var aGenericClass: D = new D(); +>aGenericClass : Symbol(aGenericClass, Decl(everyTypeWithAnnotationAndInitializer.ts, 35, 3)) +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) +>D : Symbol(D, Decl(everyTypeWithAnnotationAndInitializer.ts, 6, 1)) + +var anObjectLiteral: I = { id: 12 }; +>anObjectLiteral : Symbol(anObjectLiteral, Decl(everyTypeWithAnnotationAndInitializer.ts, 36, 3)) +>I : Symbol(I, Decl(everyTypeWithAnnotationAndInitializer.ts, 0, 0)) +>id : Symbol(id, Decl(everyTypeWithAnnotationAndInitializer.ts, 36, 26)) + +var anOtherObjectLiteral: { id: number } = new C(); +>anOtherObjectLiteral : Symbol(anOtherObjectLiteral, Decl(everyTypeWithAnnotationAndInitializer.ts, 37, 3)) +>id : Symbol(id, Decl(everyTypeWithAnnotationAndInitializer.ts, 37, 27)) +>C : Symbol(C, Decl(everyTypeWithAnnotationAndInitializer.ts, 2, 1)) + +var aFunction: typeof F = F; +>aFunction : Symbol(aFunction, Decl(everyTypeWithAnnotationAndInitializer.ts, 39, 3)) +>F : Symbol(F, Decl(everyTypeWithAnnotationAndInitializer.ts, 12, 1)) +>F : Symbol(F, Decl(everyTypeWithAnnotationAndInitializer.ts, 12, 1)) + +var anOtherFunction: (x: string) => number = F; +>anOtherFunction : Symbol(anOtherFunction, Decl(everyTypeWithAnnotationAndInitializer.ts, 40, 3)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 40, 22)) +>F : Symbol(F, Decl(everyTypeWithAnnotationAndInitializer.ts, 12, 1)) + +var aLambda: typeof F = (x) => 2; +>aLambda : Symbol(aLambda, Decl(everyTypeWithAnnotationAndInitializer.ts, 41, 3)) +>F : Symbol(F, Decl(everyTypeWithAnnotationAndInitializer.ts, 12, 1)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 41, 25)) + +var aModule: typeof M = M; +>aModule : Symbol(aModule, Decl(everyTypeWithAnnotationAndInitializer.ts, 43, 3)) +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) + +var aClassInModule: M.A = new M.A(); +>aClassInModule : Symbol(aClassInModule, Decl(everyTypeWithAnnotationAndInitializer.ts, 44, 3)) +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) +>A : Symbol(M.A, Decl(everyTypeWithAnnotationAndInitializer.ts, 16, 10)) +>M.A : Symbol(M.A, Decl(everyTypeWithAnnotationAndInitializer.ts, 16, 10)) +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) +>A : Symbol(M.A, Decl(everyTypeWithAnnotationAndInitializer.ts, 16, 10)) + +var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; +>aFunctionInModule : Symbol(aFunctionInModule, Decl(everyTypeWithAnnotationAndInitializer.ts, 45, 3)) +>M.F2 : Symbol(M.F2, Decl(everyTypeWithAnnotationAndInitializer.ts, 19, 5)) +>M : Symbol(M, Decl(everyTypeWithAnnotationAndInitializer.ts, 14, 44)) +>F2 : Symbol(M.F2, Decl(everyTypeWithAnnotationAndInitializer.ts, 19, 5)) +>x : Symbol(x, Decl(everyTypeWithAnnotationAndInitializer.ts, 45, 38)) + + diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types index c707e694468..0e7059f4eed 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types @@ -37,6 +37,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string +>42 : number module M { >M : typeof M @@ -59,15 +60,18 @@ module M { var aNumber: number = 9.9; >aNumber : number +>9.9 : number var aString: string = 'this is a string'; >aString : string +>'this is a string' : string var aDate: Date = new Date(12); >aDate : Date >Date : Date >new Date(12) : Date >Date : DateConstructor +>12 : number var anObject: Object = new Object(); >anObject : Object @@ -77,6 +81,7 @@ var anObject: Object = new Object(); var anAny: any = null; >anAny : any +>null : null var aSecondAny: any = undefined; >aSecondAny : any @@ -109,6 +114,7 @@ var anObjectLiteral: I = { id: 12 }; >I : I >{ id: 12 } : { id: number; } >id : number +>12 : number var anOtherObjectLiteral: { id: number } = new C(); >anOtherObjectLiteral : { id: number; } @@ -131,6 +137,7 @@ var aLambda: typeof F = (x) => 2; >F : (x: string) => number >(x) => 2 : (x: string) => number >x : string +>2 : number var aModule: typeof M = M; >aModule : typeof M @@ -139,7 +146,7 @@ var aModule: typeof M = M; var aClassInModule: M.A = new M.A(); >aClassInModule : M.A ->M : unknown +>M : any >A : M.A >new M.A() : M.A >M.A : typeof M.A @@ -148,9 +155,11 @@ var aClassInModule: M.A = new M.A(); var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; >aFunctionInModule : (x: number) => string +>M.F2 : (x: number) => string >M : typeof M >F2 : (x: number) => string >(x) => 'this is a string' : (x: number) => string >x : number +>'this is a string' : string diff --git a/tests/baselines/reference/everyTypeWithInitializer.symbols b/tests/baselines/reference/everyTypeWithInitializer.symbols new file mode 100644 index 00000000000..0a22252164b --- /dev/null +++ b/tests/baselines/reference/everyTypeWithInitializer.symbols @@ -0,0 +1,125 @@ +=== tests/cases/conformance/statements/VariableStatements/everyTypeWithInitializer.ts === +interface I { +>I : Symbol(I, Decl(everyTypeWithInitializer.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(everyTypeWithInitializer.ts, 0, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(everyTypeWithInitializer.ts, 2, 1)) +>I : Symbol(I, Decl(everyTypeWithInitializer.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(everyTypeWithInitializer.ts, 4, 22)) +} + +class D{ +>D : Symbol(D, Decl(everyTypeWithInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithInitializer.ts, 8, 8)) + + source: T; +>source : Symbol(source, Decl(everyTypeWithInitializer.ts, 8, 11)) +>T : Symbol(T, Decl(everyTypeWithInitializer.ts, 8, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(everyTypeWithInitializer.ts, 9, 14)) +>D : Symbol(D, Decl(everyTypeWithInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithInitializer.ts, 8, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(everyTypeWithInitializer.ts, 10, 18)) +>D : Symbol(D, Decl(everyTypeWithInitializer.ts, 6, 1)) +>D : Symbol(D, Decl(everyTypeWithInitializer.ts, 6, 1)) +>T : Symbol(T, Decl(everyTypeWithInitializer.ts, 8, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(everyTypeWithInitializer.ts, 12, 1)) +>x : Symbol(x, Decl(everyTypeWithInitializer.ts, 14, 11)) + +module M { +>M : Symbol(M, Decl(everyTypeWithInitializer.ts, 14, 44)) + + export class A { +>A : Symbol(A, Decl(everyTypeWithInitializer.ts, 16, 10)) + + name: string; +>name : Symbol(name, Decl(everyTypeWithInitializer.ts, 17, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(everyTypeWithInitializer.ts, 19, 5)) +>x : Symbol(x, Decl(everyTypeWithInitializer.ts, 21, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(everyTypeWithInitializer.ts, 21, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} + +var aNumber = 9.9; +>aNumber : Symbol(aNumber, Decl(everyTypeWithInitializer.ts, 24, 3)) + +var aString = 'this is a string'; +>aString : Symbol(aString, Decl(everyTypeWithInitializer.ts, 25, 3)) + +var aDate = new Date(12); +>aDate : Symbol(aDate, Decl(everyTypeWithInitializer.ts, 26, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var anObject = new Object(); +>anObject : Symbol(anObject, Decl(everyTypeWithInitializer.ts, 27, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var anAny = null; +>anAny : Symbol(anAny, Decl(everyTypeWithInitializer.ts, 29, 3)) + +var anOtherAny = new C(); +>anOtherAny : Symbol(anOtherAny, Decl(everyTypeWithInitializer.ts, 30, 3)) +>C : Symbol(C, Decl(everyTypeWithInitializer.ts, 2, 1)) + +var anUndefined = undefined; +>anUndefined : Symbol(anUndefined, Decl(everyTypeWithInitializer.ts, 31, 3)) +>undefined : Symbol(undefined) + + +var aClass = new C(); +>aClass : Symbol(aClass, Decl(everyTypeWithInitializer.ts, 34, 3)) +>C : Symbol(C, Decl(everyTypeWithInitializer.ts, 2, 1)) + +var aGenericClass = new D(); +>aGenericClass : Symbol(aGenericClass, Decl(everyTypeWithInitializer.ts, 35, 3)) +>D : Symbol(D, Decl(everyTypeWithInitializer.ts, 6, 1)) + +var anObjectLiteral = { id: 12 }; +>anObjectLiteral : Symbol(anObjectLiteral, Decl(everyTypeWithInitializer.ts, 36, 3)) +>id : Symbol(id, Decl(everyTypeWithInitializer.ts, 36, 23)) + +var aFunction = F; +>aFunction : Symbol(aFunction, Decl(everyTypeWithInitializer.ts, 38, 3)) +>F : Symbol(F, Decl(everyTypeWithInitializer.ts, 12, 1)) + +var aLambda = (x) => 2; +>aLambda : Symbol(aLambda, Decl(everyTypeWithInitializer.ts, 39, 3)) +>x : Symbol(x, Decl(everyTypeWithInitializer.ts, 39, 15)) + +var aModule = M; +>aModule : Symbol(aModule, Decl(everyTypeWithInitializer.ts, 41, 3)) +>M : Symbol(M, Decl(everyTypeWithInitializer.ts, 14, 44)) + +var aClassInModule = new M.A(); +>aClassInModule : Symbol(aClassInModule, Decl(everyTypeWithInitializer.ts, 42, 3)) +>M.A : Symbol(M.A, Decl(everyTypeWithInitializer.ts, 16, 10)) +>M : Symbol(M, Decl(everyTypeWithInitializer.ts, 14, 44)) +>A : Symbol(M.A, Decl(everyTypeWithInitializer.ts, 16, 10)) + +var aFunctionInModule = M.F2; +>aFunctionInModule : Symbol(aFunctionInModule, Decl(everyTypeWithInitializer.ts, 43, 3)) +>M.F2 : Symbol(M.F2, Decl(everyTypeWithInitializer.ts, 19, 5)) +>M : Symbol(M, Decl(everyTypeWithInitializer.ts, 14, 44)) +>F2 : Symbol(M.F2, Decl(everyTypeWithInitializer.ts, 19, 5)) + +// no initializer or annotation, so this is an 'any' +var x; +>x : Symbol(x, Decl(everyTypeWithInitializer.ts, 46, 3)) + + diff --git a/tests/baselines/reference/everyTypeWithInitializer.types b/tests/baselines/reference/everyTypeWithInitializer.types index 7a0318718e4..abc0e770e35 100644 --- a/tests/baselines/reference/everyTypeWithInitializer.types +++ b/tests/baselines/reference/everyTypeWithInitializer.types @@ -37,6 +37,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string +>42 : number module M { >M : typeof M @@ -59,14 +60,17 @@ module M { var aNumber = 9.9; >aNumber : number +>9.9 : number var aString = 'this is a string'; >aString : string +>'this is a string' : string var aDate = new Date(12); >aDate : Date >new Date(12) : Date >Date : DateConstructor +>12 : number var anObject = new Object(); >anObject : Object @@ -75,6 +79,7 @@ var anObject = new Object(); var anAny = null; >anAny : any +>null : null var anOtherAny = new C(); >anOtherAny : any @@ -101,6 +106,7 @@ var anObjectLiteral = { id: 12 }; >anObjectLiteral : { id: number; } >{ id: 12 } : { id: number; } >id : number +>12 : number var aFunction = F; >aFunction : (x: string) => number @@ -110,6 +116,7 @@ var aLambda = (x) => 2; >aLambda : (x: any) => number >(x) => 2 : (x: any) => number >x : any +>2 : number var aModule = M; >aModule : typeof M diff --git a/tests/baselines/reference/exportAssignClassAndModule.symbols b/tests/baselines/reference/exportAssignClassAndModule.symbols new file mode 100644 index 00000000000..9f38ed80b1b --- /dev/null +++ b/tests/baselines/reference/exportAssignClassAndModule.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/exportAssignClassAndModule_1.ts === +/// +import Foo = require('exportAssignClassAndModule_0'); +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_1.ts, 0, 0)) + +var z: Foo.Bar; +>z : Symbol(z, Decl(exportAssignClassAndModule_1.ts, 3, 3)) +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_1.ts, 0, 0)) +>Bar : Symbol(Foo.Bar, Decl(exportAssignClassAndModule_0.ts, 3, 12)) + +var zz: Foo; +>zz : Symbol(zz, Decl(exportAssignClassAndModule_1.ts, 4, 3)) +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_1.ts, 0, 0)) + +zz.x; +>zz.x : Symbol(Foo.x, Decl(exportAssignClassAndModule_0.ts, 0, 11)) +>zz : Symbol(zz, Decl(exportAssignClassAndModule_1.ts, 4, 3)) +>x : Symbol(Foo.x, Decl(exportAssignClassAndModule_0.ts, 0, 11)) + +=== tests/cases/compiler/exportAssignClassAndModule_0.ts === +class Foo { +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_0.ts, 0, 0), Decl(exportAssignClassAndModule_0.ts, 2, 1)) + + x: Foo.Bar; +>x : Symbol(x, Decl(exportAssignClassAndModule_0.ts, 0, 11)) +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_0.ts, 0, 0), Decl(exportAssignClassAndModule_0.ts, 2, 1)) +>Bar : Symbol(Foo.Bar, Decl(exportAssignClassAndModule_0.ts, 3, 12)) +} +module Foo { +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_0.ts, 0, 0), Decl(exportAssignClassAndModule_0.ts, 2, 1)) + + export interface Bar { +>Bar : Symbol(Bar, Decl(exportAssignClassAndModule_0.ts, 3, 12)) + } +} +export = Foo; +>Foo : Symbol(Foo, Decl(exportAssignClassAndModule_0.ts, 0, 0), Decl(exportAssignClassAndModule_0.ts, 2, 1)) + diff --git a/tests/baselines/reference/exportAssignClassAndModule.types b/tests/baselines/reference/exportAssignClassAndModule.types index dc4a19f345c..aa1ede6b2d4 100644 --- a/tests/baselines/reference/exportAssignClassAndModule.types +++ b/tests/baselines/reference/exportAssignClassAndModule.types @@ -5,7 +5,7 @@ import Foo = require('exportAssignClassAndModule_0'); var z: Foo.Bar; >z : Foo.Bar ->Foo : unknown +>Foo : any >Bar : Foo.Bar var zz: Foo; @@ -23,7 +23,7 @@ class Foo { x: Foo.Bar; >x : Foo.Bar ->Foo : unknown +>Foo : any >Bar : Foo.Bar } module Foo { diff --git a/tests/baselines/reference/exportAssignValueAndType.symbols b/tests/baselines/reference/exportAssignValueAndType.symbols new file mode 100644 index 00000000000..b6d5b5b3bb6 --- /dev/null +++ b/tests/baselines/reference/exportAssignValueAndType.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/exportAssignValueAndType.ts === +declare module http { +>http : Symbol(http, Decl(exportAssignValueAndType.ts, 0, 0)) + + export interface Server { openPort: number; } +>Server : Symbol(Server, Decl(exportAssignValueAndType.ts, 0, 21)) +>openPort : Symbol(openPort, Decl(exportAssignValueAndType.ts, 1, 26)) +} + +interface server { +>server : Symbol(server, Decl(exportAssignValueAndType.ts, 2, 1), Decl(exportAssignValueAndType.ts, 10, 3)) + + (): http.Server; +>http : Symbol(http, Decl(exportAssignValueAndType.ts, 0, 0)) +>Server : Symbol(http.Server, Decl(exportAssignValueAndType.ts, 0, 21)) + + startTime: Date; +>startTime : Symbol(startTime, Decl(exportAssignValueAndType.ts, 5, 20)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var x = 5; +>x : Symbol(x, Decl(exportAssignValueAndType.ts, 9, 3)) + +var server = new Date(); +>server : Symbol(server, Decl(exportAssignValueAndType.ts, 2, 1), Decl(exportAssignValueAndType.ts, 10, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +export = server; +>server : Symbol(server, Decl(exportAssignValueAndType.ts, 2, 1), Decl(exportAssignValueAndType.ts, 10, 3)) + + diff --git a/tests/baselines/reference/exportAssignValueAndType.types b/tests/baselines/reference/exportAssignValueAndType.types index fca84f399ec..2dc7442b9ac 100644 --- a/tests/baselines/reference/exportAssignValueAndType.types +++ b/tests/baselines/reference/exportAssignValueAndType.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportAssignValueAndType.ts === declare module http { ->http : unknown +>http : any export interface Server { openPort: number; } >Server : Server @@ -11,7 +11,7 @@ interface server { >server : server (): http.Server; ->http : unknown +>http : any >Server : http.Server startTime: Date; @@ -21,6 +21,7 @@ interface server { var x = 5; >x : number +>5 : number var server = new Date(); >server : Date diff --git a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.symbols b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.symbols new file mode 100644 index 00000000000..2c286e8518d --- /dev/null +++ b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/exportAssignedTypeAsTypeAnnotation_1.ts === +/// +import test = require('exportAssignedTypeAsTypeAnnotation_0'); +>test : Symbol(test, Decl(exportAssignedTypeAsTypeAnnotation_1.ts, 0, 0)) + +var t2: test; // should not raise a 'container type' error +>t2 : Symbol(t2, Decl(exportAssignedTypeAsTypeAnnotation_1.ts, 2, 3)) +>test : Symbol(test, Decl(exportAssignedTypeAsTypeAnnotation_1.ts, 0, 0)) + +=== tests/cases/compiler/exportAssignedTypeAsTypeAnnotation_0.ts === + +interface x { +>x : Symbol(x, Decl(exportAssignedTypeAsTypeAnnotation_0.ts, 0, 0)) + + (): Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + foo: string; +>foo : Symbol(foo, Decl(exportAssignedTypeAsTypeAnnotation_0.ts, 2, 13)) +} +export = x; +>x : Symbol(x, Decl(exportAssignedTypeAsTypeAnnotation_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.types b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.types index 8ac473f970a..553dbe35c4f 100644 --- a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.types +++ b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.types @@ -1,7 +1,7 @@ === tests/cases/compiler/exportAssignedTypeAsTypeAnnotation_1.ts === /// import test = require('exportAssignedTypeAsTypeAnnotation_0'); ->test : unknown +>test : any var t2: test; // should not raise a 'container type' error >t2 : test diff --git a/tests/baselines/reference/exportAssignmentCircularModules.symbols b/tests/baselines/reference/exportAssignmentCircularModules.symbols new file mode 100644 index 00000000000..5e2d5470c90 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentCircularModules.symbols @@ -0,0 +1,48 @@ +=== tests/cases/conformance/externalModules/foo_2.ts === +import foo0 = require("./foo_0"); +>foo0 : Symbol(foo0, Decl(foo_2.ts, 0, 0)) + +module Foo { +>Foo : Symbol(Foo, Decl(foo_2.ts, 0, 33)) + + export var x = foo0.x; +>x : Symbol(x, Decl(foo_2.ts, 2, 11)) +>foo0.x : Symbol(foo0.x, Decl(foo_0.ts, 2, 11)) +>foo0 : Symbol(foo0, Decl(foo_2.ts, 0, 0)) +>x : Symbol(foo0.x, Decl(foo_0.ts, 2, 11)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_2.ts, 0, 33)) + +=== tests/cases/conformance/externalModules/foo_0.ts === +import foo1 = require('./foo_1'); +>foo1 : Symbol(foo1, Decl(foo_0.ts, 0, 0)) + +module Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 33)) + + export var x = foo1.x; +>x : Symbol(x, Decl(foo_0.ts, 2, 11)) +>foo1.x : Symbol(foo1.x, Decl(foo_1.ts, 2, 11)) +>foo1 : Symbol(foo1, Decl(foo_0.ts, 0, 0)) +>x : Symbol(foo1.x, Decl(foo_1.ts, 2, 11)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 33)) + +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo2 = require("./foo_2"); +>foo2 : Symbol(foo2, Decl(foo_1.ts, 0, 0)) + +module Foo { +>Foo : Symbol(Foo, Decl(foo_1.ts, 0, 33)) + + export var x = foo2.x; +>x : Symbol(x, Decl(foo_1.ts, 2, 11)) +>foo2.x : Symbol(foo2.x, Decl(foo_2.ts, 2, 11)) +>foo2 : Symbol(foo2, Decl(foo_1.ts, 0, 0)) +>x : Symbol(foo2.x, Decl(foo_2.ts, 2, 11)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_1.ts, 0, 33)) + diff --git a/tests/baselines/reference/exportAssignmentClass.symbols b/tests/baselines/reference/exportAssignmentClass.symbols new file mode 100644 index 00000000000..d0935ca8f8c --- /dev/null +++ b/tests/baselines/reference/exportAssignmentClass.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/exportAssignmentClass_B.ts === +import D = require("exportAssignmentClass_A"); +>D : Symbol(D, Decl(exportAssignmentClass_B.ts, 0, 0)) + +var d = new D(); +>d : Symbol(d, Decl(exportAssignmentClass_B.ts, 2, 3)) +>D : Symbol(D, Decl(exportAssignmentClass_B.ts, 0, 0)) + +var x = d.p; +>x : Symbol(x, Decl(exportAssignmentClass_B.ts, 3, 3)) +>d.p : Symbol(D.p, Decl(exportAssignmentClass_A.ts, 0, 9)) +>d : Symbol(d, Decl(exportAssignmentClass_B.ts, 2, 3)) +>p : Symbol(D.p, Decl(exportAssignmentClass_A.ts, 0, 9)) + +=== tests/cases/compiler/exportAssignmentClass_A.ts === +class C { public p = 0; } +>C : Symbol(C, Decl(exportAssignmentClass_A.ts, 0, 0)) +>p : Symbol(p, Decl(exportAssignmentClass_A.ts, 0, 9)) + +export = C; +>C : Symbol(C, Decl(exportAssignmentClass_A.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentClass.types b/tests/baselines/reference/exportAssignmentClass.types index c7c3f38d7ea..b724c837244 100644 --- a/tests/baselines/reference/exportAssignmentClass.types +++ b/tests/baselines/reference/exportAssignmentClass.types @@ -17,6 +17,7 @@ var x = d.p; class C { public p = 0; } >C : C >p : number +>0 : number export = C; >C : C diff --git a/tests/baselines/reference/exportAssignmentEnum.symbols b/tests/baselines/reference/exportAssignmentEnum.symbols new file mode 100644 index 00000000000..07eb5f7b907 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentEnum.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/exportAssignmentEnum_B.ts === +import EnumE = require("exportAssignmentEnum_A"); +>EnumE : Symbol(EnumE, Decl(exportAssignmentEnum_B.ts, 0, 0)) + +var a = EnumE.A; +>a : Symbol(a, Decl(exportAssignmentEnum_B.ts, 2, 3)) +>EnumE.A : Symbol(EnumE.A, Decl(exportAssignmentEnum_A.ts, 0, 8)) +>EnumE : Symbol(EnumE, Decl(exportAssignmentEnum_B.ts, 0, 0)) +>A : Symbol(EnumE.A, Decl(exportAssignmentEnum_A.ts, 0, 8)) + +var b = EnumE.B; +>b : Symbol(b, Decl(exportAssignmentEnum_B.ts, 3, 3)) +>EnumE.B : Symbol(EnumE.B, Decl(exportAssignmentEnum_A.ts, 1, 3)) +>EnumE : Symbol(EnumE, Decl(exportAssignmentEnum_B.ts, 0, 0)) +>B : Symbol(EnumE.B, Decl(exportAssignmentEnum_A.ts, 1, 3)) + +var c = EnumE.C; +>c : Symbol(c, Decl(exportAssignmentEnum_B.ts, 4, 3)) +>EnumE.C : Symbol(EnumE.C, Decl(exportAssignmentEnum_A.ts, 2, 3)) +>EnumE : Symbol(EnumE, Decl(exportAssignmentEnum_B.ts, 0, 0)) +>C : Symbol(EnumE.C, Decl(exportAssignmentEnum_A.ts, 2, 3)) + +=== tests/cases/compiler/exportAssignmentEnum_A.ts === +enum E { +>E : Symbol(E, Decl(exportAssignmentEnum_A.ts, 0, 0)) + + A, +>A : Symbol(E.A, Decl(exportAssignmentEnum_A.ts, 0, 8)) + + B, +>B : Symbol(E.B, Decl(exportAssignmentEnum_A.ts, 1, 3)) + + C, +>C : Symbol(E.C, Decl(exportAssignmentEnum_A.ts, 2, 3)) +} + +export = E; +>E : Symbol(E, Decl(exportAssignmentEnum_A.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentError.symbols b/tests/baselines/reference/exportAssignmentError.symbols new file mode 100644 index 00000000000..482ad586dc2 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentError.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/exportAssignmentError.ts === +module M { +>M : Symbol(M, Decl(exportAssignmentError.ts, 0, 0)) + + export var x; +>x : Symbol(x, Decl(exportAssignmentError.ts, 1, 11)) +} + +import M2 = M; +>M2 : Symbol(M2, Decl(exportAssignmentError.ts, 2, 1)) +>M : Symbol(M, Decl(exportAssignmentError.ts, 0, 0)) + +export = M2; // should not error +>M2 : Symbol(M2, Decl(exportAssignmentError.ts, 2, 1)) + diff --git a/tests/baselines/reference/exportAssignmentFunction.symbols b/tests/baselines/reference/exportAssignmentFunction.symbols new file mode 100644 index 00000000000..749c7d61949 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentFunction.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/exportAssignmentFunction_B.ts === +import fooFunc = require("exportAssignmentFunction_A"); +>fooFunc : Symbol(fooFunc, Decl(exportAssignmentFunction_B.ts, 0, 0)) + +var n: number = fooFunc(); +>n : Symbol(n, Decl(exportAssignmentFunction_B.ts, 2, 3)) +>fooFunc : Symbol(fooFunc, Decl(exportAssignmentFunction_B.ts, 0, 0)) + +=== tests/cases/compiler/exportAssignmentFunction_A.ts === +function foo() { return 0; } +>foo : Symbol(foo, Decl(exportAssignmentFunction_A.ts, 0, 0)) + +export = foo; +>foo : Symbol(foo, Decl(exportAssignmentFunction_A.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentFunction.types b/tests/baselines/reference/exportAssignmentFunction.types index 023a8c234d2..bd10465d221 100644 --- a/tests/baselines/reference/exportAssignmentFunction.types +++ b/tests/baselines/reference/exportAssignmentFunction.types @@ -10,6 +10,7 @@ var n: number = fooFunc(); === tests/cases/compiler/exportAssignmentFunction_A.ts === function foo() { return 0; } >foo : () => number +>0 : number export = foo; >foo : () => number diff --git a/tests/baselines/reference/exportAssignmentGenericType.symbols b/tests/baselines/reference/exportAssignmentGenericType.symbols new file mode 100644 index 00000000000..ca228e7092e --- /dev/null +++ b/tests/baselines/reference/exportAssignmentGenericType.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var x = new foo(); +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var y:number = x.test; +>y : Symbol(y, Decl(foo_1.ts, 2, 3)) +>x.test : Symbol(foo.test, Decl(foo_0.ts, 0, 13)) +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>test : Symbol(foo.test, Decl(foo_0.ts, 0, 13)) + +=== tests/cases/conformance/externalModules/foo_0.ts === +class Foo{ +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0)) +>T : Symbol(T, Decl(foo_0.ts, 0, 10)) + + test: T; +>test : Symbol(test, Decl(foo_0.ts, 0, 13)) +>T : Symbol(T, Decl(foo_0.ts, 0, 10)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentInterface.symbols b/tests/baselines/reference/exportAssignmentInterface.symbols new file mode 100644 index 00000000000..22f344a2cb9 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentInterface.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/exportAssignmentInterface_B.ts === +import I1 = require("exportAssignmentInterface_A"); +>I1 : Symbol(I1, Decl(exportAssignmentInterface_B.ts, 0, 0)) + +var i: I1; +>i : Symbol(i, Decl(exportAssignmentInterface_B.ts, 2, 3)) +>I1 : Symbol(I1, Decl(exportAssignmentInterface_B.ts, 0, 0)) + +var n: number = i.p1; +>n : Symbol(n, Decl(exportAssignmentInterface_B.ts, 4, 3)) +>i.p1 : Symbol(I1.p1, Decl(exportAssignmentInterface_A.ts, 0, 13)) +>i : Symbol(i, Decl(exportAssignmentInterface_B.ts, 2, 3)) +>p1 : Symbol(I1.p1, Decl(exportAssignmentInterface_A.ts, 0, 13)) + +=== tests/cases/compiler/exportAssignmentInterface_A.ts === +interface A { +>A : Symbol(A, Decl(exportAssignmentInterface_A.ts, 0, 0)) + + p1: number; +>p1 : Symbol(p1, Decl(exportAssignmentInterface_A.ts, 0, 13)) +} + +export = A; +>A : Symbol(A, Decl(exportAssignmentInterface_A.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentInterface.types b/tests/baselines/reference/exportAssignmentInterface.types index f4ed92d9471..efd75daca79 100644 --- a/tests/baselines/reference/exportAssignmentInterface.types +++ b/tests/baselines/reference/exportAssignmentInterface.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportAssignmentInterface_B.ts === import I1 = require("exportAssignmentInterface_A"); ->I1 : unknown +>I1 : any var i: I1; >i : I1 diff --git a/tests/baselines/reference/exportAssignmentInternalModule.symbols b/tests/baselines/reference/exportAssignmentInternalModule.symbols new file mode 100644 index 00000000000..37667aa5c43 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentInternalModule.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/exportAssignmentInternalModule_B.ts === +import modM = require("exportAssignmentInternalModule_A"); +>modM : Symbol(modM, Decl(exportAssignmentInternalModule_B.ts, 0, 0)) + +var n: number = modM.x; +>n : Symbol(n, Decl(exportAssignmentInternalModule_B.ts, 2, 3)) +>modM.x : Symbol(modM.x, Decl(exportAssignmentInternalModule_A.ts, 1, 11)) +>modM : Symbol(modM, Decl(exportAssignmentInternalModule_B.ts, 0, 0)) +>x : Symbol(modM.x, Decl(exportAssignmentInternalModule_A.ts, 1, 11)) + +=== tests/cases/compiler/exportAssignmentInternalModule_A.ts === +module M { +>M : Symbol(M, Decl(exportAssignmentInternalModule_A.ts, 0, 0)) + + export var x; +>x : Symbol(x, Decl(exportAssignmentInternalModule_A.ts, 1, 11)) +} + +export = M; +>M : Symbol(M, Decl(exportAssignmentInternalModule_A.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentMergedInterface.symbols b/tests/baselines/reference/exportAssignmentMergedInterface.symbols new file mode 100644 index 00000000000..a199ed4e6c5 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentMergedInterface.symbols @@ -0,0 +1,63 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var x: foo; +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +x("test"); +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) + +x(42); +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) + +var y: string = x.b; +>y : Symbol(y, Decl(foo_1.ts, 4, 3)) +>x.b : Symbol(foo.b, Decl(foo_0.ts, 1, 19)) +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>b : Symbol(foo.b, Decl(foo_0.ts, 1, 19)) + +if(!!x.c){ } +>x.c : Symbol(foo.c, Decl(foo_0.ts, 5, 21)) +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>c : Symbol(foo.c, Decl(foo_0.ts, 5, 21)) + +var z = {x: 1, y: 2}; +>z : Symbol(z, Decl(foo_1.ts, 6, 3)) +>x : Symbol(x, Decl(foo_1.ts, 6, 9)) +>y : Symbol(y, Decl(foo_1.ts, 6, 14)) + +z = x.d; +>z : Symbol(z, Decl(foo_1.ts, 6, 3)) +>x.d : Symbol(foo.d, Decl(foo_0.ts, 6, 12)) +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>d : Symbol(foo.d, Decl(foo_0.ts, 6, 12)) + +=== tests/cases/conformance/externalModules/foo_0.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 3, 1)) + + (a: string): void; +>a : Symbol(a, Decl(foo_0.ts, 1, 2)) + + b: string; +>b : Symbol(b, Decl(foo_0.ts, 1, 19)) +} +interface Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 3, 1)) + + (a: number): number; +>a : Symbol(a, Decl(foo_0.ts, 5, 2)) + + c: boolean; +>c : Symbol(c, Decl(foo_0.ts, 5, 21)) + + d: {x: number; y: number}; +>d : Symbol(d, Decl(foo_0.ts, 6, 12)) +>x : Symbol(x, Decl(foo_0.ts, 7, 5)) +>y : Symbol(y, Decl(foo_0.ts, 7, 15)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 3, 1)) + diff --git a/tests/baselines/reference/exportAssignmentMergedInterface.types b/tests/baselines/reference/exportAssignmentMergedInterface.types index d0fb5383b29..52978783f6d 100644 --- a/tests/baselines/reference/exportAssignmentMergedInterface.types +++ b/tests/baselines/reference/exportAssignmentMergedInterface.types @@ -1,6 +1,6 @@ === tests/cases/conformance/externalModules/foo_1.ts === import foo = require("./foo_0"); ->foo : unknown +>foo : any var x: foo; >x : foo @@ -9,10 +9,12 @@ var x: foo; x("test"); >x("test") : void >x : foo +>"test" : string x(42); >x(42) : number >x : foo +>42 : number var y: string = x.b; >y : string @@ -31,7 +33,9 @@ var z = {x: 1, y: 2}; >z : { x: number; y: number; } >{x: 1, y: 2} : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number z = x.d; >z = x.d : { x: number; y: number; } diff --git a/tests/baselines/reference/exportAssignmentMergedModule.symbols b/tests/baselines/reference/exportAssignmentMergedModule.symbols new file mode 100644 index 00000000000..2fe8d01764b --- /dev/null +++ b/tests/baselines/reference/exportAssignmentMergedModule.symbols @@ -0,0 +1,57 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var a: number = foo.a(); +>a : Symbol(a, Decl(foo_1.ts, 1, 3)) +>foo.a : Symbol(foo.a, Decl(foo_0.ts, 0, 12)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>a : Symbol(foo.a, Decl(foo_0.ts, 0, 12)) + +if(!!foo.b){ +>foo.b : Symbol(foo.b, Decl(foo_0.ts, 4, 11)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>b : Symbol(foo.b, Decl(foo_0.ts, 4, 11)) + + foo.Test.answer = foo.c(42); +>foo.Test.answer : Symbol(foo.Test.answer, Decl(foo_0.ts, 11, 12)) +>foo.Test : Symbol(foo.Test, Decl(foo_0.ts, 9, 2)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>Test : Symbol(foo.Test, Decl(foo_0.ts, 9, 2)) +>answer : Symbol(foo.Test.answer, Decl(foo_0.ts, 11, 12)) +>foo.c : Symbol(foo.c, Decl(foo_0.ts, 6, 12)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>c : Symbol(foo.c, Decl(foo_0.ts, 6, 12)) +} +=== tests/cases/conformance/externalModules/foo_0.ts === +module Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 5, 1)) + + export function a(){ +>a : Symbol(a, Decl(foo_0.ts, 0, 12)) + + return 5; + } + export var b = true; +>b : Symbol(b, Decl(foo_0.ts, 4, 11)) +} +module Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 5, 1)) + + export function c(a: number){ +>c : Symbol(c, Decl(foo_0.ts, 6, 12)) +>a : Symbol(a, Decl(foo_0.ts, 7, 19)) + + return a; +>a : Symbol(a, Decl(foo_0.ts, 7, 19)) + } + export module Test { +>Test : Symbol(Test, Decl(foo_0.ts, 9, 2)) + + export var answer = 42; +>answer : Symbol(answer, Decl(foo_0.ts, 11, 12)) + } +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 5, 1)) + diff --git a/tests/baselines/reference/exportAssignmentMergedModule.types b/tests/baselines/reference/exportAssignmentMergedModule.types index d72f173a439..39f0d8d859e 100644 --- a/tests/baselines/reference/exportAssignmentMergedModule.types +++ b/tests/baselines/reference/exportAssignmentMergedModule.types @@ -27,6 +27,7 @@ if(!!foo.b){ >foo.c : (a: number) => number >foo : typeof foo >c : (a: number) => number +>42 : number } === tests/cases/conformance/externalModules/foo_0.ts === module Foo { @@ -36,9 +37,11 @@ module Foo { >a : () => number return 5; +>5 : number } export var b = true; >b : boolean +>true : boolean } module Foo { >Foo : typeof Foo @@ -55,6 +58,7 @@ module Foo { export var answer = 42; >answer : number +>42 : number } } export = Foo; diff --git a/tests/baselines/reference/exportAssignmentOfGenericType1.symbols b/tests/baselines/reference/exportAssignmentOfGenericType1.symbols new file mode 100644 index 00000000000..8ae7dbc73a9 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentOfGenericType1.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/exportAssignmentOfGenericType1_1.ts === +/// +import q = require("exportAssignmentOfGenericType1_0"); +>q : Symbol(q, Decl(exportAssignmentOfGenericType1_1.ts, 0, 0)) + +class M extends q { } +>M : Symbol(M, Decl(exportAssignmentOfGenericType1_1.ts, 1, 55)) +>q : Symbol(q, Decl(exportAssignmentOfGenericType1_1.ts, 0, 0)) + +var m: M; +>m : Symbol(m, Decl(exportAssignmentOfGenericType1_1.ts, 4, 3)) +>M : Symbol(M, Decl(exportAssignmentOfGenericType1_1.ts, 1, 55)) + +var r: string = m.foo; +>r : Symbol(r, Decl(exportAssignmentOfGenericType1_1.ts, 5, 3)) +>m.foo : Symbol(q.foo, Decl(exportAssignmentOfGenericType1_0.ts, 1, 12)) +>m : Symbol(m, Decl(exportAssignmentOfGenericType1_1.ts, 4, 3)) +>foo : Symbol(q.foo, Decl(exportAssignmentOfGenericType1_0.ts, 1, 12)) + +=== tests/cases/compiler/exportAssignmentOfGenericType1_0.ts === +export = T; +>T : Symbol(T, Decl(exportAssignmentOfGenericType1_0.ts, 0, 11)) + +class T { foo: X; } +>T : Symbol(T, Decl(exportAssignmentOfGenericType1_0.ts, 0, 11)) +>X : Symbol(X, Decl(exportAssignmentOfGenericType1_0.ts, 1, 8)) +>foo : Symbol(foo, Decl(exportAssignmentOfGenericType1_0.ts, 1, 12)) +>X : Symbol(X, Decl(exportAssignmentOfGenericType1_0.ts, 1, 8)) + diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.symbols b/tests/baselines/reference/exportAssignmentTopLevelClodule.symbols new file mode 100644 index 00000000000..d672457f451 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(foo.answer === 42){ +>foo.answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) + + var x = new foo(); +>x : Symbol(x, Decl(foo_1.ts, 2, 4)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +class Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + test = "test"; +>test : Symbol(test, Decl(foo_0.ts, 0, 11)) +} +module Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + export var answer = 42; +>answer : Symbol(answer, Decl(foo_0.ts, 4, 11)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + diff --git a/tests/baselines/reference/exportAssignmentTopLevelClodule.types b/tests/baselines/reference/exportAssignmentTopLevelClodule.types index 80a56cd7b5f..93ce39c3b60 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelClodule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelClodule.types @@ -7,6 +7,7 @@ if(foo.answer === 42){ >foo.answer : number >foo : typeof foo >answer : number +>42 : number var x = new foo(); >x : foo @@ -20,12 +21,14 @@ class Foo { test = "test"; >test : string +>"test" : string } module Foo { >Foo : typeof Foo export var answer = 42; >answer : number +>42 : number } export = Foo; >Foo : Foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.symbols b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.symbols new file mode 100644 index 00000000000..6ad539f5f8e --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var color: foo; +>color : Symbol(color, Decl(foo_1.ts, 1, 3)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(color === foo.green){ +>color : Symbol(color, Decl(foo_1.ts, 1, 3)) +>foo.green : Symbol(foo.green, Decl(foo_0.ts, 1, 5)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>green : Symbol(foo.green, Decl(foo_0.ts, 1, 5)) + + color = foo.answer; +>color : Symbol(color, Decl(foo_1.ts, 1, 3)) +>foo.answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +enum foo { +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + red, green, blue +>red : Symbol(foo.red, Decl(foo_0.ts, 0, 10)) +>green : Symbol(foo.green, Decl(foo_0.ts, 1, 5)) +>blue : Symbol(foo.blue, Decl(foo_0.ts, 1, 12)) +} +module foo { +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + export var answer = 42; +>answer : Symbol(answer, Decl(foo_0.ts, 4, 11)) +} +export = foo; +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + diff --git a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types index 4ee49f6d20f..d60fc878319 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelEnumdule.types @@ -35,6 +35,7 @@ module foo { export var answer = 42; >answer : number +>42 : number } export = foo; >foo : foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelFundule.symbols b/tests/baselines/reference/exportAssignmentTopLevelFundule.symbols new file mode 100644 index 00000000000..672c8ca6231 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelFundule.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(foo.answer === 42){ +>foo.answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>answer : Symbol(foo.answer, Decl(foo_0.ts, 4, 11)) + + var x = foo(); +>x : Symbol(x, Decl(foo_1.ts, 2, 4)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +function foo() { +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + return "test"; +} +module foo { +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + + export var answer = 42; +>answer : Symbol(answer, Decl(foo_0.ts, 4, 11)) +} +export = foo; +>foo : Symbol(foo, Decl(foo_0.ts, 0, 0), Decl(foo_0.ts, 2, 1)) + diff --git a/tests/baselines/reference/exportAssignmentTopLevelFundule.types b/tests/baselines/reference/exportAssignmentTopLevelFundule.types index 982e87e59f3..3464f4294a0 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelFundule.types +++ b/tests/baselines/reference/exportAssignmentTopLevelFundule.types @@ -7,6 +7,7 @@ if(foo.answer === 42){ >foo.answer : number >foo : typeof foo >answer : number +>42 : number var x = foo(); >x : string @@ -19,12 +20,14 @@ function foo() { >foo : typeof foo return "test"; +>"test" : string } module foo { >foo : typeof foo export var answer = 42; >answer : number +>42 : number } export = foo; >foo : typeof foo diff --git a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.symbols b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.symbols new file mode 100644 index 00000000000..55b3d3718f9 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require("./foo_0"); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +if(foo.answer === 42){ +>foo.answer : Symbol(foo.answer, Decl(foo_0.ts, 1, 11)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>answer : Symbol(foo.answer, Decl(foo_0.ts, 1, 11)) + +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +module Foo { +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0)) + + export var answer = 42; +>answer : Symbol(answer, Decl(foo_0.ts, 1, 11)) +} +export = Foo; +>Foo : Symbol(Foo, Decl(foo_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types index 09d881715dd..34971ca9cd6 100644 --- a/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types +++ b/tests/baselines/reference/exportAssignmentTopLevelIdentifier.types @@ -7,6 +7,7 @@ if(foo.answer === 42){ >foo.answer : number >foo : typeof foo >answer : number +>42 : number } @@ -16,6 +17,7 @@ module Foo { export var answer = 42; >answer : number +>42 : number } export = Foo; >Foo : typeof Foo diff --git a/tests/baselines/reference/exportAssignmentVariable.symbols b/tests/baselines/reference/exportAssignmentVariable.symbols new file mode 100644 index 00000000000..b819678d080 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentVariable.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/exportAssignmentVariable_B.ts === +import y = require("exportAssignmentVariable_A"); +>y : Symbol(y, Decl(exportAssignmentVariable_B.ts, 0, 0)) + +var n: number = y; +>n : Symbol(n, Decl(exportAssignmentVariable_B.ts, 2, 3)) +>y : Symbol(y, Decl(exportAssignmentVariable_B.ts, 0, 0)) + +=== tests/cases/compiler/exportAssignmentVariable_A.ts === +var x = 0; +>x : Symbol(x, Decl(exportAssignmentVariable_A.ts, 0, 3)) + +export = x; +>x : Symbol(x, Decl(exportAssignmentVariable_A.ts, 0, 3)) + diff --git a/tests/baselines/reference/exportAssignmentVariable.types b/tests/baselines/reference/exportAssignmentVariable.types index 36f02f60a95..71f0afdea68 100644 --- a/tests/baselines/reference/exportAssignmentVariable.types +++ b/tests/baselines/reference/exportAssignmentVariable.types @@ -9,6 +9,7 @@ var n: number = y; === tests/cases/compiler/exportAssignmentVariable_A.ts === var x = 0; >x : number +>0 : number export = x; >x : number diff --git a/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.symbols b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.symbols new file mode 100644 index 00000000000..80a48dff3ad --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/exportAssignmentWithImportStatementPrivacyError.ts === +module m2 { +>m2 : Symbol(m2, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 0)) + + export interface connectModule { +>connectModule : Symbol(connectModule, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 11)) + + (res, req, next): void; +>res : Symbol(res, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 2, 9)) +>req : Symbol(req, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 2, 13)) +>next : Symbol(next, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 2, 18)) + } + export interface connectExport { +>connectExport : Symbol(connectExport, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 3, 5)) + + use: (mod: connectModule) => connectExport; +>use : Symbol(use, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 4, 36)) +>mod : Symbol(mod, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 5, 14)) +>connectModule : Symbol(connectModule, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 11)) +>connectExport : Symbol(connectExport, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 3, 5)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 5, 51)) +>port : Symbol(port, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 6, 17)) + } + +} + +module M { +>M : Symbol(M, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 9, 1)) + + export var server: { +>server : Symbol(server, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 12, 14)) + + (): m2.connectExport; +>m2 : Symbol(m2, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 0)) +>connectExport : Symbol(m2.connectExport, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 3, 5)) + + test1: m2.connectModule; +>test1 : Symbol(test1, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 13, 29)) +>m2 : Symbol(m2, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 0)) +>connectModule : Symbol(m2.connectModule, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 11)) + + test2(): m2.connectModule; +>test2 : Symbol(test2, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 14, 32)) +>m2 : Symbol(m2, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 0)) +>connectModule : Symbol(m2.connectModule, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 0, 11)) + + }; +} +import M22 = M; +>M22 : Symbol(M22, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 17, 1)) +>M : Symbol(M, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 9, 1)) + +export = M; +>M : Symbol(M, Decl(exportAssignmentWithImportStatementPrivacyError.ts, 9, 1)) + diff --git a/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types index 7d6c7166655..9008cc267c8 100644 --- a/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types +++ b/tests/baselines/reference/exportAssignmentWithImportStatementPrivacyError.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportAssignmentWithImportStatementPrivacyError.ts === module m2 { ->m2 : unknown +>m2 : any export interface connectModule { >connectModule : connectModule @@ -33,17 +33,17 @@ module M { >server : { (): m2.connectExport; test1: m2.connectModule; test2(): m2.connectModule; } (): m2.connectExport; ->m2 : unknown +>m2 : any >connectExport : m2.connectExport test1: m2.connectModule; >test1 : m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule test2(): m2.connectModule; >test2 : () => m2.connectModule ->m2 : unknown +>m2 : any >connectModule : m2.connectModule }; diff --git a/tests/baselines/reference/exportAssignmentWithPrivacyError.symbols b/tests/baselines/reference/exportAssignmentWithPrivacyError.symbols new file mode 100644 index 00000000000..f69a4e00823 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithPrivacyError.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/exportAssignmentWithPrivacyError.ts === +interface connectmodule { +>connectmodule : Symbol(connectmodule, Decl(exportAssignmentWithPrivacyError.ts, 0, 0)) + + (res, req, next): void; +>res : Symbol(res, Decl(exportAssignmentWithPrivacyError.ts, 1, 5)) +>req : Symbol(req, Decl(exportAssignmentWithPrivacyError.ts, 1, 9)) +>next : Symbol(next, Decl(exportAssignmentWithPrivacyError.ts, 1, 14)) +} +interface connectexport { +>connectexport : Symbol(connectexport, Decl(exportAssignmentWithPrivacyError.ts, 2, 1)) + + use: (mod: connectmodule) => connectexport; +>use : Symbol(use, Decl(exportAssignmentWithPrivacyError.ts, 3, 25)) +>mod : Symbol(mod, Decl(exportAssignmentWithPrivacyError.ts, 4, 10)) +>connectmodule : Symbol(connectmodule, Decl(exportAssignmentWithPrivacyError.ts, 0, 0)) +>connectexport : Symbol(connectexport, Decl(exportAssignmentWithPrivacyError.ts, 2, 1)) + + listen: (port: number) => void; +>listen : Symbol(listen, Decl(exportAssignmentWithPrivacyError.ts, 4, 47)) +>port : Symbol(port, Decl(exportAssignmentWithPrivacyError.ts, 5, 13)) +} + +var server: { +>server : Symbol(server, Decl(exportAssignmentWithPrivacyError.ts, 8, 3)) + + (): connectexport; +>connectexport : Symbol(connectexport, Decl(exportAssignmentWithPrivacyError.ts, 2, 1)) + + test1: connectmodule; +>test1 : Symbol(test1, Decl(exportAssignmentWithPrivacyError.ts, 9, 22)) +>connectmodule : Symbol(connectmodule, Decl(exportAssignmentWithPrivacyError.ts, 0, 0)) + + test2(): connectmodule; +>test2 : Symbol(test2, Decl(exportAssignmentWithPrivacyError.ts, 10, 25)) +>connectmodule : Symbol(connectmodule, Decl(exportAssignmentWithPrivacyError.ts, 0, 0)) + +}; + +export = server; +>server : Symbol(server, Decl(exportAssignmentWithPrivacyError.ts, 8, 3)) + + diff --git a/tests/baselines/reference/exportAssignmentWithoutIdentifier1.symbols b/tests/baselines/reference/exportAssignmentWithoutIdentifier1.symbols new file mode 100644 index 00000000000..bcbf5eb1f60 --- /dev/null +++ b/tests/baselines/reference/exportAssignmentWithoutIdentifier1.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts === +function Greeter() { +>Greeter : Symbol(Greeter, Decl(exportAssignmentWithoutIdentifier1.ts, 0, 0)) + + //... +} +Greeter.prototype.greet = function () { +>Greeter.prototype : Symbol(Function.prototype, Decl(lib.d.ts, 249, 48)) +>Greeter : Symbol(Greeter, Decl(exportAssignmentWithoutIdentifier1.ts, 0, 0)) +>prototype : Symbol(Function.prototype, Decl(lib.d.ts, 249, 48)) + + //... +} +export = new Greeter(); +>Greeter : Symbol(Greeter, Decl(exportAssignmentWithoutIdentifier1.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportCodeGen.symbols b/tests/baselines/reference/exportCodeGen.symbols new file mode 100644 index 00000000000..fbc70cf8324 --- /dev/null +++ b/tests/baselines/reference/exportCodeGen.symbols @@ -0,0 +1,109 @@ +=== tests/cases/conformance/internalModules/codeGeneration/exportCodeGen.ts === + +// should replace all refs to 'x' in the body, +// with fully qualified +module A { +>A : Symbol(A, Decl(exportCodeGen.ts, 0, 0)) + + export var x = 12; +>x : Symbol(x, Decl(exportCodeGen.ts, 4, 14)) + + function lt12() { +>lt12 : Symbol(lt12, Decl(exportCodeGen.ts, 4, 22)) + + return x < 12; +>x : Symbol(x, Decl(exportCodeGen.ts, 4, 14)) + } +} + +// should not fully qualify 'x' +module B { +>B : Symbol(B, Decl(exportCodeGen.ts, 8, 1)) + + var x = 12; +>x : Symbol(x, Decl(exportCodeGen.ts, 12, 7)) + + function lt12() { +>lt12 : Symbol(lt12, Decl(exportCodeGen.ts, 12, 15)) + + return x < 12; +>x : Symbol(x, Decl(exportCodeGen.ts, 12, 7)) + } +} + +// not copied, since not exported +module C { +>C : Symbol(C, Decl(exportCodeGen.ts, 16, 1)) + + function no() { +>no : Symbol(no, Decl(exportCodeGen.ts, 19, 10)) + + return false; + } +} + +// copies, since exported +module D { +>D : Symbol(D, Decl(exportCodeGen.ts, 23, 1)) + + export function yes() { +>yes : Symbol(yes, Decl(exportCodeGen.ts, 26, 10)) + + return true; + } +} + +// validate all exportable statements +module E { +>E : Symbol(E, Decl(exportCodeGen.ts, 30, 1)) + + export enum Color { Red } +>Color : Symbol(Color, Decl(exportCodeGen.ts, 33, 10)) +>Red : Symbol(Color.Red, Decl(exportCodeGen.ts, 34, 23)) + + export function fn() { } +>fn : Symbol(fn, Decl(exportCodeGen.ts, 34, 29)) + + export interface I { id: number } +>I : Symbol(I, Decl(exportCodeGen.ts, 35, 28)) +>id : Symbol(id, Decl(exportCodeGen.ts, 36, 24)) + + export class C { name: string } +>C : Symbol(C, Decl(exportCodeGen.ts, 36, 37)) +>name : Symbol(name, Decl(exportCodeGen.ts, 37, 20)) + + export module M { +>M : Symbol(M, Decl(exportCodeGen.ts, 37, 35)) + + export var x = 42; +>x : Symbol(x, Decl(exportCodeGen.ts, 39, 18)) + } +} + +// validate all exportable statements, +// which are not exported +module F { +>F : Symbol(F, Decl(exportCodeGen.ts, 41, 1)) + + enum Color { Red } +>Color : Symbol(Color, Decl(exportCodeGen.ts, 45, 10)) +>Red : Symbol(Color.Red, Decl(exportCodeGen.ts, 46, 16)) + + function fn() { } +>fn : Symbol(fn, Decl(exportCodeGen.ts, 46, 22)) + + interface I { id: number } +>I : Symbol(I, Decl(exportCodeGen.ts, 47, 21)) +>id : Symbol(id, Decl(exportCodeGen.ts, 48, 17)) + + class C { name: string } +>C : Symbol(C, Decl(exportCodeGen.ts, 48, 30)) +>name : Symbol(name, Decl(exportCodeGen.ts, 49, 13)) + + module M { +>M : Symbol(M, Decl(exportCodeGen.ts, 49, 28)) + + var x = 42; +>x : Symbol(x, Decl(exportCodeGen.ts, 51, 11)) + } +} diff --git a/tests/baselines/reference/exportCodeGen.types b/tests/baselines/reference/exportCodeGen.types index 89cb16fdf4c..e08678a76da 100644 --- a/tests/baselines/reference/exportCodeGen.types +++ b/tests/baselines/reference/exportCodeGen.types @@ -7,6 +7,7 @@ module A { export var x = 12; >x : number +>12 : number function lt12() { >lt12 : () => boolean @@ -14,6 +15,7 @@ module A { return x < 12; >x < 12 : boolean >x : number +>12 : number } } @@ -23,6 +25,7 @@ module B { var x = 12; >x : number +>12 : number function lt12() { >lt12 : () => boolean @@ -30,6 +33,7 @@ module B { return x < 12; >x < 12 : boolean >x : number +>12 : number } } @@ -41,6 +45,7 @@ module C { >no : () => boolean return false; +>false : boolean } } @@ -52,6 +57,7 @@ module D { >yes : () => boolean return true; +>true : boolean } } @@ -79,6 +85,7 @@ module E { export var x = 42; >x : number +>42 : number } } @@ -107,5 +114,6 @@ module F { var x = 42; >x : number +>42 : number } } diff --git a/tests/baselines/reference/exportDefaultForNonInstantiatedModule.symbols b/tests/baselines/reference/exportDefaultForNonInstantiatedModule.symbols new file mode 100644 index 00000000000..eb0836fd519 --- /dev/null +++ b/tests/baselines/reference/exportDefaultForNonInstantiatedModule.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/exportDefaultForNonInstantiatedModule.ts === + +module m { +>m : Symbol(m, Decl(exportDefaultForNonInstantiatedModule.ts, 0, 0)) + + export interface foo { +>foo : Symbol(foo, Decl(exportDefaultForNonInstantiatedModule.ts, 1, 10)) + } +} +// Should not be emitted +export default m; +>m : Symbol(m, Decl(exportDefaultForNonInstantiatedModule.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportDefaultForNonInstantiatedModule.types b/tests/baselines/reference/exportDefaultForNonInstantiatedModule.types index 940bb44658e..6ec8f9868a3 100644 --- a/tests/baselines/reference/exportDefaultForNonInstantiatedModule.types +++ b/tests/baselines/reference/exportDefaultForNonInstantiatedModule.types @@ -1,7 +1,7 @@ === tests/cases/compiler/exportDefaultForNonInstantiatedModule.ts === module m { ->m : unknown +>m : any export interface foo { >foo : foo @@ -9,5 +9,5 @@ module m { } // Should not be emitted export default m; ->m : unknown +>m : any diff --git a/tests/baselines/reference/exportEqualCallable.symbols b/tests/baselines/reference/exportEqualCallable.symbols new file mode 100644 index 00000000000..df1c6da8c7b --- /dev/null +++ b/tests/baselines/reference/exportEqualCallable.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/exportEqualCallable_1.ts === +/// +import connect = require('exportEqualCallable_0'); +>connect : Symbol(connect, Decl(exportEqualCallable_1.ts, 0, 0)) + +connect(); +>connect : Symbol(connect, Decl(exportEqualCallable_1.ts, 0, 0)) + +=== tests/cases/compiler/exportEqualCallable_0.ts === + +var server: { +>server : Symbol(server, Decl(exportEqualCallable_0.ts, 1, 3)) + + (): any; +}; +export = server; +>server : Symbol(server, Decl(exportEqualCallable_0.ts, 1, 3)) + diff --git a/tests/baselines/reference/exportEqualNamespaces.symbols b/tests/baselines/reference/exportEqualNamespaces.symbols new file mode 100644 index 00000000000..f6f0767d414 --- /dev/null +++ b/tests/baselines/reference/exportEqualNamespaces.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/exportEqualNamespaces.ts === +declare module server { +>server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) + + interface Server extends Object { } +>Server : Symbol(Server, Decl(exportEqualNamespaces.ts, 0, 23)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +interface server { +>server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) + + (): server.Server; +>server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) +>Server : Symbol(server.Server, Decl(exportEqualNamespaces.ts, 0, 23)) + + startTime: Date; +>startTime : Symbol(startTime, Decl(exportEqualNamespaces.ts, 5, 22)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var x = 5; +>x : Symbol(x, Decl(exportEqualNamespaces.ts, 9, 3)) + +var server = new Date(); +>server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +export = server; +>server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) + diff --git a/tests/baselines/reference/exportEqualNamespaces.types b/tests/baselines/reference/exportEqualNamespaces.types index 0f3091c1b8a..0e27102c015 100644 --- a/tests/baselines/reference/exportEqualNamespaces.types +++ b/tests/baselines/reference/exportEqualNamespaces.types @@ -11,7 +11,7 @@ interface server { >server : server (): server.Server; ->server : unknown +>server : any >Server : server.Server startTime: Date; @@ -21,6 +21,7 @@ interface server { var x = 5; >x : number +>5 : number var server = new Date(); >server : Date diff --git a/tests/baselines/reference/exportImport.symbols b/tests/baselines/reference/exportImport.symbols new file mode 100644 index 00000000000..02132338834 --- /dev/null +++ b/tests/baselines/reference/exportImport.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/consumer.ts === +import e = require('./exporter'); +>e : Symbol(e, Decl(consumer.ts, 0, 0)) + +export function w(): e.w { // Should be OK +>w : Symbol(w, Decl(consumer.ts, 0, 33)) +>e : Symbol(e, Decl(consumer.ts, 0, 0)) +>w : Symbol(e.w, Decl(exporter.ts, 0, 0)) + + return new e.w(); +>e.w : Symbol(e.w, Decl(exporter.ts, 0, 0)) +>e : Symbol(e, Decl(consumer.ts, 0, 0)) +>w : Symbol(e.w, Decl(exporter.ts, 0, 0)) +} +=== tests/cases/compiler/w1.ts === + +export = Widget1 +>Widget1 : Symbol(Widget1, Decl(w1.ts, 1, 16)) + +class Widget1 { name = 'one'; } +>Widget1 : Symbol(Widget1, Decl(w1.ts, 1, 16)) +>name : Symbol(name, Decl(w1.ts, 2, 15)) + +=== tests/cases/compiler/exporter.ts === +export import w = require('./w1'); +>w : Symbol(w, Decl(exporter.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportImport.types b/tests/baselines/reference/exportImport.types index 9899103d779..a6361d3cbac 100644 --- a/tests/baselines/reference/exportImport.types +++ b/tests/baselines/reference/exportImport.types @@ -4,7 +4,7 @@ import e = require('./exporter'); export function w(): e.w { // Should be OK >w : () => e.w ->e : unknown +>e : any >w : e.w return new e.w(); @@ -21,6 +21,7 @@ export = Widget1 class Widget1 { name = 'one'; } >Widget1 : Widget1 >name : string +>'one' : string === tests/cases/compiler/exporter.ts === export import w = require('./w1'); diff --git a/tests/baselines/reference/exportImportAlias.symbols b/tests/baselines/reference/exportImportAlias.symbols new file mode 100644 index 00000000000..131f53919ab --- /dev/null +++ b/tests/baselines/reference/exportImportAlias.symbols @@ -0,0 +1,171 @@ +=== tests/cases/conformance/internalModules/importDeclarations/exportImportAlias.ts === +// expect no errors here + +module A { +>A : Symbol(A, Decl(exportImportAlias.ts, 0, 0)) + + export var x = 'hello world' +>x : Symbol(x, Decl(exportImportAlias.ts, 4, 14)) + + export class Point { +>Point : Symbol(Point, Decl(exportImportAlias.ts, 4, 32)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(exportImportAlias.ts, 6, 20)) +>y : Symbol(y, Decl(exportImportAlias.ts, 6, 37)) + } + export module B { +>B : Symbol(B, Decl(exportImportAlias.ts, 7, 5)) + + export interface Id { +>Id : Symbol(Id, Decl(exportImportAlias.ts, 8, 21)) + + name: string; +>name : Symbol(name, Decl(exportImportAlias.ts, 9, 29)) + } + } +} + +module C { +>C : Symbol(C, Decl(exportImportAlias.ts, 13, 1)) + + export import a = A; +>a : Symbol(a, Decl(exportImportAlias.ts, 15, 10)) +>A : Symbol(a, Decl(exportImportAlias.ts, 0, 0)) +} + +var a: string = C.a.x; +>a : Symbol(a, Decl(exportImportAlias.ts, 19, 3)) +>C.a.x : Symbol(A.x, Decl(exportImportAlias.ts, 4, 14)) +>C.a : Symbol(C.a, Decl(exportImportAlias.ts, 15, 10)) +>C : Symbol(C, Decl(exportImportAlias.ts, 13, 1)) +>a : Symbol(C.a, Decl(exportImportAlias.ts, 15, 10)) +>x : Symbol(A.x, Decl(exportImportAlias.ts, 4, 14)) + +var b: { x: number; y: number; } = new C.a.Point(0, 0); +>b : Symbol(b, Decl(exportImportAlias.ts, 20, 3)) +>x : Symbol(x, Decl(exportImportAlias.ts, 20, 8)) +>y : Symbol(y, Decl(exportImportAlias.ts, 20, 19)) +>C.a.Point : Symbol(A.Point, Decl(exportImportAlias.ts, 4, 32)) +>C.a : Symbol(C.a, Decl(exportImportAlias.ts, 15, 10)) +>C : Symbol(C, Decl(exportImportAlias.ts, 13, 1)) +>a : Symbol(C.a, Decl(exportImportAlias.ts, 15, 10)) +>Point : Symbol(A.Point, Decl(exportImportAlias.ts, 4, 32)) + +var c: { name: string }; +>c : Symbol(c, Decl(exportImportAlias.ts, 21, 3), Decl(exportImportAlias.ts, 22, 3)) +>name : Symbol(name, Decl(exportImportAlias.ts, 21, 8)) + +var c: C.a.B.Id; +>c : Symbol(c, Decl(exportImportAlias.ts, 21, 3), Decl(exportImportAlias.ts, 22, 3)) +>C : Symbol(C, Decl(exportImportAlias.ts, 13, 1)) +>a : Symbol(C.a, Decl(exportImportAlias.ts, 15, 10)) +>B : Symbol(A.B, Decl(exportImportAlias.ts, 7, 5)) +>Id : Symbol(A.B.Id, Decl(exportImportAlias.ts, 8, 21)) + +module X { +>X : Symbol(X, Decl(exportImportAlias.ts, 22, 16)) + + export function Y() { +>Y : Symbol(Y, Decl(exportImportAlias.ts, 24, 10), Decl(exportImportAlias.ts, 27, 5)) + + return 42; + } + + export module Y { +>Y : Symbol(Y, Decl(exportImportAlias.ts, 24, 10), Decl(exportImportAlias.ts, 27, 5)) + + export class Point { +>Point : Symbol(Point, Decl(exportImportAlias.ts, 29, 21)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(exportImportAlias.ts, 31, 24)) +>y : Symbol(y, Decl(exportImportAlias.ts, 31, 41)) + } + } +} + +module Z { +>Z : Symbol(Z, Decl(exportImportAlias.ts, 34, 1)) + + // 'y' should be a fundule here + export import y = X.Y; +>y : Symbol(y, Decl(exportImportAlias.ts, 36, 10)) +>X : Symbol(X, Decl(exportImportAlias.ts, 22, 16)) +>Y : Symbol(y, Decl(exportImportAlias.ts, 24, 10), Decl(exportImportAlias.ts, 27, 5)) +} + +var m: number = Z.y(); +>m : Symbol(m, Decl(exportImportAlias.ts, 42, 3)) +>Z.y : Symbol(Z.y, Decl(exportImportAlias.ts, 36, 10)) +>Z : Symbol(Z, Decl(exportImportAlias.ts, 34, 1)) +>y : Symbol(Z.y, Decl(exportImportAlias.ts, 36, 10)) + +var n: { x: number; y: number; } = new Z.y.Point(0, 0); +>n : Symbol(n, Decl(exportImportAlias.ts, 43, 3)) +>x : Symbol(x, Decl(exportImportAlias.ts, 43, 8)) +>y : Symbol(y, Decl(exportImportAlias.ts, 43, 19)) +>Z.y.Point : Symbol(X.Y.Point, Decl(exportImportAlias.ts, 29, 21)) +>Z.y : Symbol(Z.y, Decl(exportImportAlias.ts, 36, 10)) +>Z : Symbol(Z, Decl(exportImportAlias.ts, 34, 1)) +>y : Symbol(Z.y, Decl(exportImportAlias.ts, 36, 10)) +>Point : Symbol(X.Y.Point, Decl(exportImportAlias.ts, 29, 21)) + +module K { +>K : Symbol(K, Decl(exportImportAlias.ts, 43, 55)) + + export class L { +>L : Symbol(L, Decl(exportImportAlias.ts, 45, 10), Decl(exportImportAlias.ts, 48, 5)) + + constructor(public name: string) { } +>name : Symbol(name, Decl(exportImportAlias.ts, 47, 20)) + } + + export module L { +>L : Symbol(L, Decl(exportImportAlias.ts, 45, 10), Decl(exportImportAlias.ts, 48, 5)) + + export var y = 12; +>y : Symbol(y, Decl(exportImportAlias.ts, 51, 18)) + + export interface Point { +>Point : Symbol(Point, Decl(exportImportAlias.ts, 51, 26)) + + x: number; +>x : Symbol(x, Decl(exportImportAlias.ts, 52, 32)) + + y: number; +>y : Symbol(y, Decl(exportImportAlias.ts, 53, 22)) + } + } +} + +module M { +>M : Symbol(M, Decl(exportImportAlias.ts, 57, 1)) + + export import D = K.L; +>D : Symbol(D, Decl(exportImportAlias.ts, 59, 10)) +>K : Symbol(K, Decl(exportImportAlias.ts, 43, 55)) +>L : Symbol(D, Decl(exportImportAlias.ts, 45, 10), Decl(exportImportAlias.ts, 48, 5)) +} + +var o: { name: string }; +>o : Symbol(o, Decl(exportImportAlias.ts, 63, 3), Decl(exportImportAlias.ts, 64, 3)) +>name : Symbol(name, Decl(exportImportAlias.ts, 63, 8)) + +var o = new M.D('Hello'); +>o : Symbol(o, Decl(exportImportAlias.ts, 63, 3), Decl(exportImportAlias.ts, 64, 3)) +>M.D : Symbol(M.D, Decl(exportImportAlias.ts, 59, 10)) +>M : Symbol(M, Decl(exportImportAlias.ts, 57, 1)) +>D : Symbol(M.D, Decl(exportImportAlias.ts, 59, 10)) + +var p: { x: number; y: number; } +>p : Symbol(p, Decl(exportImportAlias.ts, 66, 3), Decl(exportImportAlias.ts, 67, 3)) +>x : Symbol(x, Decl(exportImportAlias.ts, 66, 8)) +>y : Symbol(y, Decl(exportImportAlias.ts, 66, 19)) + +var p: M.D.Point; +>p : Symbol(p, Decl(exportImportAlias.ts, 66, 3), Decl(exportImportAlias.ts, 67, 3)) +>M : Symbol(M, Decl(exportImportAlias.ts, 57, 1)) +>D : Symbol(M.D, Decl(exportImportAlias.ts, 59, 10)) +>Point : Symbol(K.L.Point, Decl(exportImportAlias.ts, 51, 26)) + diff --git a/tests/baselines/reference/exportImportAlias.types b/tests/baselines/reference/exportImportAlias.types index 0834d664861..f0c21d461bc 100644 --- a/tests/baselines/reference/exportImportAlias.types +++ b/tests/baselines/reference/exportImportAlias.types @@ -6,6 +6,7 @@ module A { export var x = 'hello world' >x : string +>'hello world' : string export class Point { >Point : Point @@ -15,7 +16,7 @@ module A { >y : number } export module B { ->B : unknown +>B : any export interface Id { >Id : Id @@ -52,6 +53,8 @@ var b: { x: number; y: number; } = new C.a.Point(0, 0); >C : typeof C >a : typeof A >Point : typeof A.Point +>0 : number +>0 : number var c: { name: string }; >c : { name: string; } @@ -59,9 +62,9 @@ var c: { name: string }; var c: C.a.B.Id; >c : { name: string; } ->C : unknown ->a : unknown ->B : unknown +>C : any +>a : any +>B : any >Id : A.B.Id module X { @@ -71,6 +74,7 @@ module X { >Y : typeof Y return 42; +>42 : number } export module Y { @@ -113,6 +117,8 @@ var n: { x: number; y: number; } = new Z.y.Point(0, 0); >Z : typeof Z >y : typeof X.Y >Point : typeof X.Y.Point +>0 : number +>0 : number module K { >K : typeof K @@ -129,6 +135,7 @@ module K { export var y = 12; >y : number +>12 : number export interface Point { >Point : Point @@ -161,6 +168,7 @@ var o = new M.D('Hello'); >M.D : typeof K.L >M : typeof M >D : typeof K.L +>'Hello' : string var p: { x: number; y: number; } >p : { x: number; y: number; } @@ -169,7 +177,7 @@ var p: { x: number; y: number; } var p: M.D.Point; >p : { x: number; y: number; } ->M : unknown ->D : unknown +>M : any +>D : any >Point : K.L.Point diff --git a/tests/baselines/reference/exportImportAndClodule.symbols b/tests/baselines/reference/exportImportAndClodule.symbols new file mode 100644 index 00000000000..23995243bf9 --- /dev/null +++ b/tests/baselines/reference/exportImportAndClodule.symbols @@ -0,0 +1,56 @@ +=== tests/cases/compiler/exportImportAndClodule.ts === +module K { +>K : Symbol(K, Decl(exportImportAndClodule.ts, 0, 0)) + + export class L { +>L : Symbol(L, Decl(exportImportAndClodule.ts, 0, 10), Decl(exportImportAndClodule.ts, 3, 5)) + + constructor(public name: string) { } +>name : Symbol(name, Decl(exportImportAndClodule.ts, 2, 20)) + } + export module L { +>L : Symbol(L, Decl(exportImportAndClodule.ts, 0, 10), Decl(exportImportAndClodule.ts, 3, 5)) + + export var y = 12; +>y : Symbol(y, Decl(exportImportAndClodule.ts, 5, 18)) + + export interface Point { +>Point : Symbol(Point, Decl(exportImportAndClodule.ts, 5, 26)) + + x: number; +>x : Symbol(x, Decl(exportImportAndClodule.ts, 6, 32)) + + y: number; +>y : Symbol(y, Decl(exportImportAndClodule.ts, 7, 22)) + } + } +} +module M { +>M : Symbol(M, Decl(exportImportAndClodule.ts, 11, 1)) + + export import D = K.L; +>D : Symbol(D, Decl(exportImportAndClodule.ts, 12, 10)) +>K : Symbol(K, Decl(exportImportAndClodule.ts, 0, 0)) +>L : Symbol(D, Decl(exportImportAndClodule.ts, 0, 10), Decl(exportImportAndClodule.ts, 3, 5)) +} +var o: { name: string }; +>o : Symbol(o, Decl(exportImportAndClodule.ts, 15, 3), Decl(exportImportAndClodule.ts, 16, 3)) +>name : Symbol(name, Decl(exportImportAndClodule.ts, 15, 8)) + +var o = new M.D('Hello'); +>o : Symbol(o, Decl(exportImportAndClodule.ts, 15, 3), Decl(exportImportAndClodule.ts, 16, 3)) +>M.D : Symbol(M.D, Decl(exportImportAndClodule.ts, 12, 10)) +>M : Symbol(M, Decl(exportImportAndClodule.ts, 11, 1)) +>D : Symbol(M.D, Decl(exportImportAndClodule.ts, 12, 10)) + +var p: { x: number; y: number; } +>p : Symbol(p, Decl(exportImportAndClodule.ts, 17, 3), Decl(exportImportAndClodule.ts, 18, 3)) +>x : Symbol(x, Decl(exportImportAndClodule.ts, 17, 8)) +>y : Symbol(y, Decl(exportImportAndClodule.ts, 17, 19)) + +var p: M.D.Point; +>p : Symbol(p, Decl(exportImportAndClodule.ts, 17, 3), Decl(exportImportAndClodule.ts, 18, 3)) +>M : Symbol(M, Decl(exportImportAndClodule.ts, 11, 1)) +>D : Symbol(M.D, Decl(exportImportAndClodule.ts, 12, 10)) +>Point : Symbol(K.L.Point, Decl(exportImportAndClodule.ts, 5, 26)) + diff --git a/tests/baselines/reference/exportImportAndClodule.types b/tests/baselines/reference/exportImportAndClodule.types index 7d233e72e77..36ca259666c 100644 --- a/tests/baselines/reference/exportImportAndClodule.types +++ b/tests/baselines/reference/exportImportAndClodule.types @@ -13,6 +13,7 @@ module K { export var y = 12; >y : number +>12 : number export interface Point { >Point : Point @@ -43,6 +44,7 @@ var o = new M.D('Hello'); >M.D : typeof K.L >M : typeof M >D : typeof K.L +>'Hello' : string var p: { x: number; y: number; } >p : { x: number; y: number; } @@ -51,7 +53,7 @@ var p: { x: number; y: number; } var p: M.D.Point; >p : { x: number; y: number; } ->M : unknown ->D : unknown +>M : any +>D : any >Point : K.L.Point diff --git a/tests/baselines/reference/exportImportMultipleFiles.symbols b/tests/baselines/reference/exportImportMultipleFiles.symbols new file mode 100644 index 00000000000..f0870cdf396 --- /dev/null +++ b/tests/baselines/reference/exportImportMultipleFiles.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/exportImportMultipleFiles_userCode.ts === +import lib = require('./exportImportMultipleFiles_library'); +>lib : Symbol(lib, Decl(exportImportMultipleFiles_userCode.ts, 0, 0)) + +lib.math.add(3, 4); // Shouldnt be error +>lib.math.add : Symbol(lib.math.add, Decl(exportImportMultipleFiles_math.ts, 0, 0)) +>lib.math : Symbol(lib.math, Decl(exportImportMultipleFiles_library.ts, 0, 0)) +>lib : Symbol(lib, Decl(exportImportMultipleFiles_userCode.ts, 0, 0)) +>math : Symbol(lib.math, Decl(exportImportMultipleFiles_library.ts, 0, 0)) +>add : Symbol(lib.math.add, Decl(exportImportMultipleFiles_math.ts, 0, 0)) + +=== tests/cases/compiler/exportImportMultipleFiles_math.ts === +export function add(a, b) { return a + b; } +>add : Symbol(add, Decl(exportImportMultipleFiles_math.ts, 0, 0)) +>a : Symbol(a, Decl(exportImportMultipleFiles_math.ts, 0, 20)) +>b : Symbol(b, Decl(exportImportMultipleFiles_math.ts, 0, 22)) +>a : Symbol(a, Decl(exportImportMultipleFiles_math.ts, 0, 20)) +>b : Symbol(b, Decl(exportImportMultipleFiles_math.ts, 0, 22)) + +=== tests/cases/compiler/exportImportMultipleFiles_library.ts === +export import math = require("exportImportMultipleFiles_math"); +>math : Symbol(math, Decl(exportImportMultipleFiles_library.ts, 0, 0)) + +math.add(3, 4); // OK +>math.add : Symbol(math.add, Decl(exportImportMultipleFiles_math.ts, 0, 0)) +>math : Symbol(math, Decl(exportImportMultipleFiles_library.ts, 0, 0)) +>add : Symbol(math.add, Decl(exportImportMultipleFiles_math.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportImportMultipleFiles.types b/tests/baselines/reference/exportImportMultipleFiles.types index adafcef2dba..6ac5e7641ea 100644 --- a/tests/baselines/reference/exportImportMultipleFiles.types +++ b/tests/baselines/reference/exportImportMultipleFiles.types @@ -9,6 +9,8 @@ lib.math.add(3, 4); // Shouldnt be error >lib : typeof lib >math : typeof lib.math >add : (a: any, b: any) => any +>3 : number +>4 : number === tests/cases/compiler/exportImportMultipleFiles_math.ts === export function add(a, b) { return a + b; } @@ -28,4 +30,6 @@ math.add(3, 4); // OK >math.add : (a: any, b: any) => any >math : typeof math >add : (a: any, b: any) => any +>3 : number +>4 : number diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.symbols b/tests/baselines/reference/exportImportNonInstantiatedModule.symbols new file mode 100644 index 00000000000..6e044368bfb --- /dev/null +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/exportImportNonInstantiatedModule.ts === +module A { +>A : Symbol(A, Decl(exportImportNonInstantiatedModule.ts, 0, 0)) + + export interface I { x: number } +>I : Symbol(I, Decl(exportImportNonInstantiatedModule.ts, 0, 10)) +>x : Symbol(x, Decl(exportImportNonInstantiatedModule.ts, 1, 24)) +} + +module B { +>B : Symbol(B, Decl(exportImportNonInstantiatedModule.ts, 2, 1)) + + export import A1 = A +>A1 : Symbol(A1, Decl(exportImportNonInstantiatedModule.ts, 4, 10)) +>A : Symbol(A1, Decl(exportImportNonInstantiatedModule.ts, 0, 0)) + +} + +var x: B.A1.I = { x: 1 }; +>x : Symbol(x, Decl(exportImportNonInstantiatedModule.ts, 9, 3)) +>B : Symbol(B, Decl(exportImportNonInstantiatedModule.ts, 2, 1)) +>A1 : Symbol(B.A1, Decl(exportImportNonInstantiatedModule.ts, 4, 10)) +>I : Symbol(A.I, Decl(exportImportNonInstantiatedModule.ts, 0, 10)) +>x : Symbol(x, Decl(exportImportNonInstantiatedModule.ts, 9, 17)) + diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.types b/tests/baselines/reference/exportImportNonInstantiatedModule.types index d1210cba6fe..0b1da72dad8 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.types @@ -1,6 +1,6 @@ === tests/cases/compiler/exportImportNonInstantiatedModule.ts === module A { ->A : unknown +>A : any export interface I { x: number } >I : I @@ -11,16 +11,17 @@ module B { >B : typeof B export import A1 = A ->A1 : unknown ->A : unknown +>A1 : any +>A : any } var x: B.A1.I = { x: 1 }; >x : A.I ->B : unknown ->A1 : unknown +>B : any +>A1 : any >I : A.I >{ x: 1 } : { x: number; } >x : number +>1 : number diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule2.symbols b/tests/baselines/reference/exportImportNonInstantiatedModule2.symbols new file mode 100644 index 00000000000..02ccf97b161 --- /dev/null +++ b/tests/baselines/reference/exportImportNonInstantiatedModule2.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/consumer.ts === +import e = require('./exporter'); +>e : Symbol(e, Decl(consumer.ts, 0, 0)) + +export function w(): e.w { // Should be OK +>w : Symbol(w, Decl(consumer.ts, 0, 33)) +>e : Symbol(e, Decl(consumer.ts, 0, 0)) +>w : Symbol(e.w, Decl(exporter.ts, 0, 0)) + + return {name: 'value' }; +>name : Symbol(name, Decl(consumer.ts, 3, 12)) +} +=== tests/cases/compiler/w1.ts === + +export = Widget1 +>Widget1 : Symbol(Widget1, Decl(w1.ts, 1, 16)) + +interface Widget1 { name: string; } +>Widget1 : Symbol(Widget1, Decl(w1.ts, 1, 16)) +>name : Symbol(name, Decl(w1.ts, 2, 19)) + +=== tests/cases/compiler/exporter.ts === +export import w = require('./w1'); +>w : Symbol(w, Decl(exporter.ts, 0, 0)) + diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule2.types b/tests/baselines/reference/exportImportNonInstantiatedModule2.types index c11eac715a9..34f0810c12d 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule2.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule2.types @@ -4,12 +4,13 @@ import e = require('./exporter'); export function w(): e.w { // Should be OK >w : () => e.w ->e : unknown +>e : any >w : e.w return {name: 'value' }; >{name: 'value' } : { name: string; } >name : string +>'value' : string } === tests/cases/compiler/w1.ts === @@ -22,5 +23,5 @@ interface Widget1 { name: string; } === tests/cases/compiler/exporter.ts === export import w = require('./w1'); ->w : unknown +>w : any diff --git a/tests/baselines/reference/exportPrivateType.symbols b/tests/baselines/reference/exportPrivateType.symbols new file mode 100644 index 00000000000..ecb71869b39 --- /dev/null +++ b/tests/baselines/reference/exportPrivateType.symbols @@ -0,0 +1,70 @@ +=== tests/cases/compiler/exportPrivateType.ts === +module foo { +>foo : Symbol(foo, Decl(exportPrivateType.ts, 0, 0)) + + class C1 { +>C1 : Symbol(C1, Decl(exportPrivateType.ts, 0, 12)) + + x: string; +>x : Symbol(x, Decl(exportPrivateType.ts, 1, 14)) + + y: C1; +>y : Symbol(y, Decl(exportPrivateType.ts, 2, 18)) +>C1 : Symbol(C1, Decl(exportPrivateType.ts, 0, 12)) + } + + class C2 { +>C2 : Symbol(C2, Decl(exportPrivateType.ts, 4, 5)) + + test() { return true; } +>test : Symbol(test, Decl(exportPrivateType.ts, 6, 14)) + } + + interface I1 { +>I1 : Symbol(I1, Decl(exportPrivateType.ts, 8, 5)) + + (a: string, b: string): string; +>a : Symbol(a, Decl(exportPrivateType.ts, 11, 9)) +>b : Symbol(b, Decl(exportPrivateType.ts, 11, 19)) + + (x: number, y: number): I1; +>x : Symbol(x, Decl(exportPrivateType.ts, 12, 9)) +>y : Symbol(y, Decl(exportPrivateType.ts, 12, 19)) +>I1 : Symbol(I1, Decl(exportPrivateType.ts, 8, 5)) + } + + interface I2 { +>I2 : Symbol(I2, Decl(exportPrivateType.ts, 13, 5)) + + x: string; +>x : Symbol(x, Decl(exportPrivateType.ts, 15, 18)) + + y: number; +>y : Symbol(y, Decl(exportPrivateType.ts, 16, 18)) + } + + // None of the types are exported, so per section 10.3, should all be errors + export var e: C1; +>e : Symbol(e, Decl(exportPrivateType.ts, 21, 14)) +>C1 : Symbol(C1, Decl(exportPrivateType.ts, 0, 12)) + + export var f: I1; +>f : Symbol(f, Decl(exportPrivateType.ts, 22, 14)) +>I1 : Symbol(I1, Decl(exportPrivateType.ts, 8, 5)) + + export var g: C2; +>g : Symbol(g, Decl(exportPrivateType.ts, 23, 14)) +>C2 : Symbol(C2, Decl(exportPrivateType.ts, 4, 5)) + + export var h: I2; +>h : Symbol(h, Decl(exportPrivateType.ts, 24, 14)) +>I2 : Symbol(I2, Decl(exportPrivateType.ts, 13, 5)) +} + +var y = foo.g; // Exported variable 'y' has or is using private type 'foo.C2'. +>y : Symbol(y, Decl(exportPrivateType.ts, 27, 3)) +>foo.g : Symbol(foo.g, Decl(exportPrivateType.ts, 23, 14)) +>foo : Symbol(foo, Decl(exportPrivateType.ts, 0, 0)) +>g : Symbol(foo.g, Decl(exportPrivateType.ts, 23, 14)) + + diff --git a/tests/baselines/reference/exportPrivateType.types b/tests/baselines/reference/exportPrivateType.types index 87751b273a7..a91577c2b9c 100644 --- a/tests/baselines/reference/exportPrivateType.types +++ b/tests/baselines/reference/exportPrivateType.types @@ -18,6 +18,7 @@ module foo { test() { return true; } >test : () => boolean +>true : boolean } interface I1 { diff --git a/tests/baselines/reference/exportVisibility.symbols b/tests/baselines/reference/exportVisibility.symbols new file mode 100644 index 00000000000..05785abd4f0 --- /dev/null +++ b/tests/baselines/reference/exportVisibility.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/exportVisibility.ts === +export class Foo { +>Foo : Symbol(Foo, Decl(exportVisibility.ts, 0, 0)) +} + +export var foo = new Foo(); +>foo : Symbol(foo, Decl(exportVisibility.ts, 3, 10)) +>Foo : Symbol(Foo, Decl(exportVisibility.ts, 0, 0)) + +export function test(foo: Foo) { +>test : Symbol(test, Decl(exportVisibility.ts, 3, 27)) +>foo : Symbol(foo, Decl(exportVisibility.ts, 5, 21)) +>Foo : Symbol(Foo, Decl(exportVisibility.ts, 0, 0)) + + return true; +} + diff --git a/tests/baselines/reference/exportVisibility.types b/tests/baselines/reference/exportVisibility.types index 59936828275..cf1e092473e 100644 --- a/tests/baselines/reference/exportVisibility.types +++ b/tests/baselines/reference/exportVisibility.types @@ -14,5 +14,6 @@ export function test(foo: Foo) { >Foo : Foo return true; +>true : boolean } diff --git a/tests/baselines/reference/exportedInterfaceInaccessibleInCallbackInModule.symbols b/tests/baselines/reference/exportedInterfaceInaccessibleInCallbackInModule.symbols new file mode 100644 index 00000000000..3127de7b6a2 --- /dev/null +++ b/tests/baselines/reference/exportedInterfaceInaccessibleInCallbackInModule.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/exportedInterfaceInaccessibleInCallbackInModule.ts === +export interface ProgressCallback { +>ProgressCallback : Symbol(ProgressCallback, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 0, 0)) + + (progress:any):any; +>progress : Symbol(progress, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 1, 2)) +} + +// --- Generic promise +export declare class TPromise { +>TPromise : Symbol(TPromise, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 2, 1)) +>V : Symbol(V, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 5, 30)) + + constructor(init:(complete: (value:V)=>void, error:(err:any)=>void, progress:ProgressCallback)=>void, oncancel?: any); +>init : Symbol(init, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 13)) +>complete : Symbol(complete, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 19)) +>value : Symbol(value, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 30)) +>V : Symbol(V, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 5, 30)) +>error : Symbol(error, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 45)) +>err : Symbol(err, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 53)) +>progress : Symbol(progress, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 68)) +>ProgressCallback : Symbol(ProgressCallback, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 0, 0)) +>oncancel : Symbol(oncancel, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 102)) + + // removing this method fixes the error squiggle..... + public then(success?: (value:V)=>TPromise, error?: (err:any)=>TPromise, progress?:ProgressCallback): TPromise; +>then : Symbol(then, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 7, 119)) +>U : Symbol(U, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 13)) +>success : Symbol(success, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 16)) +>value : Symbol(value, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 27)) +>V : Symbol(V, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 5, 30)) +>TPromise : Symbol(TPromise, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 2, 1)) +>U : Symbol(U, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 13)) +>error : Symbol(error, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 49)) +>err : Symbol(err, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 59)) +>TPromise : Symbol(TPromise, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 2, 1)) +>U : Symbol(U, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 13)) +>progress : Symbol(progress, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 81)) +>ProgressCallback : Symbol(ProgressCallback, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 0, 0)) +>TPromise : Symbol(TPromise, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 2, 1)) +>U : Symbol(U, Decl(exportedInterfaceInaccessibleInCallbackInModule.ts, 10, 13)) +} diff --git a/tests/baselines/reference/exportedVariable1.symbols b/tests/baselines/reference/exportedVariable1.symbols new file mode 100644 index 00000000000..96c4b0210ba --- /dev/null +++ b/tests/baselines/reference/exportedVariable1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/exportedVariable1.ts === +export var foo = {name: "Bill"}; +>foo : Symbol(foo, Decl(exportedVariable1.ts, 0, 10)) +>name : Symbol(name, Decl(exportedVariable1.ts, 0, 18)) + +var upper = foo.name.toUpperCase(); +>upper : Symbol(upper, Decl(exportedVariable1.ts, 1, 3)) +>foo.name.toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) +>foo.name : Symbol(name, Decl(exportedVariable1.ts, 0, 18)) +>foo : Symbol(foo, Decl(exportedVariable1.ts, 0, 10)) +>name : Symbol(name, Decl(exportedVariable1.ts, 0, 18)) +>toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, 405, 32)) + diff --git a/tests/baselines/reference/exportedVariable1.types b/tests/baselines/reference/exportedVariable1.types index a02cbc5b36a..fa7017fefa8 100644 --- a/tests/baselines/reference/exportedVariable1.types +++ b/tests/baselines/reference/exportedVariable1.types @@ -3,6 +3,7 @@ export var foo = {name: "Bill"}; >foo : { name: string; } >{name: "Bill"} : { name: string; } >name : string +>"Bill" : string var upper = foo.name.toUpperCase(); >upper : string diff --git a/tests/baselines/reference/exportsAndImports1-amd.symbols b/tests/baselines/reference/exportsAndImports1-amd.symbols new file mode 100644 index 00000000000..dc90c8c7bf9 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports1-amd.symbols @@ -0,0 +1,101 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +var v = 1; +>v : Symbol(v, Decl(t1.ts, 1, 3)) + +function f() { } +>f : Symbol(f, Decl(t1.ts, 1, 10)) + +class C { +>C : Symbol(C, Decl(t1.ts, 2, 16)) +} +interface I { +>I : Symbol(I, Decl(t1.ts, 4, 1)) +} +enum E { +>E : Symbol(E, Decl(t1.ts, 6, 1)) + + A, B, C +>A : Symbol(E.A, Decl(t1.ts, 7, 8)) +>B : Symbol(E.B, Decl(t1.ts, 8, 6)) +>C : Symbol(E.C, Decl(t1.ts, 8, 9)) +} +const enum D { +>D : Symbol(D, Decl(t1.ts, 9, 1)) + + A, B, C +>A : Symbol(D.A, Decl(t1.ts, 10, 14)) +>B : Symbol(D.B, Decl(t1.ts, 11, 6)) +>C : Symbol(D.C, Decl(t1.ts, 11, 9)) +} +module M { +>M : Symbol(M, Decl(t1.ts, 12, 1)) + + export var x; +>x : Symbol(x, Decl(t1.ts, 14, 14)) +} +module N { +>N : Symbol(N, Decl(t1.ts, 15, 1)) + + export interface I { +>I : Symbol(I, Decl(t1.ts, 16, 10)) + } +} +type T = number; +>T : Symbol(T, Decl(t1.ts, 19, 1)) + +import a = M.x; +>a : Symbol(a, Decl(t1.ts, 20, 16)) +>M : Symbol(M, Decl(t1.ts, 12, 1)) +>x : Symbol(a, Decl(t1.ts, 14, 14)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t1.ts, 23, 8)) +>f : Symbol(f, Decl(t1.ts, 23, 11)) +>C : Symbol(C, Decl(t1.ts, 23, 14)) +>I : Symbol(I, Decl(t1.ts, 23, 17)) +>E : Symbol(E, Decl(t1.ts, 23, 20)) +>D : Symbol(D, Decl(t1.ts, 23, 23)) +>M : Symbol(M, Decl(t1.ts, 23, 26)) +>N : Symbol(N, Decl(t1.ts, 23, 29)) +>T : Symbol(T, Decl(t1.ts, 23, 32)) +>a : Symbol(a, Decl(t1.ts, 23, 35)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { v, f, C, I, E, D, M, N, T, a } from "./t1"; +>v : Symbol(v, Decl(t2.ts, 0, 8)) +>f : Symbol(f, Decl(t2.ts, 0, 11)) +>C : Symbol(C, Decl(t2.ts, 0, 14)) +>I : Symbol(I, Decl(t2.ts, 0, 17)) +>E : Symbol(E, Decl(t2.ts, 0, 20)) +>D : Symbol(D, Decl(t2.ts, 0, 23)) +>M : Symbol(M, Decl(t2.ts, 0, 26)) +>N : Symbol(N, Decl(t2.ts, 0, 29)) +>T : Symbol(T, Decl(t2.ts, 0, 32)) +>a : Symbol(a, Decl(t2.ts, 0, 35)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { v, f, C, I, E, D, M, N, T, a } from "./t1"; +>v : Symbol(v, Decl(t3.ts, 0, 8)) +>f : Symbol(f, Decl(t3.ts, 0, 11)) +>C : Symbol(C, Decl(t3.ts, 0, 14)) +>I : Symbol(I, Decl(t3.ts, 0, 17)) +>E : Symbol(E, Decl(t3.ts, 0, 20)) +>D : Symbol(D, Decl(t3.ts, 0, 23)) +>M : Symbol(M, Decl(t3.ts, 0, 26)) +>N : Symbol(N, Decl(t3.ts, 0, 29)) +>T : Symbol(T, Decl(t3.ts, 0, 32)) +>a : Symbol(a, Decl(t3.ts, 0, 35)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t3.ts, 1, 8)) +>f : Symbol(f, Decl(t3.ts, 1, 11)) +>C : Symbol(C, Decl(t3.ts, 1, 14)) +>I : Symbol(I, Decl(t3.ts, 1, 17)) +>E : Symbol(E, Decl(t3.ts, 1, 20)) +>D : Symbol(D, Decl(t3.ts, 1, 23)) +>M : Symbol(M, Decl(t3.ts, 1, 26)) +>N : Symbol(N, Decl(t3.ts, 1, 29)) +>T : Symbol(T, Decl(t3.ts, 1, 32)) +>a : Symbol(a, Decl(t3.ts, 1, 35)) + diff --git a/tests/baselines/reference/exportsAndImports1-amd.types b/tests/baselines/reference/exportsAndImports1-amd.types index 0b35b04e22e..4ba83121541 100644 --- a/tests/baselines/reference/exportsAndImports1-amd.types +++ b/tests/baselines/reference/exportsAndImports1-amd.types @@ -2,6 +2,7 @@ var v = 1; >v : number +>1 : number function f() { } >f : () => void @@ -35,7 +36,7 @@ module M { >x : any } module N { ->N : unknown +>N : any export interface I { >I : I @@ -53,12 +54,12 @@ export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any === tests/cases/conformance/es6/modules/t2.ts === @@ -66,12 +67,12 @@ export { v, f, C, I, E, D, M, N, T, a } from "./t1"; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any === tests/cases/conformance/es6/modules/t3.ts === @@ -79,23 +80,23 @@ import { v, f, C, I, E, D, M, N, T, a } from "./t1"; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any diff --git a/tests/baselines/reference/exportsAndImports1.symbols b/tests/baselines/reference/exportsAndImports1.symbols new file mode 100644 index 00000000000..dc90c8c7bf9 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports1.symbols @@ -0,0 +1,101 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +var v = 1; +>v : Symbol(v, Decl(t1.ts, 1, 3)) + +function f() { } +>f : Symbol(f, Decl(t1.ts, 1, 10)) + +class C { +>C : Symbol(C, Decl(t1.ts, 2, 16)) +} +interface I { +>I : Symbol(I, Decl(t1.ts, 4, 1)) +} +enum E { +>E : Symbol(E, Decl(t1.ts, 6, 1)) + + A, B, C +>A : Symbol(E.A, Decl(t1.ts, 7, 8)) +>B : Symbol(E.B, Decl(t1.ts, 8, 6)) +>C : Symbol(E.C, Decl(t1.ts, 8, 9)) +} +const enum D { +>D : Symbol(D, Decl(t1.ts, 9, 1)) + + A, B, C +>A : Symbol(D.A, Decl(t1.ts, 10, 14)) +>B : Symbol(D.B, Decl(t1.ts, 11, 6)) +>C : Symbol(D.C, Decl(t1.ts, 11, 9)) +} +module M { +>M : Symbol(M, Decl(t1.ts, 12, 1)) + + export var x; +>x : Symbol(x, Decl(t1.ts, 14, 14)) +} +module N { +>N : Symbol(N, Decl(t1.ts, 15, 1)) + + export interface I { +>I : Symbol(I, Decl(t1.ts, 16, 10)) + } +} +type T = number; +>T : Symbol(T, Decl(t1.ts, 19, 1)) + +import a = M.x; +>a : Symbol(a, Decl(t1.ts, 20, 16)) +>M : Symbol(M, Decl(t1.ts, 12, 1)) +>x : Symbol(a, Decl(t1.ts, 14, 14)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t1.ts, 23, 8)) +>f : Symbol(f, Decl(t1.ts, 23, 11)) +>C : Symbol(C, Decl(t1.ts, 23, 14)) +>I : Symbol(I, Decl(t1.ts, 23, 17)) +>E : Symbol(E, Decl(t1.ts, 23, 20)) +>D : Symbol(D, Decl(t1.ts, 23, 23)) +>M : Symbol(M, Decl(t1.ts, 23, 26)) +>N : Symbol(N, Decl(t1.ts, 23, 29)) +>T : Symbol(T, Decl(t1.ts, 23, 32)) +>a : Symbol(a, Decl(t1.ts, 23, 35)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { v, f, C, I, E, D, M, N, T, a } from "./t1"; +>v : Symbol(v, Decl(t2.ts, 0, 8)) +>f : Symbol(f, Decl(t2.ts, 0, 11)) +>C : Symbol(C, Decl(t2.ts, 0, 14)) +>I : Symbol(I, Decl(t2.ts, 0, 17)) +>E : Symbol(E, Decl(t2.ts, 0, 20)) +>D : Symbol(D, Decl(t2.ts, 0, 23)) +>M : Symbol(M, Decl(t2.ts, 0, 26)) +>N : Symbol(N, Decl(t2.ts, 0, 29)) +>T : Symbol(T, Decl(t2.ts, 0, 32)) +>a : Symbol(a, Decl(t2.ts, 0, 35)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { v, f, C, I, E, D, M, N, T, a } from "./t1"; +>v : Symbol(v, Decl(t3.ts, 0, 8)) +>f : Symbol(f, Decl(t3.ts, 0, 11)) +>C : Symbol(C, Decl(t3.ts, 0, 14)) +>I : Symbol(I, Decl(t3.ts, 0, 17)) +>E : Symbol(E, Decl(t3.ts, 0, 20)) +>D : Symbol(D, Decl(t3.ts, 0, 23)) +>M : Symbol(M, Decl(t3.ts, 0, 26)) +>N : Symbol(N, Decl(t3.ts, 0, 29)) +>T : Symbol(T, Decl(t3.ts, 0, 32)) +>a : Symbol(a, Decl(t3.ts, 0, 35)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t3.ts, 1, 8)) +>f : Symbol(f, Decl(t3.ts, 1, 11)) +>C : Symbol(C, Decl(t3.ts, 1, 14)) +>I : Symbol(I, Decl(t3.ts, 1, 17)) +>E : Symbol(E, Decl(t3.ts, 1, 20)) +>D : Symbol(D, Decl(t3.ts, 1, 23)) +>M : Symbol(M, Decl(t3.ts, 1, 26)) +>N : Symbol(N, Decl(t3.ts, 1, 29)) +>T : Symbol(T, Decl(t3.ts, 1, 32)) +>a : Symbol(a, Decl(t3.ts, 1, 35)) + diff --git a/tests/baselines/reference/exportsAndImports1.types b/tests/baselines/reference/exportsAndImports1.types index 0b35b04e22e..4ba83121541 100644 --- a/tests/baselines/reference/exportsAndImports1.types +++ b/tests/baselines/reference/exportsAndImports1.types @@ -2,6 +2,7 @@ var v = 1; >v : number +>1 : number function f() { } >f : () => void @@ -35,7 +36,7 @@ module M { >x : any } module N { ->N : unknown +>N : any export interface I { >I : I @@ -53,12 +54,12 @@ export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any === tests/cases/conformance/es6/modules/t2.ts === @@ -66,12 +67,12 @@ export { v, f, C, I, E, D, M, N, T, a } from "./t1"; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any === tests/cases/conformance/es6/modules/t3.ts === @@ -79,23 +80,23 @@ import { v, f, C, I, E, D, M, N, T, a } from "./t1"; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any diff --git a/tests/baselines/reference/exportsAndImports2-amd.symbols b/tests/baselines/reference/exportsAndImports2-amd.symbols new file mode 100644 index 00000000000..8b53794abae --- /dev/null +++ b/tests/baselines/reference/exportsAndImports2-amd.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +export var x = "x"; +>x : Symbol(x, Decl(t1.ts, 1, 10)) + +export var y = "y"; +>y : Symbol(y, Decl(t1.ts, 2, 10)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { x as y, y as x } from "./t1"; +>x : Symbol(y, Decl(t2.ts, 0, 8)) +>y : Symbol(y, Decl(t2.ts, 0, 8)) +>y : Symbol(x, Decl(t2.ts, 0, 16)) +>x : Symbol(x, Decl(t2.ts, 0, 16)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { x, y } from "./t1"; +>x : Symbol(x, Decl(t3.ts, 0, 8)) +>y : Symbol(y, Decl(t3.ts, 0, 11)) + +export { x as y, y as x }; +>x : Symbol(y, Decl(t3.ts, 1, 8)) +>y : Symbol(y, Decl(t3.ts, 1, 8)) +>y : Symbol(x, Decl(t3.ts, 1, 16)) +>x : Symbol(x, Decl(t3.ts, 1, 16)) + diff --git a/tests/baselines/reference/exportsAndImports2-amd.types b/tests/baselines/reference/exportsAndImports2-amd.types index ebfc097da5a..32de763c567 100644 --- a/tests/baselines/reference/exportsAndImports2-amd.types +++ b/tests/baselines/reference/exportsAndImports2-amd.types @@ -2,9 +2,11 @@ export var x = "x"; >x : string +>"x" : string export var y = "y"; >y : string +>"y" : string === tests/cases/conformance/es6/modules/t2.ts === export { x as y, y as x } from "./t1"; diff --git a/tests/baselines/reference/exportsAndImports2.symbols b/tests/baselines/reference/exportsAndImports2.symbols new file mode 100644 index 00000000000..8b53794abae --- /dev/null +++ b/tests/baselines/reference/exportsAndImports2.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +export var x = "x"; +>x : Symbol(x, Decl(t1.ts, 1, 10)) + +export var y = "y"; +>y : Symbol(y, Decl(t1.ts, 2, 10)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { x as y, y as x } from "./t1"; +>x : Symbol(y, Decl(t2.ts, 0, 8)) +>y : Symbol(y, Decl(t2.ts, 0, 8)) +>y : Symbol(x, Decl(t2.ts, 0, 16)) +>x : Symbol(x, Decl(t2.ts, 0, 16)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { x, y } from "./t1"; +>x : Symbol(x, Decl(t3.ts, 0, 8)) +>y : Symbol(y, Decl(t3.ts, 0, 11)) + +export { x as y, y as x }; +>x : Symbol(y, Decl(t3.ts, 1, 8)) +>y : Symbol(y, Decl(t3.ts, 1, 8)) +>y : Symbol(x, Decl(t3.ts, 1, 16)) +>x : Symbol(x, Decl(t3.ts, 1, 16)) + diff --git a/tests/baselines/reference/exportsAndImports2.types b/tests/baselines/reference/exportsAndImports2.types index ebfc097da5a..32de763c567 100644 --- a/tests/baselines/reference/exportsAndImports2.types +++ b/tests/baselines/reference/exportsAndImports2.types @@ -2,9 +2,11 @@ export var x = "x"; >x : string +>"x" : string export var y = "y"; >y : string +>"y" : string === tests/cases/conformance/es6/modules/t2.ts === export { x as y, y as x } from "./t1"; diff --git a/tests/baselines/reference/exportsAndImports3-amd.symbols b/tests/baselines/reference/exportsAndImports3-amd.symbols new file mode 100644 index 00000000000..4ab418a9bef --- /dev/null +++ b/tests/baselines/reference/exportsAndImports3-amd.symbols @@ -0,0 +1,131 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +export var v = 1; +>v : Symbol(v, Decl(t1.ts, 1, 10)) + +export function f() { } +>f : Symbol(f, Decl(t1.ts, 1, 17)) + +export class C { +>C : Symbol(C, Decl(t1.ts, 2, 23)) +} +export interface I { +>I : Symbol(I, Decl(t1.ts, 4, 1)) +} +export enum E { +>E : Symbol(E, Decl(t1.ts, 6, 1)) + + A, B, C +>A : Symbol(E1.A, Decl(t1.ts, 7, 15)) +>B : Symbol(E1.B, Decl(t1.ts, 8, 6)) +>C : Symbol(E1.C, Decl(t1.ts, 8, 9)) +} +export const enum D { +>D : Symbol(D, Decl(t1.ts, 9, 1)) + + A, B, C +>A : Symbol(D1.A, Decl(t1.ts, 10, 21)) +>B : Symbol(D1.B, Decl(t1.ts, 11, 6)) +>C : Symbol(D1.C, Decl(t1.ts, 11, 9)) +} +export module M { +>M : Symbol(M, Decl(t1.ts, 12, 1)) + + export var x; +>x : Symbol(x, Decl(t1.ts, 14, 14)) +} +export module N { +>N : Symbol(N, Decl(t1.ts, 15, 1)) + + export interface I { +>I : Symbol(I, Decl(t1.ts, 16, 17)) + } +} +export type T = number; +>T : Symbol(T, Decl(t1.ts, 19, 1)) + +export import a = M.x; +>a : Symbol(a, Decl(t1.ts, 20, 23)) +>M : Symbol(M, Decl(t1.ts, 12, 1)) +>x : Symbol(a, Decl(t1.ts, 14, 14)) + +export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, T as T1, a as a1 }; +>v : Symbol(v1, Decl(t1.ts, 23, 8)) +>v1 : Symbol(v1, Decl(t1.ts, 23, 8)) +>f : Symbol(f1, Decl(t1.ts, 23, 17)) +>f1 : Symbol(f1, Decl(t1.ts, 23, 17)) +>C : Symbol(C1, Decl(t1.ts, 23, 26)) +>C1 : Symbol(C1, Decl(t1.ts, 23, 26)) +>I : Symbol(I1, Decl(t1.ts, 23, 35)) +>I1 : Symbol(I1, Decl(t1.ts, 23, 35)) +>E : Symbol(E1, Decl(t1.ts, 23, 44)) +>E1 : Symbol(E1, Decl(t1.ts, 23, 44)) +>D : Symbol(D1, Decl(t1.ts, 23, 53)) +>D1 : Symbol(D1, Decl(t1.ts, 23, 53)) +>M : Symbol(M1, Decl(t1.ts, 23, 62)) +>M1 : Symbol(M1, Decl(t1.ts, 23, 62)) +>N : Symbol(N1, Decl(t1.ts, 23, 71)) +>N1 : Symbol(N1, Decl(t1.ts, 23, 71)) +>T : Symbol(T1, Decl(t1.ts, 23, 80)) +>T1 : Symbol(T1, Decl(t1.ts, 23, 80)) +>a : Symbol(a1, Decl(t1.ts, 23, 89)) +>a1 : Symbol(a1, Decl(t1.ts, 23, 89)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; +>v1 : Symbol(v, Decl(t2.ts, 0, 8)) +>v : Symbol(v, Decl(t2.ts, 0, 8)) +>f1 : Symbol(f, Decl(t2.ts, 0, 17)) +>f : Symbol(f, Decl(t2.ts, 0, 17)) +>C1 : Symbol(C, Decl(t2.ts, 0, 26)) +>C : Symbol(C, Decl(t2.ts, 0, 26)) +>I1 : Symbol(I, Decl(t2.ts, 0, 35)) +>I : Symbol(I, Decl(t2.ts, 0, 35)) +>E1 : Symbol(E, Decl(t2.ts, 0, 44)) +>E : Symbol(E, Decl(t2.ts, 0, 44)) +>D1 : Symbol(D, Decl(t2.ts, 0, 53)) +>D : Symbol(D, Decl(t2.ts, 0, 53)) +>M1 : Symbol(M, Decl(t2.ts, 0, 62)) +>M : Symbol(M, Decl(t2.ts, 0, 62)) +>N1 : Symbol(N, Decl(t2.ts, 0, 71)) +>N : Symbol(N, Decl(t2.ts, 0, 71)) +>T1 : Symbol(T, Decl(t2.ts, 0, 80)) +>T : Symbol(T, Decl(t2.ts, 0, 80)) +>a1 : Symbol(a, Decl(t2.ts, 0, 89)) +>a : Symbol(a, Decl(t2.ts, 0, 89)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; +>v1 : Symbol(v, Decl(t3.ts, 0, 8)) +>v : Symbol(v, Decl(t3.ts, 0, 8)) +>f1 : Symbol(f, Decl(t3.ts, 0, 17)) +>f : Symbol(f, Decl(t3.ts, 0, 17)) +>C1 : Symbol(C, Decl(t3.ts, 0, 26)) +>C : Symbol(C, Decl(t3.ts, 0, 26)) +>I1 : Symbol(I, Decl(t3.ts, 0, 35)) +>I : Symbol(I, Decl(t3.ts, 0, 35)) +>E1 : Symbol(E, Decl(t3.ts, 0, 44)) +>E : Symbol(E, Decl(t3.ts, 0, 44)) +>D1 : Symbol(D, Decl(t3.ts, 0, 53)) +>D : Symbol(D, Decl(t3.ts, 0, 53)) +>M1 : Symbol(M, Decl(t3.ts, 0, 62)) +>M : Symbol(M, Decl(t3.ts, 0, 62)) +>N1 : Symbol(N, Decl(t3.ts, 0, 71)) +>N : Symbol(N, Decl(t3.ts, 0, 71)) +>T1 : Symbol(T, Decl(t3.ts, 0, 80)) +>T : Symbol(T, Decl(t3.ts, 0, 80)) +>a1 : Symbol(a, Decl(t3.ts, 0, 89)) +>a : Symbol(a, Decl(t3.ts, 0, 89)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t3.ts, 1, 8)) +>f : Symbol(f, Decl(t3.ts, 1, 11)) +>C : Symbol(C, Decl(t3.ts, 1, 14)) +>I : Symbol(I, Decl(t3.ts, 1, 17)) +>E : Symbol(E, Decl(t3.ts, 1, 20)) +>D : Symbol(D, Decl(t3.ts, 1, 23)) +>M : Symbol(M, Decl(t3.ts, 1, 26)) +>N : Symbol(N, Decl(t3.ts, 1, 29)) +>T : Symbol(T, Decl(t3.ts, 1, 32)) +>a : Symbol(a, Decl(t3.ts, 1, 35)) + diff --git a/tests/baselines/reference/exportsAndImports3-amd.types b/tests/baselines/reference/exportsAndImports3-amd.types index 86e21cfd084..0b8235d969c 100644 --- a/tests/baselines/reference/exportsAndImports3-amd.types +++ b/tests/baselines/reference/exportsAndImports3-amd.types @@ -2,6 +2,7 @@ export var v = 1; >v : number +>1 : number export function f() { } >f : () => void @@ -35,7 +36,7 @@ export module M { >x : any } export module N { ->N : unknown +>N : any export interface I { >I : I @@ -56,18 +57,18 @@ export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, >f1 : () => void >C : typeof C >C1 : typeof C ->I : unknown ->I1 : unknown +>I : any +>I1 : any >E : typeof E >E1 : typeof E >D : typeof D >D1 : typeof D >M : typeof M >M1 : typeof M ->N : unknown ->N1 : unknown ->T : unknown ->T1 : unknown +>N : any +>N1 : any +>T : any +>T1 : any >a : any >a1 : any @@ -79,18 +80,18 @@ export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, >f : () => void >C1 : typeof C >C : typeof C ->I1 : unknown ->I : unknown +>I1 : any +>I : any >E1 : typeof E >E : typeof E >D1 : typeof D >D : typeof D >M1 : typeof M >M : typeof M ->N1 : unknown ->N : unknown ->T1 : unknown ->T : unknown +>N1 : any +>N : any +>T1 : any +>T : any >a1 : any >a : any @@ -102,18 +103,18 @@ import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, >f : () => void >C1 : typeof C >C : typeof C ->I1 : unknown ->I : unknown +>I1 : any +>I : any >E1 : typeof E >E : typeof E >D1 : typeof D >D : typeof D >M1 : typeof M >M : typeof M ->N1 : unknown ->N : unknown ->T1 : unknown ->T : unknown +>N1 : any +>N : any +>T1 : any +>T : any >a1 : any >a : any @@ -121,11 +122,11 @@ export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any diff --git a/tests/baselines/reference/exportsAndImports3.symbols b/tests/baselines/reference/exportsAndImports3.symbols new file mode 100644 index 00000000000..4ab418a9bef --- /dev/null +++ b/tests/baselines/reference/exportsAndImports3.symbols @@ -0,0 +1,131 @@ +=== tests/cases/conformance/es6/modules/t1.ts === + +export var v = 1; +>v : Symbol(v, Decl(t1.ts, 1, 10)) + +export function f() { } +>f : Symbol(f, Decl(t1.ts, 1, 17)) + +export class C { +>C : Symbol(C, Decl(t1.ts, 2, 23)) +} +export interface I { +>I : Symbol(I, Decl(t1.ts, 4, 1)) +} +export enum E { +>E : Symbol(E, Decl(t1.ts, 6, 1)) + + A, B, C +>A : Symbol(E1.A, Decl(t1.ts, 7, 15)) +>B : Symbol(E1.B, Decl(t1.ts, 8, 6)) +>C : Symbol(E1.C, Decl(t1.ts, 8, 9)) +} +export const enum D { +>D : Symbol(D, Decl(t1.ts, 9, 1)) + + A, B, C +>A : Symbol(D1.A, Decl(t1.ts, 10, 21)) +>B : Symbol(D1.B, Decl(t1.ts, 11, 6)) +>C : Symbol(D1.C, Decl(t1.ts, 11, 9)) +} +export module M { +>M : Symbol(M, Decl(t1.ts, 12, 1)) + + export var x; +>x : Symbol(x, Decl(t1.ts, 14, 14)) +} +export module N { +>N : Symbol(N, Decl(t1.ts, 15, 1)) + + export interface I { +>I : Symbol(I, Decl(t1.ts, 16, 17)) + } +} +export type T = number; +>T : Symbol(T, Decl(t1.ts, 19, 1)) + +export import a = M.x; +>a : Symbol(a, Decl(t1.ts, 20, 23)) +>M : Symbol(M, Decl(t1.ts, 12, 1)) +>x : Symbol(a, Decl(t1.ts, 14, 14)) + +export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, T as T1, a as a1 }; +>v : Symbol(v1, Decl(t1.ts, 23, 8)) +>v1 : Symbol(v1, Decl(t1.ts, 23, 8)) +>f : Symbol(f1, Decl(t1.ts, 23, 17)) +>f1 : Symbol(f1, Decl(t1.ts, 23, 17)) +>C : Symbol(C1, Decl(t1.ts, 23, 26)) +>C1 : Symbol(C1, Decl(t1.ts, 23, 26)) +>I : Symbol(I1, Decl(t1.ts, 23, 35)) +>I1 : Symbol(I1, Decl(t1.ts, 23, 35)) +>E : Symbol(E1, Decl(t1.ts, 23, 44)) +>E1 : Symbol(E1, Decl(t1.ts, 23, 44)) +>D : Symbol(D1, Decl(t1.ts, 23, 53)) +>D1 : Symbol(D1, Decl(t1.ts, 23, 53)) +>M : Symbol(M1, Decl(t1.ts, 23, 62)) +>M1 : Symbol(M1, Decl(t1.ts, 23, 62)) +>N : Symbol(N1, Decl(t1.ts, 23, 71)) +>N1 : Symbol(N1, Decl(t1.ts, 23, 71)) +>T : Symbol(T1, Decl(t1.ts, 23, 80)) +>T1 : Symbol(T1, Decl(t1.ts, 23, 80)) +>a : Symbol(a1, Decl(t1.ts, 23, 89)) +>a1 : Symbol(a1, Decl(t1.ts, 23, 89)) + +=== tests/cases/conformance/es6/modules/t2.ts === +export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; +>v1 : Symbol(v, Decl(t2.ts, 0, 8)) +>v : Symbol(v, Decl(t2.ts, 0, 8)) +>f1 : Symbol(f, Decl(t2.ts, 0, 17)) +>f : Symbol(f, Decl(t2.ts, 0, 17)) +>C1 : Symbol(C, Decl(t2.ts, 0, 26)) +>C : Symbol(C, Decl(t2.ts, 0, 26)) +>I1 : Symbol(I, Decl(t2.ts, 0, 35)) +>I : Symbol(I, Decl(t2.ts, 0, 35)) +>E1 : Symbol(E, Decl(t2.ts, 0, 44)) +>E : Symbol(E, Decl(t2.ts, 0, 44)) +>D1 : Symbol(D, Decl(t2.ts, 0, 53)) +>D : Symbol(D, Decl(t2.ts, 0, 53)) +>M1 : Symbol(M, Decl(t2.ts, 0, 62)) +>M : Symbol(M, Decl(t2.ts, 0, 62)) +>N1 : Symbol(N, Decl(t2.ts, 0, 71)) +>N : Symbol(N, Decl(t2.ts, 0, 71)) +>T1 : Symbol(T, Decl(t2.ts, 0, 80)) +>T : Symbol(T, Decl(t2.ts, 0, 80)) +>a1 : Symbol(a, Decl(t2.ts, 0, 89)) +>a : Symbol(a, Decl(t2.ts, 0, 89)) + +=== tests/cases/conformance/es6/modules/t3.ts === +import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, T1 as T, a1 as a } from "./t1"; +>v1 : Symbol(v, Decl(t3.ts, 0, 8)) +>v : Symbol(v, Decl(t3.ts, 0, 8)) +>f1 : Symbol(f, Decl(t3.ts, 0, 17)) +>f : Symbol(f, Decl(t3.ts, 0, 17)) +>C1 : Symbol(C, Decl(t3.ts, 0, 26)) +>C : Symbol(C, Decl(t3.ts, 0, 26)) +>I1 : Symbol(I, Decl(t3.ts, 0, 35)) +>I : Symbol(I, Decl(t3.ts, 0, 35)) +>E1 : Symbol(E, Decl(t3.ts, 0, 44)) +>E : Symbol(E, Decl(t3.ts, 0, 44)) +>D1 : Symbol(D, Decl(t3.ts, 0, 53)) +>D : Symbol(D, Decl(t3.ts, 0, 53)) +>M1 : Symbol(M, Decl(t3.ts, 0, 62)) +>M : Symbol(M, Decl(t3.ts, 0, 62)) +>N1 : Symbol(N, Decl(t3.ts, 0, 71)) +>N : Symbol(N, Decl(t3.ts, 0, 71)) +>T1 : Symbol(T, Decl(t3.ts, 0, 80)) +>T : Symbol(T, Decl(t3.ts, 0, 80)) +>a1 : Symbol(a, Decl(t3.ts, 0, 89)) +>a : Symbol(a, Decl(t3.ts, 0, 89)) + +export { v, f, C, I, E, D, M, N, T, a }; +>v : Symbol(v, Decl(t3.ts, 1, 8)) +>f : Symbol(f, Decl(t3.ts, 1, 11)) +>C : Symbol(C, Decl(t3.ts, 1, 14)) +>I : Symbol(I, Decl(t3.ts, 1, 17)) +>E : Symbol(E, Decl(t3.ts, 1, 20)) +>D : Symbol(D, Decl(t3.ts, 1, 23)) +>M : Symbol(M, Decl(t3.ts, 1, 26)) +>N : Symbol(N, Decl(t3.ts, 1, 29)) +>T : Symbol(T, Decl(t3.ts, 1, 32)) +>a : Symbol(a, Decl(t3.ts, 1, 35)) + diff --git a/tests/baselines/reference/exportsAndImports3.types b/tests/baselines/reference/exportsAndImports3.types index 86e21cfd084..0b8235d969c 100644 --- a/tests/baselines/reference/exportsAndImports3.types +++ b/tests/baselines/reference/exportsAndImports3.types @@ -2,6 +2,7 @@ export var v = 1; >v : number +>1 : number export function f() { } >f : () => void @@ -35,7 +36,7 @@ export module M { >x : any } export module N { ->N : unknown +>N : any export interface I { >I : I @@ -56,18 +57,18 @@ export { v as v1, f as f1, C as C1, I as I1, E as E1, D as D1, M as M1, N as N1, >f1 : () => void >C : typeof C >C1 : typeof C ->I : unknown ->I1 : unknown +>I : any +>I1 : any >E : typeof E >E1 : typeof E >D : typeof D >D1 : typeof D >M : typeof M >M1 : typeof M ->N : unknown ->N1 : unknown ->T : unknown ->T1 : unknown +>N : any +>N1 : any +>T : any +>T1 : any >a : any >a1 : any @@ -79,18 +80,18 @@ export { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, >f : () => void >C1 : typeof C >C : typeof C ->I1 : unknown ->I : unknown +>I1 : any +>I : any >E1 : typeof E >E : typeof E >D1 : typeof D >D : typeof D >M1 : typeof M >M : typeof M ->N1 : unknown ->N : unknown ->T1 : unknown ->T : unknown +>N1 : any +>N : any +>T1 : any +>T : any >a1 : any >a : any @@ -102,18 +103,18 @@ import { v1 as v, f1 as f, C1 as C, I1 as I, E1 as E, D1 as D, M1 as M, N1 as N, >f : () => void >C1 : typeof C >C : typeof C ->I1 : unknown ->I : unknown +>I1 : any +>I : any >E1 : typeof E >E : typeof E >D1 : typeof D >D : typeof D >M1 : typeof M >M : typeof M ->N1 : unknown ->N : unknown ->T1 : unknown ->T : unknown +>N1 : any +>N : any +>T1 : any +>T : any >a1 : any >a : any @@ -121,11 +122,11 @@ export { v, f, C, I, E, D, M, N, T, a }; >v : number >f : () => void >C : typeof C ->I : unknown +>I : any >E : typeof E >D : typeof D >M : typeof M ->N : unknown ->T : unknown +>N : any +>T : any >a : any diff --git a/tests/baselines/reference/exportsAndImports4-amd.symbols b/tests/baselines/reference/exportsAndImports4-amd.symbols new file mode 100644 index 00000000000..0204d9bd586 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports4-amd.symbols @@ -0,0 +1,68 @@ +=== tests/cases/conformance/es6/modules/t3.ts === +import a = require("./t1"); +>a : Symbol(a, Decl(t3.ts, 0, 0)) + +a.default; +>a.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>a : Symbol(a, Decl(t3.ts, 0, 0)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import b from "./t1"; +>b : Symbol(b, Decl(t3.ts, 2, 6)) + +b; +>b : Symbol(b, Decl(t3.ts, 2, 6)) + +import * as c from "./t1"; +>c : Symbol(c, Decl(t3.ts, 4, 6)) + +c.default; +>c.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>c : Symbol(c, Decl(t3.ts, 4, 6)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import { default as d } from "./t1"; +>default : Symbol(d, Decl(t3.ts, 6, 8)) +>d : Symbol(d, Decl(t3.ts, 6, 8)) + +d; +>d : Symbol(d, Decl(t3.ts, 6, 8)) + +import e1, * as e2 from "./t1"; +>e1 : Symbol(e1, Decl(t3.ts, 8, 6)) +>e2 : Symbol(e2, Decl(t3.ts, 8, 10)) + +e1; +>e1 : Symbol(e1, Decl(t3.ts, 8, 6)) + +e2.default; +>e2.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>e2 : Symbol(e2, Decl(t3.ts, 8, 10)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import f1, { default as f2 } from "./t1"; +>f1 : Symbol(f1, Decl(t3.ts, 11, 6)) +>default : Symbol(f2, Decl(t3.ts, 11, 12)) +>f2 : Symbol(f2, Decl(t3.ts, 11, 12)) + +f1; +>f1 : Symbol(f1, Decl(t3.ts, 11, 6)) + +f2; +>f2 : Symbol(f2, Decl(t3.ts, 11, 12)) + +export { a, b, c, d, e1, e2, f1, f2 }; +>a : Symbol(a, Decl(t3.ts, 14, 8)) +>b : Symbol(b, Decl(t3.ts, 14, 11)) +>c : Symbol(c, Decl(t3.ts, 14, 14)) +>d : Symbol(d, Decl(t3.ts, 14, 17)) +>e1 : Symbol(e1, Decl(t3.ts, 14, 20)) +>e2 : Symbol(e2, Decl(t3.ts, 14, 24)) +>f1 : Symbol(f1, Decl(t3.ts, 14, 28)) +>f2 : Symbol(f2, Decl(t3.ts, 14, 32)) + +=== tests/cases/conformance/es6/modules/t1.ts === + +No type information for this code.export default "hello"; +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/exportsAndImports4.symbols b/tests/baselines/reference/exportsAndImports4.symbols new file mode 100644 index 00000000000..0204d9bd586 --- /dev/null +++ b/tests/baselines/reference/exportsAndImports4.symbols @@ -0,0 +1,68 @@ +=== tests/cases/conformance/es6/modules/t3.ts === +import a = require("./t1"); +>a : Symbol(a, Decl(t3.ts, 0, 0)) + +a.default; +>a.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>a : Symbol(a, Decl(t3.ts, 0, 0)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import b from "./t1"; +>b : Symbol(b, Decl(t3.ts, 2, 6)) + +b; +>b : Symbol(b, Decl(t3.ts, 2, 6)) + +import * as c from "./t1"; +>c : Symbol(c, Decl(t3.ts, 4, 6)) + +c.default; +>c.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>c : Symbol(c, Decl(t3.ts, 4, 6)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import { default as d } from "./t1"; +>default : Symbol(d, Decl(t3.ts, 6, 8)) +>d : Symbol(d, Decl(t3.ts, 6, 8)) + +d; +>d : Symbol(d, Decl(t3.ts, 6, 8)) + +import e1, * as e2 from "./t1"; +>e1 : Symbol(e1, Decl(t3.ts, 8, 6)) +>e2 : Symbol(e2, Decl(t3.ts, 8, 10)) + +e1; +>e1 : Symbol(e1, Decl(t3.ts, 8, 6)) + +e2.default; +>e2.default : Symbol(a.default, Decl(t1.ts, 0, 0)) +>e2 : Symbol(e2, Decl(t3.ts, 8, 10)) +>default : Symbol(a.default, Decl(t1.ts, 0, 0)) + +import f1, { default as f2 } from "./t1"; +>f1 : Symbol(f1, Decl(t3.ts, 11, 6)) +>default : Symbol(f2, Decl(t3.ts, 11, 12)) +>f2 : Symbol(f2, Decl(t3.ts, 11, 12)) + +f1; +>f1 : Symbol(f1, Decl(t3.ts, 11, 6)) + +f2; +>f2 : Symbol(f2, Decl(t3.ts, 11, 12)) + +export { a, b, c, d, e1, e2, f1, f2 }; +>a : Symbol(a, Decl(t3.ts, 14, 8)) +>b : Symbol(b, Decl(t3.ts, 14, 11)) +>c : Symbol(c, Decl(t3.ts, 14, 14)) +>d : Symbol(d, Decl(t3.ts, 14, 17)) +>e1 : Symbol(e1, Decl(t3.ts, 14, 20)) +>e2 : Symbol(e2, Decl(t3.ts, 14, 24)) +>f1 : Symbol(f1, Decl(t3.ts, 14, 28)) +>f2 : Symbol(f2, Decl(t3.ts, 14, 32)) + +=== tests/cases/conformance/es6/modules/t1.ts === + +No type information for this code.export default "hello"; +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/extBaseClass1.symbols b/tests/baselines/reference/extBaseClass1.symbols new file mode 100644 index 00000000000..416fa910f31 --- /dev/null +++ b/tests/baselines/reference/extBaseClass1.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/extBaseClass1.ts === +module M { +>M : Symbol(M, Decl(extBaseClass1.ts, 0, 0), Decl(extBaseClass1.ts, 7, 1)) + + export class B { +>B : Symbol(B, Decl(extBaseClass1.ts, 0, 10)) + + public x=10; +>x : Symbol(x, Decl(extBaseClass1.ts, 1, 20)) + } + + export class C extends B { +>C : Symbol(C, Decl(extBaseClass1.ts, 3, 5)) +>B : Symbol(B, Decl(extBaseClass1.ts, 0, 10)) + } +} + +module M { +>M : Symbol(M, Decl(extBaseClass1.ts, 0, 0), Decl(extBaseClass1.ts, 7, 1)) + + export class C2 extends B { +>C2 : Symbol(C2, Decl(extBaseClass1.ts, 9, 10)) +>B : Symbol(B, Decl(extBaseClass1.ts, 0, 10)) + } +} + +module N { +>N : Symbol(N, Decl(extBaseClass1.ts, 12, 1)) + + export class C3 extends M.B { +>C3 : Symbol(C3, Decl(extBaseClass1.ts, 14, 10)) +>M.B : Symbol(M.B, Decl(extBaseClass1.ts, 0, 10)) +>M : Symbol(M, Decl(extBaseClass1.ts, 0, 0), Decl(extBaseClass1.ts, 7, 1)) +>B : Symbol(M.B, Decl(extBaseClass1.ts, 0, 10)) + } +} + diff --git a/tests/baselines/reference/extBaseClass1.types b/tests/baselines/reference/extBaseClass1.types index d160db9a06e..b476e1b4206 100644 --- a/tests/baselines/reference/extBaseClass1.types +++ b/tests/baselines/reference/extBaseClass1.types @@ -7,6 +7,7 @@ module M { public x=10; >x : number +>10 : number } export class C extends B { @@ -29,6 +30,7 @@ module N { export class C3 extends M.B { >C3 : C3 +>M.B : any >M : typeof M >B : M.B } diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.symbols b/tests/baselines/reference/extendAndImplementTheSameBaseType.symbols new file mode 100644 index 00000000000..c211fa4955b --- /dev/null +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/extendAndImplementTheSameBaseType.ts === +class C { +>C : Symbol(C, Decl(extendAndImplementTheSameBaseType.ts, 0, 0)) + + foo: number +>foo : Symbol(foo, Decl(extendAndImplementTheSameBaseType.ts, 0, 9)) + + bar() {} +>bar : Symbol(bar, Decl(extendAndImplementTheSameBaseType.ts, 1, 15)) +} +class D extends C implements C { +>D : Symbol(D, Decl(extendAndImplementTheSameBaseType.ts, 3, 1)) +>C : Symbol(C, Decl(extendAndImplementTheSameBaseType.ts, 0, 0)) +>C : Symbol(C, Decl(extendAndImplementTheSameBaseType.ts, 0, 0)) + + baz() { } +>baz : Symbol(baz, Decl(extendAndImplementTheSameBaseType.ts, 4, 32)) +} + +var c: C; +>c : Symbol(c, Decl(extendAndImplementTheSameBaseType.ts, 8, 3)) +>C : Symbol(C, Decl(extendAndImplementTheSameBaseType.ts, 0, 0)) + +var d: D = new D(); +>d : Symbol(d, Decl(extendAndImplementTheSameBaseType.ts, 9, 3)) +>D : Symbol(D, Decl(extendAndImplementTheSameBaseType.ts, 3, 1)) +>D : Symbol(D, Decl(extendAndImplementTheSameBaseType.ts, 3, 1)) + +d.bar(); +>d.bar : Symbol(C.bar, Decl(extendAndImplementTheSameBaseType.ts, 1, 15)) +>d : Symbol(d, Decl(extendAndImplementTheSameBaseType.ts, 9, 3)) +>bar : Symbol(C.bar, Decl(extendAndImplementTheSameBaseType.ts, 1, 15)) + +d.baz(); +>d.baz : Symbol(D.baz, Decl(extendAndImplementTheSameBaseType.ts, 4, 32)) +>d : Symbol(d, Decl(extendAndImplementTheSameBaseType.ts, 9, 3)) +>baz : Symbol(D.baz, Decl(extendAndImplementTheSameBaseType.ts, 4, 32)) + +d.foo; +>d.foo : Symbol(C.foo, Decl(extendAndImplementTheSameBaseType.ts, 0, 9)) +>d : Symbol(d, Decl(extendAndImplementTheSameBaseType.ts, 9, 3)) +>foo : Symbol(C.foo, Decl(extendAndImplementTheSameBaseType.ts, 0, 9)) + diff --git a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.symbols b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.symbols new file mode 100644 index 00000000000..88aca935113 --- /dev/null +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/extendBaseClassBeforeItsDeclared.ts === +class derived extends base { } +>derived : Symbol(derived, Decl(extendBaseClassBeforeItsDeclared.ts, 0, 0)) +>base : Symbol(base, Decl(extendBaseClassBeforeItsDeclared.ts, 0, 30)) + +class base { constructor (public n: number) { } } +>base : Symbol(base, Decl(extendBaseClassBeforeItsDeclared.ts, 0, 30)) +>n : Symbol(n, Decl(extendBaseClassBeforeItsDeclared.ts, 2, 26)) + diff --git a/tests/baselines/reference/extendBooleanInterface.symbols b/tests/baselines/reference/extendBooleanInterface.symbols new file mode 100644 index 00000000000..8e123eb050e --- /dev/null +++ b/tests/baselines/reference/extendBooleanInterface.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/types/primitives/boolean/extendBooleanInterface.ts === +interface Boolean { +>Boolean : Symbol(Boolean, Decl(lib.d.ts, 443, 38), Decl(lib.d.ts, 456, 11), Decl(extendBooleanInterface.ts, 0, 0)) + + doStuff(): string; +>doStuff : Symbol(doStuff, Decl(extendBooleanInterface.ts, 0, 19)) + + doOtherStuff(x: T): T; +>doOtherStuff : Symbol(doOtherStuff, Decl(extendBooleanInterface.ts, 1, 22)) +>T : Symbol(T, Decl(extendBooleanInterface.ts, 2, 17)) +>x : Symbol(x, Decl(extendBooleanInterface.ts, 2, 20)) +>T : Symbol(T, Decl(extendBooleanInterface.ts, 2, 17)) +>T : Symbol(T, Decl(extendBooleanInterface.ts, 2, 17)) +} + +var x = true; +>x : Symbol(x, Decl(extendBooleanInterface.ts, 5, 3)) + +var a: string = x.doStuff(); +>a : Symbol(a, Decl(extendBooleanInterface.ts, 6, 3)) +>x.doStuff : Symbol(Boolean.doStuff, Decl(extendBooleanInterface.ts, 0, 19)) +>x : Symbol(x, Decl(extendBooleanInterface.ts, 5, 3)) +>doStuff : Symbol(Boolean.doStuff, Decl(extendBooleanInterface.ts, 0, 19)) + +var b: string = x.doOtherStuff('hm'); +>b : Symbol(b, Decl(extendBooleanInterface.ts, 7, 3)) +>x.doOtherStuff : Symbol(Boolean.doOtherStuff, Decl(extendBooleanInterface.ts, 1, 22)) +>x : Symbol(x, Decl(extendBooleanInterface.ts, 5, 3)) +>doOtherStuff : Symbol(Boolean.doOtherStuff, Decl(extendBooleanInterface.ts, 1, 22)) + +var c: string = x['doStuff'](); +>c : Symbol(c, Decl(extendBooleanInterface.ts, 8, 3)) +>x : Symbol(x, Decl(extendBooleanInterface.ts, 5, 3)) +>'doStuff' : Symbol(Boolean.doStuff, Decl(extendBooleanInterface.ts, 0, 19)) + +var d: string = x['doOtherStuff']('hm'); +>d : Symbol(d, Decl(extendBooleanInterface.ts, 9, 3)) +>x : Symbol(x, Decl(extendBooleanInterface.ts, 5, 3)) +>'doOtherStuff' : Symbol(Boolean.doOtherStuff, Decl(extendBooleanInterface.ts, 1, 22)) + diff --git a/tests/baselines/reference/extendBooleanInterface.types b/tests/baselines/reference/extendBooleanInterface.types index 2d94680599a..8f91deba713 100644 --- a/tests/baselines/reference/extendBooleanInterface.types +++ b/tests/baselines/reference/extendBooleanInterface.types @@ -15,6 +15,7 @@ interface Boolean { var x = true; >x : boolean +>true : boolean var a: string = x.doStuff(); >a : string @@ -29,16 +30,20 @@ var b: string = x.doOtherStuff('hm'); >x.doOtherStuff : (x: T) => T >x : boolean >doOtherStuff : (x: T) => T +>'hm' : string var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string >x : boolean +>'doStuff' : string var d: string = x['doOtherStuff']('hm'); >d : string >x['doOtherStuff']('hm') : string >x['doOtherStuff'] : (x: T) => T >x : boolean +>'doOtherStuff' : string +>'hm' : string diff --git a/tests/baselines/reference/extendNumberInterface.symbols b/tests/baselines/reference/extendNumberInterface.symbols new file mode 100644 index 00000000000..56d2f8b0014 --- /dev/null +++ b/tests/baselines/reference/extendNumberInterface.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/types/primitives/number/extendNumberInterface.ts === +interface Number { +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11), Decl(extendNumberInterface.ts, 0, 0)) + + doStuff(): string; +>doStuff : Symbol(doStuff, Decl(extendNumberInterface.ts, 0, 18)) + + doOtherStuff(x:T): T; +>doOtherStuff : Symbol(doOtherStuff, Decl(extendNumberInterface.ts, 1, 22)) +>T : Symbol(T, Decl(extendNumberInterface.ts, 2, 17)) +>x : Symbol(x, Decl(extendNumberInterface.ts, 2, 20)) +>T : Symbol(T, Decl(extendNumberInterface.ts, 2, 17)) +>T : Symbol(T, Decl(extendNumberInterface.ts, 2, 17)) +} + +var x = 1; +>x : Symbol(x, Decl(extendNumberInterface.ts, 5, 3)) + +var a: string = x.doStuff(); +>a : Symbol(a, Decl(extendNumberInterface.ts, 6, 3)) +>x.doStuff : Symbol(Number.doStuff, Decl(extendNumberInterface.ts, 0, 18)) +>x : Symbol(x, Decl(extendNumberInterface.ts, 5, 3)) +>doStuff : Symbol(Number.doStuff, Decl(extendNumberInterface.ts, 0, 18)) + +var b: string = x.doOtherStuff('hm'); +>b : Symbol(b, Decl(extendNumberInterface.ts, 7, 3)) +>x.doOtherStuff : Symbol(Number.doOtherStuff, Decl(extendNumberInterface.ts, 1, 22)) +>x : Symbol(x, Decl(extendNumberInterface.ts, 5, 3)) +>doOtherStuff : Symbol(Number.doOtherStuff, Decl(extendNumberInterface.ts, 1, 22)) + +var c: string = x['doStuff'](); +>c : Symbol(c, Decl(extendNumberInterface.ts, 8, 3)) +>x : Symbol(x, Decl(extendNumberInterface.ts, 5, 3)) +>'doStuff' : Symbol(Number.doStuff, Decl(extendNumberInterface.ts, 0, 18)) + +var d: string = x['doOtherStuff']('hm'); +>d : Symbol(d, Decl(extendNumberInterface.ts, 9, 3)) +>x : Symbol(x, Decl(extendNumberInterface.ts, 5, 3)) +>'doOtherStuff' : Symbol(Number.doOtherStuff, Decl(extendNumberInterface.ts, 1, 22)) + diff --git a/tests/baselines/reference/extendNumberInterface.types b/tests/baselines/reference/extendNumberInterface.types index f109e05be89..97ef307bab8 100644 --- a/tests/baselines/reference/extendNumberInterface.types +++ b/tests/baselines/reference/extendNumberInterface.types @@ -15,6 +15,7 @@ interface Number { var x = 1; >x : number +>1 : number var a: string = x.doStuff(); >a : string @@ -29,16 +30,20 @@ var b: string = x.doOtherStuff('hm'); >x.doOtherStuff : (x: T) => T >x : number >doOtherStuff : (x: T) => T +>'hm' : string var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string >x : number +>'doStuff' : string var d: string = x['doOtherStuff']('hm'); >d : string >x['doOtherStuff']('hm') : string >x['doOtherStuff'] : (x: T) => T >x : number +>'doOtherStuff' : string +>'hm' : string diff --git a/tests/baselines/reference/extendStringInterface.symbols b/tests/baselines/reference/extendStringInterface.symbols new file mode 100644 index 00000000000..a72773647a8 --- /dev/null +++ b/tests/baselines/reference/extendStringInterface.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/types/primitives/string/extendStringInterface.ts === +interface String { +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(extendStringInterface.ts, 0, 0)) + + doStuff(): string; +>doStuff : Symbol(doStuff, Decl(extendStringInterface.ts, 0, 18)) + + doOtherStuff(x:T): T; +>doOtherStuff : Symbol(doOtherStuff, Decl(extendStringInterface.ts, 1, 22)) +>T : Symbol(T, Decl(extendStringInterface.ts, 2, 17)) +>x : Symbol(x, Decl(extendStringInterface.ts, 2, 20)) +>T : Symbol(T, Decl(extendStringInterface.ts, 2, 17)) +>T : Symbol(T, Decl(extendStringInterface.ts, 2, 17)) +} + +var x = ''; +>x : Symbol(x, Decl(extendStringInterface.ts, 5, 3)) + +var a: string = x.doStuff(); +>a : Symbol(a, Decl(extendStringInterface.ts, 6, 3)) +>x.doStuff : Symbol(String.doStuff, Decl(extendStringInterface.ts, 0, 18)) +>x : Symbol(x, Decl(extendStringInterface.ts, 5, 3)) +>doStuff : Symbol(String.doStuff, Decl(extendStringInterface.ts, 0, 18)) + +var b: string = x.doOtherStuff('hm'); +>b : Symbol(b, Decl(extendStringInterface.ts, 7, 3)) +>x.doOtherStuff : Symbol(String.doOtherStuff, Decl(extendStringInterface.ts, 1, 22)) +>x : Symbol(x, Decl(extendStringInterface.ts, 5, 3)) +>doOtherStuff : Symbol(String.doOtherStuff, Decl(extendStringInterface.ts, 1, 22)) + +var c: string = x['doStuff'](); +>c : Symbol(c, Decl(extendStringInterface.ts, 8, 3)) +>x : Symbol(x, Decl(extendStringInterface.ts, 5, 3)) +>'doStuff' : Symbol(String.doStuff, Decl(extendStringInterface.ts, 0, 18)) + +var d: string = x['doOtherStuff']('hm'); +>d : Symbol(d, Decl(extendStringInterface.ts, 9, 3)) +>x : Symbol(x, Decl(extendStringInterface.ts, 5, 3)) +>'doOtherStuff' : Symbol(String.doOtherStuff, Decl(extendStringInterface.ts, 1, 22)) + diff --git a/tests/baselines/reference/extendStringInterface.types b/tests/baselines/reference/extendStringInterface.types index 3cf9f72f5f2..edfd8239015 100644 --- a/tests/baselines/reference/extendStringInterface.types +++ b/tests/baselines/reference/extendStringInterface.types @@ -15,6 +15,7 @@ interface String { var x = ''; >x : string +>'' : string var a: string = x.doStuff(); >a : string @@ -29,16 +30,20 @@ var b: string = x.doOtherStuff('hm'); >x.doOtherStuff : (x: T) => T >x : string >doOtherStuff : (x: T) => T +>'hm' : string var c: string = x['doStuff'](); >c : string >x['doStuff']() : string >x['doStuff'] : () => string >x : string +>'doStuff' : string var d: string = x['doOtherStuff']('hm'); >d : string >x['doOtherStuff']('hm') : string >x['doOtherStuff'] : (x: T) => T >x : string +>'doOtherStuff' : string +>'hm' : string diff --git a/tests/baselines/reference/extendedInterfaceGenericType.symbols b/tests/baselines/reference/extendedInterfaceGenericType.symbols new file mode 100644 index 00000000000..47e17b1e6a1 --- /dev/null +++ b/tests/baselines/reference/extendedInterfaceGenericType.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/extendedInterfaceGenericType.ts === +interface Alpha { +>Alpha : Symbol(Alpha, Decl(extendedInterfaceGenericType.ts, 0, 0)) +>T : Symbol(T, Decl(extendedInterfaceGenericType.ts, 0, 16)) + + takesArgOfT(arg: T): Alpha; +>takesArgOfT : Symbol(takesArgOfT, Decl(extendedInterfaceGenericType.ts, 0, 20)) +>arg : Symbol(arg, Decl(extendedInterfaceGenericType.ts, 1, 16)) +>T : Symbol(T, Decl(extendedInterfaceGenericType.ts, 0, 16)) +>Alpha : Symbol(Alpha, Decl(extendedInterfaceGenericType.ts, 0, 0)) +>T : Symbol(T, Decl(extendedInterfaceGenericType.ts, 0, 16)) + + makeBetaOfNumber(): Beta; +>makeBetaOfNumber : Symbol(makeBetaOfNumber, Decl(extendedInterfaceGenericType.ts, 1, 34)) +>Beta : Symbol(Beta, Decl(extendedInterfaceGenericType.ts, 3, 1)) +} +interface Beta extends Alpha { +>Beta : Symbol(Beta, Decl(extendedInterfaceGenericType.ts, 3, 1)) +>T : Symbol(T, Decl(extendedInterfaceGenericType.ts, 4, 15)) +>Alpha : Symbol(Alpha, Decl(extendedInterfaceGenericType.ts, 0, 0)) +>T : Symbol(T, Decl(extendedInterfaceGenericType.ts, 4, 15)) +} + +var alpha: Alpha; +>alpha : Symbol(alpha, Decl(extendedInterfaceGenericType.ts, 7, 3)) +>Alpha : Symbol(Alpha, Decl(extendedInterfaceGenericType.ts, 0, 0)) + +var betaOfNumber = alpha.makeBetaOfNumber(); +>betaOfNumber : Symbol(betaOfNumber, Decl(extendedInterfaceGenericType.ts, 8, 3)) +>alpha.makeBetaOfNumber : Symbol(Alpha.makeBetaOfNumber, Decl(extendedInterfaceGenericType.ts, 1, 34)) +>alpha : Symbol(alpha, Decl(extendedInterfaceGenericType.ts, 7, 3)) +>makeBetaOfNumber : Symbol(Alpha.makeBetaOfNumber, Decl(extendedInterfaceGenericType.ts, 1, 34)) + +betaOfNumber.takesArgOfT(5); +>betaOfNumber.takesArgOfT : Symbol(Alpha.takesArgOfT, Decl(extendedInterfaceGenericType.ts, 0, 20)) +>betaOfNumber : Symbol(betaOfNumber, Decl(extendedInterfaceGenericType.ts, 8, 3)) +>takesArgOfT : Symbol(Alpha.takesArgOfT, Decl(extendedInterfaceGenericType.ts, 0, 20)) + diff --git a/tests/baselines/reference/extendedInterfaceGenericType.types b/tests/baselines/reference/extendedInterfaceGenericType.types index 17fd949215a..a536ec75190 100644 --- a/tests/baselines/reference/extendedInterfaceGenericType.types +++ b/tests/baselines/reference/extendedInterfaceGenericType.types @@ -37,4 +37,5 @@ betaOfNumber.takesArgOfT(5); >betaOfNumber.takesArgOfT : (arg: number) => Alpha >betaOfNumber : Beta >takesArgOfT : (arg: number) => Alpha +>5 : number diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.symbols b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.symbols new file mode 100644 index 00000000000..02d57509a55 --- /dev/null +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.symbols @@ -0,0 +1,80 @@ +=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_main.ts === +import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 0, 0)) + +import moduleA = require("extendingClassFromAliasAndUsageInIndexer_moduleA"); +>moduleA : Symbol(moduleA, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 0, 79)) + +import moduleB = require("extendingClassFromAliasAndUsageInIndexer_moduleB"); +>moduleB : Symbol(moduleB, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 1, 77)) + +interface IHasVisualizationModel { +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 2, 77)) + + VisualizationModel: typeof Backbone.Model; +>VisualizationModel : Symbol(VisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 3, 34)) +>Backbone.Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) +} +var moduleATyped: IHasVisualizationModel = moduleA; +>moduleATyped : Symbol(moduleATyped, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 6, 3)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 2, 77)) +>moduleA : Symbol(moduleA, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 0, 79)) + +var moduleMap: { [key: string]: IHasVisualizationModel } = { +>moduleMap : Symbol(moduleMap, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 7, 3)) +>key : Symbol(key, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 7, 18)) +>IHasVisualizationModel : Symbol(IHasVisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 2, 77)) + + "moduleA": moduleA, +>moduleA : Symbol(moduleA, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 0, 79)) + + "moduleB": moduleB +>moduleB : Symbol(moduleB, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 1, 77)) + +}; +var moduleName: string; +>moduleName : Symbol(moduleName, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 11, 3)) + +var visModel = new moduleMap[moduleName].VisualizationModel(); +>visModel : Symbol(visModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 12, 3)) +>moduleMap[moduleName].VisualizationModel : Symbol(IHasVisualizationModel.VisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 3, 34)) +>moduleMap : Symbol(moduleMap, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 7, 3)) +>moduleName : Symbol(moduleName, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 11, 3)) +>VisualizationModel : Symbol(IHasVisualizationModel.VisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_main.ts, 3, 34)) + +=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_backbone.ts === +export class Model { +>Model : Symbol(Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) + + public someData: string; +>someData : Symbol(someData, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 20)) +} + +=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_moduleA.ts === +import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_moduleA.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_moduleA.ts, 0, 79)) +>Backbone.Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_moduleA.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) + + // interesting stuff here +} + +=== tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_moduleB.ts === +import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_moduleB.ts, 0, 0)) + +export class VisualizationModel extends Backbone.Model { +>VisualizationModel : Symbol(VisualizationModel, Decl(extendingClassFromAliasAndUsageInIndexer_moduleB.ts, 0, 79)) +>Backbone.Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) +>Backbone : Symbol(Backbone, Decl(extendingClassFromAliasAndUsageInIndexer_moduleB.ts, 0, 0)) +>Model : Symbol(Backbone.Model, Decl(extendingClassFromAliasAndUsageInIndexer_backbone.ts, 0, 0)) + + // different interesting stuff here +} + diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types index 769f6f5a602..5b9154516c5 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types @@ -13,6 +13,7 @@ interface IHasVisualizationModel { VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model +>Backbone.Model : typeof Backbone.Model >Backbone : typeof Backbone >Model : typeof Backbone.Model } @@ -60,6 +61,7 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model @@ -72,6 +74,7 @@ import Backbone = require("extendingClassFromAliasAndUsageInIndexer_backbone"); export class VisualizationModel extends Backbone.Model { >VisualizationModel : VisualizationModel +>Backbone.Model : any >Backbone : typeof Backbone >Model : Backbone.Model diff --git a/tests/baselines/reference/externFunc.symbols b/tests/baselines/reference/externFunc.symbols new file mode 100644 index 00000000000..1a02596d7db --- /dev/null +++ b/tests/baselines/reference/externFunc.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/externFunc.ts === +declare function parseInt(s:string):number; +>parseInt : Symbol(parseInt, Decl(lib.d.ts, 28, 38), Decl(externFunc.ts, 0, 0)) +>s : Symbol(s, Decl(externFunc.ts, 0, 26)) + +parseInt("2"); +>parseInt : Symbol(parseInt, Decl(lib.d.ts, 28, 38), Decl(externFunc.ts, 0, 0)) + diff --git a/tests/baselines/reference/externFunc.types b/tests/baselines/reference/externFunc.types index 5aac52ac125..ab417859ea5 100644 --- a/tests/baselines/reference/externFunc.types +++ b/tests/baselines/reference/externFunc.types @@ -6,4 +6,5 @@ declare function parseInt(s:string):number; parseInt("2"); >parseInt("2") : number >parseInt : { (s: string, radix?: number): number; (s: string): number; } +>"2" : string diff --git a/tests/baselines/reference/externModuleClobber.symbols b/tests/baselines/reference/externModuleClobber.symbols new file mode 100644 index 00000000000..af4b19ad7c9 --- /dev/null +++ b/tests/baselines/reference/externModuleClobber.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/externModuleClobber.ts === +declare module EM { +>EM : Symbol(EM, Decl(externModuleClobber.ts, 0, 0)) + + export class Position { } +>Position : Symbol(Position, Decl(externModuleClobber.ts, 0, 19)) + + export class EC { +>EC : Symbol(EC, Decl(externModuleClobber.ts, 1, 26)) + + public getPosition() : EM.Position; +>getPosition : Symbol(getPosition, Decl(externModuleClobber.ts, 3, 18)) +>EM : Symbol(EM, Decl(externModuleClobber.ts, 0, 0)) +>Position : Symbol(Position, Decl(externModuleClobber.ts, 0, 19)) + } +} + +var x:EM.Position; +>x : Symbol(x, Decl(externModuleClobber.ts, 8, 3)) +>EM : Symbol(EM, Decl(externModuleClobber.ts, 0, 0)) +>Position : Symbol(EM.Position, Decl(externModuleClobber.ts, 0, 19)) + +var ec:EM.EC = new EM.EC(); +>ec : Symbol(ec, Decl(externModuleClobber.ts, 9, 3)) +>EM : Symbol(EM, Decl(externModuleClobber.ts, 0, 0)) +>EC : Symbol(EM.EC, Decl(externModuleClobber.ts, 1, 26)) +>EM.EC : Symbol(EM.EC, Decl(externModuleClobber.ts, 1, 26)) +>EM : Symbol(EM, Decl(externModuleClobber.ts, 0, 0)) +>EC : Symbol(EM.EC, Decl(externModuleClobber.ts, 1, 26)) + +x = ec.getPosition(); +>x : Symbol(x, Decl(externModuleClobber.ts, 8, 3)) +>ec.getPosition : Symbol(EM.EC.getPosition, Decl(externModuleClobber.ts, 3, 18)) +>ec : Symbol(ec, Decl(externModuleClobber.ts, 9, 3)) +>getPosition : Symbol(EM.EC.getPosition, Decl(externModuleClobber.ts, 3, 18)) + diff --git a/tests/baselines/reference/externModuleClobber.types b/tests/baselines/reference/externModuleClobber.types index d1a7ba32651..dae050aec40 100644 --- a/tests/baselines/reference/externModuleClobber.types +++ b/tests/baselines/reference/externModuleClobber.types @@ -10,19 +10,19 @@ declare module EM { public getPosition() : EM.Position; >getPosition : () => Position ->EM : unknown +>EM : any >Position : Position } } var x:EM.Position; >x : EM.Position ->EM : unknown +>EM : any >Position : EM.Position var ec:EM.EC = new EM.EC(); >ec : EM.EC ->EM : unknown +>EM : any >EC : EM.EC >new EM.EC() : EM.EC >EM.EC : typeof EM.EC diff --git a/tests/baselines/reference/externalModuleAssignToVar.symbols b/tests/baselines/reference/externalModuleAssignToVar.symbols new file mode 100644 index 00000000000..373dd3f793e --- /dev/null +++ b/tests/baselines/reference/externalModuleAssignToVar.symbols @@ -0,0 +1,61 @@ +=== tests/cases/compiler/externalModuleAssignToVar_core.ts === +/// +import ext = require('externalModuleAssignToVar_core_require'); +>ext : Symbol(ext, Decl(externalModuleAssignToVar_core.ts, 0, 0)) + +var y1: { C: new() => ext.C; } = ext; +>y1 : Symbol(y1, Decl(externalModuleAssignToVar_core.ts, 2, 3)) +>C : Symbol(C, Decl(externalModuleAssignToVar_core.ts, 2, 9)) +>ext : Symbol(ext, Decl(externalModuleAssignToVar_core.ts, 0, 0)) +>C : Symbol(ext.C, Decl(externalModuleAssignToVar_core_require.ts, 0, 0)) +>ext : Symbol(ext, Decl(externalModuleAssignToVar_core.ts, 0, 0)) + +y1 = ext; // ok +>y1 : Symbol(y1, Decl(externalModuleAssignToVar_core.ts, 2, 3)) +>ext : Symbol(ext, Decl(externalModuleAssignToVar_core.ts, 0, 0)) + +import ext2 = require('externalModuleAssignToVar_core_require2'); +>ext2 : Symbol(ext2, Decl(externalModuleAssignToVar_core.ts, 3, 9)) + +var y2: new() => ext2 = ext2; +>y2 : Symbol(y2, Decl(externalModuleAssignToVar_core.ts, 6, 3)) +>ext2 : Symbol(ext2, Decl(externalModuleAssignToVar_core.ts, 3, 9)) +>ext2 : Symbol(ext2, Decl(externalModuleAssignToVar_core.ts, 3, 9)) + +y2 = ext2; // ok +>y2 : Symbol(y2, Decl(externalModuleAssignToVar_core.ts, 6, 3)) +>ext2 : Symbol(ext2, Decl(externalModuleAssignToVar_core.ts, 3, 9)) + +import ext3 = require('externalModuleAssignToVar_ext'); +>ext3 : Symbol(ext3, Decl(externalModuleAssignToVar_core.ts, 7, 10)) + +var y3: new () => ext3 = ext3; +>y3 : Symbol(y3, Decl(externalModuleAssignToVar_core.ts, 10, 3)) +>ext3 : Symbol(ext3, Decl(externalModuleAssignToVar_core.ts, 7, 10)) +>ext3 : Symbol(ext3, Decl(externalModuleAssignToVar_core.ts, 7, 10)) + +y3 = ext3; // ok +>y3 : Symbol(y3, Decl(externalModuleAssignToVar_core.ts, 10, 3)) +>ext3 : Symbol(ext3, Decl(externalModuleAssignToVar_core.ts, 7, 10)) + +=== tests/cases/compiler/externalModuleAssignToVar_ext.ts === +class D { foo: string; } +>D : Symbol(D, Decl(externalModuleAssignToVar_ext.ts, 0, 0)) +>foo : Symbol(foo, Decl(externalModuleAssignToVar_ext.ts, 0, 9)) + +export = D; +>D : Symbol(D, Decl(externalModuleAssignToVar_ext.ts, 0, 0)) + +=== tests/cases/compiler/externalModuleAssignToVar_core_require.ts === +export class C { bar: string; } +>C : Symbol(C, Decl(externalModuleAssignToVar_core_require.ts, 0, 0)) +>bar : Symbol(bar, Decl(externalModuleAssignToVar_core_require.ts, 0, 16)) + +=== tests/cases/compiler/externalModuleAssignToVar_core_require2.ts === +class C { baz: string; } +>C : Symbol(C, Decl(externalModuleAssignToVar_core_require2.ts, 0, 0)) +>baz : Symbol(baz, Decl(externalModuleAssignToVar_core_require2.ts, 0, 9)) + +export = C; +>C : Symbol(C, Decl(externalModuleAssignToVar_core_require2.ts, 0, 0)) + diff --git a/tests/baselines/reference/externalModuleAssignToVar.types b/tests/baselines/reference/externalModuleAssignToVar.types index 8bcc6cdf3e6..c25e2d78460 100644 --- a/tests/baselines/reference/externalModuleAssignToVar.types +++ b/tests/baselines/reference/externalModuleAssignToVar.types @@ -6,7 +6,7 @@ import ext = require('externalModuleAssignToVar_core_require'); var y1: { C: new() => ext.C; } = ext; >y1 : { C: new () => ext.C; } >C : new () => ext.C ->ext : unknown +>ext : any >C : ext.C >ext : typeof ext diff --git a/tests/baselines/reference/externalModuleQualification.symbols b/tests/baselines/reference/externalModuleQualification.symbols new file mode 100644 index 00000000000..dc056802c76 --- /dev/null +++ b/tests/baselines/reference/externalModuleQualification.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/externalModuleQualification.ts === +export var ID = "test"; +>ID : Symbol(ID, Decl(externalModuleQualification.ts, 0, 10)) + +export class DiffEditor { +>DiffEditor : Symbol(DiffEditor, Decl(externalModuleQualification.ts, 0, 23)) +>A : Symbol(A, Decl(externalModuleQualification.ts, 1, 24)) +>B : Symbol(B, Decl(externalModuleQualification.ts, 1, 26)) +>C : Symbol(C, Decl(externalModuleQualification.ts, 1, 29)) + + private previousDiffAction: NavigateAction; +>previousDiffAction : Symbol(previousDiffAction, Decl(externalModuleQualification.ts, 1, 34)) +>NavigateAction : Symbol(NavigateAction, Decl(externalModuleQualification.ts, 5, 1)) + + constructor(id: string = ID) { +>id : Symbol(id, Decl(externalModuleQualification.ts, 3, 16)) +>ID : Symbol(ID, Decl(externalModuleQualification.ts, 0, 10)) + } +} +class NavigateAction { +>NavigateAction : Symbol(NavigateAction, Decl(externalModuleQualification.ts, 5, 1)) + + f(editor: DiffEditor) { +>f : Symbol(f, Decl(externalModuleQualification.ts, 6, 22)) +>editor : Symbol(editor, Decl(externalModuleQualification.ts, 7, 6)) +>DiffEditor : Symbol(DiffEditor, Decl(externalModuleQualification.ts, 0, 23)) + } +} + diff --git a/tests/baselines/reference/externalModuleQualification.types b/tests/baselines/reference/externalModuleQualification.types index ba8fc516fb8..a7b70697209 100644 --- a/tests/baselines/reference/externalModuleQualification.types +++ b/tests/baselines/reference/externalModuleQualification.types @@ -1,6 +1,7 @@ === tests/cases/compiler/externalModuleQualification.ts === export var ID = "test"; >ID : string +>"test" : string export class DiffEditor { >DiffEditor : DiffEditor diff --git a/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.symbols b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.symbols new file mode 100644 index 00000000000..02e5e6cfc5a --- /dev/null +++ b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/externalModuleReferenceDoubleUnderscore1.ts === +declare module 'timezonecomplete' { + import basics = require("__timezonecomplete/basics"); +>basics : Symbol(basics, Decl(externalModuleReferenceDoubleUnderscore1.ts, 0, 35)) + + export import TimeUnit = basics.TimeUnit; +>TimeUnit : Symbol(TimeUnit, Decl(externalModuleReferenceDoubleUnderscore1.ts, 1, 57)) +>basics : Symbol(basics, Decl(externalModuleReferenceDoubleUnderscore1.ts, 3, 1)) +>TimeUnit : Symbol(basics.TimeUnit, Decl(externalModuleReferenceDoubleUnderscore1.ts, 5, 44)) +} + +declare module '__timezonecomplete/basics' { + export enum TimeUnit { +>TimeUnit : Symbol(TimeUnit, Decl(externalModuleReferenceDoubleUnderscore1.ts, 5, 44)) + + Second = 0, +>Second : Symbol(TimeUnit.Second, Decl(externalModuleReferenceDoubleUnderscore1.ts, 6, 26)) + + Minute = 1, +>Minute : Symbol(TimeUnit.Minute, Decl(externalModuleReferenceDoubleUnderscore1.ts, 7, 19)) + + Hour = 2, +>Hour : Symbol(TimeUnit.Hour, Decl(externalModuleReferenceDoubleUnderscore1.ts, 8, 19)) + + Day = 3, +>Day : Symbol(TimeUnit.Day, Decl(externalModuleReferenceDoubleUnderscore1.ts, 9, 17)) + + Week = 4, +>Week : Symbol(TimeUnit.Week, Decl(externalModuleReferenceDoubleUnderscore1.ts, 10, 16)) + + Month = 5, +>Month : Symbol(TimeUnit.Month, Decl(externalModuleReferenceDoubleUnderscore1.ts, 11, 17)) + + Year = 6, +>Year : Symbol(TimeUnit.Year, Decl(externalModuleReferenceDoubleUnderscore1.ts, 12, 18)) + } +} diff --git a/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types index e255e64d467..8d2c9b65991 100644 --- a/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types +++ b/tests/baselines/reference/externalModuleReferenceDoubleUnderscore1.types @@ -15,23 +15,30 @@ declare module '__timezonecomplete/basics' { Second = 0, >Second : TimeUnit +>0 : number Minute = 1, >Minute : TimeUnit +>1 : number Hour = 2, >Hour : TimeUnit +>2 : number Day = 3, >Day : TimeUnit +>3 : number Week = 4, >Week : TimeUnit +>4 : number Month = 5, >Month : TimeUnit +>5 : number Year = 6, >Year : TimeUnit +>6 : number } } diff --git a/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.symbols b/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.symbols new file mode 100644 index 00000000000..f81febef320 --- /dev/null +++ b/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/externalModuleReferenceOfImportDeclarationWithExportModifier_1.ts === +export import file1 = require('externalModuleReferenceOfImportDeclarationWithExportModifier_0'); +>file1 : Symbol(file1, Decl(externalModuleReferenceOfImportDeclarationWithExportModifier_1.ts, 0, 0)) + +file1.foo(); +>file1.foo : Symbol(file1.foo, Decl(externalModuleReferenceOfImportDeclarationWithExportModifier_0.ts, 0, 0)) +>file1 : Symbol(file1, Decl(externalModuleReferenceOfImportDeclarationWithExportModifier_1.ts, 0, 0)) +>foo : Symbol(file1.foo, Decl(externalModuleReferenceOfImportDeclarationWithExportModifier_0.ts, 0, 0)) + +=== tests/cases/compiler/externalModuleReferenceOfImportDeclarationWithExportModifier_0.ts === +export function foo() { }; +>foo : Symbol(foo, Decl(externalModuleReferenceOfImportDeclarationWithExportModifier_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/externalModuleResolution.symbols b/tests/baselines/reference/externalModuleResolution.symbols new file mode 100644 index 00000000000..d23b57e5061 --- /dev/null +++ b/tests/baselines/reference/externalModuleResolution.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/consumer.ts === +import x = require('./foo'); +>x : Symbol(x, Decl(consumer.ts, 0, 0)) + +x.Y // .ts should be picked +>x.Y : Symbol(x.Y, Decl(foo.ts, 1, 14)) +>x : Symbol(x, Decl(consumer.ts, 0, 0)) +>Y : Symbol(x.Y, Decl(foo.ts, 1, 14)) + +=== tests/cases/compiler/foo.ts === +module M2 { +>M2 : Symbol(M2, Decl(foo.ts, 0, 0)) + + export var Y = 1; +>Y : Symbol(Y, Decl(foo.ts, 1, 14)) +} +export = M2 +>M2 : Symbol(M2, Decl(foo.ts, 0, 0)) + diff --git a/tests/baselines/reference/externalModuleResolution.types b/tests/baselines/reference/externalModuleResolution.types index 929695b2203..45e2aef6883 100644 --- a/tests/baselines/reference/externalModuleResolution.types +++ b/tests/baselines/reference/externalModuleResolution.types @@ -13,6 +13,7 @@ module M2 { export var Y = 1; >Y : number +>1 : number } export = M2 >M2 : typeof M2 diff --git a/tests/baselines/reference/externalModuleResolution2.symbols b/tests/baselines/reference/externalModuleResolution2.symbols new file mode 100644 index 00000000000..f77a676ac6a --- /dev/null +++ b/tests/baselines/reference/externalModuleResolution2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/consumer.ts === +import x = require('./foo'); +>x : Symbol(x, Decl(consumer.ts, 0, 0)) + +x.X // .ts should be picked +>x.X : Symbol(x.X, Decl(foo.ts, 1, 14)) +>x : Symbol(x, Decl(consumer.ts, 0, 0)) +>X : Symbol(x.X, Decl(foo.ts, 1, 14)) + +=== tests/cases/compiler/foo.ts === +module M2 { +>M2 : Symbol(M2, Decl(foo.ts, 0, 0)) + + export var X = 1; +>X : Symbol(X, Decl(foo.ts, 1, 14)) +} +export = M2 +>M2 : Symbol(M2, Decl(foo.ts, 0, 0)) + diff --git a/tests/baselines/reference/externalModuleResolution2.types b/tests/baselines/reference/externalModuleResolution2.types index 09b33fb2bee..9f48b8b38f1 100644 --- a/tests/baselines/reference/externalModuleResolution2.types +++ b/tests/baselines/reference/externalModuleResolution2.types @@ -13,6 +13,7 @@ module M2 { export var X = 1; >X : number +>1 : number } export = M2 >M2 : typeof M2 diff --git a/tests/baselines/reference/fatArrowSelf.symbols b/tests/baselines/reference/fatArrowSelf.symbols new file mode 100644 index 00000000000..4008b648ae6 --- /dev/null +++ b/tests/baselines/reference/fatArrowSelf.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/fatArrowSelf.ts === +module Events { +>Events : Symbol(Events, Decl(fatArrowSelf.ts, 0, 0)) + + export interface ListenerCallback { +>ListenerCallback : Symbol(ListenerCallback, Decl(fatArrowSelf.ts, 0, 15)) + + (value:any):void; +>value : Symbol(value, Decl(fatArrowSelf.ts, 2, 9)) + } + export class EventEmitter { +>EventEmitter : Symbol(EventEmitter, Decl(fatArrowSelf.ts, 3, 5)) + + public addListener(type:string, listener:ListenerCallback) { +>addListener : Symbol(addListener, Decl(fatArrowSelf.ts, 4, 31)) +>type : Symbol(type, Decl(fatArrowSelf.ts, 5, 28)) +>listener : Symbol(listener, Decl(fatArrowSelf.ts, 5, 40)) +>ListenerCallback : Symbol(ListenerCallback, Decl(fatArrowSelf.ts, 0, 15)) + } + } +} + +module Consumer { +>Consumer : Symbol(Consumer, Decl(fatArrowSelf.ts, 8, 1)) + + class EventEmitterConsummer { +>EventEmitterConsummer : Symbol(EventEmitterConsummer, Decl(fatArrowSelf.ts, 10, 17)) + + constructor (private emitter: Events.EventEmitter) { } +>emitter : Symbol(emitter, Decl(fatArrowSelf.ts, 12, 21)) +>Events : Symbol(Events, Decl(fatArrowSelf.ts, 0, 0)) +>EventEmitter : Symbol(Events.EventEmitter, Decl(fatArrowSelf.ts, 3, 5)) + + private register() { +>register : Symbol(register, Decl(fatArrowSelf.ts, 12, 62)) + + this.emitter.addListener('change', (e) => { +>this.emitter.addListener : Symbol(Events.EventEmitter.addListener, Decl(fatArrowSelf.ts, 4, 31)) +>this.emitter : Symbol(emitter, Decl(fatArrowSelf.ts, 12, 21)) +>this : Symbol(EventEmitterConsummer, Decl(fatArrowSelf.ts, 10, 17)) +>emitter : Symbol(emitter, Decl(fatArrowSelf.ts, 12, 21)) +>addListener : Symbol(Events.EventEmitter.addListener, Decl(fatArrowSelf.ts, 4, 31)) +>e : Symbol(e, Decl(fatArrowSelf.ts, 15, 48)) + + this.changed(); +>this.changed : Symbol(changed, Decl(fatArrowSelf.ts, 18, 9)) +>this : Symbol(EventEmitterConsummer, Decl(fatArrowSelf.ts, 10, 17)) +>changed : Symbol(changed, Decl(fatArrowSelf.ts, 18, 9)) + + }); + } + + private changed() { +>changed : Symbol(changed, Decl(fatArrowSelf.ts, 18, 9)) + } + } +} diff --git a/tests/baselines/reference/fatArrowSelf.types b/tests/baselines/reference/fatArrowSelf.types index 912e0cd78a7..c4b2936fd37 100644 --- a/tests/baselines/reference/fatArrowSelf.types +++ b/tests/baselines/reference/fatArrowSelf.types @@ -28,7 +28,7 @@ module Consumer { constructor (private emitter: Events.EventEmitter) { } >emitter : Events.EventEmitter ->Events : unknown +>Events : any >EventEmitter : Events.EventEmitter private register() { @@ -41,6 +41,7 @@ module Consumer { >this : EventEmitterConsummer >emitter : Events.EventEmitter >addListener : (type: string, listener: Events.ListenerCallback) => void +>'change' : string >(e) => { this.changed(); } : (e: any) => void >e : any diff --git a/tests/baselines/reference/fatArrowfunctionAsType.symbols b/tests/baselines/reference/fatArrowfunctionAsType.symbols new file mode 100644 index 00000000000..9764149bade --- /dev/null +++ b/tests/baselines/reference/fatArrowfunctionAsType.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/fatArrowfunctionAsType.ts === +declare var b: (x: T) => void ; +>b : Symbol(b, Decl(fatArrowfunctionAsType.ts, 0, 11)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 0, 16)) +>x : Symbol(x, Decl(fatArrowfunctionAsType.ts, 0, 19)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 0, 16)) + +var c: (x: T) => void = function (x: T) { return 42; } +>c : Symbol(c, Decl(fatArrowfunctionAsType.ts, 2, 3)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 2, 8)) +>x : Symbol(x, Decl(fatArrowfunctionAsType.ts, 2, 11)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 2, 8)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 2, 37)) +>x : Symbol(x, Decl(fatArrowfunctionAsType.ts, 2, 40)) +>T : Symbol(T, Decl(fatArrowfunctionAsType.ts, 2, 37)) + +b = c; +>b : Symbol(b, Decl(fatArrowfunctionAsType.ts, 0, 11)) +>c : Symbol(c, Decl(fatArrowfunctionAsType.ts, 2, 3)) + diff --git a/tests/baselines/reference/fatArrowfunctionAsType.types b/tests/baselines/reference/fatArrowfunctionAsType.types index 31f8c128611..a165048695f 100644 --- a/tests/baselines/reference/fatArrowfunctionAsType.types +++ b/tests/baselines/reference/fatArrowfunctionAsType.types @@ -14,6 +14,7 @@ var c: (x: T) => void = function (x: T) { return 42; } >T : T >x : T >T : T +>42 : number b = c; >b = c : (x: T) => void diff --git a/tests/baselines/reference/fatarrowfunctions.symbols b/tests/baselines/reference/fatarrowfunctions.symbols new file mode 100644 index 00000000000..6ed865b0914 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctions.symbols @@ -0,0 +1,168 @@ +=== tests/cases/compiler/fatarrowfunctions.ts === + +function foo(x:any) { +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 1, 13)) + + return x(); +>x : Symbol(x, Decl(fatarrowfunctions.ts, 1, 13)) +} + + +foo((x:number,y,z)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 6, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 6, 14)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 6, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 6, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 6, 14)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 6, 16)) + +foo((x,y,z)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 7, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 7, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 7, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 7, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 7, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 7, 9)) + +foo((x,y:number,z)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 8, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 8, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 8, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 8, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 8, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 8, 16)) + +foo((x,y:number,z:number)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 9, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 9, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 9, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 9, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 9, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 9, 16)) + +foo((x,y,z:number)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 10, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 10, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 10, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 10, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 10, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 10, 9)) + +foo(()=>{return 0;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) + +foo((x:number,y,z)=>x+y+z); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 13, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 13, 14)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 13, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 13, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 13, 14)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 13, 16)) + +foo((x,y,z)=>x+y+z); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 14, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 14, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 14, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 14, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 14, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 14, 9)) + +foo((x,y:number,z)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 15, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 15, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 15, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 15, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 15, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 15, 16)) + +foo((x,y:number,z:number)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 16, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 16, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 16, 16)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 16, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 16, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 16, 16)) + +foo((x,y,z:number)=>{return x+y+z;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 17, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 17, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 17, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 17, 5)) +>y : Symbol(y, Decl(fatarrowfunctions.ts, 17, 7)) +>z : Symbol(z, Decl(fatarrowfunctions.ts, 17, 9)) + +foo(()=>{return 0;}); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) + + +foo(((x) => x)); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 21, 6)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 21, 6)) + +foo(x => x*x); +>foo : Symbol(foo, Decl(fatarrowfunctions.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 23, 4)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 23, 4)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 23, 4)) + +var y = x => x*x; +>y : Symbol(y, Decl(fatarrowfunctions.ts, 25, 3)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 25, 7)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 25, 7)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 25, 7)) + +var z = (x:number) => x*x; +>z : Symbol(z, Decl(fatarrowfunctions.ts, 26, 3)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 26, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 26, 9)) +>x : Symbol(x, Decl(fatarrowfunctions.ts, 26, 9)) + +var w = () => 3; +>w : Symbol(w, Decl(fatarrowfunctions.ts, 28, 3)) + +function ternaryTest(isWhile:boolean) { +>ternaryTest : Symbol(ternaryTest, Decl(fatarrowfunctions.ts, 28, 16)) +>isWhile : Symbol(isWhile, Decl(fatarrowfunctions.ts, 30, 21)) + + var f = isWhile ? function (n) { return n > 0; } : function (n) { return n === 0; }; +>f : Symbol(f, Decl(fatarrowfunctions.ts, 32, 19)) +>isWhile : Symbol(isWhile, Decl(fatarrowfunctions.ts, 30, 21)) +>n : Symbol(n, Decl(fatarrowfunctions.ts, 32, 44)) +>n : Symbol(n, Decl(fatarrowfunctions.ts, 32, 44)) +>n : Symbol(n, Decl(fatarrowfunctions.ts, 32, 77)) +>n : Symbol(n, Decl(fatarrowfunctions.ts, 32, 77)) + +} + +declare function setTimeout(expression: any, msec?: number, language?: any): number; +>setTimeout : Symbol(setTimeout, Decl(fatarrowfunctions.ts, 34, 1)) +>expression : Symbol(expression, Decl(fatarrowfunctions.ts, 36, 28)) +>msec : Symbol(msec, Decl(fatarrowfunctions.ts, 36, 44)) +>language : Symbol(language, Decl(fatarrowfunctions.ts, 36, 59)) + +var messenger = { +>messenger : Symbol(messenger, Decl(fatarrowfunctions.ts, 38, 3)) + + message: "Hello World", +>message : Symbol(message, Decl(fatarrowfunctions.ts, 38, 17)) + + start: function() { +>start : Symbol(start, Decl(fatarrowfunctions.ts, 39, 27)) + + setTimeout(() => { this.message.toString(); }, 3000); +>setTimeout : Symbol(setTimeout, Decl(fatarrowfunctions.ts, 34, 1)) + } +}; + diff --git a/tests/baselines/reference/fatarrowfunctions.types b/tests/baselines/reference/fatarrowfunctions.types index 1b819b8496a..e48b63e50ee 100644 --- a/tests/baselines/reference/fatarrowfunctions.types +++ b/tests/baselines/reference/fatarrowfunctions.types @@ -79,6 +79,7 @@ foo(()=>{return 0;}); >foo(()=>{return 0;}) : any >foo : (x: any) => any >()=>{return 0;} : () => number +>0 : number foo((x:number,y,z)=>x+y+z); >foo((x:number,y,z)=>x+y+z) : any @@ -149,6 +150,7 @@ foo(()=>{return 0;}); >foo(()=>{return 0;}) : any >foo : (x: any) => any >()=>{return 0;} : () => number +>0 : number foo(((x) => x)); @@ -187,6 +189,7 @@ var z = (x:number) => x*x; var w = () => 3; >w : () => number >() => 3 : () => number +>3 : number function ternaryTest(isWhile:boolean) { >ternaryTest : (isWhile: boolean) => void @@ -200,10 +203,12 @@ function ternaryTest(isWhile:boolean) { >n : any >n > 0 : boolean >n : any +>0 : number >function (n) { return n === 0; } : (n: any) => boolean >n : any >n === 0 : boolean >n : any +>0 : number } @@ -219,6 +224,7 @@ var messenger = { message: "Hello World", >message : string +>"Hello World" : string start: function() { >start : () => void @@ -234,6 +240,7 @@ var messenger = { >this : any >message : any >toString : any +>3000 : number } }; diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.symbols b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.symbols new file mode 100644 index 00000000000..731e8558bab --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/fatarrowfunctionsInFunctionParameterDefaults.ts === +function fn(x = () => this, y = x()) { +>fn : Symbol(fn, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 0)) +>x : Symbol(x, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 12)) +>y : Symbol(y, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 27)) +>x : Symbol(x, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 12)) + + // should be 4 + return y; +>y : Symbol(y, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 27)) + +} + +fn.call(4); // Should be 4 +>fn.call : Symbol(Function.call, Decl(lib.d.ts, 234, 45)) +>fn : Symbol(fn, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 0)) +>call : Symbol(Function.call, Decl(lib.d.ts, 234, 45)) + diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types index cf561eb08af..55d72e854d3 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types @@ -19,4 +19,5 @@ fn.call(4); // Should be 4 >fn.call : (thisArg: any, ...argArray: any[]) => any >fn : (x?: () => any, y?: any) => any >call : (thisArg: any, ...argArray: any[]) => any +>4 : number diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctions.symbols b/tests/baselines/reference/fatarrowfunctionsInFunctions.symbols new file mode 100644 index 00000000000..0a86affc215 --- /dev/null +++ b/tests/baselines/reference/fatarrowfunctionsInFunctions.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/fatarrowfunctionsInFunctions.ts === +declare function setTimeout(expression: any, msec?: number, language?: any): number; +>setTimeout : Symbol(setTimeout, Decl(fatarrowfunctionsInFunctions.ts, 0, 0)) +>expression : Symbol(expression, Decl(fatarrowfunctionsInFunctions.ts, 0, 28)) +>msec : Symbol(msec, Decl(fatarrowfunctionsInFunctions.ts, 0, 44)) +>language : Symbol(language, Decl(fatarrowfunctionsInFunctions.ts, 0, 59)) + +var messenger = { +>messenger : Symbol(messenger, Decl(fatarrowfunctionsInFunctions.ts, 2, 3)) + + message: "Hello World", +>message : Symbol(message, Decl(fatarrowfunctionsInFunctions.ts, 2, 17)) + + start: function() { +>start : Symbol(start, Decl(fatarrowfunctionsInFunctions.ts, 3, 27)) + + var _self = this; +>_self : Symbol(_self, Decl(fatarrowfunctionsInFunctions.ts, 5, 11)) + + setTimeout(function() { +>setTimeout : Symbol(setTimeout, Decl(fatarrowfunctionsInFunctions.ts, 0, 0)) + + _self.message.toString(); +>_self : Symbol(_self, Decl(fatarrowfunctionsInFunctions.ts, 5, 11)) + + }, 3000); + } +}; +messenger.start(); +>messenger.start : Symbol(start, Decl(fatarrowfunctionsInFunctions.ts, 3, 27)) +>messenger : Symbol(messenger, Decl(fatarrowfunctionsInFunctions.ts, 2, 3)) +>start : Symbol(start, Decl(fatarrowfunctionsInFunctions.ts, 3, 27)) + diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctions.types b/tests/baselines/reference/fatarrowfunctionsInFunctions.types index a8633eb1a8c..00abaec9f25 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctions.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctions.types @@ -11,6 +11,7 @@ var messenger = { message: "Hello World", >message : string +>"Hello World" : string start: function() { >start : () => void @@ -34,6 +35,7 @@ var messenger = { >toString : any }, 3000); +>3000 : number } }; messenger.start(); diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js index 428a085ca56..e746b24a066 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors1.js @@ -24,7 +24,6 @@ return 103; }); (function () { - if (arg === void 0) { arg = []; } var arg = []; for (var _i = 0; _i < arguments.length; _i++) { arg[_i - 0] = arguments[_i]; diff --git a/tests/baselines/reference/fileReferencesWithNoExtensions.symbols b/tests/baselines/reference/fileReferencesWithNoExtensions.symbols new file mode 100644 index 00000000000..cbf2b27882c --- /dev/null +++ b/tests/baselines/reference/fileReferencesWithNoExtensions.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/t.ts === +/// +/// +/// +var a = aa; // Check that a.ts is referenced +>a : Symbol(a, Decl(t.ts, 3, 3)) +>aa : Symbol(aa, Decl(a.ts, 0, 3)) + +var b = bb; // Check that b.d.ts is referenced +>b : Symbol(b, Decl(t.ts, 4, 3)) +>bb : Symbol(bb, Decl(b.d.ts, 0, 11)) + +var c = cc; // Check that c.ts has precedence over c.d.ts +>c : Symbol(c, Decl(t.ts, 5, 3)) +>cc : Symbol(cc, Decl(c.ts, 0, 3)) + +=== tests/cases/compiler/a.ts === +var aa = 1; +>aa : Symbol(aa, Decl(a.ts, 0, 3)) + +=== tests/cases/compiler/b.d.ts === +declare var bb: number; +>bb : Symbol(bb, Decl(b.d.ts, 0, 11)) + +=== tests/cases/compiler/c.ts === +var cc = 1; +>cc : Symbol(cc, Decl(c.ts, 0, 3)) + +=== tests/cases/compiler/c.d.ts === +declare var xx: number; +>xx : Symbol(xx, Decl(c.d.ts, 0, 11)) + diff --git a/tests/baselines/reference/fileReferencesWithNoExtensions.types b/tests/baselines/reference/fileReferencesWithNoExtensions.types index ec58e338345..7b56dbe0d20 100644 --- a/tests/baselines/reference/fileReferencesWithNoExtensions.types +++ b/tests/baselines/reference/fileReferencesWithNoExtensions.types @@ -17,6 +17,7 @@ var c = cc; // Check that c.ts has precedence over c.d.ts === tests/cases/compiler/a.ts === var aa = 1; >aa : number +>1 : number === tests/cases/compiler/b.d.ts === declare var bb: number; @@ -25,6 +26,7 @@ declare var bb: number; === tests/cases/compiler/c.ts === var cc = 1; >cc : number +>1 : number === tests/cases/compiler/c.d.ts === declare var xx: number; diff --git a/tests/baselines/reference/fileWithNextLine1.symbols b/tests/baselines/reference/fileWithNextLine1.symbols new file mode 100644 index 00000000000..07a8779a486 --- /dev/null +++ b/tests/baselines/reference/fileWithNextLine1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/fileWithNextLine1.ts === +// Note: there is a nextline (0x85) in the string +// 0. It should be counted as a space and should not cause an error. +var v = '…'; +>v : Symbol(v, Decl(fileWithNextLine1.ts, 2, 3)) + diff --git a/tests/baselines/reference/fileWithNextLine1.types b/tests/baselines/reference/fileWithNextLine1.types index 721b3d6fb10..2afb1f2ae37 100644 --- a/tests/baselines/reference/fileWithNextLine1.types +++ b/tests/baselines/reference/fileWithNextLine1.types @@ -3,4 +3,5 @@ // 0. It should be counted as a space and should not cause an error. var v = '…'; >v : string +>'…' : string diff --git a/tests/baselines/reference/fileWithNextLine2.symbols b/tests/baselines/reference/fileWithNextLine2.symbols new file mode 100644 index 00000000000..a9c6d65a9cb --- /dev/null +++ b/tests/baselines/reference/fileWithNextLine2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/fileWithNextLine2.ts === +// Note: there is a nextline (0x85) char between the = and the 0. +// it should be treated like a space +var v =…0; +>v : Symbol(v, Decl(fileWithNextLine2.ts, 2, 3)) + diff --git a/tests/baselines/reference/fileWithNextLine2.types b/tests/baselines/reference/fileWithNextLine2.types index 8a6de1a4b2f..c3e1fd642cf 100644 --- a/tests/baselines/reference/fileWithNextLine2.types +++ b/tests/baselines/reference/fileWithNextLine2.types @@ -3,4 +3,5 @@ // it should be treated like a space var v =…0; >v : number +>0 : number diff --git a/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.symbols b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.symbols new file mode 100644 index 00000000000..eff8999a0f7 --- /dev/null +++ b/tests/baselines/reference/fillInMissingTypeArgsOnConstructCalls.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/fillInMissingTypeArgsOnConstructCalls.ts === +class A{ +>A : Symbol(A, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 0, 0)) +>T : Symbol(T, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 0, 8)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + list: T ; +>list : Symbol(list, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 0, 26)) +>T : Symbol(T, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 0, 8)) +} +var a = new A(); +>a : Symbol(a, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 3, 3)) +>A : Symbol(A, Decl(fillInMissingTypeArgsOnConstructCalls.ts, 0, 0)) + diff --git a/tests/baselines/reference/for-of1.symbols b/tests/baselines/reference/for-of1.symbols new file mode 100644 index 00000000000..05ce10d440b --- /dev/null +++ b/tests/baselines/reference/for-of1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of1.ts === +var v; +>v : Symbol(v, Decl(for-of1.ts, 0, 3)) + +for (v of []) { } +>v : Symbol(v, Decl(for-of1.ts, 0, 3)) + diff --git a/tests/baselines/reference/for-of13.symbols b/tests/baselines/reference/for-of13.symbols new file mode 100644 index 00000000000..c9d3c4d254c --- /dev/null +++ b/tests/baselines/reference/for-of13.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of13.ts === +var v: string; +>v : Symbol(v, Decl(for-of13.ts, 0, 3)) + +for (v of [""].values()) { } +>v : Symbol(v, Decl(for-of13.ts, 0, 3)) +>[""].values : Symbol(Array.values, Decl(lib.d.ts, 1423, 37)) +>values : Symbol(Array.values, Decl(lib.d.ts, 1423, 37)) + diff --git a/tests/baselines/reference/for-of13.types b/tests/baselines/reference/for-of13.types index 4bb29c1e0ab..e176b1bbf0c 100644 --- a/tests/baselines/reference/for-of13.types +++ b/tests/baselines/reference/for-of13.types @@ -7,5 +7,6 @@ for (v of [""].values()) { } >[""].values() : IterableIterator >[""].values : () => IterableIterator >[""] : string[] +>"" : string >values : () => IterableIterator diff --git a/tests/baselines/reference/for-of18.symbols b/tests/baselines/reference/for-of18.symbols new file mode 100644 index 00000000000..180766144c8 --- /dev/null +++ b/tests/baselines/reference/for-of18.symbols @@ -0,0 +1,32 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of18.ts === +var v: string; +>v : Symbol(v, Decl(for-of18.ts, 0, 3)) + +for (v of new StringIterator) { } // Should succeed +>v : Symbol(v, Decl(for-of18.ts, 0, 3)) +>StringIterator : Symbol(StringIterator, Decl(for-of18.ts, 1, 33)) + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(for-of18.ts, 1, 33)) + + next() { +>next : Symbol(next, Decl(for-of18.ts, 3, 22)) + + return { + value: "", +>value : Symbol(value, Decl(for-of18.ts, 5, 16)) + + done: false +>done : Symbol(done, Decl(for-of18.ts, 6, 22)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(StringIterator, Decl(for-of18.ts, 1, 33)) + } +} diff --git a/tests/baselines/reference/for-of18.types b/tests/baselines/reference/for-of18.types index 9ade9359475..5b2be7edc3e 100644 --- a/tests/baselines/reference/for-of18.types +++ b/tests/baselines/reference/for-of18.types @@ -18,9 +18,11 @@ class StringIterator { value: "", >value : string +>"" : string done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of19.symbols b/tests/baselines/reference/for-of19.symbols new file mode 100644 index 00000000000..5dd58d671a7 --- /dev/null +++ b/tests/baselines/reference/for-of19.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of19.ts === +for (var v of new FooIterator) { +>v : Symbol(v, Decl(for-of19.ts, 0, 8)) +>FooIterator : Symbol(FooIterator, Decl(for-of19.ts, 4, 13)) + + v; +>v : Symbol(v, Decl(for-of19.ts, 0, 8)) +} + +class Foo { } +>Foo : Symbol(Foo, Decl(for-of19.ts, 2, 1)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(for-of19.ts, 4, 13)) + + next() { +>next : Symbol(next, Decl(for-of19.ts, 5, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(for-of19.ts, 7, 16)) +>Foo : Symbol(Foo, Decl(for-of19.ts, 2, 1)) + + done: false +>done : Symbol(done, Decl(for-of19.ts, 8, 27)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(for-of19.ts, 4, 13)) + } +} diff --git a/tests/baselines/reference/for-of19.types b/tests/baselines/reference/for-of19.types index 49172b09d83..02ef786ddd9 100644 --- a/tests/baselines/reference/for-of19.types +++ b/tests/baselines/reference/for-of19.types @@ -27,6 +27,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of20.symbols b/tests/baselines/reference/for-of20.symbols new file mode 100644 index 00000000000..50c191a7ac0 --- /dev/null +++ b/tests/baselines/reference/for-of20.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of20.ts === +for (let v of new FooIterator) { +>v : Symbol(v, Decl(for-of20.ts, 0, 8)) +>FooIterator : Symbol(FooIterator, Decl(for-of20.ts, 4, 13)) + + v; +>v : Symbol(v, Decl(for-of20.ts, 0, 8)) +} + +class Foo { } +>Foo : Symbol(Foo, Decl(for-of20.ts, 2, 1)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(for-of20.ts, 4, 13)) + + next() { +>next : Symbol(next, Decl(for-of20.ts, 5, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(for-of20.ts, 7, 16)) +>Foo : Symbol(Foo, Decl(for-of20.ts, 2, 1)) + + done: false +>done : Symbol(done, Decl(for-of20.ts, 8, 27)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(for-of20.ts, 4, 13)) + } +} diff --git a/tests/baselines/reference/for-of20.types b/tests/baselines/reference/for-of20.types index e967869fbd0..3da6fd484b1 100644 --- a/tests/baselines/reference/for-of20.types +++ b/tests/baselines/reference/for-of20.types @@ -27,6 +27,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of21.symbols b/tests/baselines/reference/for-of21.symbols new file mode 100644 index 00000000000..0fbef87af15 --- /dev/null +++ b/tests/baselines/reference/for-of21.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of21.ts === +for (const v of new FooIterator) { +>v : Symbol(v, Decl(for-of21.ts, 0, 10)) +>FooIterator : Symbol(FooIterator, Decl(for-of21.ts, 4, 13)) + + v; +>v : Symbol(v, Decl(for-of21.ts, 0, 10)) +} + +class Foo { } +>Foo : Symbol(Foo, Decl(for-of21.ts, 2, 1)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(for-of21.ts, 4, 13)) + + next() { +>next : Symbol(next, Decl(for-of21.ts, 5, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(for-of21.ts, 7, 16)) +>Foo : Symbol(Foo, Decl(for-of21.ts, 2, 1)) + + done: false +>done : Symbol(done, Decl(for-of21.ts, 8, 27)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(for-of21.ts, 4, 13)) + } +} diff --git a/tests/baselines/reference/for-of21.types b/tests/baselines/reference/for-of21.types index 362f92577e2..a0cc50e99d7 100644 --- a/tests/baselines/reference/for-of21.types +++ b/tests/baselines/reference/for-of21.types @@ -27,6 +27,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of22.symbols b/tests/baselines/reference/for-of22.symbols new file mode 100644 index 00000000000..9714f615a79 --- /dev/null +++ b/tests/baselines/reference/for-of22.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of22.ts === +v; +>v : Symbol(v, Decl(for-of22.ts, 1, 8)) + +for (var v of new FooIterator) { +>v : Symbol(v, Decl(for-of22.ts, 1, 8)) +>FooIterator : Symbol(FooIterator, Decl(for-of22.ts, 5, 13)) + +} + +class Foo { } +>Foo : Symbol(Foo, Decl(for-of22.ts, 3, 1)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(for-of22.ts, 5, 13)) + + next() { +>next : Symbol(next, Decl(for-of22.ts, 6, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(for-of22.ts, 8, 16)) +>Foo : Symbol(Foo, Decl(for-of22.ts, 3, 1)) + + done: false +>done : Symbol(done, Decl(for-of22.ts, 9, 27)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(for-of22.ts, 5, 13)) + } +} diff --git a/tests/baselines/reference/for-of22.types b/tests/baselines/reference/for-of22.types index bb2d5569bfc..09e85798554 100644 --- a/tests/baselines/reference/for-of22.types +++ b/tests/baselines/reference/for-of22.types @@ -28,6 +28,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of23.symbols b/tests/baselines/reference/for-of23.symbols new file mode 100644 index 00000000000..328cb41ad29 --- /dev/null +++ b/tests/baselines/reference/for-of23.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of23.ts === +for (const v of new FooIterator) { +>v : Symbol(v, Decl(for-of23.ts, 0, 10)) +>FooIterator : Symbol(FooIterator, Decl(for-of23.ts, 4, 13)) + + const v = 0; // new scope +>v : Symbol(v, Decl(for-of23.ts, 1, 9)) +} + +class Foo { } +>Foo : Symbol(Foo, Decl(for-of23.ts, 2, 1)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(for-of23.ts, 4, 13)) + + next() { +>next : Symbol(next, Decl(for-of23.ts, 5, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(for-of23.ts, 7, 16)) +>Foo : Symbol(Foo, Decl(for-of23.ts, 2, 1)) + + done: false +>done : Symbol(done, Decl(for-of23.ts, 8, 27)) + + }; + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(for-of23.ts, 4, 13)) + } +} diff --git a/tests/baselines/reference/for-of23.types b/tests/baselines/reference/for-of23.types index b490616edc8..37515c0b70a 100644 --- a/tests/baselines/reference/for-of23.types +++ b/tests/baselines/reference/for-of23.types @@ -6,6 +6,7 @@ for (const v of new FooIterator) { const v = 0; // new scope >v : number +>0 : number } class Foo { } @@ -27,6 +28,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/for-of24.symbols b/tests/baselines/reference/for-of24.symbols new file mode 100644 index 00000000000..cd2546f7278 --- /dev/null +++ b/tests/baselines/reference/for-of24.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of24.ts === +var x: any; +>x : Symbol(x, Decl(for-of24.ts, 0, 3)) + +for (var v of x) { } +>v : Symbol(v, Decl(for-of24.ts, 1, 8)) +>x : Symbol(x, Decl(for-of24.ts, 0, 3)) + diff --git a/tests/baselines/reference/for-of25.symbols b/tests/baselines/reference/for-of25.symbols new file mode 100644 index 00000000000..1a0b660fc1e --- /dev/null +++ b/tests/baselines/reference/for-of25.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of25.ts === +var x: any; +>x : Symbol(x, Decl(for-of25.ts, 0, 3)) + +for (var v of new StringIterator) { } +>v : Symbol(v, Decl(for-of25.ts, 1, 8)) +>StringIterator : Symbol(StringIterator, Decl(for-of25.ts, 1, 37)) + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(for-of25.ts, 1, 37)) + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return x; +>x : Symbol(x, Decl(for-of25.ts, 0, 3)) + } +} diff --git a/tests/baselines/reference/for-of26.symbols b/tests/baselines/reference/for-of26.symbols new file mode 100644 index 00000000000..a2c21c95146 --- /dev/null +++ b/tests/baselines/reference/for-of26.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of26.ts === +var x: any; +>x : Symbol(x, Decl(for-of26.ts, 0, 3)) + +for (var v of new StringIterator) { } +>v : Symbol(v, Decl(for-of26.ts, 1, 8)) +>StringIterator : Symbol(StringIterator, Decl(for-of26.ts, 1, 37)) + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(for-of26.ts, 1, 37)) + + next() { +>next : Symbol(next, Decl(for-of26.ts, 3, 22)) + + return x; +>x : Symbol(x, Decl(for-of26.ts, 0, 3)) + } + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(StringIterator, Decl(for-of26.ts, 1, 37)) + } +} diff --git a/tests/baselines/reference/for-of27.symbols b/tests/baselines/reference/for-of27.symbols new file mode 100644 index 00000000000..e03b580551d --- /dev/null +++ b/tests/baselines/reference/for-of27.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of27.ts === +for (var v of new StringIterator) { } +>v : Symbol(v, Decl(for-of27.ts, 0, 8)) +>StringIterator : Symbol(StringIterator, Decl(for-of27.ts, 0, 37)) + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(for-of27.ts, 0, 37)) + + [Symbol.iterator]: any; +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +} diff --git a/tests/baselines/reference/for-of28.symbols b/tests/baselines/reference/for-of28.symbols new file mode 100644 index 00000000000..9d6b912bd94 --- /dev/null +++ b/tests/baselines/reference/for-of28.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of28.ts === +for (var v of new StringIterator) { } +>v : Symbol(v, Decl(for-of28.ts, 0, 8)) +>StringIterator : Symbol(StringIterator, Decl(for-of28.ts, 0, 37)) + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(for-of28.ts, 0, 37)) + + next: any; +>next : Symbol(next, Decl(for-of28.ts, 2, 22)) + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(StringIterator, Decl(for-of28.ts, 0, 37)) + } +} diff --git a/tests/baselines/reference/for-of36.symbols b/tests/baselines/reference/for-of36.symbols new file mode 100644 index 00000000000..f1924540340 --- /dev/null +++ b/tests/baselines/reference/for-of36.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of36.ts === +var tuple: [string, boolean] = ["", true]; +>tuple : Symbol(tuple, Decl(for-of36.ts, 0, 3)) + +for (var v of tuple) { +>v : Symbol(v, Decl(for-of36.ts, 1, 8)) +>tuple : Symbol(tuple, Decl(for-of36.ts, 0, 3)) + + v; +>v : Symbol(v, Decl(for-of36.ts, 1, 8)) +} diff --git a/tests/baselines/reference/for-of36.types b/tests/baselines/reference/for-of36.types index da03367ba5d..e23ea79d0a9 100644 --- a/tests/baselines/reference/for-of36.types +++ b/tests/baselines/reference/for-of36.types @@ -2,6 +2,8 @@ var tuple: [string, boolean] = ["", true]; >tuple : [string, boolean] >["", true] : [string, boolean] +>"" : string +>true : boolean for (var v of tuple) { >v : string | boolean diff --git a/tests/baselines/reference/for-of37.symbols b/tests/baselines/reference/for-of37.symbols new file mode 100644 index 00000000000..86841971be7 --- /dev/null +++ b/tests/baselines/reference/for-of37.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of37.ts === +var map = new Map([["", true]]); +>map : Symbol(map, Decl(for-of37.ts, 0, 3)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + +for (var v of map) { +>v : Symbol(v, Decl(for-of37.ts, 1, 8)) +>map : Symbol(map, Decl(for-of37.ts, 0, 3)) + + v; +>v : Symbol(v, Decl(for-of37.ts, 1, 8)) +} diff --git a/tests/baselines/reference/for-of37.types b/tests/baselines/reference/for-of37.types index f137db79af0..89272742f62 100644 --- a/tests/baselines/reference/for-of37.types +++ b/tests/baselines/reference/for-of37.types @@ -5,6 +5,8 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean for (var v of map) { >v : [string, boolean] diff --git a/tests/baselines/reference/for-of38.symbols b/tests/baselines/reference/for-of38.symbols new file mode 100644 index 00000000000..5ee81f2eb15 --- /dev/null +++ b/tests/baselines/reference/for-of38.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of38.ts === +var map = new Map([["", true]]); +>map : Symbol(map, Decl(for-of38.ts, 0, 3)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + +for (var [k, v] of map) { +>k : Symbol(k, Decl(for-of38.ts, 1, 10)) +>v : Symbol(v, Decl(for-of38.ts, 1, 12)) +>map : Symbol(map, Decl(for-of38.ts, 0, 3)) + + k; +>k : Symbol(k, Decl(for-of38.ts, 1, 10)) + + v; +>v : Symbol(v, Decl(for-of38.ts, 1, 12)) +} diff --git a/tests/baselines/reference/for-of38.types b/tests/baselines/reference/for-of38.types index cdd1e05dd7e..f8b7555781f 100644 --- a/tests/baselines/reference/for-of38.types +++ b/tests/baselines/reference/for-of38.types @@ -5,6 +5,8 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean for (var [k, v] of map) { >k : string diff --git a/tests/baselines/reference/for-of4.symbols b/tests/baselines/reference/for-of4.symbols new file mode 100644 index 00000000000..af291f47c98 --- /dev/null +++ b/tests/baselines/reference/for-of4.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of4.ts === +for (var v of [0]) { +>v : Symbol(v, Decl(for-of4.ts, 0, 8)) + + v; +>v : Symbol(v, Decl(for-of4.ts, 0, 8)) +} diff --git a/tests/baselines/reference/for-of4.types b/tests/baselines/reference/for-of4.types index 2076fae84fc..5b8990797ba 100644 --- a/tests/baselines/reference/for-of4.types +++ b/tests/baselines/reference/for-of4.types @@ -2,6 +2,7 @@ for (var v of [0]) { >v : number >[0] : number[] +>0 : number v; >v : number diff --git a/tests/baselines/reference/for-of40.symbols b/tests/baselines/reference/for-of40.symbols new file mode 100644 index 00000000000..a9c0b3fbc30 --- /dev/null +++ b/tests/baselines/reference/for-of40.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of40.ts === +var map = new Map([["", true]]); +>map : Symbol(map, Decl(for-of40.ts, 0, 3)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + +for (var [k = "", v = false] of map) { +>k : Symbol(k, Decl(for-of40.ts, 1, 10)) +>v : Symbol(v, Decl(for-of40.ts, 1, 17)) +>map : Symbol(map, Decl(for-of40.ts, 0, 3)) + + k; +>k : Symbol(k, Decl(for-of40.ts, 1, 10)) + + v; +>v : Symbol(v, Decl(for-of40.ts, 1, 17)) +} diff --git a/tests/baselines/reference/for-of40.types b/tests/baselines/reference/for-of40.types index c0fe7cbbc02..6693514ec53 100644 --- a/tests/baselines/reference/for-of40.types +++ b/tests/baselines/reference/for-of40.types @@ -5,10 +5,14 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean for (var [k = "", v = false] of map) { >k : string +>"" : string >v : boolean +>false : boolean >map : Map k; diff --git a/tests/baselines/reference/for-of41.symbols b/tests/baselines/reference/for-of41.symbols new file mode 100644 index 00000000000..cf8db913919 --- /dev/null +++ b/tests/baselines/reference/for-of41.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of41.ts === +var array = [{x: [0], y: {p: ""}}] +>array : Symbol(array, Decl(for-of41.ts, 0, 3)) +>x : Symbol(x, Decl(for-of41.ts, 0, 14)) +>y : Symbol(y, Decl(for-of41.ts, 0, 21)) +>p : Symbol(p, Decl(for-of41.ts, 0, 26)) + +for (var {x: [a], y: {p}} of array) { +>a : Symbol(a, Decl(for-of41.ts, 1, 14)) +>p : Symbol(p, Decl(for-of41.ts, 1, 22)) +>array : Symbol(array, Decl(for-of41.ts, 0, 3)) + + a; +>a : Symbol(a, Decl(for-of41.ts, 1, 14)) + + p; +>p : Symbol(p, Decl(for-of41.ts, 1, 22)) +} diff --git a/tests/baselines/reference/for-of41.types b/tests/baselines/reference/for-of41.types index 54e58aa1ec7..31e3e253002 100644 --- a/tests/baselines/reference/for-of41.types +++ b/tests/baselines/reference/for-of41.types @@ -5,14 +5,16 @@ var array = [{x: [0], y: {p: ""}}] >{x: [0], y: {p: ""}} : { x: number[]; y: { p: string; }; } >x : number[] >[0] : number[] +>0 : number >y : { p: string; } >{p: ""} : { p: string; } >p : string +>"" : string for (var {x: [a], y: {p}} of array) { ->x : unknown +>x : any >a : number ->y : unknown +>y : any >p : string >array : { x: number[]; y: { p: string; }; }[] diff --git a/tests/baselines/reference/for-of42.symbols b/tests/baselines/reference/for-of42.symbols new file mode 100644 index 00000000000..b310fb1044f --- /dev/null +++ b/tests/baselines/reference/for-of42.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of42.ts === +var array = [{ x: "", y: 0 }] +>array : Symbol(array, Decl(for-of42.ts, 0, 3)) +>x : Symbol(x, Decl(for-of42.ts, 0, 14)) +>y : Symbol(y, Decl(for-of42.ts, 0, 21)) + +for (var {x: a, y: b} of array) { +>a : Symbol(a, Decl(for-of42.ts, 1, 10)) +>b : Symbol(b, Decl(for-of42.ts, 1, 15)) +>array : Symbol(array, Decl(for-of42.ts, 0, 3)) + + a; +>a : Symbol(a, Decl(for-of42.ts, 1, 10)) + + b; +>b : Symbol(b, Decl(for-of42.ts, 1, 15)) +} diff --git a/tests/baselines/reference/for-of42.types b/tests/baselines/reference/for-of42.types index 1a819452770..64327bcc27f 100644 --- a/tests/baselines/reference/for-of42.types +++ b/tests/baselines/reference/for-of42.types @@ -4,12 +4,14 @@ var array = [{ x: "", y: 0 }] >[{ x: "", y: 0 }] : { x: string; y: number; }[] >{ x: "", y: 0 } : { x: string; y: number; } >x : string +>"" : string >y : number +>0 : number for (var {x: a, y: b} of array) { ->x : unknown +>x : any >a : string ->y : unknown +>y : any >b : number >array : { x: string; y: number; }[] diff --git a/tests/baselines/reference/for-of44.symbols b/tests/baselines/reference/for-of44.symbols new file mode 100644 index 00000000000..e01aad51d54 --- /dev/null +++ b/tests/baselines/reference/for-of44.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of44.ts === +var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symbol()]] +>array : Symbol(array, Decl(for-of44.ts, 0, 3)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + +for (var [num, strBoolSym] of array) { +>num : Symbol(num, Decl(for-of44.ts, 1, 10)) +>strBoolSym : Symbol(strBoolSym, Decl(for-of44.ts, 1, 14)) +>array : Symbol(array, Decl(for-of44.ts, 0, 3)) + + num; +>num : Symbol(num, Decl(for-of44.ts, 1, 10)) + + strBoolSym; +>strBoolSym : Symbol(strBoolSym, Decl(for-of44.ts, 1, 14)) +} diff --git a/tests/baselines/reference/for-of44.types b/tests/baselines/reference/for-of44.types index 078b49bd309..e6f4e0450b3 100644 --- a/tests/baselines/reference/for-of44.types +++ b/tests/baselines/reference/for-of44.types @@ -3,8 +3,13 @@ var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symb >array : [number, string | boolean | symbol][] >[[0, ""], [0, true], [1, Symbol()]] : ([number, string] | [number, boolean] | [number, symbol])[] >[0, ""] : [number, string] +>0 : number +>"" : string >[0, true] : [number, boolean] +>0 : number +>true : boolean >[1, Symbol()] : [number, symbol] +>1 : number >Symbol() : symbol >Symbol : SymbolConstructor diff --git a/tests/baselines/reference/for-of45.symbols b/tests/baselines/reference/for-of45.symbols new file mode 100644 index 00000000000..e86ee110362 --- /dev/null +++ b/tests/baselines/reference/for-of45.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of45.ts === +var k: string, v: boolean; +>k : Symbol(k, Decl(for-of45.ts, 0, 3)) +>v : Symbol(v, Decl(for-of45.ts, 0, 14)) + +var map = new Map([["", true]]); +>map : Symbol(map, Decl(for-of45.ts, 1, 3)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + +for ([k = "", v = false] of map) { +>k : Symbol(k, Decl(for-of45.ts, 0, 3)) +>v : Symbol(v, Decl(for-of45.ts, 0, 14)) +>map : Symbol(map, Decl(for-of45.ts, 1, 3)) + + k; +>k : Symbol(k, Decl(for-of45.ts, 0, 3)) + + v; +>v : Symbol(v, Decl(for-of45.ts, 0, 14)) +} diff --git a/tests/baselines/reference/for-of45.types b/tests/baselines/reference/for-of45.types index 8ac4b9fa7e9..b71e062eccf 100644 --- a/tests/baselines/reference/for-of45.types +++ b/tests/baselines/reference/for-of45.types @@ -9,13 +9,17 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean for ([k = "", v = false] of map) { >[k = "", v = false] : (string | boolean)[] >k = "" : string >k : string +>"" : string >v = false : boolean >v : boolean +>false : boolean >map : Map k; diff --git a/tests/baselines/reference/for-of49.errors.txt b/tests/baselines/reference/for-of49.errors.txt index d5bc314e678..aaf29f5bfe3 100644 --- a/tests/baselines/reference/for-of49.errors.txt +++ b/tests/baselines/reference/for-of49.errors.txt @@ -1,12 +1,14 @@ -tests/cases/conformance/es6/for-ofStatements/for-of49.ts(3,13): error TS2364: Invalid left-hand side of assignment expression. +tests/cases/conformance/es6/for-ofStatements/for-of49.ts(3,14): error TS2322: Type 'string | boolean' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/for-ofStatements/for-of49.ts (1 errors) ==== var k: string, v: boolean; var map = new Map([["", true]]); for ([k, ...[v]] of map) { - ~~~ -!!! error TS2364: Invalid left-hand side of assignment expression. + ~ +!!! error TS2322: Type 'string | boolean' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. k; v; } \ No newline at end of file diff --git a/tests/baselines/reference/for-of5.symbols b/tests/baselines/reference/for-of5.symbols new file mode 100644 index 00000000000..776759b3a37 --- /dev/null +++ b/tests/baselines/reference/for-of5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of5.ts === +for (let v of [0]) { +>v : Symbol(v, Decl(for-of5.ts, 0, 8)) + + v; +>v : Symbol(v, Decl(for-of5.ts, 0, 8)) +} diff --git a/tests/baselines/reference/for-of5.types b/tests/baselines/reference/for-of5.types index feac5ef9e52..921c327c185 100644 --- a/tests/baselines/reference/for-of5.types +++ b/tests/baselines/reference/for-of5.types @@ -2,6 +2,7 @@ for (let v of [0]) { >v : number >[0] : number[] +>0 : number v; >v : number diff --git a/tests/baselines/reference/for-of50.symbols b/tests/baselines/reference/for-of50.symbols new file mode 100644 index 00000000000..9076f63300e --- /dev/null +++ b/tests/baselines/reference/for-of50.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of50.ts === +var map = new Map([["", true]]); +>map : Symbol(map, Decl(for-of50.ts, 0, 3)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + +for (const [k, v] of map) { +>k : Symbol(k, Decl(for-of50.ts, 1, 12)) +>v : Symbol(v, Decl(for-of50.ts, 1, 14)) +>map : Symbol(map, Decl(for-of50.ts, 0, 3)) + + k; +>k : Symbol(k, Decl(for-of50.ts, 1, 12)) + + v; +>v : Symbol(v, Decl(for-of50.ts, 1, 14)) +} diff --git a/tests/baselines/reference/for-of50.types b/tests/baselines/reference/for-of50.types index a38f3855174..5d5dac7abed 100644 --- a/tests/baselines/reference/for-of50.types +++ b/tests/baselines/reference/for-of50.types @@ -5,6 +5,8 @@ var map = new Map([["", true]]); >Map : MapConstructor >[["", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean for (const [k, v] of map) { >k : string diff --git a/tests/baselines/reference/for-of53.symbols b/tests/baselines/reference/for-of53.symbols new file mode 100644 index 00000000000..949b2624985 --- /dev/null +++ b/tests/baselines/reference/for-of53.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of53.ts === +for (let v of []) { +>v : Symbol(v, Decl(for-of53.ts, 0, 8)) + + var v; +>v : Symbol(v, Decl(for-of53.ts, 1, 7)) +} diff --git a/tests/baselines/reference/for-of56.symbols b/tests/baselines/reference/for-of56.symbols new file mode 100644 index 00000000000..4e754075922 --- /dev/null +++ b/tests/baselines/reference/for-of56.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of56.ts === +for (var let of []) {} +>let : Symbol(let, Decl(for-of56.ts, 0, 8)) + diff --git a/tests/baselines/reference/for-of57.symbols b/tests/baselines/reference/for-of57.symbols new file mode 100644 index 00000000000..60e87b25587 --- /dev/null +++ b/tests/baselines/reference/for-of57.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of57.ts === +var iter: Iterable; +>iter : Symbol(iter, Decl(for-of57.ts, 0, 3)) +>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1633, 1)) + +for (let num of iter) { } +>num : Symbol(num, Decl(for-of57.ts, 1, 8)) +>iter : Symbol(iter, Decl(for-of57.ts, 0, 3)) + diff --git a/tests/baselines/reference/for-of8.symbols b/tests/baselines/reference/for-of8.symbols new file mode 100644 index 00000000000..a7190fc5d13 --- /dev/null +++ b/tests/baselines/reference/for-of8.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of8.ts === +v; +>v : Symbol(v, Decl(for-of8.ts, 1, 8)) + +for (var v of [0]) { } +>v : Symbol(v, Decl(for-of8.ts, 1, 8)) + diff --git a/tests/baselines/reference/for-of8.types b/tests/baselines/reference/for-of8.types index 5f239d141fe..36bb20ef6b0 100644 --- a/tests/baselines/reference/for-of8.types +++ b/tests/baselines/reference/for-of8.types @@ -5,4 +5,5 @@ v; for (var v of [0]) { } >v : number >[0] : number[] +>0 : number diff --git a/tests/baselines/reference/for-of9.symbols b/tests/baselines/reference/for-of9.symbols new file mode 100644 index 00000000000..5fc2f76f3a6 --- /dev/null +++ b/tests/baselines/reference/for-of9.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/es6/for-ofStatements/for-of9.ts === +var v: string; +>v : Symbol(v, Decl(for-of9.ts, 0, 3)) + +for (v of ["hello"]) { } +>v : Symbol(v, Decl(for-of9.ts, 0, 3)) + +for (v of "hello") { } +>v : Symbol(v, Decl(for-of9.ts, 0, 3)) + diff --git a/tests/baselines/reference/for-of9.types b/tests/baselines/reference/for-of9.types index 55c8167094f..bf06bf46034 100644 --- a/tests/baselines/reference/for-of9.types +++ b/tests/baselines/reference/for-of9.types @@ -5,7 +5,9 @@ var v: string; for (v of ["hello"]) { } >v : string >["hello"] : string[] +>"hello" : string for (v of "hello") { } >v : string +>"hello" : string diff --git a/tests/baselines/reference/forBreakStatements.symbols b/tests/baselines/reference/forBreakStatements.symbols new file mode 100644 index 00000000000..76db9309a39 --- /dev/null +++ b/tests/baselines/reference/forBreakStatements.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/statements/breakStatements/forBreakStatements.ts === +for (; ;) { + break; +} + +ONE: +for (; ;) { + break ONE; +} + +TWO: +THREE: +for (; ;) { + break THREE; +} + +FOUR: +for (; ;) { + FIVE: + for (; ;) { + break FOUR; + } +} + +for (; ;) { + SIX: + for (; ;) break SIX; +} + +SEVEN: +for (; ;) for (; ;) for (; ;) break SEVEN; + +EIGHT: +for (; ;) { + var fn = function () { } +>fn : Symbol(fn, Decl(forBreakStatements.ts, 33, 7)) + + break EIGHT; +} + diff --git a/tests/baselines/reference/forBreakStatements.types b/tests/baselines/reference/forBreakStatements.types index dafaae9cce7..8469a85bd19 100644 --- a/tests/baselines/reference/forBreakStatements.types +++ b/tests/baselines/reference/forBreakStatements.types @@ -4,38 +4,60 @@ for (; ;) { } ONE: +>ONE : any + for (; ;) { break ONE; +>ONE : any } TWO: +>TWO : any + THREE: +>THREE : any + for (; ;) { break THREE; +>THREE : any } FOUR: +>FOUR : any + for (; ;) { FIVE: +>FIVE : any + for (; ;) { break FOUR; +>FOUR : any } } for (; ;) { SIX: +>SIX : any + for (; ;) break SIX; +>SIX : any } SEVEN: +>SEVEN : any + for (; ;) for (; ;) for (; ;) break SEVEN; +>SEVEN : any EIGHT: +>EIGHT : any + for (; ;) { var fn = function () { } >fn : () => void >function () { } : () => void break EIGHT; +>EIGHT : any } diff --git a/tests/baselines/reference/forContinueStatements.symbols b/tests/baselines/reference/forContinueStatements.symbols new file mode 100644 index 00000000000..e24eb2aaa92 --- /dev/null +++ b/tests/baselines/reference/forContinueStatements.symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/statements/continueStatements/forContinueStatements.ts === +for (; ;) { + continue; +} + +ONE: +for (; ;) { + continue ONE; +} + +TWO: +THREE: +for (; ;) { + continue THREE; +} + +FOUR: +for (; ;) { + FIVE: + for (; ;) { + continue FOUR; + } +} + +for (; ;) { + SIX: + for (; ;) continue SIX; +} + +SEVEN: +for (; ;) for (; ;) for (; ;) continue SEVEN; + +EIGHT: +for (; ;) { + var fn = function () { } +>fn : Symbol(fn, Decl(forContinueStatements.ts, 33, 7)) + + continue EIGHT; +} + diff --git a/tests/baselines/reference/forContinueStatements.types b/tests/baselines/reference/forContinueStatements.types index 60fd7115362..79b78e83345 100644 --- a/tests/baselines/reference/forContinueStatements.types +++ b/tests/baselines/reference/forContinueStatements.types @@ -4,38 +4,60 @@ for (; ;) { } ONE: +>ONE : any + for (; ;) { continue ONE; +>ONE : any } TWO: +>TWO : any + THREE: +>THREE : any + for (; ;) { continue THREE; +>THREE : any } FOUR: +>FOUR : any + for (; ;) { FIVE: +>FIVE : any + for (; ;) { continue FOUR; +>FOUR : any } } for (; ;) { SIX: +>SIX : any + for (; ;) continue SIX; +>SIX : any } SEVEN: +>SEVEN : any + for (; ;) for (; ;) for (; ;) continue SEVEN; +>SEVEN : any EIGHT: +>EIGHT : any + for (; ;) { var fn = function () { } >fn : () => void >function () { } : () => void continue EIGHT; +>EIGHT : any } diff --git a/tests/baselines/reference/forInBreakStatements.symbols b/tests/baselines/reference/forInBreakStatements.symbols new file mode 100644 index 00000000000..7984edc3fd6 --- /dev/null +++ b/tests/baselines/reference/forInBreakStatements.symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/statements/breakStatements/forInBreakStatements.ts === +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + break; +} + +ONE: +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + break ONE; +} + +TWO: +THREE: +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + break THREE; +} + +FOUR: +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + FIVE: + for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + break FOUR; + } +} + +for(var x in {}) { +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + SIX: + for(var x in {}) break SIX; +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) +} + +SEVEN: +for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + +EIGHT: +for (var x in {}){ +>x : Symbol(x, Decl(forInBreakStatements.ts, 0, 7), Decl(forInBreakStatements.ts, 5, 7), Decl(forInBreakStatements.ts, 11, 7), Decl(forInBreakStatements.ts, 16, 7), Decl(forInBreakStatements.ts, 18, 11), Decl(forInBreakStatements.ts, 23, 7), Decl(forInBreakStatements.ts, 25, 11), Decl(forInBreakStatements.ts, 29, 8), Decl(forInBreakStatements.ts, 29, 26), Decl(forInBreakStatements.ts, 29, 44), Decl(forInBreakStatements.ts, 32, 8)) + + var fn = function () { } +>fn : Symbol(fn, Decl(forInBreakStatements.ts, 33, 7)) + + break EIGHT; +} + diff --git a/tests/baselines/reference/forInBreakStatements.types b/tests/baselines/reference/forInBreakStatements.types index 8d0cf0ace3c..05ea8e35feb 100644 --- a/tests/baselines/reference/forInBreakStatements.types +++ b/tests/baselines/reference/forInBreakStatements.types @@ -7,33 +7,46 @@ for(var x in {}) { } ONE: +>ONE : any + for(var x in {}) { >x : any >{} : {} break ONE; +>ONE : any } TWO: +>TWO : any + THREE: +>THREE : any + for(var x in {}) { >x : any >{} : {} break THREE; +>THREE : any } FOUR: +>FOUR : any + for(var x in {}) { >x : any >{} : {} FIVE: +>FIVE : any + for(var x in {}) { >x : any >{} : {} break FOUR; +>FOUR : any } } @@ -42,12 +55,17 @@ for(var x in {}) { >{} : {} SIX: +>SIX : any + for(var x in {}) break SIX; >x : any >{} : {} +>SIX : any } SEVEN: +>SEVEN : any + for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; >x : any >{} : {} @@ -55,8 +73,11 @@ for (var x in {}) for (var x in {}) for (var x in {}) break SEVEN; >{} : {} >x : any >{} : {} +>SEVEN : any EIGHT: +>EIGHT : any + for (var x in {}){ >x : any >{} : {} @@ -66,5 +87,6 @@ for (var x in {}){ >function () { } : () => void break EIGHT; +>EIGHT : any } diff --git a/tests/baselines/reference/forInContinueStatements.symbols b/tests/baselines/reference/forInContinueStatements.symbols new file mode 100644 index 00000000000..88129a50d21 --- /dev/null +++ b/tests/baselines/reference/forInContinueStatements.symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/statements/continueStatements/forInContinueStatements.ts === +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + continue; +} + +ONE: +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + continue ONE; +} + +TWO: +THREE: +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + continue THREE; +} + +FOUR: +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + FIVE: + for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + continue FOUR; + } +} + +for(var x in {}) { +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + SIX: + for(var x in {}) continue SIX; +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) +} + +SEVEN: +for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + +EIGHT: +for (var x in {}){ +>x : Symbol(x, Decl(forInContinueStatements.ts, 0, 7), Decl(forInContinueStatements.ts, 5, 7), Decl(forInContinueStatements.ts, 11, 7), Decl(forInContinueStatements.ts, 16, 7), Decl(forInContinueStatements.ts, 18, 11), Decl(forInContinueStatements.ts, 23, 7), Decl(forInContinueStatements.ts, 25, 11), Decl(forInContinueStatements.ts, 29, 8), Decl(forInContinueStatements.ts, 29, 26), Decl(forInContinueStatements.ts, 29, 44), Decl(forInContinueStatements.ts, 32, 8)) + + var fn = function () { } +>fn : Symbol(fn, Decl(forInContinueStatements.ts, 33, 7)) + + continue EIGHT; +} + diff --git a/tests/baselines/reference/forInContinueStatements.types b/tests/baselines/reference/forInContinueStatements.types index 3751c11aaa9..95637345fa6 100644 --- a/tests/baselines/reference/forInContinueStatements.types +++ b/tests/baselines/reference/forInContinueStatements.types @@ -7,33 +7,46 @@ for(var x in {}) { } ONE: +>ONE : any + for(var x in {}) { >x : any >{} : {} continue ONE; +>ONE : any } TWO: +>TWO : any + THREE: +>THREE : any + for(var x in {}) { >x : any >{} : {} continue THREE; +>THREE : any } FOUR: +>FOUR : any + for(var x in {}) { >x : any >{} : {} FIVE: +>FIVE : any + for(var x in {}) { >x : any >{} : {} continue FOUR; +>FOUR : any } } @@ -42,12 +55,17 @@ for(var x in {}) { >{} : {} SIX: +>SIX : any + for(var x in {}) continue SIX; >x : any >{} : {} +>SIX : any } SEVEN: +>SEVEN : any + for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; >x : any >{} : {} @@ -55,8 +73,11 @@ for (var x in {}) for (var x in {}) for (var x in {}) continue SEVEN; >{} : {} >x : any >{} : {} +>SEVEN : any EIGHT: +>EIGHT : any + for (var x in {}){ >x : any >{} : {} @@ -66,5 +87,6 @@ for (var x in {}){ >function () { } : () => void continue EIGHT; +>EIGHT : any } diff --git a/tests/baselines/reference/forInModule.symbols b/tests/baselines/reference/forInModule.symbols new file mode 100644 index 00000000000..e540725f69f --- /dev/null +++ b/tests/baselines/reference/forInModule.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/forInModule.ts === +module Foo { +>Foo : Symbol(Foo, Decl(forInModule.ts, 0, 0)) + + for (var i = 0; i < 1; i++) { +>i : Symbol(i, Decl(forInModule.ts, 1, 9)) +>i : Symbol(i, Decl(forInModule.ts, 1, 9)) +>i : Symbol(i, Decl(forInModule.ts, 1, 9)) + + i+i; +>i : Symbol(i, Decl(forInModule.ts, 1, 9)) +>i : Symbol(i, Decl(forInModule.ts, 1, 9)) + } +} diff --git a/tests/baselines/reference/forInModule.types b/tests/baselines/reference/forInModule.types index 7de39df3b33..d78a511206b 100644 --- a/tests/baselines/reference/forInModule.types +++ b/tests/baselines/reference/forInModule.types @@ -4,8 +4,10 @@ module Foo { for (var i = 0; i < 1; i++) { >i : number +>0 : number >i < 1 : boolean >i : number +>1 : number >i++ : number >i : number diff --git a/tests/baselines/reference/forInStatement1.symbols b/tests/baselines/reference/forInStatement1.symbols new file mode 100644 index 00000000000..ab4003bb0d2 --- /dev/null +++ b/tests/baselines/reference/forInStatement1.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/forInStatement1.ts === +var expr: any; +>expr : Symbol(expr, Decl(forInStatement1.ts, 0, 3)) + +for (var a in expr) { +>a : Symbol(a, Decl(forInStatement1.ts, 1, 8)) +>expr : Symbol(expr, Decl(forInStatement1.ts, 0, 3)) +} diff --git a/tests/baselines/reference/forInStatement3.symbols b/tests/baselines/reference/forInStatement3.symbols new file mode 100644 index 00000000000..24896d89cfc --- /dev/null +++ b/tests/baselines/reference/forInStatement3.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/forInStatement3.ts === +function F() { +>F : Symbol(F, Decl(forInStatement3.ts, 0, 0)) +>T : Symbol(T, Decl(forInStatement3.ts, 0, 11)) + + var expr: T; +>expr : Symbol(expr, Decl(forInStatement3.ts, 1, 5)) +>T : Symbol(T, Decl(forInStatement3.ts, 0, 11)) + + for (var a in expr) { +>a : Symbol(a, Decl(forInStatement3.ts, 2, 10)) +>expr : Symbol(expr, Decl(forInStatement3.ts, 1, 5)) + } +} diff --git a/tests/baselines/reference/forInStatement5.symbols b/tests/baselines/reference/forInStatement5.symbols new file mode 100644 index 00000000000..2705ea3285c --- /dev/null +++ b/tests/baselines/reference/forInStatement5.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/forInStatement5.ts === +var a: string; +>a : Symbol(a, Decl(forInStatement5.ts, 0, 3)) + +var expr: any; +>expr : Symbol(expr, Decl(forInStatement5.ts, 1, 3)) + +for (a in expr) { +>a : Symbol(a, Decl(forInStatement5.ts, 0, 3)) +>expr : Symbol(expr, Decl(forInStatement5.ts, 1, 3)) +} diff --git a/tests/baselines/reference/forInStatement6.symbols b/tests/baselines/reference/forInStatement6.symbols new file mode 100644 index 00000000000..8e218969959 --- /dev/null +++ b/tests/baselines/reference/forInStatement6.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/forInStatement6.ts === +var a: any; +>a : Symbol(a, Decl(forInStatement6.ts, 0, 3)) + +var expr: any; +>expr : Symbol(expr, Decl(forInStatement6.ts, 1, 3)) + +for (a in expr) { +>a : Symbol(a, Decl(forInStatement6.ts, 0, 3)) +>expr : Symbol(expr, Decl(forInStatement6.ts, 1, 3)) +} diff --git a/tests/baselines/reference/forStatements.symbols b/tests/baselines/reference/forStatements.symbols new file mode 100644 index 00000000000..6f7c6d6cdbe --- /dev/null +++ b/tests/baselines/reference/forStatements.symbols @@ -0,0 +1,145 @@ +=== tests/cases/conformance/statements/forStatements/forStatements.ts === +interface I { +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(forStatements.ts, 0, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(forStatements.ts, 2, 1)) +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(forStatements.ts, 4, 22)) +} + +class D{ +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) +>T : Symbol(T, Decl(forStatements.ts, 8, 8)) + + source: T; +>source : Symbol(source, Decl(forStatements.ts, 8, 11)) +>T : Symbol(T, Decl(forStatements.ts, 8, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(forStatements.ts, 9, 14)) +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) +>T : Symbol(T, Decl(forStatements.ts, 8, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(forStatements.ts, 10, 18)) +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) +>T : Symbol(T, Decl(forStatements.ts, 8, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(forStatements.ts, 12, 1)) +>x : Symbol(x, Decl(forStatements.ts, 14, 11)) + +module M { +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) + + export class A { +>A : Symbol(A, Decl(forStatements.ts, 16, 10)) + + name: string; +>name : Symbol(name, Decl(forStatements.ts, 17, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(forStatements.ts, 19, 5)) +>x : Symbol(x, Decl(forStatements.ts, 21, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(forStatements.ts, 21, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} + +for(var aNumber: number = 9.9;;){} +>aNumber : Symbol(aNumber, Decl(forStatements.ts, 24, 7)) + +for(var aString: string = 'this is a string';;){} +>aString : Symbol(aString, Decl(forStatements.ts, 25, 7)) + +for(var aDate: Date = new Date(12);;){} +>aDate : Symbol(aDate, Decl(forStatements.ts, 26, 7)) +>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)) + +for(var anObject: Object = new Object();;){} +>anObject : Symbol(anObject, Decl(forStatements.ts, 27, 7)) +>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)) + +for(var anAny: any = null;;){} +>anAny : Symbol(anAny, Decl(forStatements.ts, 29, 7)) + +for(var aSecondAny: any = undefined;;){} +>aSecondAny : Symbol(aSecondAny, Decl(forStatements.ts, 30, 7)) +>undefined : Symbol(undefined) + +for(var aVoid: void = undefined;;){} +>aVoid : Symbol(aVoid, Decl(forStatements.ts, 31, 7)) +>undefined : Symbol(undefined) + +for(var anInterface: I = new C();;){} +>anInterface : Symbol(anInterface, Decl(forStatements.ts, 33, 7)) +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) +>C : Symbol(C, Decl(forStatements.ts, 2, 1)) + +for(var aClass: C = new C();;){} +>aClass : Symbol(aClass, Decl(forStatements.ts, 34, 7)) +>C : Symbol(C, Decl(forStatements.ts, 2, 1)) +>C : Symbol(C, Decl(forStatements.ts, 2, 1)) + +for(var aGenericClass: D = new D();;){} +>aGenericClass : Symbol(aGenericClass, Decl(forStatements.ts, 35, 7)) +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) +>D : Symbol(D, Decl(forStatements.ts, 6, 1)) + +for(var anObjectLiteral: I = { id: 12 };;){} +>anObjectLiteral : Symbol(anObjectLiteral, Decl(forStatements.ts, 36, 7)) +>I : Symbol(I, Decl(forStatements.ts, 0, 0)) +>id : Symbol(id, Decl(forStatements.ts, 36, 30)) + +for(var anOtherObjectLiteral: { id: number } = new C();;){} +>anOtherObjectLiteral : Symbol(anOtherObjectLiteral, Decl(forStatements.ts, 37, 7)) +>id : Symbol(id, Decl(forStatements.ts, 37, 31)) +>C : Symbol(C, Decl(forStatements.ts, 2, 1)) + +for(var aFunction: typeof F = F;;){} +>aFunction : Symbol(aFunction, Decl(forStatements.ts, 39, 7)) +>F : Symbol(F, Decl(forStatements.ts, 12, 1)) +>F : Symbol(F, Decl(forStatements.ts, 12, 1)) + +for(var anOtherFunction: (x: string) => number = F;;){} +>anOtherFunction : Symbol(anOtherFunction, Decl(forStatements.ts, 40, 7)) +>x : Symbol(x, Decl(forStatements.ts, 40, 26)) +>F : Symbol(F, Decl(forStatements.ts, 12, 1)) + +for(var aLambda: typeof F = (x) => 2;;){} +>aLambda : Symbol(aLambda, Decl(forStatements.ts, 41, 7)) +>F : Symbol(F, Decl(forStatements.ts, 12, 1)) +>x : Symbol(x, Decl(forStatements.ts, 41, 29)) + +for(var aModule: typeof M = M;;){} +>aModule : Symbol(aModule, Decl(forStatements.ts, 43, 7)) +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) + +for(var aClassInModule: M.A = new M.A();;){} +>aClassInModule : Symbol(aClassInModule, Decl(forStatements.ts, 44, 7)) +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) +>A : Symbol(M.A, Decl(forStatements.ts, 16, 10)) +>M.A : Symbol(M.A, Decl(forStatements.ts, 16, 10)) +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) +>A : Symbol(M.A, Decl(forStatements.ts, 16, 10)) + +for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} +>aFunctionInModule : Symbol(aFunctionInModule, Decl(forStatements.ts, 45, 7)) +>M.F2 : Symbol(M.F2, Decl(forStatements.ts, 19, 5)) +>M : Symbol(M, Decl(forStatements.ts, 14, 44)) +>F2 : Symbol(M.F2, Decl(forStatements.ts, 19, 5)) +>x : Symbol(x, Decl(forStatements.ts, 45, 42)) + diff --git a/tests/baselines/reference/forStatements.types b/tests/baselines/reference/forStatements.types index a5563a190ec..3fbcf2dbfb2 100644 --- a/tests/baselines/reference/forStatements.types +++ b/tests/baselines/reference/forStatements.types @@ -37,6 +37,7 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string +>42 : number module M { >M : typeof M @@ -59,15 +60,18 @@ module M { for(var aNumber: number = 9.9;;){} >aNumber : number +>9.9 : number for(var aString: string = 'this is a string';;){} >aString : string +>'this is a string' : string for(var aDate: Date = new Date(12);;){} >aDate : Date >Date : Date >new Date(12) : Date >Date : DateConstructor +>12 : number for(var anObject: Object = new Object();;){} >anObject : Object @@ -77,6 +81,7 @@ for(var anObject: Object = new Object();;){} for(var anAny: any = null;;){} >anAny : any +>null : null for(var aSecondAny: any = undefined;;){} >aSecondAny : any @@ -109,6 +114,7 @@ for(var anObjectLiteral: I = { id: 12 };;){} >I : I >{ id: 12 } : { id: number; } >id : number +>12 : number for(var anOtherObjectLiteral: { id: number } = new C();;){} >anOtherObjectLiteral : { id: number; } @@ -131,6 +137,7 @@ for(var aLambda: typeof F = (x) => 2;;){} >F : (x: string) => number >(x) => 2 : (x: string) => number >x : string +>2 : number for(var aModule: typeof M = M;;){} >aModule : typeof M @@ -139,7 +146,7 @@ for(var aModule: typeof M = M;;){} for(var aClassInModule: M.A = new M.A();;){} >aClassInModule : M.A ->M : unknown +>M : any >A : M.A >new M.A() : M.A >M.A : typeof M.A @@ -148,8 +155,10 @@ for(var aClassInModule: M.A = new M.A();;){} for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} >aFunctionInModule : (x: number) => string +>M.F2 : (x: number) => string >M : typeof M >F2 : (x: number) => string >(x) => 'this is a string' : (x: number) => string >x : number +>'this is a string' : string diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.symbols b/tests/baselines/reference/forStatementsMultipleValidDecl.symbols new file mode 100644 index 00000000000..6a98fbf133e --- /dev/null +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.symbols @@ -0,0 +1,110 @@ +=== tests/cases/conformance/statements/forStatements/forStatementsMultipleValidDecl.ts === +// all expected to be valid + +for (var x: number; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 2, 8), Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 5, 8)) + +for (var x = 2; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 2, 8), Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 5, 8)) + +for (var x = undefined; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 2, 8), Decl(forStatementsMultipleValidDecl.ts, 3, 8), Decl(forStatementsMultipleValidDecl.ts, 5, 8)) +>undefined : Symbol(undefined) + +// new declaration space, making redeclaring x as a string valid +function declSpace() { +>declSpace : Symbol(declSpace, Decl(forStatementsMultipleValidDecl.ts, 5, 38)) + + for (var x = 'this is a string'; ;) { } +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 8, 12)) +} +interface Point { x: number; y: number; } +>Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 9, 1)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 10, 17)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 10, 28)) + +for (var p: Point; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 9, 1)) + +for (var p = { x: 1, y: 2 }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 13, 14)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 13, 20)) + +for (var p: Point = { x: 0, y: undefined }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>Point : Symbol(Point, Decl(forStatementsMultipleValidDecl.ts, 9, 1)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 14, 21)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 14, 27)) +>undefined : Symbol(undefined) + +for (var p = { x: 1, y: undefined }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 15, 14)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 15, 20)) +>undefined : Symbol(undefined) + +for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 16, 13)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 16, 24)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 16, 41)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 16, 47)) + +for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 17, 15)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 17, 26)) +>x : Symbol(x, Decl(forStatementsMultipleValidDecl.ts, 17, 41)) +>y : Symbol(y, Decl(forStatementsMultipleValidDecl.ts, 17, 47)) +>undefined : Symbol(undefined) + +for (var p: typeof p; ;) { } +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) +>p : Symbol(p, Decl(forStatementsMultipleValidDecl.ts, 12, 8), Decl(forStatementsMultipleValidDecl.ts, 13, 8), Decl(forStatementsMultipleValidDecl.ts, 14, 8), Decl(forStatementsMultipleValidDecl.ts, 15, 8), Decl(forStatementsMultipleValidDecl.ts, 16, 8), Decl(forStatementsMultipleValidDecl.ts, 17, 8), Decl(forStatementsMultipleValidDecl.ts, 18, 8)) + +for (var fn = function (s: string) { return 42; }; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 20, 24)) + +for (var fn = (s: string) => 3; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 21, 15)) + +for (var fn: (s: string) => number; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 22, 14)) + +for (var fn: { (s: string): number }; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 23, 16)) + +for (var fn = <(s: string) => number> null; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>s : Symbol(s, Decl(forStatementsMultipleValidDecl.ts, 24, 16)) + +for (var fn: typeof fn; ;) { } +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) +>fn : Symbol(fn, Decl(forStatementsMultipleValidDecl.ts, 20, 8), Decl(forStatementsMultipleValidDecl.ts, 21, 8), Decl(forStatementsMultipleValidDecl.ts, 22, 8), Decl(forStatementsMultipleValidDecl.ts, 23, 8), Decl(forStatementsMultipleValidDecl.ts, 24, 8), Decl(forStatementsMultipleValidDecl.ts, 25, 8)) + +for (var a: string[]; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) + +for (var a = ['a', 'b']; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) + +for (var a = []; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) + +for (var a: string[] = []; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) + +for (var a = new Array(); ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +for (var a: typeof a; ;) { } +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) +>a : Symbol(a, Decl(forStatementsMultipleValidDecl.ts, 27, 8), Decl(forStatementsMultipleValidDecl.ts, 28, 8), Decl(forStatementsMultipleValidDecl.ts, 29, 8), Decl(forStatementsMultipleValidDecl.ts, 30, 8), Decl(forStatementsMultipleValidDecl.ts, 31, 8), Decl(forStatementsMultipleValidDecl.ts, 32, 8)) + diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.types b/tests/baselines/reference/forStatementsMultipleValidDecl.types index 988a1c8a6d3..9b9af5b850e 100644 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.types +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.types @@ -6,6 +6,7 @@ for (var x: number; ;) { } for (var x = 2; ;) { } >x : number +>2 : number for (var x = undefined; ;) { } >x : number @@ -18,6 +19,7 @@ function declSpace() { for (var x = 'this is a string'; ;) { } >x : string +>'this is a string' : string } interface Point { x: number; y: number; } >Point : Point @@ -32,13 +34,16 @@ for (var p = { x: 1, y: 2 }; ;) { } >p : Point >{ x: 1, y: 2 } : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number for (var p: Point = { x: 0, y: undefined }; ;) { } >p : Point >Point : Point >{ x: 0, y: undefined } : { x: number; y: undefined; } >x : number +>0 : number >y : undefined >undefined : undefined @@ -46,6 +51,7 @@ for (var p = { x: 1, y: undefined }; ;) { } >p : Point >{ x: 1, y: undefined } : { x: number; y: number; } >x : number +>1 : number >y : number >undefined : number >undefined : undefined @@ -56,7 +62,9 @@ for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } >y : number >{ x: 1, y: 2 } : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } >p : Point @@ -65,6 +73,7 @@ for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } >y : number >{ x: 0, y: undefined } : { x: number; y: undefined; } >x : number +>0 : number >y : undefined >undefined : undefined @@ -76,11 +85,13 @@ for (var fn = function (s: string) { return 42; }; ;) { } >fn : (s: string) => number >function (s: string) { return 42; } : (s: string) => number >s : string +>42 : number for (var fn = (s: string) => 3; ;) { } >fn : (s: string) => number >(s: string) => 3 : (s: string) => number >s : string +>3 : number for (var fn: (s: string) => number; ;) { } >fn : (s: string) => number @@ -94,6 +105,7 @@ for (var fn = <(s: string) => number> null; ;) { } >fn : (s: string) => number ><(s: string) => number> null : (s: string) => number >s : string +>null : null for (var fn: typeof fn; ;) { } >fn : (s: string) => number @@ -105,6 +117,8 @@ for (var a: string[]; ;) { } for (var a = ['a', 'b']; ;) { } >a : string[] >['a', 'b'] : string[] +>'a' : string +>'b' : string for (var a = []; ;) { } >a : string[] diff --git a/tests/baselines/reference/fromAsIdentifier1.symbols b/tests/baselines/reference/fromAsIdentifier1.symbols new file mode 100644 index 00000000000..517980a0bfc --- /dev/null +++ b/tests/baselines/reference/fromAsIdentifier1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/fromAsIdentifier1.ts === +var from; +>from : Symbol(from, Decl(fromAsIdentifier1.ts, 0, 3)) + diff --git a/tests/baselines/reference/fromAsIdentifier2.symbols b/tests/baselines/reference/fromAsIdentifier2.symbols new file mode 100644 index 00000000000..f55e374ba6b --- /dev/null +++ b/tests/baselines/reference/fromAsIdentifier2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/fromAsIdentifier2.ts === +"use strict"; +var from; +>from : Symbol(from, Decl(fromAsIdentifier2.ts, 1, 3)) + diff --git a/tests/baselines/reference/fromAsIdentifier2.types b/tests/baselines/reference/fromAsIdentifier2.types index 5faf9ec6f6c..ae605f79268 100644 --- a/tests/baselines/reference/fromAsIdentifier2.types +++ b/tests/baselines/reference/fromAsIdentifier2.types @@ -1,5 +1,7 @@ === tests/cases/compiler/fromAsIdentifier2.ts === "use strict"; +>"use strict" : string + var from; >from : any diff --git a/tests/baselines/reference/funcdecl.symbols b/tests/baselines/reference/funcdecl.symbols new file mode 100644 index 00000000000..2538e3a9a04 --- /dev/null +++ b/tests/baselines/reference/funcdecl.symbols @@ -0,0 +1,155 @@ +=== tests/cases/compiler/funcdecl.ts === +function simpleFunc() { +>simpleFunc : Symbol(simpleFunc, Decl(funcdecl.ts, 0, 0)) + + return "this is my simple func"; +} +var simpleFuncVar = simpleFunc; +>simpleFuncVar : Symbol(simpleFuncVar, Decl(funcdecl.ts, 3, 3)) +>simpleFunc : Symbol(simpleFunc, Decl(funcdecl.ts, 0, 0)) + +function anotherFuncNoReturn() { +>anotherFuncNoReturn : Symbol(anotherFuncNoReturn, Decl(funcdecl.ts, 3, 31)) +} +var anotherFuncNoReturnVar = anotherFuncNoReturn; +>anotherFuncNoReturnVar : Symbol(anotherFuncNoReturnVar, Decl(funcdecl.ts, 7, 3)) +>anotherFuncNoReturn : Symbol(anotherFuncNoReturn, Decl(funcdecl.ts, 3, 31)) + +function withReturn() : string{ +>withReturn : Symbol(withReturn, Decl(funcdecl.ts, 7, 49)) + + return "Hello"; +} +var withReturnVar = withReturn; +>withReturnVar : Symbol(withReturnVar, Decl(funcdecl.ts, 12, 3)) +>withReturn : Symbol(withReturn, Decl(funcdecl.ts, 7, 49)) + +function withParams(a : string) : string{ +>withParams : Symbol(withParams, Decl(funcdecl.ts, 12, 31)) +>a : Symbol(a, Decl(funcdecl.ts, 14, 20)) + + return a; +>a : Symbol(a, Decl(funcdecl.ts, 14, 20)) +} +var withparamsVar = withParams; +>withparamsVar : Symbol(withparamsVar, Decl(funcdecl.ts, 17, 3)) +>withParams : Symbol(withParams, Decl(funcdecl.ts, 12, 31)) + +function withMultiParams(a : number, b, c: Object) { +>withMultiParams : Symbol(withMultiParams, Decl(funcdecl.ts, 17, 31)) +>a : Symbol(a, Decl(funcdecl.ts, 19, 25)) +>b : Symbol(b, Decl(funcdecl.ts, 19, 36)) +>c : Symbol(c, Decl(funcdecl.ts, 19, 39)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + return a; +>a : Symbol(a, Decl(funcdecl.ts, 19, 25)) +} +var withMultiParamsVar = withMultiParams; +>withMultiParamsVar : Symbol(withMultiParamsVar, Decl(funcdecl.ts, 22, 3)) +>withMultiParams : Symbol(withMultiParams, Decl(funcdecl.ts, 17, 31)) + +function withOptionalParams(a?: string) { +>withOptionalParams : Symbol(withOptionalParams, Decl(funcdecl.ts, 22, 41)) +>a : Symbol(a, Decl(funcdecl.ts, 24, 28)) +} +var withOptionalParamsVar = withOptionalParams; +>withOptionalParamsVar : Symbol(withOptionalParamsVar, Decl(funcdecl.ts, 26, 3)) +>withOptionalParams : Symbol(withOptionalParams, Decl(funcdecl.ts, 22, 41)) + +function withInitializedParams(a: string, b0, b = 30, c = "string value") { +>withInitializedParams : Symbol(withInitializedParams, Decl(funcdecl.ts, 26, 47)) +>a : Symbol(a, Decl(funcdecl.ts, 28, 31)) +>b0 : Symbol(b0, Decl(funcdecl.ts, 28, 41)) +>b : Symbol(b, Decl(funcdecl.ts, 28, 45)) +>c : Symbol(c, Decl(funcdecl.ts, 28, 53)) +} +var withInitializedParamsVar = withInitializedParams; +>withInitializedParamsVar : Symbol(withInitializedParamsVar, Decl(funcdecl.ts, 30, 3)) +>withInitializedParams : Symbol(withInitializedParams, Decl(funcdecl.ts, 26, 47)) + +function withOptionalInitializedParams(a: string, c: string = "hello string") { +>withOptionalInitializedParams : Symbol(withOptionalInitializedParams, Decl(funcdecl.ts, 30, 53)) +>a : Symbol(a, Decl(funcdecl.ts, 32, 39)) +>c : Symbol(c, Decl(funcdecl.ts, 32, 49)) +} +var withOptionalInitializedParamsVar = withOptionalInitializedParams; +>withOptionalInitializedParamsVar : Symbol(withOptionalInitializedParamsVar, Decl(funcdecl.ts, 34, 3)) +>withOptionalInitializedParams : Symbol(withOptionalInitializedParams, Decl(funcdecl.ts, 30, 53)) + +function withRestParams(a: string, ... myRestParameter : number[]) { +>withRestParams : Symbol(withRestParams, Decl(funcdecl.ts, 34, 69)) +>a : Symbol(a, Decl(funcdecl.ts, 36, 24)) +>myRestParameter : Symbol(myRestParameter, Decl(funcdecl.ts, 36, 34)) + + return myRestParameter; +>myRestParameter : Symbol(myRestParameter, Decl(funcdecl.ts, 36, 34)) +} +var withRestParamsVar = withRestParams; +>withRestParamsVar : Symbol(withRestParamsVar, Decl(funcdecl.ts, 39, 3)) +>withRestParams : Symbol(withRestParams, Decl(funcdecl.ts, 34, 69)) + +function overload1(n: number) : string; +>overload1 : Symbol(overload1, Decl(funcdecl.ts, 39, 39), Decl(funcdecl.ts, 41, 39), Decl(funcdecl.ts, 42, 39)) +>n : Symbol(n, Decl(funcdecl.ts, 41, 19)) + +function overload1(s: string) : string; +>overload1 : Symbol(overload1, Decl(funcdecl.ts, 39, 39), Decl(funcdecl.ts, 41, 39), Decl(funcdecl.ts, 42, 39)) +>s : Symbol(s, Decl(funcdecl.ts, 42, 19)) + +function overload1(ns: any) { +>overload1 : Symbol(overload1, Decl(funcdecl.ts, 39, 39), Decl(funcdecl.ts, 41, 39), Decl(funcdecl.ts, 42, 39)) +>ns : Symbol(ns, Decl(funcdecl.ts, 43, 19)) + + return ns.toString(); +>ns : Symbol(ns, Decl(funcdecl.ts, 43, 19)) +} +var withOverloadSignature = overload1; +>withOverloadSignature : Symbol(withOverloadSignature, Decl(funcdecl.ts, 46, 3)) +>overload1 : Symbol(overload1, Decl(funcdecl.ts, 39, 39), Decl(funcdecl.ts, 41, 39), Decl(funcdecl.ts, 42, 39)) + +function f(n: () => void) { } +>f : Symbol(f, Decl(funcdecl.ts, 46, 38)) +>n : Symbol(n, Decl(funcdecl.ts, 48, 11)) + +module m2 { +>m2 : Symbol(m2, Decl(funcdecl.ts, 48, 29)) + + export function foo(n: () => void ) { +>foo : Symbol(foo, Decl(funcdecl.ts, 50, 11)) +>n : Symbol(n, Decl(funcdecl.ts, 51, 24)) + } + +} + +m2.foo(() => { +>m2.foo : Symbol(m2.foo, Decl(funcdecl.ts, 50, 11)) +>m2 : Symbol(m2, Decl(funcdecl.ts, 48, 29)) +>foo : Symbol(m2.foo, Decl(funcdecl.ts, 50, 11)) + + var b = 30; +>b : Symbol(b, Decl(funcdecl.ts, 58, 7)) + + return b; +>b : Symbol(b, Decl(funcdecl.ts, 58, 7)) + +}); + + +declare function fooAmbient(n: number): string; +>fooAmbient : Symbol(fooAmbient, Decl(funcdecl.ts, 60, 3)) +>n : Symbol(n, Decl(funcdecl.ts, 63, 28)) + +declare function overloadAmbient(n: number): string; +>overloadAmbient : Symbol(overloadAmbient, Decl(funcdecl.ts, 63, 47), Decl(funcdecl.ts, 65, 52)) +>n : Symbol(n, Decl(funcdecl.ts, 65, 33)) + +declare function overloadAmbient(s: string): string; +>overloadAmbient : Symbol(overloadAmbient, Decl(funcdecl.ts, 63, 47), Decl(funcdecl.ts, 65, 52)) +>s : Symbol(s, Decl(funcdecl.ts, 66, 33)) + +var f2 = () => { +>f2 : Symbol(f2, Decl(funcdecl.ts, 68, 3)) + + return "string"; +} diff --git a/tests/baselines/reference/funcdecl.types b/tests/baselines/reference/funcdecl.types index bbfd14bd220..94c310d7b25 100644 --- a/tests/baselines/reference/funcdecl.types +++ b/tests/baselines/reference/funcdecl.types @@ -3,6 +3,7 @@ function simpleFunc() { >simpleFunc : () => string return "this is my simple func"; +>"this is my simple func" : string } var simpleFuncVar = simpleFunc; >simpleFuncVar : () => string @@ -19,6 +20,7 @@ function withReturn() : string{ >withReturn : () => string return "Hello"; +>"Hello" : string } var withReturnVar = withReturn; >withReturnVar : () => string @@ -62,7 +64,9 @@ function withInitializedParams(a: string, b0, b = 30, c = "string value") { >a : string >b0 : any >b : number +>30 : number >c : string +>"string value" : string } var withInitializedParamsVar = withInitializedParams; >withInitializedParamsVar : (a: string, b0: any, b?: number, c?: string) => void @@ -72,6 +76,7 @@ function withOptionalInitializedParams(a: string, c: string = "hello string") { >withOptionalInitializedParams : (a: string, c?: string) => void >a : string >c : string +>"hello string" : string } var withOptionalInitializedParamsVar = withOptionalInitializedParams; >withOptionalInitializedParamsVar : (a: string, c?: string) => void @@ -134,6 +139,7 @@ m2.foo(() => { var b = 30; >b : number +>30 : number return b; >b : number @@ -158,4 +164,5 @@ var f2 = () => { >() => { return "string";} : () => string return "string"; +>"string" : string } diff --git a/tests/baselines/reference/functionAssignmentError.symbols b/tests/baselines/reference/functionAssignmentError.symbols new file mode 100644 index 00000000000..b0d57ac4102 --- /dev/null +++ b/tests/baselines/reference/functionAssignmentError.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/functionAssignmentError.ts === +var func = function (){return "ONE";}; +>func : Symbol(func, Decl(functionAssignmentError.ts, 0, 3)) + +func = function (){return "ONE";}; +>func : Symbol(func, Decl(functionAssignmentError.ts, 0, 3)) + diff --git a/tests/baselines/reference/functionAssignmentError.types b/tests/baselines/reference/functionAssignmentError.types index 63996db0e40..6430aa10fc4 100644 --- a/tests/baselines/reference/functionAssignmentError.types +++ b/tests/baselines/reference/functionAssignmentError.types @@ -2,9 +2,11 @@ var func = function (){return "ONE";}; >func : () => string >function (){return "ONE";} : () => string +>"ONE" : string func = function (){return "ONE";}; >func = function (){return "ONE";} : () => string >func : () => string >function (){return "ONE";} : () => string +>"ONE" : string diff --git a/tests/baselines/reference/functionCall1.symbols b/tests/baselines/reference/functionCall1.symbols new file mode 100644 index 00000000000..522a2bae5f2 --- /dev/null +++ b/tests/baselines/reference/functionCall1.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/functionCall1.ts === +function foo():any{return ""}; +>foo : Symbol(foo, Decl(functionCall1.ts, 0, 0)) + +var x = foo(); +>x : Symbol(x, Decl(functionCall1.ts, 1, 3)) +>foo : Symbol(foo, Decl(functionCall1.ts, 0, 0)) + diff --git a/tests/baselines/reference/functionCall1.types b/tests/baselines/reference/functionCall1.types index 1b06379860c..777fcd79f91 100644 --- a/tests/baselines/reference/functionCall1.types +++ b/tests/baselines/reference/functionCall1.types @@ -1,6 +1,7 @@ === tests/cases/compiler/functionCall1.ts === function foo():any{return ""}; >foo : () => any +>"" : string var x = foo(); >x : any diff --git a/tests/baselines/reference/functionCall2.symbols b/tests/baselines/reference/functionCall2.symbols new file mode 100644 index 00000000000..91f5a3127cd --- /dev/null +++ b/tests/baselines/reference/functionCall2.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/functionCall2.ts === +function foo():number{return 1}; +>foo : Symbol(foo, Decl(functionCall2.ts, 0, 0)) + +var x = foo(); +>x : Symbol(x, Decl(functionCall2.ts, 1, 3)) +>foo : Symbol(foo, Decl(functionCall2.ts, 0, 0)) + diff --git a/tests/baselines/reference/functionCall2.types b/tests/baselines/reference/functionCall2.types index 92bb0f0be23..152d54cb186 100644 --- a/tests/baselines/reference/functionCall2.types +++ b/tests/baselines/reference/functionCall2.types @@ -1,6 +1,7 @@ === tests/cases/compiler/functionCall2.ts === function foo():number{return 1}; >foo : () => number +>1 : number var x = foo(); >x : number diff --git a/tests/baselines/reference/functionCall3.symbols b/tests/baselines/reference/functionCall3.symbols new file mode 100644 index 00000000000..bd16e3e543e --- /dev/null +++ b/tests/baselines/reference/functionCall3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/functionCall3.ts === +function foo():any[]{return [1];} +>foo : Symbol(foo, Decl(functionCall3.ts, 0, 0)) + +var x = foo(); +>x : Symbol(x, Decl(functionCall3.ts, 1, 3)) +>foo : Symbol(foo, Decl(functionCall3.ts, 0, 0)) + diff --git a/tests/baselines/reference/functionCall3.types b/tests/baselines/reference/functionCall3.types index ea47de3e6d9..b58803ae666 100644 --- a/tests/baselines/reference/functionCall3.types +++ b/tests/baselines/reference/functionCall3.types @@ -2,6 +2,7 @@ function foo():any[]{return [1];} >foo : () => any[] >[1] : number[] +>1 : number var x = foo(); >x : any[] diff --git a/tests/baselines/reference/functionCall4.symbols b/tests/baselines/reference/functionCall4.symbols new file mode 100644 index 00000000000..2eee1fbbab5 --- /dev/null +++ b/tests/baselines/reference/functionCall4.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/functionCall4.ts === +function foo():any{return ""}; +>foo : Symbol(foo, Decl(functionCall4.ts, 0, 0)) + +function bar():()=>any{return foo}; +>bar : Symbol(bar, Decl(functionCall4.ts, 0, 30)) +>foo : Symbol(foo, Decl(functionCall4.ts, 0, 0)) + +var x = bar(); +>x : Symbol(x, Decl(functionCall4.ts, 2, 3)) +>bar : Symbol(bar, Decl(functionCall4.ts, 0, 30)) + diff --git a/tests/baselines/reference/functionCall4.types b/tests/baselines/reference/functionCall4.types index 37a0b980a00..ea60c759a7d 100644 --- a/tests/baselines/reference/functionCall4.types +++ b/tests/baselines/reference/functionCall4.types @@ -1,6 +1,7 @@ === tests/cases/compiler/functionCall4.ts === function foo():any{return ""}; >foo : () => any +>"" : string function bar():()=>any{return foo}; >bar : () => () => any diff --git a/tests/baselines/reference/functionCall5.symbols b/tests/baselines/reference/functionCall5.symbols new file mode 100644 index 00000000000..de166231204 --- /dev/null +++ b/tests/baselines/reference/functionCall5.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionCall5.ts === +module m1 { export class c1 { public a; }} +>m1 : Symbol(m1, Decl(functionCall5.ts, 0, 0)) +>c1 : Symbol(c1, Decl(functionCall5.ts, 0, 11)) +>a : Symbol(a, Decl(functionCall5.ts, 0, 29)) + +function foo():m1.c1{return new m1.c1();}; +>foo : Symbol(foo, Decl(functionCall5.ts, 0, 42)) +>m1 : Symbol(m1, Decl(functionCall5.ts, 0, 0)) +>c1 : Symbol(m1.c1, Decl(functionCall5.ts, 0, 11)) +>m1.c1 : Symbol(m1.c1, Decl(functionCall5.ts, 0, 11)) +>m1 : Symbol(m1, Decl(functionCall5.ts, 0, 0)) +>c1 : Symbol(m1.c1, Decl(functionCall5.ts, 0, 11)) + +var x = foo(); +>x : Symbol(x, Decl(functionCall5.ts, 2, 3)) +>foo : Symbol(foo, Decl(functionCall5.ts, 0, 42)) + diff --git a/tests/baselines/reference/functionCall5.types b/tests/baselines/reference/functionCall5.types index e5578ef3c34..b55150fc1a7 100644 --- a/tests/baselines/reference/functionCall5.types +++ b/tests/baselines/reference/functionCall5.types @@ -6,7 +6,7 @@ module m1 { export class c1 { public a; }} function foo():m1.c1{return new m1.c1();}; >foo : () => m1.c1 ->m1 : unknown +>m1 : any >c1 : m1.c1 >new m1.c1() : m1.c1 >m1.c1 : typeof m1.c1 diff --git a/tests/baselines/reference/functionConstraintSatisfaction.symbols b/tests/baselines/reference/functionConstraintSatisfaction.symbols new file mode 100644 index 00000000000..eb71bb78e25 --- /dev/null +++ b/tests/baselines/reference/functionConstraintSatisfaction.symbols @@ -0,0 +1,227 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction.ts === +// satisfaction of a constraint to Function, no errors expected + +function foo(x: T): T { return x; } +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 2, 13)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 2, 33)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 2, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 2, 13)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 2, 33)) + +interface I { +>I : Symbol(I, Decl(functionConstraintSatisfaction.ts, 2, 55)) + + (): string; +} +var i: I; +>i : Symbol(i, Decl(functionConstraintSatisfaction.ts, 7, 3)) +>I : Symbol(I, Decl(functionConstraintSatisfaction.ts, 2, 55)) + +class C { +>C : Symbol(C, Decl(functionConstraintSatisfaction.ts, 7, 9)) + + foo: string; +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 9, 9)) +} + +var a: { (): string }; +>a : Symbol(a, Decl(functionConstraintSatisfaction.ts, 13, 3)) + +var b: { new (): string }; +>b : Symbol(b, Decl(functionConstraintSatisfaction.ts, 14, 3)) + +var c: { (): string; (x): string }; +>c : Symbol(c, Decl(functionConstraintSatisfaction.ts, 15, 3)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 15, 22)) + +var r = foo(new Function()); +>r : Symbol(r, Decl(functionConstraintSatisfaction.ts, 17, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var r1 = foo((x) => x); +>r1 : Symbol(r1, Decl(functionConstraintSatisfaction.ts, 18, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 18, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 18, 14)) + +var r2 = foo((x: string[]) => x); +>r2 : Symbol(r2, Decl(functionConstraintSatisfaction.ts, 19, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 19, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 19, 14)) + +var r3 = foo(function (x) { return x }); +>r3 : Symbol(r3, Decl(functionConstraintSatisfaction.ts, 20, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 20, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 20, 23)) + +var r4 = foo(function (x: string[]) { return x }); +>r4 : Symbol(r4, Decl(functionConstraintSatisfaction.ts, 21, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 21, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 21, 23)) + +var r5 = foo(i); +>r5 : Symbol(r5, Decl(functionConstraintSatisfaction.ts, 22, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>i : Symbol(i, Decl(functionConstraintSatisfaction.ts, 7, 3)) + +var r6 = foo(C); +>r6 : Symbol(r6, Decl(functionConstraintSatisfaction.ts, 23, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>C : Symbol(C, Decl(functionConstraintSatisfaction.ts, 7, 9)) + +var r7 = foo(b); +>r7 : Symbol(r7, Decl(functionConstraintSatisfaction.ts, 24, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>b : Symbol(b, Decl(functionConstraintSatisfaction.ts, 14, 3)) + +var r8 = foo(c); +>r8 : Symbol(r8, Decl(functionConstraintSatisfaction.ts, 25, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>c : Symbol(c, Decl(functionConstraintSatisfaction.ts, 15, 3)) + +interface I2 { +>I2 : Symbol(I2, Decl(functionConstraintSatisfaction.ts, 25, 16)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 27, 13)) + + (x: T): T; +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 28, 5)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 27, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 27, 13)) +} +var i2: I2; +>i2 : Symbol(i2, Decl(functionConstraintSatisfaction.ts, 30, 3)) +>I2 : Symbol(I2, Decl(functionConstraintSatisfaction.ts, 25, 16)) + +class C2 { +>C2 : Symbol(C2, Decl(functionConstraintSatisfaction.ts, 30, 19)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 32, 9)) + + foo: T; +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 32, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 32, 9)) +} + +var a2: { (x: T): T }; +>a2 : Symbol(a2, Decl(functionConstraintSatisfaction.ts, 36, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 36, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 36, 14)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 36, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 36, 11)) + +var b2: { new (x: T): T }; +>b2 : Symbol(b2, Decl(functionConstraintSatisfaction.ts, 37, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 37, 15)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 37, 18)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 37, 15)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 37, 15)) + +var c2: { (x: T): T; (x: T, y: T): T }; +>c2 : Symbol(c2, Decl(functionConstraintSatisfaction.ts, 38, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 38, 14)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 25)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 38, 28)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 25)) +>y : Symbol(y, Decl(functionConstraintSatisfaction.ts, 38, 33)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 25)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 38, 25)) + +var r9 = foo((x: U) => x); +>r9 : Symbol(r9, Decl(functionConstraintSatisfaction.ts, 40, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 40, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 40, 17)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 40, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 40, 17)) + +var r10 = foo(function (x: U) { return x; }); +>r10 : Symbol(r10, Decl(functionConstraintSatisfaction.ts, 41, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 41, 24)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 41, 27)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 41, 24)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 41, 27)) + +var r11 = foo((x: U) => x); +>r11 : Symbol(r11, Decl(functionConstraintSatisfaction.ts, 42, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 42, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 42, 31)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 42, 15)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 42, 31)) + +var r12 = foo((x: U, y: V) => x); +>r12 : Symbol(r12, Decl(functionConstraintSatisfaction.ts, 43, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 43, 15)) +>V : Symbol(V, Decl(functionConstraintSatisfaction.ts, 43, 17)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 43, 21)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 43, 15)) +>y : Symbol(y, Decl(functionConstraintSatisfaction.ts, 43, 26)) +>V : Symbol(V, Decl(functionConstraintSatisfaction.ts, 43, 17)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 43, 21)) + +var r13 = foo(i2); +>r13 : Symbol(r13, Decl(functionConstraintSatisfaction.ts, 44, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>i2 : Symbol(i2, Decl(functionConstraintSatisfaction.ts, 30, 3)) + +var r14 = foo(C2); +>r14 : Symbol(r14, Decl(functionConstraintSatisfaction.ts, 45, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>C2 : Symbol(C2, Decl(functionConstraintSatisfaction.ts, 30, 19)) + +var r15 = foo(b2); +>r15 : Symbol(r15, Decl(functionConstraintSatisfaction.ts, 46, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>b2 : Symbol(b2, Decl(functionConstraintSatisfaction.ts, 37, 3)) + +var r16 = foo(c2); +>r16 : Symbol(r16, Decl(functionConstraintSatisfaction.ts, 47, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>c2 : Symbol(c2, Decl(functionConstraintSatisfaction.ts, 38, 3)) + +interface F2 extends Function { foo: string; } +>F2 : Symbol(F2, Decl(functionConstraintSatisfaction.ts, 47, 18)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 49, 31)) + +var f2: F2; +>f2 : Symbol(f2, Decl(functionConstraintSatisfaction.ts, 50, 3)) +>F2 : Symbol(F2, Decl(functionConstraintSatisfaction.ts, 47, 18)) + +var r17 = foo(f2); +>r17 : Symbol(r17, Decl(functionConstraintSatisfaction.ts, 51, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>f2 : Symbol(f2, Decl(functionConstraintSatisfaction.ts, 50, 3)) + +function foo2(x: T, y: U) { +>foo2 : Symbol(foo2, Decl(functionConstraintSatisfaction.ts, 51, 18)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 53, 14)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 53, 37)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 53, 62)) +>T : Symbol(T, Decl(functionConstraintSatisfaction.ts, 53, 14)) +>y : Symbol(y, Decl(functionConstraintSatisfaction.ts, 53, 67)) +>U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 53, 37)) + + foo(x); +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 53, 62)) + + foo(y); +>foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) +>y : Symbol(y, Decl(functionConstraintSatisfaction.ts, 53, 67)) +} +//function foo2(x: T, y: U) { +// foo(x); +// foo(y); +//} diff --git a/tests/baselines/reference/functionConstraintSatisfaction3.symbols b/tests/baselines/reference/functionConstraintSatisfaction3.symbols new file mode 100644 index 00000000000..74f3a65aa8e --- /dev/null +++ b/tests/baselines/reference/functionConstraintSatisfaction3.symbols @@ -0,0 +1,147 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction3.ts === +// satisfaction of a constraint to Function, no errors expected + +function foo string>(x: T): T { return x; } +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 2, 13)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 2, 24)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 2, 46)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 2, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 2, 13)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 2, 46)) + +interface I { +>I : Symbol(I, Decl(functionConstraintSatisfaction3.ts, 2, 68)) + + (): string; +} +var i: I; +>i : Symbol(i, Decl(functionConstraintSatisfaction3.ts, 7, 3)) +>I : Symbol(I, Decl(functionConstraintSatisfaction3.ts, 2, 68)) + +class C { +>C : Symbol(C, Decl(functionConstraintSatisfaction3.ts, 7, 9)) + + foo: string; +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 9, 9)) +} + +var a: { (): string }; +>a : Symbol(a, Decl(functionConstraintSatisfaction3.ts, 13, 3)) + +var b: { new (): string }; +>b : Symbol(b, Decl(functionConstraintSatisfaction3.ts, 14, 3)) + +var c: { (): string; (x): string }; +>c : Symbol(c, Decl(functionConstraintSatisfaction3.ts, 15, 3)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 15, 22)) + +var r1 = foo((x) => x); +>r1 : Symbol(r1, Decl(functionConstraintSatisfaction3.ts, 17, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 17, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 17, 14)) + +var r2 = foo((x: string) => x); +>r2 : Symbol(r2, Decl(functionConstraintSatisfaction3.ts, 18, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 18, 14)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 18, 14)) + +var r3 = foo(function (x) { return x }); +>r3 : Symbol(r3, Decl(functionConstraintSatisfaction3.ts, 19, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 19, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 19, 23)) + +var r4 = foo(function (x: string) { return x }); +>r4 : Symbol(r4, Decl(functionConstraintSatisfaction3.ts, 20, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 20, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 20, 23)) + +var r5 = foo(i); +>r5 : Symbol(r5, Decl(functionConstraintSatisfaction3.ts, 21, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>i : Symbol(i, Decl(functionConstraintSatisfaction3.ts, 7, 3)) + +var r8 = foo(c); +>r8 : Symbol(r8, Decl(functionConstraintSatisfaction3.ts, 22, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>c : Symbol(c, Decl(functionConstraintSatisfaction3.ts, 15, 3)) + +interface I2 { +>I2 : Symbol(I2, Decl(functionConstraintSatisfaction3.ts, 22, 16)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 24, 13)) + + (x: T): T; +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 25, 5)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 24, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 24, 13)) +} +var i2: I2; +>i2 : Symbol(i2, Decl(functionConstraintSatisfaction3.ts, 27, 3)) +>I2 : Symbol(I2, Decl(functionConstraintSatisfaction3.ts, 22, 16)) + +class C2 { +>C2 : Symbol(C2, Decl(functionConstraintSatisfaction3.ts, 27, 19)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 29, 9)) + + foo: T; +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 29, 13)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 29, 9)) +} + +var a2: { (x: T): T }; +>a2 : Symbol(a2, Decl(functionConstraintSatisfaction3.ts, 33, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 33, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 33, 14)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 33, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 33, 11)) + +var b2: { new (x: T): T }; +>b2 : Symbol(b2, Decl(functionConstraintSatisfaction3.ts, 34, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 34, 15)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 34, 18)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 34, 15)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 34, 15)) + +var c2: { (x: T): T; (x: T, y: T): T }; +>c2 : Symbol(c2, Decl(functionConstraintSatisfaction3.ts, 35, 3)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 11)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 35, 14)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 11)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 35, 28)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25)) +>y : Symbol(y, Decl(functionConstraintSatisfaction3.ts, 35, 33)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25)) +>T : Symbol(T, Decl(functionConstraintSatisfaction3.ts, 35, 25)) + +var r9 = foo(function (x: U) { return x; }); +>r9 : Symbol(r9, Decl(functionConstraintSatisfaction3.ts, 37, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 37, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 37, 26)) +>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 37, 23)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 37, 26)) + +var r10 = foo((x: U) => x); +>r10 : Symbol(r10, Decl(functionConstraintSatisfaction3.ts, 38, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 38, 15)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 38, 33)) +>U : Symbol(U, Decl(functionConstraintSatisfaction3.ts, 38, 15)) +>x : Symbol(x, Decl(functionConstraintSatisfaction3.ts, 38, 33)) + +var r12 = foo(i2); +>r12 : Symbol(r12, Decl(functionConstraintSatisfaction3.ts, 39, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>i2 : Symbol(i2, Decl(functionConstraintSatisfaction3.ts, 27, 3)) + +var r15 = foo(c2); +>r15 : Symbol(r15, Decl(functionConstraintSatisfaction3.ts, 40, 3)) +>foo : Symbol(foo, Decl(functionConstraintSatisfaction3.ts, 0, 0)) +>c2 : Symbol(c2, Decl(functionConstraintSatisfaction3.ts, 35, 3)) + diff --git a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.symbols b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.symbols new file mode 100644 index 00000000000..cf504147346 --- /dev/null +++ b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts === +function foo(args: { (x): number }[]) { +>foo : Symbol(foo, Decl(functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts, 0, 0)) +>args : Symbol(args, Decl(functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts, 0, 13)) +>x : Symbol(x, Decl(functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts, 0, 22)) + + return args.length; +>args.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>args : Symbol(args, Decl(functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts, 0, 13)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +} + diff --git a/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.symbols b/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.symbols new file mode 100644 index 00000000000..db66aa5618b --- /dev/null +++ b/tests/baselines/reference/functionExpressionAndLambdaMatchesFunction.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/functionExpressionAndLambdaMatchesFunction.ts === +class CDoc { +>CDoc : Symbol(CDoc, Decl(functionExpressionAndLambdaMatchesFunction.ts, 0, 0)) + + constructor() { + function doSomething(a: Function) { +>doSomething : Symbol(doSomething, Decl(functionExpressionAndLambdaMatchesFunction.ts, 1, 23)) +>a : Symbol(a, Decl(functionExpressionAndLambdaMatchesFunction.ts, 2, 29)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + } + doSomething(() => undefined); +>doSomething : Symbol(doSomething, Decl(functionExpressionAndLambdaMatchesFunction.ts, 1, 23)) +>undefined : Symbol(undefined) + + doSomething(function () { }); +>doSomething : Symbol(doSomething, Decl(functionExpressionAndLambdaMatchesFunction.ts, 1, 23)) + } +} + diff --git a/tests/baselines/reference/functionExpressionReturningItself.symbols b/tests/baselines/reference/functionExpressionReturningItself.symbols new file mode 100644 index 00000000000..ba4d29f275a --- /dev/null +++ b/tests/baselines/reference/functionExpressionReturningItself.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/functionExpressionReturningItself.ts === +var x = function somefn() { return somefn; }; +>x : Symbol(x, Decl(functionExpressionReturningItself.ts, 0, 3)) +>somefn : Symbol(somefn, Decl(functionExpressionReturningItself.ts, 0, 7)) +>somefn : Symbol(somefn, Decl(functionExpressionReturningItself.ts, 0, 7)) + diff --git a/tests/baselines/reference/functionImplementations.symbols b/tests/baselines/reference/functionImplementations.symbols new file mode 100644 index 00000000000..f9205f37650 --- /dev/null +++ b/tests/baselines/reference/functionImplementations.symbols @@ -0,0 +1,344 @@ +=== tests/cases/conformance/functions/functionImplementations.ts === +// FunctionExpression with no return type annotation and no return statement returns void +var v: void = function () { } (); +>v : Symbol(v, Decl(functionImplementations.ts, 1, 3)) + +// FunctionExpression f with no return type annotation and directly references f in its body returns any +var a: any = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 4, 12)) + + return f; +>f : Symbol(f, Decl(functionImplementations.ts, 4, 12)) + +}; +var a: any = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 7, 12)) + + return f(); +>f : Symbol(f, Decl(functionImplementations.ts, 7, 12)) + +}; + +// FunctionExpression f with no return type annotation and indirectly references f in its body returns any +var a: any = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 12, 12)) + + var x = f; +>x : Symbol(x, Decl(functionImplementations.ts, 13, 7)) +>f : Symbol(f, Decl(functionImplementations.ts, 12, 12)) + + return x; +>x : Symbol(x, Decl(functionImplementations.ts, 13, 7)) + +}; + +// Two mutually recursive function implementations with no return type annotations +function rec1() { +>rec1 : Symbol(rec1, Decl(functionImplementations.ts, 15, 2)) + + return rec2(); +>rec2 : Symbol(rec2, Decl(functionImplementations.ts, 20, 1)) +} +function rec2() { +>rec2 : Symbol(rec2, Decl(functionImplementations.ts, 20, 1)) + + return rec1(); +>rec1 : Symbol(rec1, Decl(functionImplementations.ts, 15, 2)) +} +var a = rec1(); +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>rec1 : Symbol(rec1, Decl(functionImplementations.ts, 15, 2)) + +var a = rec2(); +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>rec2 : Symbol(rec2, Decl(functionImplementations.ts, 20, 1)) + +// Two mutually recursive function implementations with return type annotation in one +function rec3(): number { +>rec3 : Symbol(rec3, Decl(functionImplementations.ts, 25, 15)) + + return rec4(); +>rec4 : Symbol(rec4, Decl(functionImplementations.ts, 30, 1)) +} +function rec4() { +>rec4 : Symbol(rec4, Decl(functionImplementations.ts, 30, 1)) + + return rec3(); +>rec3 : Symbol(rec3, Decl(functionImplementations.ts, 25, 15)) +} +var n: number; +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) + +var n = rec3(); +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) +>rec3 : Symbol(rec3, Decl(functionImplementations.ts, 25, 15)) + +var n = rec4(); +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) +>rec4 : Symbol(rec4, Decl(functionImplementations.ts, 30, 1)) + +// FunctionExpression with no return type annotation and returns a number +var n = function () { +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) + + return 3; +} (); + +// FunctionExpression with no return type annotation and returns null +var nu = null; +>nu : Symbol(nu, Decl(functionImplementations.ts, 44, 3), Decl(functionImplementations.ts, 45, 3)) + +var nu = function () { +>nu : Symbol(nu, Decl(functionImplementations.ts, 44, 3), Decl(functionImplementations.ts, 45, 3)) + + return null; +} (); + +// FunctionExpression with no return type annotation and returns undefined +var un = undefined; +>un : Symbol(un, Decl(functionImplementations.ts, 50, 3), Decl(functionImplementations.ts, 51, 3)) +>undefined : Symbol(undefined) + +var un = function () { +>un : Symbol(un, Decl(functionImplementations.ts, 50, 3), Decl(functionImplementations.ts, 51, 3)) + + return undefined; +>undefined : Symbol(undefined) + +} (); + +// FunctionExpression with no return type annotation and returns a type parameter type +var n = function (x: T) { +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) +>T : Symbol(T, Decl(functionImplementations.ts, 56, 18)) +>x : Symbol(x, Decl(functionImplementations.ts, 56, 21)) +>T : Symbol(T, Decl(functionImplementations.ts, 56, 18)) + + return x; +>x : Symbol(x, Decl(functionImplementations.ts, 56, 21)) + +} (4); + +// FunctionExpression with no return type annotation and returns a constrained type parameter type +var n = function (x: T) { +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) +>T : Symbol(T, Decl(functionImplementations.ts, 61, 18)) +>x : Symbol(x, Decl(functionImplementations.ts, 61, 32)) +>T : Symbol(T, Decl(functionImplementations.ts, 61, 18)) + + return x; +>x : Symbol(x, Decl(functionImplementations.ts, 61, 32)) + +} (4); + +// FunctionExpression with no return type annotation with multiple return statements with identical types +var n = function () { +>n : Symbol(n, Decl(functionImplementations.ts, 34, 3), Decl(functionImplementations.ts, 35, 3), Decl(functionImplementations.ts, 36, 3), Decl(functionImplementations.ts, 39, 3), Decl(functionImplementations.ts, 56, 3), Decl(functionImplementations.ts, 61, 3), Decl(functionImplementations.ts, 66, 3)) + + return 3; + return 5; +}(); + +// Otherwise, the inferred return type is the first of the types of the return statement expressions +// in the function body that is a supertype of each of the others, +// ignoring return statements with no expressions. +// A compile - time error occurs if no return statement expression has a type that is a supertype of each of the others. +// FunctionExpression with no return type annotation with multiple return statements with subtype relation between returns +class Base { private m; } +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) +>m : Symbol(m, Decl(functionImplementations.ts, 76, 12)) + +class Derived extends Base { private q; } +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) +>q : Symbol(q, Decl(functionImplementations.ts, 77, 28)) + +var b: Base; +>b : Symbol(b, Decl(functionImplementations.ts, 78, 3), Decl(functionImplementations.ts, 79, 3)) +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) + +var b = function () { +>b : Symbol(b, Decl(functionImplementations.ts, 78, 3), Decl(functionImplementations.ts, 79, 3)) + + return new Base(); return new Derived(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) + +} (); + +// FunctionExpression with no return type annotation with multiple return statements with one a recursive call +var a = function f() { +>a : Symbol(a, Decl(functionImplementations.ts, 4, 3), Decl(functionImplementations.ts, 7, 3), Decl(functionImplementations.ts, 12, 3), Decl(functionImplementations.ts, 24, 3), Decl(functionImplementations.ts, 25, 3), Decl(functionImplementations.ts, 84, 3)) +>f : Symbol(f, Decl(functionImplementations.ts, 84, 7)) + + return new Base(); return new Derived(); return f(); // ? +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) +>f : Symbol(f, Decl(functionImplementations.ts, 84, 7)) + +} (); + +// FunctionExpression with non -void return type annotation with a single throw statement +undefined === function (): number { +>undefined : Symbol(undefined) + + throw undefined; +>undefined : Symbol(undefined) + +}; + +// Type of 'this' in function implementation is 'any' +function thisFunc() { +>thisFunc : Symbol(thisFunc, Decl(functionImplementations.ts, 91, 2)) + + var x = this; +>x : Symbol(x, Decl(functionImplementations.ts, 95, 7), Decl(functionImplementations.ts, 96, 7)) + + var x: any; +>x : Symbol(x, Decl(functionImplementations.ts, 95, 7), Decl(functionImplementations.ts, 96, 7)) +} + +// Function signature with optional parameter, no type annotation and initializer has initializer's type +function opt1(n = 4) { +>opt1 : Symbol(opt1, Decl(functionImplementations.ts, 97, 1)) +>n : Symbol(n, Decl(functionImplementations.ts, 100, 14)) + + var m = n; +>m : Symbol(m, Decl(functionImplementations.ts, 101, 7), Decl(functionImplementations.ts, 102, 7)) +>n : Symbol(n, Decl(functionImplementations.ts, 100, 14)) + + var m: number; +>m : Symbol(m, Decl(functionImplementations.ts, 101, 7), Decl(functionImplementations.ts, 102, 7)) +} + +// Function signature with optional parameter, no type annotation and initializer has initializer's widened type +function opt2(n = { x: null, y: undefined }) { +>opt2 : Symbol(opt2, Decl(functionImplementations.ts, 103, 1)) +>n : Symbol(n, Decl(functionImplementations.ts, 106, 14)) +>x : Symbol(x, Decl(functionImplementations.ts, 106, 19)) +>y : Symbol(y, Decl(functionImplementations.ts, 106, 28)) +>undefined : Symbol(undefined) + + var m = n; +>m : Symbol(m, Decl(functionImplementations.ts, 107, 7), Decl(functionImplementations.ts, 108, 7)) +>n : Symbol(n, Decl(functionImplementations.ts, 106, 14)) + + var m: { x: any; y: any }; +>m : Symbol(m, Decl(functionImplementations.ts, 107, 7), Decl(functionImplementations.ts, 108, 7)) +>x : Symbol(x, Decl(functionImplementations.ts, 108, 12)) +>y : Symbol(y, Decl(functionImplementations.ts, 108, 20)) +} + +// Function signature with initializer referencing other parameter to the left +function opt3(n: number, m = n) { +>opt3 : Symbol(opt3, Decl(functionImplementations.ts, 109, 1)) +>n : Symbol(n, Decl(functionImplementations.ts, 112, 14)) +>m : Symbol(m, Decl(functionImplementations.ts, 112, 24)) +>n : Symbol(n, Decl(functionImplementations.ts, 112, 14)) + + var y = m; +>y : Symbol(y, Decl(functionImplementations.ts, 113, 7), Decl(functionImplementations.ts, 114, 7)) +>m : Symbol(m, Decl(functionImplementations.ts, 112, 24)) + + var y: number; +>y : Symbol(y, Decl(functionImplementations.ts, 113, 7), Decl(functionImplementations.ts, 114, 7)) +} + +// Function signature with optional parameter has correct codegen +// (tested above) + +// FunctionExpression with non -void return type annotation return with no expression +function f6(): number { +>f6 : Symbol(f6, Decl(functionImplementations.ts, 115, 1)) + + return; +} + +class Derived2 extends Base { private r: string; } +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) +>r : Symbol(r, Decl(functionImplementations.ts, 125, 29)) + +class AnotherClass { private x } +>AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 125, 50)) +>x : Symbol(x, Decl(functionImplementations.ts, 126, 20)) + +// if f is a contextually typed function expression, the inferred return type is the union type +// of the types of the return statement expressions in the function body, +// ignoring return statements with no expressions. +var f7: (x: number) => string | number = x => { // should be (x: number) => number | string +>f7 : Symbol(f7, Decl(functionImplementations.ts, 130, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 130, 9)) +>x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) + + if (x < 0) { return x; } +>x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) +>x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) + + return x.toString(); +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(functionImplementations.ts, 130, 40)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} +var f8: (x: number) => any = x => { // should be (x: number) => Base +>f8 : Symbol(f8, Decl(functionImplementations.ts, 134, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 134, 9)) +>x : Symbol(x, Decl(functionImplementations.ts, 134, 28)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) + + return new Derived2(); +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) +} +var f9: (x: number) => any = x => { // should be (x: number) => Base +>f9 : Symbol(f9, Decl(functionImplementations.ts, 138, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 138, 9)) +>x : Symbol(x, Decl(functionImplementations.ts, 138, 28)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) + + return new Derived(); +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) + + return new Derived2(); +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) +} +var f10: (x: number) => any = x => { // should be (x: number) => Derived | Derived1 +>f10 : Symbol(f10, Decl(functionImplementations.ts, 143, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 143, 10)) +>x : Symbol(x, Decl(functionImplementations.ts, 143, 29)) + + return new Derived(); +>Derived : Symbol(Derived, Decl(functionImplementations.ts, 76, 25)) + + return new Derived2(); +>Derived2 : Symbol(Derived2, Decl(functionImplementations.ts, 123, 1)) +} +var f11: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass +>f11 : Symbol(f11, Decl(functionImplementations.ts, 147, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 147, 10)) +>x : Symbol(x, Decl(functionImplementations.ts, 147, 29)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) + + return new AnotherClass(); +>AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 125, 50)) +} +var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherClass +>f12 : Symbol(f12, Decl(functionImplementations.ts, 151, 3)) +>x : Symbol(x, Decl(functionImplementations.ts, 151, 10)) +>x : Symbol(x, Decl(functionImplementations.ts, 151, 29)) + + return new Base(); +>Base : Symbol(Base, Decl(functionImplementations.ts, 69, 4)) + + return; // should be ignored + return new AnotherClass(); +>AnotherClass : Symbol(AnotherClass, Decl(functionImplementations.ts, 125, 50)) +} diff --git a/tests/baselines/reference/functionImplementations.types b/tests/baselines/reference/functionImplementations.types index 04144e3a65b..f277821d696 100644 --- a/tests/baselines/reference/functionImplementations.types +++ b/tests/baselines/reference/functionImplementations.types @@ -101,11 +101,14 @@ var n = function () { >function () { return 3;} : () => number return 3; +>3 : number + } (); // FunctionExpression with no return type annotation and returns null var nu = null; >nu : any +>null : null var nu = function () { >nu : any @@ -113,6 +116,8 @@ var nu = function () { >function () { return null;} : () => any return null; +>null : null + } (); // FunctionExpression with no return type annotation and returns undefined @@ -143,6 +148,7 @@ var n = function (x: T) { >x : T } (4); +>4 : number // FunctionExpression with no return type annotation and returns a constrained type parameter type var n = function (x: T) { @@ -157,6 +163,7 @@ var n = function (x: T) { >x : T } (4); +>4 : number // FunctionExpression with no return type annotation with multiple return statements with identical types var n = function () { @@ -165,7 +172,11 @@ var n = function () { >function () { return 3; return 5;} : () => number return 3; +>3 : number + return 5; +>5 : number + }(); // Otherwise, the inferred return type is the first of the types of the return statement expressions @@ -243,6 +254,7 @@ function thisFunc() { function opt1(n = 4) { >opt1 : (n?: number) => void >n : number +>4 : number var m = n; >m : number @@ -258,6 +270,7 @@ function opt2(n = { x: null, y: undefined }) { >n : { x: any; y: any; } >{ x: null, y: undefined } : { x: null; y: undefined; } >x : null +>null : null >y : undefined >undefined : undefined @@ -317,6 +330,7 @@ var f7: (x: number) => string | number = x => { // should be (x: number) => numb if (x < 0) { return x; } >x < 0 : boolean >x : number +>0 : number >x : number return x.toString(); diff --git a/tests/baselines/reference/functionInIfStatementInModule.symbols b/tests/baselines/reference/functionInIfStatementInModule.symbols new file mode 100644 index 00000000000..5d297fceb4e --- /dev/null +++ b/tests/baselines/reference/functionInIfStatementInModule.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionInIfStatementInModule.ts === + +module Midori +>Midori : Symbol(Midori, Decl(functionInIfStatementInModule.ts, 0, 0)) +{ + if (false) { + function Foo(src) +>Foo : Symbol(Foo, Decl(functionInIfStatementInModule.ts, 3, 16)) +>src : Symbol(src, Decl(functionInIfStatementInModule.ts, 4, 21)) + { + } + } +} + diff --git a/tests/baselines/reference/functionInIfStatementInModule.types b/tests/baselines/reference/functionInIfStatementInModule.types index 773fd9c4186..11cdd80f0a1 100644 --- a/tests/baselines/reference/functionInIfStatementInModule.types +++ b/tests/baselines/reference/functionInIfStatementInModule.types @@ -4,6 +4,8 @@ module Midori >Midori : typeof Midori { if (false) { +>false : boolean + function Foo(src) >Foo : (src: any) => void >src : any diff --git a/tests/baselines/reference/functionLiteral.symbols b/tests/baselines/reference/functionLiteral.symbols new file mode 100644 index 00000000000..3a8a4cfbad7 --- /dev/null +++ b/tests/baselines/reference/functionLiteral.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/functionLiteral.ts === +// basic valid forms of function literals + +var x = () => 1; +>x : Symbol(x, Decl(functionLiteral.ts, 2, 3), Decl(functionLiteral.ts, 3, 3)) + +var x: { +>x : Symbol(x, Decl(functionLiteral.ts, 2, 3), Decl(functionLiteral.ts, 3, 3)) + + (): number; +} + +var y: { (x: string): string; }; +>y : Symbol(y, Decl(functionLiteral.ts, 7, 3), Decl(functionLiteral.ts, 8, 3)) +>x : Symbol(x, Decl(functionLiteral.ts, 7, 10)) + +var y: (x: string) => string; +>y : Symbol(y, Decl(functionLiteral.ts, 7, 3), Decl(functionLiteral.ts, 8, 3)) +>x : Symbol(x, Decl(functionLiteral.ts, 8, 8)) + +var y2: { (x: T): T; } = (x: T) => x +>y2 : Symbol(y2, Decl(functionLiteral.ts, 9, 3)) +>T : Symbol(T, Decl(functionLiteral.ts, 9, 11)) +>x : Symbol(x, Decl(functionLiteral.ts, 9, 14)) +>T : Symbol(T, Decl(functionLiteral.ts, 9, 11)) +>T : Symbol(T, Decl(functionLiteral.ts, 9, 11)) +>T : Symbol(T, Decl(functionLiteral.ts, 9, 29)) +>x : Symbol(x, Decl(functionLiteral.ts, 9, 32)) +>T : Symbol(T, Decl(functionLiteral.ts, 9, 29)) +>x : Symbol(x, Decl(functionLiteral.ts, 9, 32)) + +var z: { new (x: number): number; }; +>z : Symbol(z, Decl(functionLiteral.ts, 11, 3), Decl(functionLiteral.ts, 12, 3)) +>x : Symbol(x, Decl(functionLiteral.ts, 11, 14)) + +var z: new (x: number) => number; +>z : Symbol(z, Decl(functionLiteral.ts, 11, 3), Decl(functionLiteral.ts, 12, 3)) +>x : Symbol(x, Decl(functionLiteral.ts, 12, 12)) + diff --git a/tests/baselines/reference/functionLiteral.types b/tests/baselines/reference/functionLiteral.types index 7a57f0b1e1b..06c811093c3 100644 --- a/tests/baselines/reference/functionLiteral.types +++ b/tests/baselines/reference/functionLiteral.types @@ -4,6 +4,7 @@ var x = () => 1; >x : () => number >() => 1 : () => number +>1 : number var x: { >x : () => number diff --git a/tests/baselines/reference/functionLiteralForOverloads.symbols b/tests/baselines/reference/functionLiteralForOverloads.symbols new file mode 100644 index 00000000000..205945b73ea --- /dev/null +++ b/tests/baselines/reference/functionLiteralForOverloads.symbols @@ -0,0 +1,65 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/functionLiteralForOverloads.ts === +// basic uses of function literals with overloads + +var f: { +>f : Symbol(f, Decl(functionLiteralForOverloads.ts, 2, 3)) + + (x: string): string; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 3, 5)) + + (x: number): number; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 4, 5)) + +} = (x) => x; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 5, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 5, 5)) + +var f2: { +>f2 : Symbol(f2, Decl(functionLiteralForOverloads.ts, 7, 3)) + + (x: string): string; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 8, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 8, 8)) + + (x: number): number; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 9, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 9, 8)) + +} = (x) => x; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 10, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 10, 5)) + +var f3: { +>f3 : Symbol(f3, Decl(functionLiteralForOverloads.ts, 12, 3)) + + (x: T): string; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 13, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 13, 8)) +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 13, 5)) + + (x: T): number; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 14, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 14, 8)) +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 14, 5)) + +} = (x) => x; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 15, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 15, 5)) + +var f4: { +>f4 : Symbol(f4, Decl(functionLiteralForOverloads.ts, 17, 3)) + + (x: string): T; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 18, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 18, 8)) +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 18, 5)) + + (x: number): T; +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 19, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 19, 8)) +>T : Symbol(T, Decl(functionLiteralForOverloads.ts, 19, 5)) + +} = (x) => x; +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 20, 5)) +>x : Symbol(x, Decl(functionLiteralForOverloads.ts, 20, 5)) + diff --git a/tests/baselines/reference/functionLiteralForOverloads2.symbols b/tests/baselines/reference/functionLiteralForOverloads2.symbols new file mode 100644 index 00000000000..c42926384d5 --- /dev/null +++ b/tests/baselines/reference/functionLiteralForOverloads2.symbols @@ -0,0 +1,78 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/functionLiteralForOverloads2.ts === +// basic uses of function literals with constructor overloads + +class C { +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + + constructor(x: string); +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 3, 16)) + + constructor(x: number); +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 4, 16)) + + constructor(x) { } +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 5, 16)) +} + +class D { +>D : Symbol(D, Decl(functionLiteralForOverloads2.ts, 6, 1)) +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 8, 8)) + + constructor(x: string); +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 9, 16)) + + constructor(x: number); +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 10, 16)) + + constructor(x) { } +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 11, 16)) +} + +var f: { +>f : Symbol(f, Decl(functionLiteralForOverloads2.ts, 14, 3)) + + new(x: string): C; +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 15, 8)) +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + + new(x: number): C; +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 16, 8)) +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + +} = C; +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + +var f2: { +>f2 : Symbol(f2, Decl(functionLiteralForOverloads2.ts, 19, 3)) + + new(x: string): C; +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 20, 8)) +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 20, 11)) +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + + new(x: number): C; +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 21, 8)) +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 21, 11)) +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + +} = C; +>C : Symbol(C, Decl(functionLiteralForOverloads2.ts, 0, 0)) + +var f3: { +>f3 : Symbol(f3, Decl(functionLiteralForOverloads2.ts, 24, 3)) + + new(x: string): D; +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 25, 8)) +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 25, 11)) +>D : Symbol(D, Decl(functionLiteralForOverloads2.ts, 6, 1)) +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 25, 8)) + + new(x: number): D; +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 26, 8)) +>x : Symbol(x, Decl(functionLiteralForOverloads2.ts, 26, 11)) +>D : Symbol(D, Decl(functionLiteralForOverloads2.ts, 6, 1)) +>T : Symbol(T, Decl(functionLiteralForOverloads2.ts, 26, 8)) + +} = D; +>D : Symbol(D, Decl(functionLiteralForOverloads2.ts, 6, 1)) + diff --git a/tests/baselines/reference/functionLiterals.symbols b/tests/baselines/reference/functionLiterals.symbols new file mode 100644 index 00000000000..64e212f2d60 --- /dev/null +++ b/tests/baselines/reference/functionLiterals.symbols @@ -0,0 +1,228 @@ +=== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/functionLiterals.ts === +// PropName(ParamList):ReturnType is equivalent to PropName: { (ParamList): ReturnType } + +var b: { +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) + + func1(x: number): number; // Method signature +>func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>x : Symbol(x, Decl(functionLiterals.ts, 3, 10)) + + func2: (x: number) => number; // Function type literal +>func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>x : Symbol(x, Decl(functionLiterals.ts, 4, 12)) + + func3: { (x: number): number }; // Object type literal +>func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>x : Symbol(x, Decl(functionLiterals.ts, 5, 14)) +} + +// no errors +b.func1 = b.func2; +>b.func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b.func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) + +b.func1 = b.func3; +>b.func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b.func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) + +b.func2 = b.func1; +>b.func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b.func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) + +b.func2 = b.func3; +>b.func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b.func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) + +b.func3 = b.func1; +>b.func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b.func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 2, 8)) + +b.func3 = b.func2; +>b.func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 4, 33)) +>b.func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) +>b : Symbol(b, Decl(functionLiterals.ts, 2, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 3, 29)) + +var c: { +>c : Symbol(c, Decl(functionLiterals.ts, 16, 3)) + + func4(x: number): number; +>func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) +>x : Symbol(x, Decl(functionLiterals.ts, 17, 10)) + + func4(s: string): string; +>func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) +>s : Symbol(s, Decl(functionLiterals.ts, 18, 10)) + + func5: { +>func5 : Symbol(func5, Decl(functionLiterals.ts, 18, 29)) + + (x: number): number; +>x : Symbol(x, Decl(functionLiterals.ts, 20, 9)) + + (s: string): string; +>s : Symbol(s, Decl(functionLiterals.ts, 21, 9)) + + }; +}; + +// no errors +c.func4 = c.func5; +>c.func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) +>c : Symbol(c, Decl(functionLiterals.ts, 16, 3)) +>func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) +>c.func5 : Symbol(func5, Decl(functionLiterals.ts, 18, 29)) +>c : Symbol(c, Decl(functionLiterals.ts, 16, 3)) +>func5 : Symbol(func5, Decl(functionLiterals.ts, 18, 29)) + +c.func5 = c.func4; +>c.func5 : Symbol(func5, Decl(functionLiterals.ts, 18, 29)) +>c : Symbol(c, Decl(functionLiterals.ts, 16, 3)) +>func5 : Symbol(func5, Decl(functionLiterals.ts, 18, 29)) +>c.func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) +>c : Symbol(c, Decl(functionLiterals.ts, 16, 3)) +>func4 : Symbol(func4, Decl(functionLiterals.ts, 16, 8), Decl(functionLiterals.ts, 17, 29)) + +// generic versions +var b2: { +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) + + func1(x: T): number; // Method signature +>func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>T : Symbol(T, Decl(functionLiterals.ts, 31, 10)) +>x : Symbol(x, Decl(functionLiterals.ts, 31, 13)) +>T : Symbol(T, Decl(functionLiterals.ts, 31, 10)) + + func2: (x: T) => number; // Function type literal +>func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>T : Symbol(T, Decl(functionLiterals.ts, 32, 12)) +>x : Symbol(x, Decl(functionLiterals.ts, 32, 15)) +>T : Symbol(T, Decl(functionLiterals.ts, 32, 12)) + + func3: { (x: T): number }; // Object type literal +>func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>T : Symbol(T, Decl(functionLiterals.ts, 33, 14)) +>x : Symbol(x, Decl(functionLiterals.ts, 33, 17)) +>T : Symbol(T, Decl(functionLiterals.ts, 33, 14)) +} + +// no errors +b2.func1 = b2.func2; +>b2.func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2.func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) + +b2.func1 = b2.func3; +>b2.func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2.func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) + +b2.func2 = b2.func1; +>b2.func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2.func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) + +b2.func2 = b2.func3; +>b2.func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2.func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) + +b2.func3 = b2.func1; +>b2.func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2.func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func1 : Symbol(func1, Decl(functionLiterals.ts, 30, 9)) + +b2.func3 = b2.func2; +>b2.func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func3 : Symbol(func3, Decl(functionLiterals.ts, 32, 31)) +>b2.func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) +>b2 : Symbol(b2, Decl(functionLiterals.ts, 30, 3)) +>func2 : Symbol(func2, Decl(functionLiterals.ts, 31, 27)) + +var c2: { +>c2 : Symbol(c2, Decl(functionLiterals.ts, 44, 3)) + + func4(x: T): number; +>func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) +>T : Symbol(T, Decl(functionLiterals.ts, 45, 10)) +>x : Symbol(x, Decl(functionLiterals.ts, 45, 13)) +>T : Symbol(T, Decl(functionLiterals.ts, 45, 10)) + + func4(s: T): string; +>func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) +>T : Symbol(T, Decl(functionLiterals.ts, 46, 10)) +>s : Symbol(s, Decl(functionLiterals.ts, 46, 13)) +>T : Symbol(T, Decl(functionLiterals.ts, 46, 10)) + + func5: { +>func5 : Symbol(func5, Decl(functionLiterals.ts, 46, 27)) + + (x: T): number; +>T : Symbol(T, Decl(functionLiterals.ts, 48, 9)) +>x : Symbol(x, Decl(functionLiterals.ts, 48, 12)) +>T : Symbol(T, Decl(functionLiterals.ts, 48, 9)) + + (s: T): string; +>T : Symbol(T, Decl(functionLiterals.ts, 49, 9)) +>s : Symbol(s, Decl(functionLiterals.ts, 49, 12)) +>T : Symbol(T, Decl(functionLiterals.ts, 49, 9)) + + }; +}; + +// no errors +c2.func4 = c2.func5; +>c2.func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) +>c2 : Symbol(c2, Decl(functionLiterals.ts, 44, 3)) +>func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) +>c2.func5 : Symbol(func5, Decl(functionLiterals.ts, 46, 27)) +>c2 : Symbol(c2, Decl(functionLiterals.ts, 44, 3)) +>func5 : Symbol(func5, Decl(functionLiterals.ts, 46, 27)) + +c2.func5 = c2.func4; +>c2.func5 : Symbol(func5, Decl(functionLiterals.ts, 46, 27)) +>c2 : Symbol(c2, Decl(functionLiterals.ts, 44, 3)) +>func5 : Symbol(func5, Decl(functionLiterals.ts, 46, 27)) +>c2.func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) +>c2 : Symbol(c2, Decl(functionLiterals.ts, 44, 3)) +>func4 : Symbol(func4, Decl(functionLiterals.ts, 44, 9), Decl(functionLiterals.ts, 45, 27)) + diff --git a/tests/baselines/reference/functionMergedWithModule.symbols b/tests/baselines/reference/functionMergedWithModule.symbols new file mode 100644 index 00000000000..d22d7725317 --- /dev/null +++ b/tests/baselines/reference/functionMergedWithModule.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/functionMergedWithModule.ts === +function foo(title: string) { +>foo : Symbol(foo, Decl(functionMergedWithModule.ts, 0, 0), Decl(functionMergedWithModule.ts, 2, 1), Decl(functionMergedWithModule.ts, 7, 1)) +>title : Symbol(title, Decl(functionMergedWithModule.ts, 0, 13)) + + var x = 10; +>x : Symbol(x, Decl(functionMergedWithModule.ts, 1, 7)) +} + +module foo.Bar { +>foo : Symbol(foo, Decl(functionMergedWithModule.ts, 0, 0), Decl(functionMergedWithModule.ts, 2, 1), Decl(functionMergedWithModule.ts, 7, 1)) +>Bar : Symbol(Bar, Decl(functionMergedWithModule.ts, 4, 11)) + + export function f() { +>f : Symbol(f, Decl(functionMergedWithModule.ts, 4, 16)) + } +} + +module foo.Baz { +>foo : Symbol(foo, Decl(functionMergedWithModule.ts, 0, 0), Decl(functionMergedWithModule.ts, 2, 1), Decl(functionMergedWithModule.ts, 7, 1)) +>Baz : Symbol(Baz, Decl(functionMergedWithModule.ts, 9, 11)) + + export function g() { +>g : Symbol(g, Decl(functionMergedWithModule.ts, 9, 16)) + + Bar.f(); +>Bar.f : Symbol(Bar.f, Decl(functionMergedWithModule.ts, 4, 16)) +>Bar : Symbol(Bar, Decl(functionMergedWithModule.ts, 4, 11)) +>f : Symbol(Bar.f, Decl(functionMergedWithModule.ts, 4, 16)) + } +} diff --git a/tests/baselines/reference/functionMergedWithModule.types b/tests/baselines/reference/functionMergedWithModule.types index d0c711ab39a..ec0143f2923 100644 --- a/tests/baselines/reference/functionMergedWithModule.types +++ b/tests/baselines/reference/functionMergedWithModule.types @@ -5,6 +5,7 @@ function foo(title: string) { var x = 10; >x : number +>10 : number } module foo.Bar { diff --git a/tests/baselines/reference/functionOnlyHasThrow.symbols b/tests/baselines/reference/functionOnlyHasThrow.symbols new file mode 100644 index 00000000000..fc8d60a58be --- /dev/null +++ b/tests/baselines/reference/functionOnlyHasThrow.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/functionOnlyHasThrow.ts === +function clone():number { +>clone : Symbol(clone, Decl(functionOnlyHasThrow.ts, 0, 0)) + + throw new Error("To be implemented"); +>Error : Symbol(Error, Decl(lib.d.ts, 876, 38), Decl(lib.d.ts, 889, 11)) +} diff --git a/tests/baselines/reference/functionOnlyHasThrow.types b/tests/baselines/reference/functionOnlyHasThrow.types index d37284f547c..c4e8cce38a2 100644 --- a/tests/baselines/reference/functionOnlyHasThrow.types +++ b/tests/baselines/reference/functionOnlyHasThrow.types @@ -5,4 +5,5 @@ function clone():number { throw new Error("To be implemented"); >new Error("To be implemented") : Error >Error : ErrorConstructor +>"To be implemented" : string } diff --git a/tests/baselines/reference/functionOverloads10.symbols b/tests/baselines/reference/functionOverloads10.symbols new file mode 100644 index 00000000000..b2eda9bda8a --- /dev/null +++ b/tests/baselines/reference/functionOverloads10.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionOverloads10.ts === +function foo(foo:string, bar:number); +>foo : Symbol(foo, Decl(functionOverloads10.ts, 0, 0), Decl(functionOverloads10.ts, 0, 37), Decl(functionOverloads10.ts, 1, 25)) +>foo : Symbol(foo, Decl(functionOverloads10.ts, 0, 13)) +>bar : Symbol(bar, Decl(functionOverloads10.ts, 0, 24)) + +function foo(foo:string); +>foo : Symbol(foo, Decl(functionOverloads10.ts, 0, 0), Decl(functionOverloads10.ts, 0, 37), Decl(functionOverloads10.ts, 1, 25)) +>foo : Symbol(foo, Decl(functionOverloads10.ts, 1, 13)) + +function foo(foo:any){ } +>foo : Symbol(foo, Decl(functionOverloads10.ts, 0, 0), Decl(functionOverloads10.ts, 0, 37), Decl(functionOverloads10.ts, 1, 25)) +>foo : Symbol(foo, Decl(functionOverloads10.ts, 2, 13)) + diff --git a/tests/baselines/reference/functionOverloads12.symbols b/tests/baselines/reference/functionOverloads12.symbols new file mode 100644 index 00000000000..583e7f5c045 --- /dev/null +++ b/tests/baselines/reference/functionOverloads12.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/functionOverloads12.ts === +function foo():string; +>foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 0, 22), Decl(functionOverloads12.ts, 1, 22)) + +function foo():number; +>foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 0, 22), Decl(functionOverloads12.ts, 1, 22)) + +function foo():any { if (true) return ""; else return 0;} +>foo : Symbol(foo, Decl(functionOverloads12.ts, 0, 0), Decl(functionOverloads12.ts, 0, 22), Decl(functionOverloads12.ts, 1, 22)) + diff --git a/tests/baselines/reference/functionOverloads12.types b/tests/baselines/reference/functionOverloads12.types index 6e4c2d9189e..20f5ee5d556 100644 --- a/tests/baselines/reference/functionOverloads12.types +++ b/tests/baselines/reference/functionOverloads12.types @@ -7,4 +7,7 @@ function foo():number; function foo():any { if (true) return ""; else return 0;} >foo : { (): string; (): number; } +>true : boolean +>"" : string +>0 : number diff --git a/tests/baselines/reference/functionOverloads13.symbols b/tests/baselines/reference/functionOverloads13.symbols new file mode 100644 index 00000000000..c2aa01c9329 --- /dev/null +++ b/tests/baselines/reference/functionOverloads13.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/functionOverloads13.ts === +function foo(bar:number):string; +>foo : Symbol(foo, Decl(functionOverloads13.ts, 0, 0), Decl(functionOverloads13.ts, 0, 32), Decl(functionOverloads13.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads13.ts, 0, 13)) + +function foo(bar:number):number; +>foo : Symbol(foo, Decl(functionOverloads13.ts, 0, 0), Decl(functionOverloads13.ts, 0, 32), Decl(functionOverloads13.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads13.ts, 1, 13)) + +function foo(bar?:number):any { return "" } +>foo : Symbol(foo, Decl(functionOverloads13.ts, 0, 0), Decl(functionOverloads13.ts, 0, 32), Decl(functionOverloads13.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads13.ts, 2, 13)) + diff --git a/tests/baselines/reference/functionOverloads13.types b/tests/baselines/reference/functionOverloads13.types index ee65bc296e7..f26067c7eb8 100644 --- a/tests/baselines/reference/functionOverloads13.types +++ b/tests/baselines/reference/functionOverloads13.types @@ -10,4 +10,5 @@ function foo(bar:number):number; function foo(bar?:number):any { return "" } >foo : { (bar: number): string; (bar: number): number; } >bar : number +>"" : string diff --git a/tests/baselines/reference/functionOverloads14.symbols b/tests/baselines/reference/functionOverloads14.symbols new file mode 100644 index 00000000000..4f4c3e4750b --- /dev/null +++ b/tests/baselines/reference/functionOverloads14.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionOverloads14.ts === +function foo():{a:number;} +>foo : Symbol(foo, Decl(functionOverloads14.ts, 0, 0), Decl(functionOverloads14.ts, 0, 26), Decl(functionOverloads14.ts, 1, 26)) +>a : Symbol(a, Decl(functionOverloads14.ts, 0, 16)) + +function foo():{a:string;} +>foo : Symbol(foo, Decl(functionOverloads14.ts, 0, 0), Decl(functionOverloads14.ts, 0, 26), Decl(functionOverloads14.ts, 1, 26)) +>a : Symbol(a, Decl(functionOverloads14.ts, 1, 16)) + +function foo():{a:any;} { return {a:1} } +>foo : Symbol(foo, Decl(functionOverloads14.ts, 0, 0), Decl(functionOverloads14.ts, 0, 26), Decl(functionOverloads14.ts, 1, 26)) +>a : Symbol(a, Decl(functionOverloads14.ts, 2, 16)) +>a : Symbol(a, Decl(functionOverloads14.ts, 2, 34)) + diff --git a/tests/baselines/reference/functionOverloads14.types b/tests/baselines/reference/functionOverloads14.types index 562c43965c7..032ed700545 100644 --- a/tests/baselines/reference/functionOverloads14.types +++ b/tests/baselines/reference/functionOverloads14.types @@ -12,4 +12,5 @@ function foo():{a:any;} { return {a:1} } >a : any >{a:1} : { a: number; } >a : number +>1 : number diff --git a/tests/baselines/reference/functionOverloads15.symbols b/tests/baselines/reference/functionOverloads15.symbols new file mode 100644 index 00000000000..520480ad1a6 --- /dev/null +++ b/tests/baselines/reference/functionOverloads15.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/functionOverloads15.ts === +function foo(foo:{a:string; b:number;}):string; +>foo : Symbol(foo, Decl(functionOverloads15.ts, 0, 0), Decl(functionOverloads15.ts, 0, 47), Decl(functionOverloads15.ts, 1, 47)) +>foo : Symbol(foo, Decl(functionOverloads15.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads15.ts, 0, 18)) +>b : Symbol(b, Decl(functionOverloads15.ts, 0, 27)) + +function foo(foo:{a:string; b:number;}):number; +>foo : Symbol(foo, Decl(functionOverloads15.ts, 0, 0), Decl(functionOverloads15.ts, 0, 47), Decl(functionOverloads15.ts, 1, 47)) +>foo : Symbol(foo, Decl(functionOverloads15.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads15.ts, 1, 18)) +>b : Symbol(b, Decl(functionOverloads15.ts, 1, 27)) + +function foo(foo:{a:string; b?:number;}):any { return "" } +>foo : Symbol(foo, Decl(functionOverloads15.ts, 0, 0), Decl(functionOverloads15.ts, 0, 47), Decl(functionOverloads15.ts, 1, 47)) +>foo : Symbol(foo, Decl(functionOverloads15.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads15.ts, 2, 18)) +>b : Symbol(b, Decl(functionOverloads15.ts, 2, 27)) + diff --git a/tests/baselines/reference/functionOverloads15.types b/tests/baselines/reference/functionOverloads15.types index 6ca5b6709cb..8fe428e9a40 100644 --- a/tests/baselines/reference/functionOverloads15.types +++ b/tests/baselines/reference/functionOverloads15.types @@ -16,4 +16,5 @@ function foo(foo:{a:string; b?:number;}):any { return "" } >foo : { a: string; b?: number; } >a : string >b : number +>"" : string diff --git a/tests/baselines/reference/functionOverloads16.symbols b/tests/baselines/reference/functionOverloads16.symbols new file mode 100644 index 00000000000..97f7dfe7e74 --- /dev/null +++ b/tests/baselines/reference/functionOverloads16.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/functionOverloads16.ts === +function foo(foo:{a:string;}):string; +>foo : Symbol(foo, Decl(functionOverloads16.ts, 0, 0), Decl(functionOverloads16.ts, 0, 37), Decl(functionOverloads16.ts, 1, 37)) +>foo : Symbol(foo, Decl(functionOverloads16.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads16.ts, 0, 18)) + +function foo(foo:{a:string;}):number; +>foo : Symbol(foo, Decl(functionOverloads16.ts, 0, 0), Decl(functionOverloads16.ts, 0, 37), Decl(functionOverloads16.ts, 1, 37)) +>foo : Symbol(foo, Decl(functionOverloads16.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads16.ts, 1, 18)) + +function foo(foo:{a:string; b?:number;}):any { return "" } +>foo : Symbol(foo, Decl(functionOverloads16.ts, 0, 0), Decl(functionOverloads16.ts, 0, 37), Decl(functionOverloads16.ts, 1, 37)) +>foo : Symbol(foo, Decl(functionOverloads16.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads16.ts, 2, 18)) +>b : Symbol(b, Decl(functionOverloads16.ts, 2, 27)) + diff --git a/tests/baselines/reference/functionOverloads16.types b/tests/baselines/reference/functionOverloads16.types index 6974d0dab98..e6c6ceb57a6 100644 --- a/tests/baselines/reference/functionOverloads16.types +++ b/tests/baselines/reference/functionOverloads16.types @@ -14,4 +14,5 @@ function foo(foo:{a:string; b?:number;}):any { return "" } >foo : { a: string; b?: number; } >a : string >b : number +>"" : string diff --git a/tests/baselines/reference/functionOverloads21.symbols b/tests/baselines/reference/functionOverloads21.symbols new file mode 100644 index 00000000000..9e772c8aed8 --- /dev/null +++ b/tests/baselines/reference/functionOverloads21.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionOverloads21.ts === +function foo(bar:{a:number;}[]); +>foo : Symbol(foo, Decl(functionOverloads21.ts, 0, 0), Decl(functionOverloads21.ts, 0, 32), Decl(functionOverloads21.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads21.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads21.ts, 0, 18)) + +function foo(bar:{a:number; b:string;}[]); +>foo : Symbol(foo, Decl(functionOverloads21.ts, 0, 0), Decl(functionOverloads21.ts, 0, 32), Decl(functionOverloads21.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads21.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads21.ts, 1, 18)) +>b : Symbol(b, Decl(functionOverloads21.ts, 1, 27)) + +function foo(bar:{a:any; b?:string;}[]) { return 0 } +>foo : Symbol(foo, Decl(functionOverloads21.ts, 0, 0), Decl(functionOverloads21.ts, 0, 32), Decl(functionOverloads21.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads21.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads21.ts, 2, 18)) +>b : Symbol(b, Decl(functionOverloads21.ts, 2, 24)) + diff --git a/tests/baselines/reference/functionOverloads21.types b/tests/baselines/reference/functionOverloads21.types index dc9e28b7b57..3b4cf261ea9 100644 --- a/tests/baselines/reference/functionOverloads21.types +++ b/tests/baselines/reference/functionOverloads21.types @@ -15,4 +15,5 @@ function foo(bar:{a:any; b?:string;}[]) { return 0 } >bar : { a: any; b?: string; }[] >a : any >b : string +>0 : number diff --git a/tests/baselines/reference/functionOverloads23.symbols b/tests/baselines/reference/functionOverloads23.symbols new file mode 100644 index 00000000000..bc79c1b4e2b --- /dev/null +++ b/tests/baselines/reference/functionOverloads23.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionOverloads23.ts === +function foo(bar:(b:string)=>void); +>foo : Symbol(foo, Decl(functionOverloads23.ts, 0, 0), Decl(functionOverloads23.ts, 0, 35), Decl(functionOverloads23.ts, 1, 35)) +>bar : Symbol(bar, Decl(functionOverloads23.ts, 0, 13)) +>b : Symbol(b, Decl(functionOverloads23.ts, 0, 18)) + +function foo(bar:(a:number)=>void); +>foo : Symbol(foo, Decl(functionOverloads23.ts, 0, 0), Decl(functionOverloads23.ts, 0, 35), Decl(functionOverloads23.ts, 1, 35)) +>bar : Symbol(bar, Decl(functionOverloads23.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads23.ts, 1, 18)) + +function foo(bar:(a?)=>void) { return 0 } +>foo : Symbol(foo, Decl(functionOverloads23.ts, 0, 0), Decl(functionOverloads23.ts, 0, 35), Decl(functionOverloads23.ts, 1, 35)) +>bar : Symbol(bar, Decl(functionOverloads23.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads23.ts, 2, 18)) + diff --git a/tests/baselines/reference/functionOverloads23.types b/tests/baselines/reference/functionOverloads23.types index 40b67a78c55..ee510a336e1 100644 --- a/tests/baselines/reference/functionOverloads23.types +++ b/tests/baselines/reference/functionOverloads23.types @@ -13,4 +13,5 @@ function foo(bar:(a?)=>void) { return 0 } >foo : { (bar: (b: string) => void): any; (bar: (a: number) => void): any; } >bar : (a?: any) => void >a : any +>0 : number diff --git a/tests/baselines/reference/functionOverloads24.symbols b/tests/baselines/reference/functionOverloads24.symbols new file mode 100644 index 00000000000..0753e1f832b --- /dev/null +++ b/tests/baselines/reference/functionOverloads24.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionOverloads24.ts === +function foo(bar:number):(b:string)=>void; +>foo : Symbol(foo, Decl(functionOverloads24.ts, 0, 0), Decl(functionOverloads24.ts, 0, 42), Decl(functionOverloads24.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads24.ts, 0, 13)) +>b : Symbol(b, Decl(functionOverloads24.ts, 0, 26)) + +function foo(bar:string):(a:number)=>void; +>foo : Symbol(foo, Decl(functionOverloads24.ts, 0, 0), Decl(functionOverloads24.ts, 0, 42), Decl(functionOverloads24.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads24.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads24.ts, 1, 26)) + +function foo(bar:any):(a)=>void { return function(){} } +>foo : Symbol(foo, Decl(functionOverloads24.ts, 0, 0), Decl(functionOverloads24.ts, 0, 42), Decl(functionOverloads24.ts, 1, 42)) +>bar : Symbol(bar, Decl(functionOverloads24.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads24.ts, 2, 23)) + diff --git a/tests/baselines/reference/functionOverloads25.symbols b/tests/baselines/reference/functionOverloads25.symbols new file mode 100644 index 00000000000..9eeae4b3ce5 --- /dev/null +++ b/tests/baselines/reference/functionOverloads25.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionOverloads25.ts === +function foo():string; +>foo : Symbol(foo, Decl(functionOverloads25.ts, 0, 0), Decl(functionOverloads25.ts, 0, 22), Decl(functionOverloads25.ts, 1, 32)) + +function foo(bar:string):number; +>foo : Symbol(foo, Decl(functionOverloads25.ts, 0, 0), Decl(functionOverloads25.ts, 0, 22), Decl(functionOverloads25.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads25.ts, 1, 13)) + +function foo(bar?:any):any{ return '' }; +>foo : Symbol(foo, Decl(functionOverloads25.ts, 0, 0), Decl(functionOverloads25.ts, 0, 22), Decl(functionOverloads25.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads25.ts, 2, 13)) + +var x = foo(); +>x : Symbol(x, Decl(functionOverloads25.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads25.ts, 0, 0), Decl(functionOverloads25.ts, 0, 22), Decl(functionOverloads25.ts, 1, 32)) + diff --git a/tests/baselines/reference/functionOverloads25.types b/tests/baselines/reference/functionOverloads25.types index ace77ebc9e4..5b5c3781e74 100644 --- a/tests/baselines/reference/functionOverloads25.types +++ b/tests/baselines/reference/functionOverloads25.types @@ -9,6 +9,7 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' }; >foo : { (): string; (bar: string): number; } >bar : any +>'' : string var x = foo(); >x : string diff --git a/tests/baselines/reference/functionOverloads26.symbols b/tests/baselines/reference/functionOverloads26.symbols new file mode 100644 index 00000000000..b5e48390a2c --- /dev/null +++ b/tests/baselines/reference/functionOverloads26.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionOverloads26.ts === +function foo():string; +>foo : Symbol(foo, Decl(functionOverloads26.ts, 0, 0), Decl(functionOverloads26.ts, 0, 22), Decl(functionOverloads26.ts, 1, 32)) + +function foo(bar:string):number; +>foo : Symbol(foo, Decl(functionOverloads26.ts, 0, 0), Decl(functionOverloads26.ts, 0, 22), Decl(functionOverloads26.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads26.ts, 1, 13)) + +function foo(bar?:any):any{ return '' } +>foo : Symbol(foo, Decl(functionOverloads26.ts, 0, 0), Decl(functionOverloads26.ts, 0, 22), Decl(functionOverloads26.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads26.ts, 2, 13)) + +var x = foo('baz'); +>x : Symbol(x, Decl(functionOverloads26.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads26.ts, 0, 0), Decl(functionOverloads26.ts, 0, 22), Decl(functionOverloads26.ts, 1, 32)) + diff --git a/tests/baselines/reference/functionOverloads26.types b/tests/baselines/reference/functionOverloads26.types index 402003d7e7b..9345507b72e 100644 --- a/tests/baselines/reference/functionOverloads26.types +++ b/tests/baselines/reference/functionOverloads26.types @@ -9,9 +9,11 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' } >foo : { (): string; (bar: string): number; } >bar : any +>'' : string var x = foo('baz'); >x : number >foo('baz') : number >foo : { (): string; (bar: string): number; } +>'baz' : string diff --git a/tests/baselines/reference/functionOverloads28.symbols b/tests/baselines/reference/functionOverloads28.symbols new file mode 100644 index 00000000000..643bc4d5993 --- /dev/null +++ b/tests/baselines/reference/functionOverloads28.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionOverloads28.ts === +function foo():string; +>foo : Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32)) + +function foo(bar:string):number; +>foo : Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads28.ts, 1, 13)) + +function foo(bar?:any):any{ return '' } +>foo : Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads28.ts, 2, 13)) + +var t:any; var x = foo(t); +>t : Symbol(t, Decl(functionOverloads28.ts, 3, 3)) +>x : Symbol(x, Decl(functionOverloads28.ts, 3, 14)) +>foo : Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32)) +>t : Symbol(t, Decl(functionOverloads28.ts, 3, 3)) + diff --git a/tests/baselines/reference/functionOverloads28.types b/tests/baselines/reference/functionOverloads28.types index 034d35c64f7..ae4ab6c0664 100644 --- a/tests/baselines/reference/functionOverloads28.types +++ b/tests/baselines/reference/functionOverloads28.types @@ -9,6 +9,7 @@ function foo(bar:string):number; function foo(bar?:any):any{ return '' } >foo : { (): string; (bar: string): number; } >bar : any +>'' : string var t:any; var x = foo(t); >t : any diff --git a/tests/baselines/reference/functionOverloads30.symbols b/tests/baselines/reference/functionOverloads30.symbols new file mode 100644 index 00000000000..828c9149a12 --- /dev/null +++ b/tests/baselines/reference/functionOverloads30.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionOverloads30.ts === +function foo(bar:string):string; +>foo : Symbol(foo, Decl(functionOverloads30.ts, 0, 0), Decl(functionOverloads30.ts, 0, 32), Decl(functionOverloads30.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads30.ts, 0, 13)) + +function foo(bar:number):number; +>foo : Symbol(foo, Decl(functionOverloads30.ts, 0, 0), Decl(functionOverloads30.ts, 0, 32), Decl(functionOverloads30.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads30.ts, 1, 13)) + +function foo(bar:any):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads30.ts, 0, 0), Decl(functionOverloads30.ts, 0, 32), Decl(functionOverloads30.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads30.ts, 2, 13)) +>bar : Symbol(bar, Decl(functionOverloads30.ts, 2, 13)) + +var x = foo('bar'); +>x : Symbol(x, Decl(functionOverloads30.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads30.ts, 0, 0), Decl(functionOverloads30.ts, 0, 32), Decl(functionOverloads30.ts, 1, 32)) + diff --git a/tests/baselines/reference/functionOverloads30.types b/tests/baselines/reference/functionOverloads30.types index 80d43c952d9..a97bc0bb74d 100644 --- a/tests/baselines/reference/functionOverloads30.types +++ b/tests/baselines/reference/functionOverloads30.types @@ -16,4 +16,5 @@ var x = foo('bar'); >x : string >foo('bar') : string >foo : { (bar: string): string; (bar: number): number; } +>'bar' : string diff --git a/tests/baselines/reference/functionOverloads31.symbols b/tests/baselines/reference/functionOverloads31.symbols new file mode 100644 index 00000000000..e869e9f21b7 --- /dev/null +++ b/tests/baselines/reference/functionOverloads31.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionOverloads31.ts === +function foo(bar:string):string; +>foo : Symbol(foo, Decl(functionOverloads31.ts, 0, 0), Decl(functionOverloads31.ts, 0, 32), Decl(functionOverloads31.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads31.ts, 0, 13)) + +function foo(bar:number):number; +>foo : Symbol(foo, Decl(functionOverloads31.ts, 0, 0), Decl(functionOverloads31.ts, 0, 32), Decl(functionOverloads31.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads31.ts, 1, 13)) + +function foo(bar:any):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads31.ts, 0, 0), Decl(functionOverloads31.ts, 0, 32), Decl(functionOverloads31.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads31.ts, 2, 13)) +>bar : Symbol(bar, Decl(functionOverloads31.ts, 2, 13)) + +var x = foo(5); +>x : Symbol(x, Decl(functionOverloads31.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads31.ts, 0, 0), Decl(functionOverloads31.ts, 0, 32), Decl(functionOverloads31.ts, 1, 32)) + diff --git a/tests/baselines/reference/functionOverloads31.types b/tests/baselines/reference/functionOverloads31.types index 4d7816166bc..c85470ebd65 100644 --- a/tests/baselines/reference/functionOverloads31.types +++ b/tests/baselines/reference/functionOverloads31.types @@ -16,4 +16,5 @@ var x = foo(5); >x : number >foo(5) : number >foo : { (bar: string): string; (bar: number): number; } +>5 : number diff --git a/tests/baselines/reference/functionOverloads32.symbols b/tests/baselines/reference/functionOverloads32.symbols new file mode 100644 index 00000000000..6f0f013abf7 --- /dev/null +++ b/tests/baselines/reference/functionOverloads32.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/functionOverloads32.ts === +function foo(bar:string):string; +>foo : Symbol(foo, Decl(functionOverloads32.ts, 0, 0), Decl(functionOverloads32.ts, 0, 32), Decl(functionOverloads32.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads32.ts, 0, 13)) + +function foo(bar:number):number; +>foo : Symbol(foo, Decl(functionOverloads32.ts, 0, 0), Decl(functionOverloads32.ts, 0, 32), Decl(functionOverloads32.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads32.ts, 1, 13)) + +function foo(bar:any):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads32.ts, 0, 0), Decl(functionOverloads32.ts, 0, 32), Decl(functionOverloads32.ts, 1, 32)) +>bar : Symbol(bar, Decl(functionOverloads32.ts, 2, 13)) +>bar : Symbol(bar, Decl(functionOverloads32.ts, 2, 13)) + +var baz:number; var x = foo(baz); +>baz : Symbol(baz, Decl(functionOverloads32.ts, 3, 3)) +>x : Symbol(x, Decl(functionOverloads32.ts, 3, 19)) +>foo : Symbol(foo, Decl(functionOverloads32.ts, 0, 0), Decl(functionOverloads32.ts, 0, 32), Decl(functionOverloads32.ts, 1, 32)) +>baz : Symbol(baz, Decl(functionOverloads32.ts, 3, 3)) + diff --git a/tests/baselines/reference/functionOverloads33.symbols b/tests/baselines/reference/functionOverloads33.symbols new file mode 100644 index 00000000000..0ba6733a0f7 --- /dev/null +++ b/tests/baselines/reference/functionOverloads33.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/functionOverloads33.ts === +function foo(bar:string):string; +>foo : Symbol(foo, Decl(functionOverloads33.ts, 0, 0), Decl(functionOverloads33.ts, 0, 32), Decl(functionOverloads33.ts, 1, 29)) +>bar : Symbol(bar, Decl(functionOverloads33.ts, 0, 13)) + +function foo(bar:any):number; +>foo : Symbol(foo, Decl(functionOverloads33.ts, 0, 0), Decl(functionOverloads33.ts, 0, 32), Decl(functionOverloads33.ts, 1, 29)) +>bar : Symbol(bar, Decl(functionOverloads33.ts, 1, 13)) + +function foo(bar:any):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads33.ts, 0, 0), Decl(functionOverloads33.ts, 0, 32), Decl(functionOverloads33.ts, 1, 29)) +>bar : Symbol(bar, Decl(functionOverloads33.ts, 2, 13)) +>bar : Symbol(bar, Decl(functionOverloads33.ts, 2, 13)) + +var x = foo(5); +>x : Symbol(x, Decl(functionOverloads33.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads33.ts, 0, 0), Decl(functionOverloads33.ts, 0, 32), Decl(functionOverloads33.ts, 1, 29)) + diff --git a/tests/baselines/reference/functionOverloads33.types b/tests/baselines/reference/functionOverloads33.types index 0199277180d..3d57c983305 100644 --- a/tests/baselines/reference/functionOverloads33.types +++ b/tests/baselines/reference/functionOverloads33.types @@ -16,4 +16,5 @@ var x = foo(5); >x : number >foo(5) : number >foo : { (bar: string): string; (bar: any): number; } +>5 : number diff --git a/tests/baselines/reference/functionOverloads35.symbols b/tests/baselines/reference/functionOverloads35.symbols new file mode 100644 index 00000000000..44a65a452f4 --- /dev/null +++ b/tests/baselines/reference/functionOverloads35.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/functionOverloads35.ts === +function foo(bar:{a:number;}):number; +>foo : Symbol(foo, Decl(functionOverloads35.ts, 0, 0), Decl(functionOverloads35.ts, 0, 37), Decl(functionOverloads35.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads35.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads35.ts, 0, 18)) + +function foo(bar:{a:string;}):string; +>foo : Symbol(foo, Decl(functionOverloads35.ts, 0, 0), Decl(functionOverloads35.ts, 0, 37), Decl(functionOverloads35.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads35.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads35.ts, 1, 18)) + +function foo(bar:{a:any;}):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads35.ts, 0, 0), Decl(functionOverloads35.ts, 0, 37), Decl(functionOverloads35.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads35.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads35.ts, 2, 18)) +>bar : Symbol(bar, Decl(functionOverloads35.ts, 2, 13)) + +var x = foo({a:1}); +>x : Symbol(x, Decl(functionOverloads35.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads35.ts, 0, 0), Decl(functionOverloads35.ts, 0, 37), Decl(functionOverloads35.ts, 1, 37)) +>a : Symbol(a, Decl(functionOverloads35.ts, 3, 13)) + diff --git a/tests/baselines/reference/functionOverloads35.types b/tests/baselines/reference/functionOverloads35.types index 567f9512e3d..1b811cf4246 100644 --- a/tests/baselines/reference/functionOverloads35.types +++ b/tests/baselines/reference/functionOverloads35.types @@ -21,4 +21,5 @@ var x = foo({a:1}); >foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } >{a:1} : { a: number; } >a : number +>1 : number diff --git a/tests/baselines/reference/functionOverloads36.symbols b/tests/baselines/reference/functionOverloads36.symbols new file mode 100644 index 00000000000..fa6df8fafac --- /dev/null +++ b/tests/baselines/reference/functionOverloads36.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/functionOverloads36.ts === +function foo(bar:{a:number;}):number; +>foo : Symbol(foo, Decl(functionOverloads36.ts, 0, 0), Decl(functionOverloads36.ts, 0, 37), Decl(functionOverloads36.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads36.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads36.ts, 0, 18)) + +function foo(bar:{a:string;}):string; +>foo : Symbol(foo, Decl(functionOverloads36.ts, 0, 0), Decl(functionOverloads36.ts, 0, 37), Decl(functionOverloads36.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads36.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads36.ts, 1, 18)) + +function foo(bar:{a:any;}):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads36.ts, 0, 0), Decl(functionOverloads36.ts, 0, 37), Decl(functionOverloads36.ts, 1, 37)) +>bar : Symbol(bar, Decl(functionOverloads36.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads36.ts, 2, 18)) +>bar : Symbol(bar, Decl(functionOverloads36.ts, 2, 13)) + +var x = foo({a:'foo'}); +>x : Symbol(x, Decl(functionOverloads36.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads36.ts, 0, 0), Decl(functionOverloads36.ts, 0, 37), Decl(functionOverloads36.ts, 1, 37)) +>a : Symbol(a, Decl(functionOverloads36.ts, 3, 13)) + diff --git a/tests/baselines/reference/functionOverloads36.types b/tests/baselines/reference/functionOverloads36.types index 8118a1c113a..c8c1f7cede8 100644 --- a/tests/baselines/reference/functionOverloads36.types +++ b/tests/baselines/reference/functionOverloads36.types @@ -21,4 +21,5 @@ var x = foo({a:'foo'}); >foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } >{a:'foo'} : { a: string; } >a : string +>'foo' : string diff --git a/tests/baselines/reference/functionOverloads38.symbols b/tests/baselines/reference/functionOverloads38.symbols new file mode 100644 index 00000000000..460ea753776 --- /dev/null +++ b/tests/baselines/reference/functionOverloads38.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/functionOverloads38.ts === +function foo(bar:{a:number;}[]):string; +>foo : Symbol(foo, Decl(functionOverloads38.ts, 0, 0), Decl(functionOverloads38.ts, 0, 39), Decl(functionOverloads38.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads38.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads38.ts, 0, 18)) + +function foo(bar:{a:boolean;}[]):number; +>foo : Symbol(foo, Decl(functionOverloads38.ts, 0, 0), Decl(functionOverloads38.ts, 0, 39), Decl(functionOverloads38.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads38.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads38.ts, 1, 18)) + +function foo(bar:{a:any;}[]):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads38.ts, 0, 0), Decl(functionOverloads38.ts, 0, 39), Decl(functionOverloads38.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads38.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads38.ts, 2, 18)) +>bar : Symbol(bar, Decl(functionOverloads38.ts, 2, 13)) + +var x = foo([{a:1}]); +>x : Symbol(x, Decl(functionOverloads38.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads38.ts, 0, 0), Decl(functionOverloads38.ts, 0, 39), Decl(functionOverloads38.ts, 1, 40)) +>a : Symbol(a, Decl(functionOverloads38.ts, 3, 14)) + diff --git a/tests/baselines/reference/functionOverloads38.types b/tests/baselines/reference/functionOverloads38.types index 852191ba07f..d718569c9bf 100644 --- a/tests/baselines/reference/functionOverloads38.types +++ b/tests/baselines/reference/functionOverloads38.types @@ -22,4 +22,5 @@ var x = foo([{a:1}]); >[{a:1}] : { a: number; }[] >{a:1} : { a: number; } >a : number +>1 : number diff --git a/tests/baselines/reference/functionOverloads39.symbols b/tests/baselines/reference/functionOverloads39.symbols new file mode 100644 index 00000000000..37bb56117d5 --- /dev/null +++ b/tests/baselines/reference/functionOverloads39.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/functionOverloads39.ts === +function foo(bar:{a:number;}[]):string; +>foo : Symbol(foo, Decl(functionOverloads39.ts, 0, 0), Decl(functionOverloads39.ts, 0, 39), Decl(functionOverloads39.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads39.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads39.ts, 0, 18)) + +function foo(bar:{a:boolean;}[]):number; +>foo : Symbol(foo, Decl(functionOverloads39.ts, 0, 0), Decl(functionOverloads39.ts, 0, 39), Decl(functionOverloads39.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads39.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads39.ts, 1, 18)) + +function foo(bar:{a:any;}[]):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads39.ts, 0, 0), Decl(functionOverloads39.ts, 0, 39), Decl(functionOverloads39.ts, 1, 40)) +>bar : Symbol(bar, Decl(functionOverloads39.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads39.ts, 2, 18)) +>bar : Symbol(bar, Decl(functionOverloads39.ts, 2, 13)) + +var x = foo([{a:true}]); +>x : Symbol(x, Decl(functionOverloads39.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads39.ts, 0, 0), Decl(functionOverloads39.ts, 0, 39), Decl(functionOverloads39.ts, 1, 40)) +>a : Symbol(a, Decl(functionOverloads39.ts, 3, 14)) + diff --git a/tests/baselines/reference/functionOverloads39.types b/tests/baselines/reference/functionOverloads39.types index 70eee2b5163..78c0e78bca1 100644 --- a/tests/baselines/reference/functionOverloads39.types +++ b/tests/baselines/reference/functionOverloads39.types @@ -22,4 +22,5 @@ var x = foo([{a:true}]); >[{a:true}] : { a: boolean; }[] >{a:true} : { a: boolean; } >a : boolean +>true : boolean diff --git a/tests/baselines/reference/functionOverloads42.symbols b/tests/baselines/reference/functionOverloads42.symbols new file mode 100644 index 00000000000..6cca9a552f2 --- /dev/null +++ b/tests/baselines/reference/functionOverloads42.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/functionOverloads42.ts === +function foo(bar:{a:number;}[]):string; +>foo : Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36)) +>bar : Symbol(bar, Decl(functionOverloads42.ts, 0, 13)) +>a : Symbol(a, Decl(functionOverloads42.ts, 0, 18)) + +function foo(bar:{a:any;}[]):number; +>foo : Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36)) +>bar : Symbol(bar, Decl(functionOverloads42.ts, 1, 13)) +>a : Symbol(a, Decl(functionOverloads42.ts, 1, 18)) + +function foo(bar:{a:any;}[]):any{ return bar } +>foo : Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36)) +>bar : Symbol(bar, Decl(functionOverloads42.ts, 2, 13)) +>a : Symbol(a, Decl(functionOverloads42.ts, 2, 18)) +>bar : Symbol(bar, Decl(functionOverloads42.ts, 2, 13)) + +var x = foo([{a:'s'}]); +>x : Symbol(x, Decl(functionOverloads42.ts, 3, 3)) +>foo : Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36)) +>a : Symbol(a, Decl(functionOverloads42.ts, 3, 14)) + diff --git a/tests/baselines/reference/functionOverloads42.types b/tests/baselines/reference/functionOverloads42.types index 6641a28c87a..32e99d46aa1 100644 --- a/tests/baselines/reference/functionOverloads42.types +++ b/tests/baselines/reference/functionOverloads42.types @@ -22,4 +22,5 @@ var x = foo([{a:'s'}]); >[{a:'s'}] : { a: string; }[] >{a:'s'} : { a: string; } >a : string +>'s' : string diff --git a/tests/baselines/reference/functionOverloads6.symbols b/tests/baselines/reference/functionOverloads6.symbols new file mode 100644 index 00000000000..390339753a6 --- /dev/null +++ b/tests/baselines/reference/functionOverloads6.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/functionOverloads6.ts === +class foo { +>foo : Symbol(foo, Decl(functionOverloads6.ts, 0, 0)) + + static fnOverload(); +>fnOverload : Symbol(foo.fnOverload, Decl(functionOverloads6.ts, 0, 11), Decl(functionOverloads6.ts, 1, 23), Decl(functionOverloads6.ts, 2, 33)) + + static fnOverload(foo:string); +>fnOverload : Symbol(foo.fnOverload, Decl(functionOverloads6.ts, 0, 11), Decl(functionOverloads6.ts, 1, 23), Decl(functionOverloads6.ts, 2, 33)) +>foo : Symbol(foo, Decl(functionOverloads6.ts, 2, 21)) + + static fnOverload(foo?: any){ } +>fnOverload : Symbol(foo.fnOverload, Decl(functionOverloads6.ts, 0, 11), Decl(functionOverloads6.ts, 1, 23), Decl(functionOverloads6.ts, 2, 33)) +>foo : Symbol(foo, Decl(functionOverloads6.ts, 3, 21)) +} + diff --git a/tests/baselines/reference/functionOverloads7.symbols b/tests/baselines/reference/functionOverloads7.symbols new file mode 100644 index 00000000000..1d2fe3ea6a2 --- /dev/null +++ b/tests/baselines/reference/functionOverloads7.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/functionOverloads7.ts === +class foo { +>foo : Symbol(foo, Decl(functionOverloads7.ts, 0, 0)) + + private bar(); +>bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) + + private bar(foo: string); +>bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) +>foo : Symbol(foo, Decl(functionOverloads7.ts, 2, 15)) + + private bar(foo?: any){ return "foo" } +>bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) +>foo : Symbol(foo, Decl(functionOverloads7.ts, 3, 15)) + + public n() { +>n : Symbol(n, Decl(functionOverloads7.ts, 3, 41)) + + var foo = this.bar(); +>foo : Symbol(foo, Decl(functionOverloads7.ts, 5, 8)) +>this.bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) +>this : Symbol(foo, Decl(functionOverloads7.ts, 0, 0)) +>bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) + + foo = this.bar("test"); +>foo : Symbol(foo, Decl(functionOverloads7.ts, 5, 8)) +>this.bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) +>this : Symbol(foo, Decl(functionOverloads7.ts, 0, 0)) +>bar : Symbol(bar, Decl(functionOverloads7.ts, 0, 11), Decl(functionOverloads7.ts, 1, 17), Decl(functionOverloads7.ts, 2, 28)) + } +} + diff --git a/tests/baselines/reference/functionOverloads7.types b/tests/baselines/reference/functionOverloads7.types index fed669c8943..c57f042b354 100644 --- a/tests/baselines/reference/functionOverloads7.types +++ b/tests/baselines/reference/functionOverloads7.types @@ -12,6 +12,7 @@ class foo { private bar(foo?: any){ return "foo" } >bar : { (): any; (foo: string): any; } >foo : any +>"foo" : string public n() { >n : () => void @@ -30,6 +31,7 @@ class foo { >this.bar : { (): any; (foo: string): any; } >this : foo >bar : { (): any; (foo: string): any; } +>"test" : string } } diff --git a/tests/baselines/reference/functionOverloads8.symbols b/tests/baselines/reference/functionOverloads8.symbols new file mode 100644 index 00000000000..39acaddcd4f --- /dev/null +++ b/tests/baselines/reference/functionOverloads8.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/functionOverloads8.ts === +function foo(); +>foo : Symbol(foo, Decl(functionOverloads8.ts, 0, 0), Decl(functionOverloads8.ts, 0, 15), Decl(functionOverloads8.ts, 1, 25)) + +function foo(foo:string); +>foo : Symbol(foo, Decl(functionOverloads8.ts, 0, 0), Decl(functionOverloads8.ts, 0, 15), Decl(functionOverloads8.ts, 1, 25)) +>foo : Symbol(foo, Decl(functionOverloads8.ts, 1, 13)) + +function foo(foo?:any){ return '' } +>foo : Symbol(foo, Decl(functionOverloads8.ts, 0, 0), Decl(functionOverloads8.ts, 0, 15), Decl(functionOverloads8.ts, 1, 25)) +>foo : Symbol(foo, Decl(functionOverloads8.ts, 2, 13)) + diff --git a/tests/baselines/reference/functionOverloads8.types b/tests/baselines/reference/functionOverloads8.types index e342db5d174..4751533e2af 100644 --- a/tests/baselines/reference/functionOverloads8.types +++ b/tests/baselines/reference/functionOverloads8.types @@ -9,4 +9,5 @@ function foo(foo:string); function foo(foo?:any){ return '' } >foo : { (): any; (foo: string): any; } >foo : any +>'' : string diff --git a/tests/baselines/reference/functionOverloads9.symbols b/tests/baselines/reference/functionOverloads9.symbols new file mode 100644 index 00000000000..0fe6fe731a8 --- /dev/null +++ b/tests/baselines/reference/functionOverloads9.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/functionOverloads9.ts === +function foo(foo:string); +>foo : Symbol(foo, Decl(functionOverloads9.ts, 0, 0), Decl(functionOverloads9.ts, 0, 25)) +>foo : Symbol(foo, Decl(functionOverloads9.ts, 0, 13)) + +function foo(foo?:string){ return '' }; +>foo : Symbol(foo, Decl(functionOverloads9.ts, 0, 0), Decl(functionOverloads9.ts, 0, 25)) +>foo : Symbol(foo, Decl(functionOverloads9.ts, 1, 13)) + +var x = foo('foo'); +>x : Symbol(x, Decl(functionOverloads9.ts, 2, 3)) +>foo : Symbol(foo, Decl(functionOverloads9.ts, 0, 0), Decl(functionOverloads9.ts, 0, 25)) + diff --git a/tests/baselines/reference/functionOverloads9.types b/tests/baselines/reference/functionOverloads9.types index a844aee7df1..88586c32eb2 100644 --- a/tests/baselines/reference/functionOverloads9.types +++ b/tests/baselines/reference/functionOverloads9.types @@ -6,9 +6,11 @@ function foo(foo:string); function foo(foo?:string){ return '' }; >foo : (foo: string) => any >foo : string +>'' : string var x = foo('foo'); >x : any >foo('foo') : any >foo : (foo: string) => any +>'foo' : string diff --git a/tests/baselines/reference/functionOverloadsOnGenericArity1.symbols b/tests/baselines/reference/functionOverloadsOnGenericArity1.symbols new file mode 100644 index 00000000000..d4721e5ec08 --- /dev/null +++ b/tests/baselines/reference/functionOverloadsOnGenericArity1.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/functionOverloadsOnGenericArity1.ts === +// overloading on arity not allowed +interface C { +>C : Symbol(C, Decl(functionOverloadsOnGenericArity1.ts, 0, 0)) + + f(): string; +>f : Symbol(f, Decl(functionOverloadsOnGenericArity1.ts, 1, 13), Decl(functionOverloadsOnGenericArity1.ts, 2, 18)) +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 2, 5)) + + f(): string; +>f : Symbol(f, Decl(functionOverloadsOnGenericArity1.ts, 1, 13), Decl(functionOverloadsOnGenericArity1.ts, 2, 18)) +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 3, 5)) +>U : Symbol(U, Decl(functionOverloadsOnGenericArity1.ts, 3, 7)) + + (): string; +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 5, 4)) + + (): string; +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 6, 4)) +>U : Symbol(U, Decl(functionOverloadsOnGenericArity1.ts, 6, 6)) + + new (): string; +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 8, 7)) + + new (): string; +>T : Symbol(T, Decl(functionOverloadsOnGenericArity1.ts, 9, 7)) +>U : Symbol(U, Decl(functionOverloadsOnGenericArity1.ts, 9, 9)) +} + diff --git a/tests/baselines/reference/functionOverloadsOnGenericArity2.symbols b/tests/baselines/reference/functionOverloadsOnGenericArity2.symbols new file mode 100644 index 00000000000..93a56c86035 --- /dev/null +++ b/tests/baselines/reference/functionOverloadsOnGenericArity2.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/functionOverloadsOnGenericArity2.ts === +interface I { +>I : Symbol(I, Decl(functionOverloadsOnGenericArity2.ts, 0, 0)) + + then(p: string): string; +>then : Symbol(then, Decl(functionOverloadsOnGenericArity2.ts, 0, 13), Decl(functionOverloadsOnGenericArity2.ts, 1, 28), Decl(functionOverloadsOnGenericArity2.ts, 2, 31)) +>p : Symbol(p, Decl(functionOverloadsOnGenericArity2.ts, 1, 9)) + + then(p: string): string; +>then : Symbol(then, Decl(functionOverloadsOnGenericArity2.ts, 0, 13), Decl(functionOverloadsOnGenericArity2.ts, 1, 28), Decl(functionOverloadsOnGenericArity2.ts, 2, 31)) +>U : Symbol(U, Decl(functionOverloadsOnGenericArity2.ts, 2, 9)) +>p : Symbol(p, Decl(functionOverloadsOnGenericArity2.ts, 2, 12)) + + then(p: string): Date; +>then : Symbol(then, Decl(functionOverloadsOnGenericArity2.ts, 0, 13), Decl(functionOverloadsOnGenericArity2.ts, 1, 28), Decl(functionOverloadsOnGenericArity2.ts, 2, 31)) +>U : Symbol(U, Decl(functionOverloadsOnGenericArity2.ts, 3, 9)) +>T : Symbol(T, Decl(functionOverloadsOnGenericArity2.ts, 3, 11)) +>p : Symbol(p, Decl(functionOverloadsOnGenericArity2.ts, 3, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} diff --git a/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.symbols b/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.symbols new file mode 100644 index 00000000000..42ed87e64d1 --- /dev/null +++ b/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/functionOverloadsRecursiveGenericReturnType.ts === +class B{ +>B : Symbol(B, Decl(functionOverloadsRecursiveGenericReturnType.ts, 0, 0)) +>V : Symbol(V, Decl(functionOverloadsRecursiveGenericReturnType.ts, 0, 8)) + + private id: V; +>id : Symbol(id, Decl(functionOverloadsRecursiveGenericReturnType.ts, 0, 11)) +>V : Symbol(V, Decl(functionOverloadsRecursiveGenericReturnType.ts, 0, 8)) +} + +class A{ +>A : Symbol(A, Decl(functionOverloadsRecursiveGenericReturnType.ts, 2, 1)) +>U : Symbol(U, Decl(functionOverloadsRecursiveGenericReturnType.ts, 4, 8)) + + GetEnumerator: () => B; +>GetEnumerator : Symbol(GetEnumerator, Decl(functionOverloadsRecursiveGenericReturnType.ts, 4, 11)) +>B : Symbol(B, Decl(functionOverloadsRecursiveGenericReturnType.ts, 0, 0)) +>U : Symbol(U, Decl(functionOverloadsRecursiveGenericReturnType.ts, 4, 8)) +} + +function Choice(args: T[]): A; +>Choice : Symbol(Choice, Decl(functionOverloadsRecursiveGenericReturnType.ts, 6, 1), Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 36), Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 41)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 16)) +>args : Symbol(args, Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 19)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 16)) +>A : Symbol(A, Decl(functionOverloadsRecursiveGenericReturnType.ts, 2, 1)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 16)) + +function Choice(...v_args: T[]): A; +>Choice : Symbol(Choice, Decl(functionOverloadsRecursiveGenericReturnType.ts, 6, 1), Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 36), Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 41)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 16)) +>v_args : Symbol(v_args, Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 19)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 16)) +>A : Symbol(A, Decl(functionOverloadsRecursiveGenericReturnType.ts, 2, 1)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 16)) + +function Choice(...v_args: any[]): A{ +>Choice : Symbol(Choice, Decl(functionOverloadsRecursiveGenericReturnType.ts, 6, 1), Decl(functionOverloadsRecursiveGenericReturnType.ts, 8, 36), Decl(functionOverloadsRecursiveGenericReturnType.ts, 9, 41)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 10, 16)) +>v_args : Symbol(v_args, Decl(functionOverloadsRecursiveGenericReturnType.ts, 10, 19)) +>A : Symbol(A, Decl(functionOverloadsRecursiveGenericReturnType.ts, 2, 1)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 10, 16)) + + return new A(); +>A : Symbol(A, Decl(functionOverloadsRecursiveGenericReturnType.ts, 2, 1)) +>T : Symbol(T, Decl(functionOverloadsRecursiveGenericReturnType.ts, 10, 16)) +} + diff --git a/tests/baselines/reference/functionReturn.symbols b/tests/baselines/reference/functionReturn.symbols new file mode 100644 index 00000000000..9c6b794b3d0 --- /dev/null +++ b/tests/baselines/reference/functionReturn.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/functionReturn.ts === +function f0(): void { } +>f0 : Symbol(f0, Decl(functionReturn.ts, 0, 0)) + +function f1() { +>f1 : Symbol(f1, Decl(functionReturn.ts, 0, 23)) + + var n: any = f0(); +>n : Symbol(n, Decl(functionReturn.ts, 2, 7)) +>f0 : Symbol(f0, Decl(functionReturn.ts, 0, 0)) +} +function f2(): any { } +>f2 : Symbol(f2, Decl(functionReturn.ts, 3, 1)) + +function f3(): string { return; } +>f3 : Symbol(f3, Decl(functionReturn.ts, 4, 22)) + +function f4(): string { +>f4 : Symbol(f4, Decl(functionReturn.ts, 5, 33)) + + return ''; + return; +} +function f5(): string { +>f5 : Symbol(f5, Decl(functionReturn.ts, 9, 1)) + + return ''; + return undefined; +>undefined : Symbol(undefined) +} diff --git a/tests/baselines/reference/functionReturn.types b/tests/baselines/reference/functionReturn.types index 0c1ee8eafc2..6fc9d680db9 100644 --- a/tests/baselines/reference/functionReturn.types +++ b/tests/baselines/reference/functionReturn.types @@ -20,12 +20,16 @@ function f4(): string { >f4 : () => string return ''; +>'' : string + return; } function f5(): string { >f5 : () => string return ''; +>'' : string + return undefined; >undefined : undefined } diff --git a/tests/baselines/reference/functionReturningItself.symbols b/tests/baselines/reference/functionReturningItself.symbols new file mode 100644 index 00000000000..64e72d20c92 --- /dev/null +++ b/tests/baselines/reference/functionReturningItself.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/functionReturningItself.ts === +function somefn() { +>somefn : Symbol(somefn, Decl(functionReturningItself.ts, 0, 0)) + + return somefn; +>somefn : Symbol(somefn, Decl(functionReturningItself.ts, 0, 0)) +} diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs.symbols b/tests/baselines/reference/functionSubtypingOfVarArgs.symbols new file mode 100644 index 00000000000..334766dc10c --- /dev/null +++ b/tests/baselines/reference/functionSubtypingOfVarArgs.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/functionSubtypingOfVarArgs.ts === +class EventBase { +>EventBase : Symbol(EventBase, Decl(functionSubtypingOfVarArgs.ts, 0, 0)) + + private _listeners = []; +>_listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs.ts, 0, 17)) + + add(listener: (...args: any[]) => void): void { +>add : Symbol(add, Decl(functionSubtypingOfVarArgs.ts, 1, 28)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs.ts, 3, 8)) +>args : Symbol(args, Decl(functionSubtypingOfVarArgs.ts, 3, 19)) + + this._listeners.push(listener); +>this._listeners.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>this._listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs.ts, 0, 17)) +>this : Symbol(EventBase, Decl(functionSubtypingOfVarArgs.ts, 0, 0)) +>_listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs.ts, 0, 17)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs.ts, 3, 8)) + } +} + +class StringEvent extends EventBase { // should work +>StringEvent : Symbol(StringEvent, Decl(functionSubtypingOfVarArgs.ts, 6, 1)) +>EventBase : Symbol(EventBase, Decl(functionSubtypingOfVarArgs.ts, 0, 0)) + + add(listener: (items: string) => void ) { // valid, items is subtype of args +>add : Symbol(add, Decl(functionSubtypingOfVarArgs.ts, 8, 37)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs.ts, 9, 8)) +>items : Symbol(items, Decl(functionSubtypingOfVarArgs.ts, 9, 19)) + + super.add(listener); +>super.add : Symbol(EventBase.add, Decl(functionSubtypingOfVarArgs.ts, 1, 28)) +>super : Symbol(EventBase, Decl(functionSubtypingOfVarArgs.ts, 0, 0)) +>add : Symbol(EventBase.add, Decl(functionSubtypingOfVarArgs.ts, 1, 28)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs.ts, 9, 8)) + } +} + diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs2.symbols b/tests/baselines/reference/functionSubtypingOfVarArgs2.symbols new file mode 100644 index 00000000000..227264f9617 --- /dev/null +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/functionSubtypingOfVarArgs2.ts === +class EventBase { +>EventBase : Symbol(EventBase, Decl(functionSubtypingOfVarArgs2.ts, 0, 0)) + + private _listeners: { (...args: any[]): void; }[] = []; +>_listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs2.ts, 0, 17)) +>args : Symbol(args, Decl(functionSubtypingOfVarArgs2.ts, 1, 27)) + + add(listener: (...args: any[]) => void): void { +>add : Symbol(add, Decl(functionSubtypingOfVarArgs2.ts, 1, 59)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs2.ts, 3, 8)) +>args : Symbol(args, Decl(functionSubtypingOfVarArgs2.ts, 3, 19)) + + this._listeners.push(listener); +>this._listeners.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>this._listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs2.ts, 0, 17)) +>this : Symbol(EventBase, Decl(functionSubtypingOfVarArgs2.ts, 0, 0)) +>_listeners : Symbol(_listeners, Decl(functionSubtypingOfVarArgs2.ts, 0, 17)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs2.ts, 3, 8)) + } +} + +class StringEvent extends EventBase { +>StringEvent : Symbol(StringEvent, Decl(functionSubtypingOfVarArgs2.ts, 6, 1)) +>EventBase : Symbol(EventBase, Decl(functionSubtypingOfVarArgs2.ts, 0, 0)) + + add(listener: (items: string, moreitems: number) => void ) { +>add : Symbol(add, Decl(functionSubtypingOfVarArgs2.ts, 8, 37)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs2.ts, 9, 8)) +>items : Symbol(items, Decl(functionSubtypingOfVarArgs2.ts, 9, 19)) +>moreitems : Symbol(moreitems, Decl(functionSubtypingOfVarArgs2.ts, 9, 33)) + + super.add(listener); +>super.add : Symbol(EventBase.add, Decl(functionSubtypingOfVarArgs2.ts, 1, 59)) +>super : Symbol(EventBase, Decl(functionSubtypingOfVarArgs2.ts, 0, 0)) +>add : Symbol(EventBase.add, Decl(functionSubtypingOfVarArgs2.ts, 1, 59)) +>listener : Symbol(listener, Decl(functionSubtypingOfVarArgs2.ts, 9, 8)) + } +} + diff --git a/tests/baselines/reference/functionType.symbols b/tests/baselines/reference/functionType.symbols new file mode 100644 index 00000000000..f972b6fc8a1 --- /dev/null +++ b/tests/baselines/reference/functionType.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionType.ts === +function salt() {} +>salt : Symbol(salt, Decl(functionType.ts, 0, 0)) + +salt.apply("hello", []); +>salt.apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) +>salt : Symbol(salt, Decl(functionType.ts, 0, 0)) +>apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) + +(new Function("return 5"))(); +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + + + diff --git a/tests/baselines/reference/functionType.types b/tests/baselines/reference/functionType.types index 29a940db205..e7ea7a47edf 100644 --- a/tests/baselines/reference/functionType.types +++ b/tests/baselines/reference/functionType.types @@ -7,6 +7,7 @@ salt.apply("hello", []); >salt.apply : (thisArg: any, argArray?: any) => any >salt : () => void >apply : (thisArg: any, argArray?: any) => any +>"hello" : string >[] : undefined[] (new Function("return 5"))(); @@ -14,6 +15,7 @@ salt.apply("hello", []); >(new Function("return 5")) : Function >new Function("return 5") : Function >Function : FunctionConstructor +>"return 5" : string diff --git a/tests/baselines/reference/functionTypeArgumentArrayAssignment.symbols b/tests/baselines/reference/functionTypeArgumentArrayAssignment.symbols new file mode 100644 index 00000000000..4b597bea9ae --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArrayAssignment.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/functionTypeArgumentArrayAssignment.ts === +module test { +>test : Symbol(test, Decl(functionTypeArgumentArrayAssignment.ts, 0, 0)) + + interface Array { +>Array : Symbol(Array, Decl(functionTypeArgumentArrayAssignment.ts, 0, 13)) +>T : Symbol(T, Decl(functionTypeArgumentArrayAssignment.ts, 1, 20)) + + foo: T; +>foo : Symbol(foo, Decl(functionTypeArgumentArrayAssignment.ts, 1, 24)) +>T : Symbol(T, Decl(functionTypeArgumentArrayAssignment.ts, 1, 20)) + + length: number; +>length : Symbol(length, Decl(functionTypeArgumentArrayAssignment.ts, 2, 15)) + } + + function map() { +>map : Symbol(map, Decl(functionTypeArgumentArrayAssignment.ts, 4, 5)) +>U : Symbol(U, Decl(functionTypeArgumentArrayAssignment.ts, 6, 17)) + + var ys: U[] = []; +>ys : Symbol(ys, Decl(functionTypeArgumentArrayAssignment.ts, 7, 11)) +>U : Symbol(U, Decl(functionTypeArgumentArrayAssignment.ts, 6, 17)) + } +} + diff --git a/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.symbols b/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.symbols new file mode 100644 index 00000000000..71a678b6c93 --- /dev/null +++ b/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/functionWithAnyReturnTypeAndNoReturnExpression.ts === +// All should be allowed +function f(): any { } +>f : Symbol(f, Decl(functionWithAnyReturnTypeAndNoReturnExpression.ts, 0, 0)) + +var f2: () => any = () => { }; +>f2 : Symbol(f2, Decl(functionWithAnyReturnTypeAndNoReturnExpression.ts, 2, 3)) + +var f3 = (): any => { }; +>f3 : Symbol(f3, Decl(functionWithAnyReturnTypeAndNoReturnExpression.ts, 3, 3)) + diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.symbols new file mode 100644 index 00000000000..f10320b4ca9 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements1.ts === +function foo(x = 0) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements1.ts, 0, 0)) +>x : Symbol(x, Decl(functionWithDefaultParameterWithNoStatements1.ts, 0, 13)) + diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types index d5c114c9216..d695157db40 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements1.types @@ -2,4 +2,5 @@ function foo(x = 0) { } >foo : (x?: number) => void >x : number +>0 : number diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.symbols new file mode 100644 index 00000000000..2d68fc0007c --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements10.ts === +function foo(a = [0]) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements10.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements10.ts, 0, 13)) + +function bar(a = [0]) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements10.ts, 0, 25)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements10.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types index df28a085d85..8f8f03fafb1 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements10.types @@ -3,9 +3,11 @@ function foo(a = [0]) { } >foo : (a?: number[]) => void >a : number[] >[0] : number[] +>0 : number function bar(a = [0]) { >bar : (a?: number[]) => void >a : number[] >[0] : number[] +>0 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.symbols new file mode 100644 index 00000000000..c73cf6ce4d8 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements11.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements11.ts, 0, 3)) + +function foo(a = v[0]) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements11.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements11.ts, 2, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements11.ts, 0, 3)) + +function bar(a = v[0]) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements11.ts, 2, 26)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements11.ts, 4, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements11.ts, 0, 3)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types index 5e522855e4b..e0a87bb2656 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements11.types @@ -7,10 +7,12 @@ function foo(a = v[0]) { } >a : any >v[0] : any >v : any[] +>0 : number function bar(a = v[0]) { >bar : (a?: any) => void >a : any >v[0] : any >v : any[] +>0 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements12.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements12.symbols new file mode 100644 index 00000000000..49d428ce430 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements12.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements12.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements12.ts, 0, 3)) + +function foo(a = (v)) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements12.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements12.ts, 2, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements12.ts, 0, 3)) + +function bar(a = (v)) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements12.ts, 2, 25)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements12.ts, 4, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements12.ts, 0, 3)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.symbols new file mode 100644 index 00000000000..3a2d5490967 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements13.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements13.ts, 0, 3)) + +function foo(a = [1 + 1]) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements13.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements13.ts, 2, 13)) + +function bar(a = [1 + 1]) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements13.ts, 2, 29)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements13.ts, 4, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types index eccf0a92856..58c2009886a 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements13.types @@ -7,10 +7,14 @@ function foo(a = [1 + 1]) { } >a : number[] >[1 + 1] : number[] >1 + 1 : number +>1 : number +>1 : number function bar(a = [1 + 1]) { >bar : (a?: number[]) => void >a : number[] >[1 + 1] : number[] >1 + 1 : number +>1 : number +>1 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.symbols new file mode 100644 index 00000000000..5d9d9598179 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements14.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements14.ts, 0, 3)) + +function foo(a = v[1 + 1]) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements14.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements14.ts, 2, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements14.ts, 0, 3)) + +function bar(a = v[1 + 1]) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements14.ts, 2, 30)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements14.ts, 4, 13)) +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements14.ts, 0, 3)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types index c155b335e9a..2a5fbab6919 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements14.types @@ -8,6 +8,8 @@ function foo(a = v[1 + 1]) { } >v[1 + 1] : any >v : any[] >1 + 1 : number +>1 : number +>1 : number function bar(a = v[1 + 1]) { >bar : (a?: any) => void @@ -15,4 +17,6 @@ function bar(a = v[1 + 1]) { >v[1 + 1] : any >v : any[] >1 + 1 : number +>1 : number +>1 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.symbols new file mode 100644 index 00000000000..37126ef4888 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements15.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements15.ts, 0, 3)) + +function foo(a = (1 + 1)) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements15.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements15.ts, 2, 13)) + +function bar(a = (1 + 1)) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements15.ts, 2, 29)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements15.ts, 4, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types index a782b4bd15c..e35f5a5f4e0 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements15.types @@ -7,10 +7,14 @@ function foo(a = (1 + 1)) { } >a : number >(1 + 1) : number >1 + 1 : number +>1 : number +>1 : number function bar(a = (1 + 1)) { >bar : (a?: number) => void >a : number >(1 + 1) : number >1 + 1 : number +>1 : number +>1 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements16.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements16.symbols new file mode 100644 index 00000000000..e9611c323ae --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements16.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements16.ts === +var v: any[]; +>v : Symbol(v, Decl(functionWithDefaultParameterWithNoStatements16.ts, 0, 3)) + +function foo(a = bar()) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements16.ts, 0, 13)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements16.ts, 2, 13)) +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements16.ts, 2, 27)) + +function bar(a = foo()) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements16.ts, 2, 27)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements16.ts, 4, 13)) +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements16.ts, 0, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.symbols new file mode 100644 index 00000000000..5c45a1be95d --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements2.ts === +function foo(x = 0) { +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements2.ts, 0, 0)) +>x : Symbol(x, Decl(functionWithDefaultParameterWithNoStatements2.ts, 0, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types index 9be77e7d82e..76b6b56dfa4 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements2.types @@ -2,4 +2,5 @@ function foo(x = 0) { >foo : (x?: number) => void >x : number +>0 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.symbols new file mode 100644 index 00000000000..967241abca4 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements3.ts === +function foo(a = "") { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements3.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements3.ts, 0, 13)) + +function bar(a = "") { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements3.ts, 0, 24)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements3.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types index 77895ae1cc9..4254c0d28a9 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements3.types @@ -2,8 +2,10 @@ function foo(a = "") { } >foo : (a?: string) => void >a : string +>"" : string function bar(a = "") { >bar : (a?: string) => void >a : string +>"" : string } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.symbols new file mode 100644 index 00000000000..8fedab52972 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements4.ts === +function foo(a = ``) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements4.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements4.ts, 0, 13)) + +function bar(a = ``) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements4.ts, 0, 24)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements4.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types index 7071c956db2..bfc627fa60a 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements4.types @@ -2,8 +2,10 @@ function foo(a = ``) { } >foo : (a?: string) => void >a : string +>`` : string function bar(a = ``) { >bar : (a?: string) => void >a : string +>`` : string } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.symbols new file mode 100644 index 00000000000..8c1c44ed8ce --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements5.ts === +function foo(a = 0) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements5.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements5.ts, 0, 13)) + +function bar(a = 0) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements5.ts, 0, 23)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements5.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types index b7d53b544fa..99e93927e0a 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements5.types @@ -2,8 +2,10 @@ function foo(a = 0) { } >foo : (a?: number) => void >a : number +>0 : number function bar(a = 0) { >bar : (a?: number) => void >a : number +>0 : number } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.symbols new file mode 100644 index 00000000000..c9f0cc1c63b --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements6.ts === +function foo(a = true) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements6.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements6.ts, 0, 13)) + +function bar(a = true) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements6.ts, 0, 26)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements6.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types index b430bc70953..6100a6dedce 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements6.types @@ -2,8 +2,10 @@ function foo(a = true) { } >foo : (a?: boolean) => void >a : boolean +>true : boolean function bar(a = true) { >bar : (a?: boolean) => void >a : boolean +>true : boolean } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.symbols new file mode 100644 index 00000000000..c91bc726486 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements7.ts === +function foo(a = false) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements7.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements7.ts, 0, 13)) + +function bar(a = false) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements7.ts, 0, 27)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements7.ts, 2, 13)) +} diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types index baf83c870a9..866087a9f9b 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements7.types @@ -2,8 +2,10 @@ function foo(a = false) { } >foo : (a?: boolean) => void >a : boolean +>false : boolean function bar(a = false) { >bar : (a?: boolean) => void >a : boolean +>false : boolean } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements8.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements8.symbols new file mode 100644 index 00000000000..54df7f64ae1 --- /dev/null +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements8.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/functionWithDefaultParameterWithNoStatements8.ts === +function foo(a = undefined) { } +>foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements8.ts, 0, 0)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements8.ts, 0, 13)) +>undefined : Symbol(undefined) + +function bar(a = undefined) { +>bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements8.ts, 0, 31)) +>a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements8.ts, 2, 13)) +>undefined : Symbol(undefined) +} diff --git a/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.symbols b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.symbols new file mode 100644 index 00000000000..9a6aff630ce --- /dev/null +++ b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/funduleExportedClassIsUsedBeforeDeclaration.ts === +interface A { // interface before module declaration +>A : Symbol(A, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 0, 0)) + + (): B.C; // uses defined below class in module +>B : Symbol(B, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 2, 1), Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 3, 26)) +>C : Symbol(B.C, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 4, 18)) +} +declare function B(): B.C; // function merged with module +>B : Symbol(B, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 2, 1), Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 3, 26)) +>B : Symbol(B, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 2, 1), Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 3, 26)) +>C : Symbol(B.C, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 4, 18)) + +declare module B { +>B : Symbol(B, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 2, 1), Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 3, 26)) + + export class C { // class defined in module +>C : Symbol(C, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 4, 18)) + } +} +new B.C(); +>B.C : Symbol(B.C, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 4, 18)) +>B : Symbol(B, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 2, 1), Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 3, 26)) +>C : Symbol(B.C, Decl(funduleExportedClassIsUsedBeforeDeclaration.ts, 4, 18)) + diff --git a/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.types b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.types index fa457680f07..74c1be3eb2c 100644 --- a/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.types +++ b/tests/baselines/reference/funduleExportedClassIsUsedBeforeDeclaration.types @@ -3,12 +3,12 @@ interface A { // interface before module declaration >A : A (): B.C; // uses defined below class in module ->B : unknown +>B : any >C : B.C } declare function B(): B.C; // function merged with module >B : typeof B ->B : unknown +>B : any >C : B.C declare module B { diff --git a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.symbols b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.symbols new file mode 100644 index 00000000000..1f7a82628d3 --- /dev/null +++ b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/funduleOfFunctionWithoutReturnTypeAnnotation.ts === +function fn() { +>fn : Symbol(fn, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 0, 0), Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 2, 1)) + + return fn.n; +>fn.n : Symbol(fn.n, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 4, 14)) +>fn : Symbol(fn, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 0, 0), Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 2, 1)) +>n : Symbol(fn.n, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 4, 14)) +} +module fn { +>fn : Symbol(fn, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 0, 0), Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 2, 1)) + + export var n = 1; +>n : Symbol(n, Decl(funduleOfFunctionWithoutReturnTypeAnnotation.ts, 4, 14)) +} + diff --git a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types index 9284ce3e19d..2d71370c2ac 100644 --- a/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types +++ b/tests/baselines/reference/funduleOfFunctionWithoutReturnTypeAnnotation.types @@ -12,5 +12,6 @@ module fn { export var n = 1; >n : number +>1 : number } diff --git a/tests/baselines/reference/funduleUsedAcrossFileBoundary.symbols b/tests/baselines/reference/funduleUsedAcrossFileBoundary.symbols new file mode 100644 index 00000000000..e0ca752d307 --- /dev/null +++ b/tests/baselines/reference/funduleUsedAcrossFileBoundary.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/funduleUsedAcrossFileBoundary_file1.ts === +declare function Q(value: T): string; +>Q : Symbol(Q, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 0), Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 40)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 19)) +>value : Symbol(value, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 22)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 19)) + +declare module Q { +>Q : Symbol(Q, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 0), Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 40)) + + interface Promise { +>Promise : Symbol(Promise, Decl(funduleUsedAcrossFileBoundary_file1.ts, 1, 18)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file1.ts, 2, 22)) + + foo: string; +>foo : Symbol(foo, Decl(funduleUsedAcrossFileBoundary_file1.ts, 2, 26)) + } + export function defer(): string; +>defer : Symbol(defer, Decl(funduleUsedAcrossFileBoundary_file1.ts, 4, 5)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file1.ts, 5, 26)) +} + +=== tests/cases/compiler/funduleUsedAcrossFileBoundary_file2.ts === +function promiseWithCancellation(promise: Q.Promise) { +>promiseWithCancellation : Symbol(promiseWithCancellation, Decl(funduleUsedAcrossFileBoundary_file2.ts, 0, 0)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file2.ts, 0, 33)) +>promise : Symbol(promise, Decl(funduleUsedAcrossFileBoundary_file2.ts, 0, 36)) +>Q : Symbol(Q, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 0), Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 40)) +>Promise : Symbol(Q.Promise, Decl(funduleUsedAcrossFileBoundary_file1.ts, 1, 18)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file2.ts, 0, 33)) + + var deferred = Q.defer(); // used to be an error +>deferred : Symbol(deferred, Decl(funduleUsedAcrossFileBoundary_file2.ts, 1, 7)) +>Q.defer : Symbol(Q.defer, Decl(funduleUsedAcrossFileBoundary_file1.ts, 4, 5)) +>Q : Symbol(Q, Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 0), Decl(funduleUsedAcrossFileBoundary_file1.ts, 0, 40)) +>defer : Symbol(Q.defer, Decl(funduleUsedAcrossFileBoundary_file1.ts, 4, 5)) +>T : Symbol(T, Decl(funduleUsedAcrossFileBoundary_file2.ts, 0, 33)) +} diff --git a/tests/baselines/reference/funduleUsedAcrossFileBoundary.types b/tests/baselines/reference/funduleUsedAcrossFileBoundary.types index 09fc76a257b..60da1786f5e 100644 --- a/tests/baselines/reference/funduleUsedAcrossFileBoundary.types +++ b/tests/baselines/reference/funduleUsedAcrossFileBoundary.types @@ -25,7 +25,7 @@ function promiseWithCancellation(promise: Q.Promise) { >promiseWithCancellation : (promise: Q.Promise) => void >T : T >promise : Q.Promise ->Q : unknown +>Q : any >Promise : Q.Promise >T : T diff --git a/tests/baselines/reference/generatedContextualTyping.symbols b/tests/baselines/reference/generatedContextualTyping.symbols new file mode 100644 index 00000000000..287b7be66d0 --- /dev/null +++ b/tests/baselines/reference/generatedContextualTyping.symbols @@ -0,0 +1,2831 @@ +=== tests/cases/conformance/expressions/contextualTyping/generatedContextualTyping.ts === +class Base { private p; } +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>p : Symbol(p, Decl(generatedContextualTyping.ts, 0, 12)) + +class Derived1 extends Base { private m; } +>Derived1 : Symbol(Derived1, Decl(generatedContextualTyping.ts, 0, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>m : Symbol(m, Decl(generatedContextualTyping.ts, 1, 29)) + +class Derived2 extends Base { private n; } +>Derived2 : Symbol(Derived2, Decl(generatedContextualTyping.ts, 1, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 2, 29)) + +interface Genric { func(n: T[]); } +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>T : Symbol(T, Decl(generatedContextualTyping.ts, 3, 17)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 3, 21)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 3, 27)) +>T : Symbol(T, Decl(generatedContextualTyping.ts, 3, 17)) + +var b = new Base(), d1 = new Derived1(), d2 = new Derived2(); +>b : Symbol(b, Decl(generatedContextualTyping.ts, 4, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>Derived1 : Symbol(Derived1, Decl(generatedContextualTyping.ts, 0, 25)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>Derived2 : Symbol(Derived2, Decl(generatedContextualTyping.ts, 1, 42)) + +var x1: () => Base[] = () => [d1, d2]; +>x1 : Symbol(x1, Decl(generatedContextualTyping.ts, 5, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x2: () => Base[] = function() { return [d1, d2] }; +>x2 : Symbol(x2, Decl(generatedContextualTyping.ts, 6, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x3: () => Base[] = function named() { return [d1, d2] }; +>x3 : Symbol(x3, Decl(generatedContextualTyping.ts, 7, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 7, 22)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x4: { (): Base[]; } = () => [d1, d2]; +>x4 : Symbol(x4, Decl(generatedContextualTyping.ts, 8, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x5: { (): Base[]; } = function() { return [d1, d2] }; +>x5 : Symbol(x5, Decl(generatedContextualTyping.ts, 9, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x6: { (): Base[]; } = function named() { return [d1, d2] }; +>x6 : Symbol(x6, Decl(generatedContextualTyping.ts, 10, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 10, 25)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x7: Base[] = [d1, d2]; +>x7 : Symbol(x7, Decl(generatedContextualTyping.ts, 11, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x8: Array = [d1, d2]; +>x8 : Symbol(x8, Decl(generatedContextualTyping.ts, 12, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x9: { [n: number]: Base; } = [d1, d2]; +>x9 : Symbol(x9, Decl(generatedContextualTyping.ts, 13, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 13, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x10: {n: Base[]; } = { n: [d1, d2] }; +>x10 : Symbol(x10, Decl(generatedContextualTyping.ts, 14, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 14, 10)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 14, 27)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; +>x11 : Symbol(x11, Decl(generatedContextualTyping.ts, 15, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 15, 10)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 15, 29), Decl(generatedContextualTyping.ts, 15, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 15, 29), Decl(generatedContextualTyping.ts, 15, 40)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x12: Genric = { func: n => { return [d1, d2]; } }; +>x12 : Symbol(x12, Decl(generatedContextualTyping.ts, 16, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 16, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 16, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x13 { member: () => Base[] = () => [d1, d2] } +>x13 : Symbol(x13, Decl(generatedContextualTyping.ts, 16, 60)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 17, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x14 { member: () => Base[] = function() { return [d1, d2] } } +>x14 : Symbol(x14, Decl(generatedContextualTyping.ts, 17, 51)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 18, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x15 { member: () => Base[] = function named() { return [d1, d2] } } +>x15 : Symbol(x15, Decl(generatedContextualTyping.ts, 18, 67)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 19, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 19, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x16 { member: { (): Base[]; } = () => [d1, d2] } +>x16 : Symbol(x16, Decl(generatedContextualTyping.ts, 19, 73)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 20, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x17 { member: { (): Base[]; } = function() { return [d1, d2] } } +>x17 : Symbol(x17, Decl(generatedContextualTyping.ts, 20, 54)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 21, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x18 { member: { (): Base[]; } = function named() { return [d1, d2] } } +>x18 : Symbol(x18, Decl(generatedContextualTyping.ts, 21, 70)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 22, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 22, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x19 { member: Base[] = [d1, d2] } +>x19 : Symbol(x19, Decl(generatedContextualTyping.ts, 22, 76)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 23, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x20 { member: Array = [d1, d2] } +>x20 : Symbol(x20, Decl(generatedContextualTyping.ts, 23, 39)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 24, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x21 { member: { [n: number]: Base; } = [d1, d2] } +>x21 : Symbol(x21, Decl(generatedContextualTyping.ts, 24, 44)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 25, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 25, 23)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x22 { member: {n: Base[]; } = { n: [d1, d2] } } +>x22 : Symbol(x22, Decl(generatedContextualTyping.ts, 25, 55)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 26, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 26, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 26, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x23 : Symbol(x23, Decl(generatedContextualTyping.ts, 26, 54)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 27, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 27, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 27, 40), Decl(generatedContextualTyping.ts, 27, 51)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 27, 40), Decl(generatedContextualTyping.ts, 27, 51)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x24 { member: Genric = { func: n => { return [d1, d2]; } } } +>x24 : Symbol(x24, Decl(generatedContextualTyping.ts, 27, 79)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 28, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 28, 36)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 28, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x25 { private member: () => Base[] = () => [d1, d2] } +>x25 : Symbol(x25, Decl(generatedContextualTyping.ts, 28, 72)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 29, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x26 { private member: () => Base[] = function() { return [d1, d2] } } +>x26 : Symbol(x26, Decl(generatedContextualTyping.ts, 29, 59)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 30, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x27 { private member: () => Base[] = function named() { return [d1, d2] } } +>x27 : Symbol(x27, Decl(generatedContextualTyping.ts, 30, 75)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 31, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 31, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x28 { private member: { (): Base[]; } = () => [d1, d2] } +>x28 : Symbol(x28, Decl(generatedContextualTyping.ts, 31, 81)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 32, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x29 { private member: { (): Base[]; } = function() { return [d1, d2] } } +>x29 : Symbol(x29, Decl(generatedContextualTyping.ts, 32, 62)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 33, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x30 { private member: { (): Base[]; } = function named() { return [d1, d2] } } +>x30 : Symbol(x30, Decl(generatedContextualTyping.ts, 33, 78)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 34, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 34, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x31 { private member: Base[] = [d1, d2] } +>x31 : Symbol(x31, Decl(generatedContextualTyping.ts, 34, 84)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 35, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x32 { private member: Array = [d1, d2] } +>x32 : Symbol(x32, Decl(generatedContextualTyping.ts, 35, 47)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 36, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x33 { private member: { [n: number]: Base; } = [d1, d2] } +>x33 : Symbol(x33, Decl(generatedContextualTyping.ts, 36, 52)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 37, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 37, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x34 { private member: {n: Base[]; } = { n: [d1, d2] } } +>x34 : Symbol(x34, Decl(generatedContextualTyping.ts, 37, 63)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 38, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 38, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 38, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x35 : Symbol(x35, Decl(generatedContextualTyping.ts, 38, 62)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 39, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 39, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 39, 48), Decl(generatedContextualTyping.ts, 39, 59)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 39, 48), Decl(generatedContextualTyping.ts, 39, 59)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } +>x36 : Symbol(x36, Decl(generatedContextualTyping.ts, 39, 87)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 40, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 40, 44)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 40, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x37 { public member: () => Base[] = () => [d1, d2] } +>x37 : Symbol(x37, Decl(generatedContextualTyping.ts, 40, 80)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 41, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x38 { public member: () => Base[] = function() { return [d1, d2] } } +>x38 : Symbol(x38, Decl(generatedContextualTyping.ts, 41, 58)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 42, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x39 { public member: () => Base[] = function named() { return [d1, d2] } } +>x39 : Symbol(x39, Decl(generatedContextualTyping.ts, 42, 74)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 43, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 43, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x40 { public member: { (): Base[]; } = () => [d1, d2] } +>x40 : Symbol(x40, Decl(generatedContextualTyping.ts, 43, 80)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 44, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x41 { public member: { (): Base[]; } = function() { return [d1, d2] } } +>x41 : Symbol(x41, Decl(generatedContextualTyping.ts, 44, 61)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 45, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x42 { public member: { (): Base[]; } = function named() { return [d1, d2] } } +>x42 : Symbol(x42, Decl(generatedContextualTyping.ts, 45, 77)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 46, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 46, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x43 { public member: Base[] = [d1, d2] } +>x43 : Symbol(x43, Decl(generatedContextualTyping.ts, 46, 83)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 47, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x44 { public member: Array = [d1, d2] } +>x44 : Symbol(x44, Decl(generatedContextualTyping.ts, 47, 46)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 48, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x45 { public member: { [n: number]: Base; } = [d1, d2] } +>x45 : Symbol(x45, Decl(generatedContextualTyping.ts, 48, 51)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 49, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 49, 30)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x46 { public member: {n: Base[]; } = { n: [d1, d2] } } +>x46 : Symbol(x46, Decl(generatedContextualTyping.ts, 49, 62)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 50, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 50, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 50, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x47 : Symbol(x47, Decl(generatedContextualTyping.ts, 50, 61)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 51, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 51, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 51, 47), Decl(generatedContextualTyping.ts, 51, 58)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 51, 47), Decl(generatedContextualTyping.ts, 51, 58)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } +>x48 : Symbol(x48, Decl(generatedContextualTyping.ts, 51, 86)) +>member : Symbol(member, Decl(generatedContextualTyping.ts, 52, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 52, 43)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 52, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x49 { static member: () => Base[] = () => [d1, d2] } +>x49 : Symbol(x49, Decl(generatedContextualTyping.ts, 52, 79)) +>member : Symbol(x49.member, Decl(generatedContextualTyping.ts, 53, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x50 { static member: () => Base[] = function() { return [d1, d2] } } +>x50 : Symbol(x50, Decl(generatedContextualTyping.ts, 53, 58)) +>member : Symbol(x50.member, Decl(generatedContextualTyping.ts, 54, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x51 { static member: () => Base[] = function named() { return [d1, d2] } } +>x51 : Symbol(x51, Decl(generatedContextualTyping.ts, 54, 74)) +>member : Symbol(x51.member, Decl(generatedContextualTyping.ts, 55, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 55, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x52 { static member: { (): Base[]; } = () => [d1, d2] } +>x52 : Symbol(x52, Decl(generatedContextualTyping.ts, 55, 80)) +>member : Symbol(x52.member, Decl(generatedContextualTyping.ts, 56, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x53 { static member: { (): Base[]; } = function() { return [d1, d2] } } +>x53 : Symbol(x53, Decl(generatedContextualTyping.ts, 56, 61)) +>member : Symbol(x53.member, Decl(generatedContextualTyping.ts, 57, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x54 { static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x54 : Symbol(x54, Decl(generatedContextualTyping.ts, 57, 77)) +>member : Symbol(x54.member, Decl(generatedContextualTyping.ts, 58, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 58, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x55 { static member: Base[] = [d1, d2] } +>x55 : Symbol(x55, Decl(generatedContextualTyping.ts, 58, 83)) +>member : Symbol(x55.member, Decl(generatedContextualTyping.ts, 59, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x56 { static member: Array = [d1, d2] } +>x56 : Symbol(x56, Decl(generatedContextualTyping.ts, 59, 46)) +>member : Symbol(x56.member, Decl(generatedContextualTyping.ts, 60, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x57 { static member: { [n: number]: Base; } = [d1, d2] } +>x57 : Symbol(x57, Decl(generatedContextualTyping.ts, 60, 51)) +>member : Symbol(x57.member, Decl(generatedContextualTyping.ts, 61, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 61, 30)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x58 { static member: {n: Base[]; } = { n: [d1, d2] } } +>x58 : Symbol(x58, Decl(generatedContextualTyping.ts, 61, 62)) +>member : Symbol(x58.member, Decl(generatedContextualTyping.ts, 62, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 62, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 62, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x59 : Symbol(x59, Decl(generatedContextualTyping.ts, 62, 61)) +>member : Symbol(x59.member, Decl(generatedContextualTyping.ts, 63, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 63, 28)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 63, 47), Decl(generatedContextualTyping.ts, 63, 58)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 63, 47), Decl(generatedContextualTyping.ts, 63, 58)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } +>x60 : Symbol(x60, Decl(generatedContextualTyping.ts, 63, 86)) +>member : Symbol(x60.member, Decl(generatedContextualTyping.ts, 64, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 64, 43)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 64, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x61 { private static member: () => Base[] = () => [d1, d2] } +>x61 : Symbol(x61, Decl(generatedContextualTyping.ts, 64, 79)) +>member : Symbol(x61.member, Decl(generatedContextualTyping.ts, 65, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x62 { private static member: () => Base[] = function() { return [d1, d2] } } +>x62 : Symbol(x62, Decl(generatedContextualTyping.ts, 65, 66)) +>member : Symbol(x62.member, Decl(generatedContextualTyping.ts, 66, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x63 { private static member: () => Base[] = function named() { return [d1, d2] } } +>x63 : Symbol(x63, Decl(generatedContextualTyping.ts, 66, 82)) +>member : Symbol(x63.member, Decl(generatedContextualTyping.ts, 67, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 67, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x64 { private static member: { (): Base[]; } = () => [d1, d2] } +>x64 : Symbol(x64, Decl(generatedContextualTyping.ts, 67, 88)) +>member : Symbol(x64.member, Decl(generatedContextualTyping.ts, 68, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x65 { private static member: { (): Base[]; } = function() { return [d1, d2] } } +>x65 : Symbol(x65, Decl(generatedContextualTyping.ts, 68, 69)) +>member : Symbol(x65.member, Decl(generatedContextualTyping.ts, 69, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x66 { private static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x66 : Symbol(x66, Decl(generatedContextualTyping.ts, 69, 85)) +>member : Symbol(x66.member, Decl(generatedContextualTyping.ts, 70, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 70, 52)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x67 { private static member: Base[] = [d1, d2] } +>x67 : Symbol(x67, Decl(generatedContextualTyping.ts, 70, 91)) +>member : Symbol(x67.member, Decl(generatedContextualTyping.ts, 71, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x68 { private static member: Array = [d1, d2] } +>x68 : Symbol(x68, Decl(generatedContextualTyping.ts, 71, 54)) +>member : Symbol(x68.member, Decl(generatedContextualTyping.ts, 72, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x69 { private static member: { [n: number]: Base; } = [d1, d2] } +>x69 : Symbol(x69, Decl(generatedContextualTyping.ts, 72, 59)) +>member : Symbol(x69.member, Decl(generatedContextualTyping.ts, 73, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 73, 38)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x70 { private static member: {n: Base[]; } = { n: [d1, d2] } } +>x70 : Symbol(x70, Decl(generatedContextualTyping.ts, 73, 70)) +>member : Symbol(x70.member, Decl(generatedContextualTyping.ts, 74, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 74, 36)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 74, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x71 : Symbol(x71, Decl(generatedContextualTyping.ts, 74, 69)) +>member : Symbol(x71.member, Decl(generatedContextualTyping.ts, 75, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 75, 36)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 75, 55), Decl(generatedContextualTyping.ts, 75, 66)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 75, 55), Decl(generatedContextualTyping.ts, 75, 66)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } +>x72 : Symbol(x72, Decl(generatedContextualTyping.ts, 75, 94)) +>member : Symbol(x72.member, Decl(generatedContextualTyping.ts, 76, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 76, 51)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 76, 57)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x73 { public static member: () => Base[] = () => [d1, d2] } +>x73 : Symbol(x73, Decl(generatedContextualTyping.ts, 76, 87)) +>member : Symbol(x73.member, Decl(generatedContextualTyping.ts, 77, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x74 { public static member: () => Base[] = function() { return [d1, d2] } } +>x74 : Symbol(x74, Decl(generatedContextualTyping.ts, 77, 65)) +>member : Symbol(x74.member, Decl(generatedContextualTyping.ts, 78, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x75 { public static member: () => Base[] = function named() { return [d1, d2] } } +>x75 : Symbol(x75, Decl(generatedContextualTyping.ts, 78, 81)) +>member : Symbol(x75.member, Decl(generatedContextualTyping.ts, 79, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 79, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x76 { public static member: { (): Base[]; } = () => [d1, d2] } +>x76 : Symbol(x76, Decl(generatedContextualTyping.ts, 79, 87)) +>member : Symbol(x76.member, Decl(generatedContextualTyping.ts, 80, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x77 { public static member: { (): Base[]; } = function() { return [d1, d2] } } +>x77 : Symbol(x77, Decl(generatedContextualTyping.ts, 80, 68)) +>member : Symbol(x77.member, Decl(generatedContextualTyping.ts, 81, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x78 { public static member: { (): Base[]; } = function named() { return [d1, d2] } } +>x78 : Symbol(x78, Decl(generatedContextualTyping.ts, 81, 84)) +>member : Symbol(x78.member, Decl(generatedContextualTyping.ts, 82, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 82, 51)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x79 { public static member: Base[] = [d1, d2] } +>x79 : Symbol(x79, Decl(generatedContextualTyping.ts, 82, 90)) +>member : Symbol(x79.member, Decl(generatedContextualTyping.ts, 83, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x80 { public static member: Array = [d1, d2] } +>x80 : Symbol(x80, Decl(generatedContextualTyping.ts, 83, 53)) +>member : Symbol(x80.member, Decl(generatedContextualTyping.ts, 84, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x81 { public static member: { [n: number]: Base; } = [d1, d2] } +>x81 : Symbol(x81, Decl(generatedContextualTyping.ts, 84, 58)) +>member : Symbol(x81.member, Decl(generatedContextualTyping.ts, 85, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 85, 37)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x82 { public static member: {n: Base[]; } = { n: [d1, d2] } } +>x82 : Symbol(x82, Decl(generatedContextualTyping.ts, 85, 69)) +>member : Symbol(x82.member, Decl(generatedContextualTyping.ts, 86, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 86, 35)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 86, 52)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; return null; } } +>x83 : Symbol(x83, Decl(generatedContextualTyping.ts, 86, 68)) +>member : Symbol(x83.member, Decl(generatedContextualTyping.ts, 87, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 87, 35)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 87, 54), Decl(generatedContextualTyping.ts, 87, 65)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 87, 54), Decl(generatedContextualTyping.ts, 87, 65)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } +>x84 : Symbol(x84, Decl(generatedContextualTyping.ts, 87, 93)) +>member : Symbol(x84.member, Decl(generatedContextualTyping.ts, 88, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 88, 50)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 88, 56)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x85 { constructor(parm: () => Base[] = () => [d1, d2]) { } } +>x85 : Symbol(x85, Decl(generatedContextualTyping.ts, 88, 86)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 89, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x86 { constructor(parm: () => Base[] = function() { return [d1, d2] }) { } } +>x86 : Symbol(x86, Decl(generatedContextualTyping.ts, 89, 66)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 90, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x87 { constructor(parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x87 : Symbol(x87, Decl(generatedContextualTyping.ts, 90, 82)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 91, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 91, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x88 { constructor(parm: { (): Base[]; } = () => [d1, d2]) { } } +>x88 : Symbol(x88, Decl(generatedContextualTyping.ts, 91, 88)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 92, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x89 { constructor(parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x89 : Symbol(x89, Decl(generatedContextualTyping.ts, 92, 69)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 93, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x90 { constructor(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x90 : Symbol(x90, Decl(generatedContextualTyping.ts, 93, 85)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 94, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 94, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x91 { constructor(parm: Base[] = [d1, d2]) { } } +>x91 : Symbol(x91, Decl(generatedContextualTyping.ts, 94, 91)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 95, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x92 { constructor(parm: Array = [d1, d2]) { } } +>x92 : Symbol(x92, Decl(generatedContextualTyping.ts, 95, 54)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 96, 24)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x93 { constructor(parm: { [n: number]: Base; } = [d1, d2]) { } } +>x93 : Symbol(x93, Decl(generatedContextualTyping.ts, 96, 59)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 97, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 97, 33)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x94 { constructor(parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x94 : Symbol(x94, Decl(generatedContextualTyping.ts, 97, 70)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 98, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 98, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 98, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x95 : Symbol(x95, Decl(generatedContextualTyping.ts, 98, 69)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 99, 24)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 99, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 99, 50), Decl(generatedContextualTyping.ts, 99, 61)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 99, 50), Decl(generatedContextualTyping.ts, 99, 61)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x96 : Symbol(x96, Decl(generatedContextualTyping.ts, 99, 94)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 100, 24)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 100, 46)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 100, 52)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x97 { constructor(public parm: () => Base[] = () => [d1, d2]) { } } +>x97 : Symbol(x97, Decl(generatedContextualTyping.ts, 100, 87)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 101, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x98 { constructor(public parm: () => Base[] = function() { return [d1, d2] }) { } } +>x98 : Symbol(x98, Decl(generatedContextualTyping.ts, 101, 73)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 102, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x99 { constructor(public parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x99 : Symbol(x99, Decl(generatedContextualTyping.ts, 102, 89)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 103, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 103, 51)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x100 { constructor(public parm: { (): Base[]; } = () => [d1, d2]) { } } +>x100 : Symbol(x100, Decl(generatedContextualTyping.ts, 103, 95)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 104, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x101 { constructor(public parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x101 : Symbol(x101, Decl(generatedContextualTyping.ts, 104, 77)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 105, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x102 { constructor(public parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x102 : Symbol(x102, Decl(generatedContextualTyping.ts, 105, 93)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 106, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 106, 55)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x103 { constructor(public parm: Base[] = [d1, d2]) { } } +>x103 : Symbol(x103, Decl(generatedContextualTyping.ts, 106, 99)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 107, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x104 { constructor(public parm: Array = [d1, d2]) { } } +>x104 : Symbol(x104, Decl(generatedContextualTyping.ts, 107, 62)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 108, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x105 { constructor(public parm: { [n: number]: Base; } = [d1, d2]) { } } +>x105 : Symbol(x105, Decl(generatedContextualTyping.ts, 108, 67)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 109, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 109, 41)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x106 { constructor(public parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x106 : Symbol(x106, Decl(generatedContextualTyping.ts, 109, 78)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 110, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 110, 39)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 110, 56)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x107 : Symbol(x107, Decl(generatedContextualTyping.ts, 110, 77)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 111, 25)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 111, 39)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 111, 58), Decl(generatedContextualTyping.ts, 111, 69)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 111, 58), Decl(generatedContextualTyping.ts, 111, 69)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x108 : Symbol(x108, Decl(generatedContextualTyping.ts, 111, 102)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 112, 25)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 112, 54)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 112, 60)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x109 { constructor(private parm: () => Base[] = () => [d1, d2]) { } } +>x109 : Symbol(x109, Decl(generatedContextualTyping.ts, 112, 95)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 113, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x110 { constructor(private parm: () => Base[] = function() { return [d1, d2] }) { } } +>x110 : Symbol(x110, Decl(generatedContextualTyping.ts, 113, 75)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 114, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x111 { constructor(private parm: () => Base[] = function named() { return [d1, d2] }) { } } +>x111 : Symbol(x111, Decl(generatedContextualTyping.ts, 114, 91)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 115, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 115, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x112 { constructor(private parm: { (): Base[]; } = () => [d1, d2]) { } } +>x112 : Symbol(x112, Decl(generatedContextualTyping.ts, 115, 97)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 116, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x113 { constructor(private parm: { (): Base[]; } = function() { return [d1, d2] }) { } } +>x113 : Symbol(x113, Decl(generatedContextualTyping.ts, 116, 78)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 117, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x114 { constructor(private parm: { (): Base[]; } = function named() { return [d1, d2] }) { } } +>x114 : Symbol(x114, Decl(generatedContextualTyping.ts, 117, 94)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 118, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 118, 56)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x115 { constructor(private parm: Base[] = [d1, d2]) { } } +>x115 : Symbol(x115, Decl(generatedContextualTyping.ts, 118, 100)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 119, 25)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x116 { constructor(private parm: Array = [d1, d2]) { } } +>x116 : Symbol(x116, Decl(generatedContextualTyping.ts, 119, 63)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 120, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x117 { constructor(private parm: { [n: number]: Base; } = [d1, d2]) { } } +>x117 : Symbol(x117, Decl(generatedContextualTyping.ts, 120, 68)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 121, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 121, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x118 { constructor(private parm: {n: Base[]; } = { n: [d1, d2] }) { } } +>x118 : Symbol(x118, Decl(generatedContextualTyping.ts, 121, 79)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 122, 25)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 122, 40)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 122, 57)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } } +>x119 : Symbol(x119, Decl(generatedContextualTyping.ts, 122, 78)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 123, 25)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 123, 40)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 123, 59), Decl(generatedContextualTyping.ts, 123, 70)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 123, 59), Decl(generatedContextualTyping.ts, 123, 70)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } +>x120 : Symbol(x120, Decl(generatedContextualTyping.ts, 123, 103)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 124, 25)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 124, 55)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 124, 61)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x121(parm: () => Base[] = () => [d1, d2]) { } +>x121 : Symbol(x121, Decl(generatedContextualTyping.ts, 124, 96)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 125, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x122(parm: () => Base[] = function() { return [d1, d2] }) { } +>x122 : Symbol(x122, Decl(generatedContextualTyping.ts, 125, 54)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 126, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } +>x123 : Symbol(x123, Decl(generatedContextualTyping.ts, 126, 70)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 127, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 127, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x124(parm: { (): Base[]; } = () => [d1, d2]) { } +>x124 : Symbol(x124, Decl(generatedContextualTyping.ts, 127, 76)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 128, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } +>x125 : Symbol(x125, Decl(generatedContextualTyping.ts, 128, 57)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 129, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } +>x126 : Symbol(x126, Decl(generatedContextualTyping.ts, 129, 73)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 130, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 130, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x127(parm: Base[] = [d1, d2]) { } +>x127 : Symbol(x127, Decl(generatedContextualTyping.ts, 130, 79)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 131, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x128(parm: Array = [d1, d2]) { } +>x128 : Symbol(x128, Decl(generatedContextualTyping.ts, 131, 42)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 132, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x129(parm: { [n: number]: Base; } = [d1, d2]) { } +>x129 : Symbol(x129, Decl(generatedContextualTyping.ts, 132, 47)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 133, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 133, 23)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } +>x130 : Symbol(x130, Decl(generatedContextualTyping.ts, 133, 58)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 134, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 134, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 134, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } +>x131 : Symbol(x131, Decl(generatedContextualTyping.ts, 134, 57)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 135, 14)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 135, 21)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 135, 40), Decl(generatedContextualTyping.ts, 135, 51)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 135, 40), Decl(generatedContextualTyping.ts, 135, 51)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } +>x132 : Symbol(x132, Decl(generatedContextualTyping.ts, 135, 82)) +>parm : Symbol(parm, Decl(generatedContextualTyping.ts, 136, 14)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 136, 36)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 136, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x133(): () => Base[] { return () => [d1, d2]; } +>x133 : Symbol(x133, Decl(generatedContextualTyping.ts, 136, 75)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x134(): () => Base[] { return function() { return [d1, d2] }; } +>x134 : Symbol(x134, Decl(generatedContextualTyping.ts, 137, 56)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x135(): () => Base[] { return function named() { return [d1, d2] }; } +>x135 : Symbol(x135, Decl(generatedContextualTyping.ts, 138, 72)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 139, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x136(): { (): Base[]; } { return () => [d1, d2]; } +>x136 : Symbol(x136, Decl(generatedContextualTyping.ts, 139, 78)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } +>x137 : Symbol(x137, Decl(generatedContextualTyping.ts, 140, 59)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } +>x138 : Symbol(x138, Decl(generatedContextualTyping.ts, 141, 75)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 142, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x139(): Base[] { return [d1, d2]; } +>x139 : Symbol(x139, Decl(generatedContextualTyping.ts, 142, 81)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x140(): Array { return [d1, d2]; } +>x140 : Symbol(x140, Decl(generatedContextualTyping.ts, 143, 44)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x141(): { [n: number]: Base; } { return [d1, d2]; } +>x141 : Symbol(x141, Decl(generatedContextualTyping.ts, 144, 49)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 145, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x142(): {n: Base[]; } { return { n: [d1, d2] }; } +>x142 : Symbol(x142, Decl(generatedContextualTyping.ts, 145, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 146, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 146, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; } +>x143 : Symbol(x143, Decl(generatedContextualTyping.ts, 146, 59)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 147, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 147, 44), Decl(generatedContextualTyping.ts, 147, 55)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 147, 44), Decl(generatedContextualTyping.ts, 147, 55)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x144(): Genric { return { func: n => { return [d1, d2]; } }; } +>x144 : Symbol(x144, Decl(generatedContextualTyping.ts, 147, 84)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 148, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 148, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } +>x145 : Symbol(x145, Decl(generatedContextualTyping.ts, 148, 77)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } +>x146 : Symbol(x146, Decl(generatedContextualTyping.ts, 149, 79)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } +>x147 : Symbol(x147, Decl(generatedContextualTyping.ts, 150, 111)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 151, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 151, 83)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } +>x148 : Symbol(x148, Decl(generatedContextualTyping.ts, 151, 123)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } +>x149 : Symbol(x149, Decl(generatedContextualTyping.ts, 152, 82)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } +>x150 : Symbol(x150, Decl(generatedContextualTyping.ts, 153, 114)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 154, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 154, 86)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x151(): Base[] { return [d1, d2]; return [d1, d2]; } +>x151 : Symbol(x151, Decl(generatedContextualTyping.ts, 154, 126)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x152(): Array { return [d1, d2]; return [d1, d2]; } +>x152 : Symbol(x152, Decl(generatedContextualTyping.ts, 155, 61)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } +>x153 : Symbol(x153, Decl(generatedContextualTyping.ts, 156, 66)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 157, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] }; } +>x154 : Symbol(x154, Decl(generatedContextualTyping.ts, 157, 77)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 158, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 158, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 158, 66)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; return n => { var n: Base[]; return null; }; } +>x155 : Symbol(x155, Decl(generatedContextualTyping.ts, 158, 83)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 159, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 44), Decl(generatedContextualTyping.ts, 159, 55)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 44), Decl(generatedContextualTyping.ts, 159, 55)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 89), Decl(generatedContextualTyping.ts, 159, 100)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 159, 89), Decl(generatedContextualTyping.ts, 159, 100)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } +>x156 : Symbol(x156, Decl(generatedContextualTyping.ts, 159, 129)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 160, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 160, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 160, 84)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 160, 90)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x157: () => () => Base[] = () => { return () => [d1, d2]; }; +>x157 : Symbol(x157, Decl(generatedContextualTyping.ts, 161, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x158: () => () => Base[] = () => { return function() { return [d1, d2] }; }; +>x158 : Symbol(x158, Decl(generatedContextualTyping.ts, 162, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x159: () => () => Base[] = () => { return function named() { return [d1, d2] }; }; +>x159 : Symbol(x159, Decl(generatedContextualTyping.ts, 163, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 163, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x160: () => { (): Base[]; } = () => { return () => [d1, d2]; }; +>x160 : Symbol(x160, Decl(generatedContextualTyping.ts, 164, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x161: () => { (): Base[]; } = () => { return function() { return [d1, d2] }; }; +>x161 : Symbol(x161, Decl(generatedContextualTyping.ts, 165, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x162: () => { (): Base[]; } = () => { return function named() { return [d1, d2] }; }; +>x162 : Symbol(x162, Decl(generatedContextualTyping.ts, 166, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 166, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x163: () => Base[] = () => { return [d1, d2]; }; +>x163 : Symbol(x163, Decl(generatedContextualTyping.ts, 167, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x164: () => Array = () => { return [d1, d2]; }; +>x164 : Symbol(x164, Decl(generatedContextualTyping.ts, 168, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x165: () => { [n: number]: Base; } = () => { return [d1, d2]; }; +>x165 : Symbol(x165, Decl(generatedContextualTyping.ts, 169, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 169, 19)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x166: () => {n: Base[]; } = () => { return { n: [d1, d2] }; }; +>x166 : Symbol(x166, Decl(generatedContextualTyping.ts, 170, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 170, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 170, 49)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return null; }; }; +>x167 : Symbol(x167, Decl(generatedContextualTyping.ts, 171, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 171, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 171, 51), Decl(generatedContextualTyping.ts, 171, 62)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 171, 51), Decl(generatedContextualTyping.ts, 171, 62)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; +>x168 : Symbol(x168, Decl(generatedContextualTyping.ts, 172, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 172, 47)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 172, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x169: () => () => Base[] = function() { return () => [d1, d2]; }; +>x169 : Symbol(x169, Decl(generatedContextualTyping.ts, 173, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x170: () => () => Base[] = function() { return function() { return [d1, d2] }; }; +>x170 : Symbol(x170, Decl(generatedContextualTyping.ts, 174, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x171: () => () => Base[] = function() { return function named() { return [d1, d2] }; }; +>x171 : Symbol(x171, Decl(generatedContextualTyping.ts, 175, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 175, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x172: () => { (): Base[]; } = function() { return () => [d1, d2]; }; +>x172 : Symbol(x172, Decl(generatedContextualTyping.ts, 176, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x173: () => { (): Base[]; } = function() { return function() { return [d1, d2] }; }; +>x173 : Symbol(x173, Decl(generatedContextualTyping.ts, 177, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x174: () => { (): Base[]; } = function() { return function named() { return [d1, d2] }; }; +>x174 : Symbol(x174, Decl(generatedContextualTyping.ts, 178, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 178, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x175: () => Base[] = function() { return [d1, d2]; }; +>x175 : Symbol(x175, Decl(generatedContextualTyping.ts, 179, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x176: () => Array = function() { return [d1, d2]; }; +>x176 : Symbol(x176, Decl(generatedContextualTyping.ts, 180, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x177: () => { [n: number]: Base; } = function() { return [d1, d2]; }; +>x177 : Symbol(x177, Decl(generatedContextualTyping.ts, 181, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 181, 19)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x178: () => {n: Base[]; } = function() { return { n: [d1, d2] }; }; +>x178 : Symbol(x178, Decl(generatedContextualTyping.ts, 182, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 182, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 182, 54)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; return null; }; }; +>x179 : Symbol(x179, Decl(generatedContextualTyping.ts, 183, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 183, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 183, 56), Decl(generatedContextualTyping.ts, 183, 67)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 183, 56), Decl(generatedContextualTyping.ts, 183, 67)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; +>x180 : Symbol(x180, Decl(generatedContextualTyping.ts, 184, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 184, 52)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 184, 58)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x181 { var t: () => Base[] = () => [d1, d2]; } +>x181 : Symbol(x181, Decl(generatedContextualTyping.ts, 184, 90)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 185, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x182 { var t: () => Base[] = function() { return [d1, d2] }; } +>x182 : Symbol(x182, Decl(generatedContextualTyping.ts, 185, 53)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 186, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x183 { var t: () => Base[] = function named() { return [d1, d2] }; } +>x183 : Symbol(x183, Decl(generatedContextualTyping.ts, 186, 69)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 187, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 187, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x184 { var t: { (): Base[]; } = () => [d1, d2]; } +>x184 : Symbol(x184, Decl(generatedContextualTyping.ts, 187, 75)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 188, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x185 { var t: { (): Base[]; } = function() { return [d1, d2] }; } +>x185 : Symbol(x185, Decl(generatedContextualTyping.ts, 188, 56)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 189, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x186 { var t: { (): Base[]; } = function named() { return [d1, d2] }; } +>x186 : Symbol(x186, Decl(generatedContextualTyping.ts, 189, 72)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 190, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 190, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x187 { var t: Base[] = [d1, d2]; } +>x187 : Symbol(x187, Decl(generatedContextualTyping.ts, 190, 78)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 191, 17)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x188 { var t: Array = [d1, d2]; } +>x188 : Symbol(x188, Decl(generatedContextualTyping.ts, 191, 41)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 192, 17)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x189 { var t: { [n: number]: Base; } = [d1, d2]; } +>x189 : Symbol(x189, Decl(generatedContextualTyping.ts, 192, 46)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 193, 17)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 193, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x190 { var t: {n: Base[]; } = { n: [d1, d2] }; } +>x190 : Symbol(x190, Decl(generatedContextualTyping.ts, 193, 57)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 194, 17)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 194, 22)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 194, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } +>x191 : Symbol(x191, Decl(generatedContextualTyping.ts, 194, 56)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 195, 17)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 195, 22)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 195, 41), Decl(generatedContextualTyping.ts, 195, 52)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 195, 41), Decl(generatedContextualTyping.ts, 195, 52)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } +>x192 : Symbol(x192, Decl(generatedContextualTyping.ts, 195, 81)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 196, 17)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 196, 37)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 196, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x193 { export var t: () => Base[] = () => [d1, d2]; } +>x193 : Symbol(x193, Decl(generatedContextualTyping.ts, 196, 74)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 197, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x194 { export var t: () => Base[] = function() { return [d1, d2] }; } +>x194 : Symbol(x194, Decl(generatedContextualTyping.ts, 197, 60)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 198, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x195 { export var t: () => Base[] = function named() { return [d1, d2] }; } +>x195 : Symbol(x195, Decl(generatedContextualTyping.ts, 198, 76)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 199, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 199, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x196 { export var t: { (): Base[]; } = () => [d1, d2]; } +>x196 : Symbol(x196, Decl(generatedContextualTyping.ts, 199, 82)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 200, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x197 { export var t: { (): Base[]; } = function() { return [d1, d2] }; } +>x197 : Symbol(x197, Decl(generatedContextualTyping.ts, 200, 63)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 201, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x198 { export var t: { (): Base[]; } = function named() { return [d1, d2] }; } +>x198 : Symbol(x198, Decl(generatedContextualTyping.ts, 201, 79)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 202, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 202, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x199 { export var t: Base[] = [d1, d2]; } +>x199 : Symbol(x199, Decl(generatedContextualTyping.ts, 202, 85)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 203, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x200 { export var t: Array = [d1, d2]; } +>x200 : Symbol(x200, Decl(generatedContextualTyping.ts, 203, 48)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 204, 24)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x201 { export var t: { [n: number]: Base; } = [d1, d2]; } +>x201 : Symbol(x201, Decl(generatedContextualTyping.ts, 204, 53)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 205, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 205, 31)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x202 { export var t: {n: Base[]; } = { n: [d1, d2] }; } +>x202 : Symbol(x202, Decl(generatedContextualTyping.ts, 205, 64)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 206, 24)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 206, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 206, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; } +>x203 : Symbol(x203, Decl(generatedContextualTyping.ts, 206, 63)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 207, 24)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 207, 29)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 207, 48), Decl(generatedContextualTyping.ts, 207, 59)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 207, 48), Decl(generatedContextualTyping.ts, 207, 59)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } +>x204 : Symbol(x204, Decl(generatedContextualTyping.ts, 207, 88)) +>t : Symbol(t, Decl(generatedContextualTyping.ts, 208, 24)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 208, 44)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 208, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x206 = <() => Base[]>function() { return [d1, d2] }; +>x206 : Symbol(x206, Decl(generatedContextualTyping.ts, 209, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x207 = <() => Base[]>function named() { return [d1, d2] }; +>x207 : Symbol(x207, Decl(generatedContextualTyping.ts, 210, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 210, 25)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x209 = <{ (): Base[]; }>function() { return [d1, d2] }; +>x209 : Symbol(x209, Decl(generatedContextualTyping.ts, 211, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x210 = <{ (): Base[]; }>function named() { return [d1, d2] }; +>x210 : Symbol(x210, Decl(generatedContextualTyping.ts, 212, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 212, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x211 = [d1, d2]; +>x211 : Symbol(x211, Decl(generatedContextualTyping.ts, 213, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x212 = >[d1, d2]; +>x212 : Symbol(x212, Decl(generatedContextualTyping.ts, 214, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x213 = <{ [n: number]: Base; }>[d1, d2]; +>x213 : Symbol(x213, Decl(generatedContextualTyping.ts, 215, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 215, 15)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x214 = <{n: Base[]; } >{ n: [d1, d2] }; +>x214 : Symbol(x214, Decl(generatedContextualTyping.ts, 216, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 216, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 216, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x216 = >{ func: n => { return [d1, d2]; } }; +>x216 : Symbol(x216, Decl(generatedContextualTyping.ts, 217, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 217, 26)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 217, 32)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x217 = (<() => Base[]>undefined) || function() { return [d1, d2] }; +>x217 : Symbol(x217, Decl(generatedContextualTyping.ts, 218, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x218 = (<() => Base[]>undefined) || function named() { return [d1, d2] }; +>x218 : Symbol(x218, Decl(generatedContextualTyping.ts, 219, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 219, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x219 = (<{ (): Base[]; }>undefined) || function() { return [d1, d2] }; +>x219 : Symbol(x219, Decl(generatedContextualTyping.ts, 220, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x220 = (<{ (): Base[]; }>undefined) || function named() { return [d1, d2] }; +>x220 : Symbol(x220, Decl(generatedContextualTyping.ts, 221, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 221, 42)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x221 = (undefined) || [d1, d2]; +>x221 : Symbol(x221, Decl(generatedContextualTyping.ts, 222, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x222 = (>undefined) || [d1, d2]; +>x222 : Symbol(x222, Decl(generatedContextualTyping.ts, 223, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2]; +>x223 : Symbol(x223, Decl(generatedContextualTyping.ts, 224, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 224, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x224 = (<{n: Base[]; } >undefined) || { n: [d1, d2] }; +>x224 : Symbol(x224, Decl(generatedContextualTyping.ts, 225, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 225, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 225, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x225: () => Base[]; x225 = () => [d1, d2]; +>x225 : Symbol(x225, Decl(generatedContextualTyping.ts, 226, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x225 : Symbol(x225, Decl(generatedContextualTyping.ts, 226, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x226: () => Base[]; x226 = function() { return [d1, d2] }; +>x226 : Symbol(x226, Decl(generatedContextualTyping.ts, 227, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x226 : Symbol(x226, Decl(generatedContextualTyping.ts, 227, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x227: () => Base[]; x227 = function named() { return [d1, d2] }; +>x227 : Symbol(x227, Decl(generatedContextualTyping.ts, 228, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x227 : Symbol(x227, Decl(generatedContextualTyping.ts, 228, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 228, 30)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x228: { (): Base[]; }; x228 = () => [d1, d2]; +>x228 : Symbol(x228, Decl(generatedContextualTyping.ts, 229, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x228 : Symbol(x228, Decl(generatedContextualTyping.ts, 229, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x229: { (): Base[]; }; x229 = function() { return [d1, d2] }; +>x229 : Symbol(x229, Decl(generatedContextualTyping.ts, 230, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x229 : Symbol(x229, Decl(generatedContextualTyping.ts, 230, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x230: { (): Base[]; }; x230 = function named() { return [d1, d2] }; +>x230 : Symbol(x230, Decl(generatedContextualTyping.ts, 231, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x230 : Symbol(x230, Decl(generatedContextualTyping.ts, 231, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 231, 33)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x231: Base[]; x231 = [d1, d2]; +>x231 : Symbol(x231, Decl(generatedContextualTyping.ts, 232, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x231 : Symbol(x231, Decl(generatedContextualTyping.ts, 232, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x232: Array; x232 = [d1, d2]; +>x232 : Symbol(x232, Decl(generatedContextualTyping.ts, 233, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x232 : Symbol(x232, Decl(generatedContextualTyping.ts, 233, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x233: { [n: number]: Base; }; x233 = [d1, d2]; +>x233 : Symbol(x233, Decl(generatedContextualTyping.ts, 234, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 234, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x233 : Symbol(x233, Decl(generatedContextualTyping.ts, 234, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x234: {n: Base[]; } ; x234 = { n: [d1, d2] }; +>x234 : Symbol(x234, Decl(generatedContextualTyping.ts, 235, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 235, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x234 : Symbol(x234, Decl(generatedContextualTyping.ts, 235, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 235, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; +>x235 : Symbol(x235, Decl(generatedContextualTyping.ts, 236, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 236, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x235 : Symbol(x235, Decl(generatedContextualTyping.ts, 236, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 236, 36), Decl(generatedContextualTyping.ts, 236, 47)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 236, 36), Decl(generatedContextualTyping.ts, 236, 47)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; +>x236 : Symbol(x236, Decl(generatedContextualTyping.ts, 237, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x236 : Symbol(x236, Decl(generatedContextualTyping.ts, 237, 3)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 237, 32)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 237, 38)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x237: { n: () => Base[]; } = { n: () => [d1, d2] }; +>x237 : Symbol(x237, Decl(generatedContextualTyping.ts, 238, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 238, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 238, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x238: { n: () => Base[]; } = { n: function() { return [d1, d2] } }; +>x238 : Symbol(x238, Decl(generatedContextualTyping.ts, 239, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 239, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 239, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x239: { n: () => Base[]; } = { n: function named() { return [d1, d2] } }; +>x239 : Symbol(x239, Decl(generatedContextualTyping.ts, 240, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 240, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 240, 34)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 240, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x240: { n: { (): Base[]; }; } = { n: () => [d1, d2] }; +>x240 : Symbol(x240, Decl(generatedContextualTyping.ts, 241, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 241, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 241, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x241: { n: { (): Base[]; }; } = { n: function() { return [d1, d2] } }; +>x241 : Symbol(x241, Decl(generatedContextualTyping.ts, 242, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 242, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 242, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x242: { n: { (): Base[]; }; } = { n: function named() { return [d1, d2] } }; +>x242 : Symbol(x242, Decl(generatedContextualTyping.ts, 243, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 243, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 243, 37)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 243, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x243: { n: Base[]; } = { n: [d1, d2] }; +>x243 : Symbol(x243, Decl(generatedContextualTyping.ts, 244, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 244, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 244, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x244: { n: Array; } = { n: [d1, d2] }; +>x244 : Symbol(x244, Decl(generatedContextualTyping.ts, 245, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 245, 11)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 245, 33)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x245: { n: { [n: number]: Base; }; } = { n: [d1, d2] }; +>x245 : Symbol(x245, Decl(generatedContextualTyping.ts, 246, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 246, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x246: { n: {n: Base[]; } ; } = { n: { n: [d1, d2] } }; +>x246 : Symbol(x246, Decl(generatedContextualTyping.ts, 247, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 11)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 36)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 247, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } }; +>x247 : Symbol(x247, Decl(generatedContextualTyping.ts, 248, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 11)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 248, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 43), Decl(generatedContextualTyping.ts, 248, 54)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 248, 43), Decl(generatedContextualTyping.ts, 248, 54)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; +>x248 : Symbol(x248, Decl(generatedContextualTyping.ts, 249, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 11)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 34)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 249, 39)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 249, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x252: { (): Base[]; }[] = [() => [d1, d2]]; +>x252 : Symbol(x252, Decl(generatedContextualTyping.ts, 250, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x253: { (): Base[]; }[] = [function() { return [d1, d2] }]; +>x253 : Symbol(x253, Decl(generatedContextualTyping.ts, 251, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x254: { (): Base[]; }[] = [function named() { return [d1, d2] }]; +>x254 : Symbol(x254, Decl(generatedContextualTyping.ts, 252, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 252, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x255: Base[][] = [[d1, d2]]; +>x255 : Symbol(x255, Decl(generatedContextualTyping.ts, 253, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x256: Array[] = [[d1, d2]]; +>x256 : Symbol(x256, Decl(generatedContextualTyping.ts, 254, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x257: { [n: number]: Base; }[] = [[d1, d2]]; +>x257 : Symbol(x257, Decl(generatedContextualTyping.ts, 255, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 255, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x258: {n: Base[]; } [] = [{ n: [d1, d2] }]; +>x258 : Symbol(x258, Decl(generatedContextualTyping.ts, 256, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 256, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 256, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x260: Genric[] = [{ func: n => { return [d1, d2]; } }]; +>x260 : Symbol(x260, Decl(generatedContextualTyping.ts, 257, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 257, 29)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 257, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x261: () => Base[] = function() { return [d1, d2] } || undefined; +>x261 : Symbol(x261, Decl(generatedContextualTyping.ts, 258, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x262: () => Base[] = function named() { return [d1, d2] } || undefined; +>x262 : Symbol(x262, Decl(generatedContextualTyping.ts, 259, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 259, 24)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x263: { (): Base[]; } = function() { return [d1, d2] } || undefined; +>x263 : Symbol(x263, Decl(generatedContextualTyping.ts, 260, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x264: { (): Base[]; } = function named() { return [d1, d2] } || undefined; +>x264 : Symbol(x264, Decl(generatedContextualTyping.ts, 261, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 261, 27)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x265: Base[] = [d1, d2] || undefined; +>x265 : Symbol(x265, Decl(generatedContextualTyping.ts, 262, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x266: Array = [d1, d2] || undefined; +>x266 : Symbol(x266, Decl(generatedContextualTyping.ts, 263, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x267: { [n: number]: Base; } = [d1, d2] || undefined; +>x267 : Symbol(x267, Decl(generatedContextualTyping.ts, 264, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 264, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x268: {n: Base[]; } = { n: [d1, d2] } || undefined; +>x268 : Symbol(x268, Decl(generatedContextualTyping.ts, 265, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 265, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 265, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x269: () => Base[] = undefined || function() { return [d1, d2] }; +>x269 : Symbol(x269, Decl(generatedContextualTyping.ts, 266, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x270: () => Base[] = undefined || function named() { return [d1, d2] }; +>x270 : Symbol(x270, Decl(generatedContextualTyping.ts, 267, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 267, 37)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x271: { (): Base[]; } = undefined || function() { return [d1, d2] }; +>x271 : Symbol(x271, Decl(generatedContextualTyping.ts, 268, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x272: { (): Base[]; } = undefined || function named() { return [d1, d2] }; +>x272 : Symbol(x272, Decl(generatedContextualTyping.ts, 269, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 269, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x273: Base[] = undefined || [d1, d2]; +>x273 : Symbol(x273, Decl(generatedContextualTyping.ts, 270, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x274: Array = undefined || [d1, d2]; +>x274 : Symbol(x274, Decl(generatedContextualTyping.ts, 271, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x275: { [n: number]: Base; } = undefined || [d1, d2]; +>x275 : Symbol(x275, Decl(generatedContextualTyping.ts, 272, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 272, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x276: {n: Base[]; } = undefined || { n: [d1, d2] }; +>x276 : Symbol(x276, Decl(generatedContextualTyping.ts, 273, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 273, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 273, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x277: () => Base[] = function() { return [d1, d2] } || function() { return [d1, d2] }; +>x277 : Symbol(x277, Decl(generatedContextualTyping.ts, 274, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x278: () => Base[] = function named() { return [d1, d2] } || function named() { return [d1, d2] }; +>x278 : Symbol(x278, Decl(generatedContextualTyping.ts, 275, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 275, 24)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 275, 64)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x279: { (): Base[]; } = function() { return [d1, d2] } || function() { return [d1, d2] }; +>x279 : Symbol(x279, Decl(generatedContextualTyping.ts, 276, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x280: { (): Base[]; } = function named() { return [d1, d2] } || function named() { return [d1, d2] }; +>x280 : Symbol(x280, Decl(generatedContextualTyping.ts, 277, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 277, 27)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 277, 67)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x281: Base[] = [d1, d2] || [d1, d2]; +>x281 : Symbol(x281, Decl(generatedContextualTyping.ts, 278, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x282: Array = [d1, d2] || [d1, d2]; +>x282 : Symbol(x282, Decl(generatedContextualTyping.ts, 279, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x283: { [n: number]: Base; } = [d1, d2] || [d1, d2]; +>x283 : Symbol(x283, Decl(generatedContextualTyping.ts, 280, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 280, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x284: {n: Base[]; } = { n: [d1, d2] } || { n: [d1, d2] }; +>x284 : Symbol(x284, Decl(generatedContextualTyping.ts, 281, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 281, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 281, 28)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 281, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; +>x285 : Symbol(x285, Decl(generatedContextualTyping.ts, 282, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; +>x286 : Symbol(x286, Decl(generatedContextualTyping.ts, 283, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x287: () => Base[] = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; +>x287 : Symbol(x287, Decl(generatedContextualTyping.ts, 284, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 284, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 284, 70)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; +>x288 : Symbol(x288, Decl(generatedContextualTyping.ts, 285, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { return [d1, d2] }; +>x289 : Symbol(x289, Decl(generatedContextualTyping.ts, 286, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : function named() { return [d1, d2] }; +>x290 : Symbol(x290, Decl(generatedContextualTyping.ts, 287, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 287, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 287, 73)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x291: Base[] = true ? [d1, d2] : [d1, d2]; +>x291 : Symbol(x291, Decl(generatedContextualTyping.ts, 288, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x292: Array = true ? [d1, d2] : [d1, d2]; +>x292 : Symbol(x292, Decl(generatedContextualTyping.ts, 289, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; +>x293 : Symbol(x293, Decl(generatedContextualTyping.ts, 290, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 290, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; +>x294 : Symbol(x294, Decl(generatedContextualTyping.ts, 291, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 291, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 291, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 291, 53)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; }; +>x295 : Symbol(x295, Decl(generatedContextualTyping.ts, 292, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 292, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 37), Decl(generatedContextualTyping.ts, 292, 48)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 37), Decl(generatedContextualTyping.ts, 292, 48)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 76), Decl(generatedContextualTyping.ts, 292, 87)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 292, 76), Decl(generatedContextualTyping.ts, 292, 87)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; +>x296 : Symbol(x296, Decl(generatedContextualTyping.ts, 293, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 293, 33)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 293, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 293, 71)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 293, 77)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x297: () => Base[] = true ? undefined : () => [d1, d2]; +>x297 : Symbol(x297, Decl(generatedContextualTyping.ts, 294, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; +>x298 : Symbol(x298, Decl(generatedContextualTyping.ts, 295, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] }; +>x299 : Symbol(x299, Decl(generatedContextualTyping.ts, 296, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 296, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; +>x300 : Symbol(x300, Decl(generatedContextualTyping.ts, 297, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; +>x301 : Symbol(x301, Decl(generatedContextualTyping.ts, 298, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2] }; +>x302 : Symbol(x302, Decl(generatedContextualTyping.ts, 299, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 299, 46)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x303: Base[] = true ? undefined : [d1, d2]; +>x303 : Symbol(x303, Decl(generatedContextualTyping.ts, 300, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x304: Array = true ? undefined : [d1, d2]; +>x304 : Symbol(x304, Decl(generatedContextualTyping.ts, 301, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; +>x305 : Symbol(x305, Decl(generatedContextualTyping.ts, 302, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 302, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; +>x306 : Symbol(x306, Decl(generatedContextualTyping.ts, 303, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 303, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 303, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return null; }; +>x307 : Symbol(x307, Decl(generatedContextualTyping.ts, 304, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 304, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 304, 49), Decl(generatedContextualTyping.ts, 304, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 304, 49), Decl(generatedContextualTyping.ts, 304, 60)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; +>x308 : Symbol(x308, Decl(generatedContextualTyping.ts, 305, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 305, 45)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 305, 51)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x309: () => Base[] = true ? () => [d1, d2] : undefined; +>x309 : Symbol(x309, Decl(generatedContextualTyping.ts, 306, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; +>x310 : Symbol(x310, Decl(generatedContextualTyping.ts, 307, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined; +>x311 : Symbol(x311, Decl(generatedContextualTyping.ts, 308, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 308, 31)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; +>x312 : Symbol(x312, Decl(generatedContextualTyping.ts, 309, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; +>x313 : Symbol(x313, Decl(generatedContextualTyping.ts, 310, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefined; +>x314 : Symbol(x314, Decl(generatedContextualTyping.ts, 311, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 311, 34)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x315: Base[] = true ? [d1, d2] : undefined; +>x315 : Symbol(x315, Decl(generatedContextualTyping.ts, 312, 3)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x316: Array = true ? [d1, d2] : undefined; +>x316 : Symbol(x316, Decl(generatedContextualTyping.ts, 313, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; +>x317 : Symbol(x317, Decl(generatedContextualTyping.ts, 314, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 314, 13)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; +>x318 : Symbol(x318, Decl(generatedContextualTyping.ts, 315, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 315, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 315, 35)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : undefined; +>x319 : Symbol(x319, Decl(generatedContextualTyping.ts, 316, 3)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 316, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 316, 37), Decl(generatedContextualTyping.ts, 316, 48)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 316, 37), Decl(generatedContextualTyping.ts, 316, 48)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>undefined : Symbol(undefined) + +var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; +>x320 : Symbol(x320, Decl(generatedContextualTyping.ts, 317, 3)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 317, 33)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 317, 39)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) +>undefined : Symbol(undefined) + +function x321(n: () => Base[]) { }; x321(() => [d1, d2]); +>x321 : Symbol(x321, Decl(generatedContextualTyping.ts, 317, 80)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 318, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x321 : Symbol(x321, Decl(generatedContextualTyping.ts, 317, 80)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); +>x322 : Symbol(x322, Decl(generatedContextualTyping.ts, 318, 57)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 319, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x322 : Symbol(x322, Decl(generatedContextualTyping.ts, 318, 57)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); +>x323 : Symbol(x323, Decl(generatedContextualTyping.ts, 319, 73)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 320, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x323 : Symbol(x323, Decl(generatedContextualTyping.ts, 319, 73)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 320, 41)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); +>x324 : Symbol(x324, Decl(generatedContextualTyping.ts, 320, 79)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 321, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x324 : Symbol(x324, Decl(generatedContextualTyping.ts, 320, 79)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); +>x325 : Symbol(x325, Decl(generatedContextualTyping.ts, 321, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 322, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x325 : Symbol(x325, Decl(generatedContextualTyping.ts, 321, 60)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] }); +>x326 : Symbol(x326, Decl(generatedContextualTyping.ts, 322, 76)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 323, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x326 : Symbol(x326, Decl(generatedContextualTyping.ts, 322, 76)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 323, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x327(n: Base[]) { }; x327([d1, d2]); +>x327 : Symbol(x327, Decl(generatedContextualTyping.ts, 323, 82)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 324, 14)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x327 : Symbol(x327, Decl(generatedContextualTyping.ts, 323, 82)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x328(n: Array) { }; x328([d1, d2]); +>x328 : Symbol(x328, Decl(generatedContextualTyping.ts, 324, 45)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 325, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x328 : Symbol(x328, Decl(generatedContextualTyping.ts, 324, 45)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); +>x329 : Symbol(x329, Decl(generatedContextualTyping.ts, 325, 50)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 326, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 326, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x329 : Symbol(x329, Decl(generatedContextualTyping.ts, 325, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); +>x330 : Symbol(x330, Decl(generatedContextualTyping.ts, 326, 61)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 14)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x330 : Symbol(x330, Decl(generatedContextualTyping.ts, 326, 61)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 327, 44)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null; }); +>x331 : Symbol(x331, Decl(generatedContextualTyping.ts, 327, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 14)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 328, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x331 : Symbol(x331, Decl(generatedContextualTyping.ts, 327, 60)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 47), Decl(generatedContextualTyping.ts, 328, 57)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 328, 47), Decl(generatedContextualTyping.ts, 328, 57)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); +>x332 : Symbol(x332, Decl(generatedContextualTyping.ts, 328, 85)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 329, 14)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x332 : Symbol(x332, Decl(generatedContextualTyping.ts, 328, 85)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 329, 42)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 329, 48)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x333 = (n: () => Base[]) => n; x333(() => [d1, d2]); +>x333 : Symbol(x333, Decl(generatedContextualTyping.ts, 330, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 330, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 330, 12)) +>x333 : Symbol(x333, Decl(generatedContextualTyping.ts, 330, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x334 = (n: () => Base[]) => n; x334(function() { return [d1, d2] }); +>x334 : Symbol(x334, Decl(generatedContextualTyping.ts, 331, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 331, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 331, 12)) +>x334 : Symbol(x334, Decl(generatedContextualTyping.ts, 331, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x335 = (n: () => Base[]) => n; x335(function named() { return [d1, d2] }); +>x335 : Symbol(x335, Decl(generatedContextualTyping.ts, 332, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 332, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 332, 12)) +>x335 : Symbol(x335, Decl(generatedContextualTyping.ts, 332, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 332, 40)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x336 = (n: { (): Base[]; }) => n; x336(() => [d1, d2]); +>x336 : Symbol(x336, Decl(generatedContextualTyping.ts, 333, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 333, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 333, 12)) +>x336 : Symbol(x336, Decl(generatedContextualTyping.ts, 333, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x337 = (n: { (): Base[]; }) => n; x337(function() { return [d1, d2] }); +>x337 : Symbol(x337, Decl(generatedContextualTyping.ts, 334, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 334, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 334, 12)) +>x337 : Symbol(x337, Decl(generatedContextualTyping.ts, 334, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x338 = (n: { (): Base[]; }) => n; x338(function named() { return [d1, d2] }); +>x338 : Symbol(x338, Decl(generatedContextualTyping.ts, 335, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 335, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 335, 12)) +>x338 : Symbol(x338, Decl(generatedContextualTyping.ts, 335, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 335, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x339 = (n: Base[]) => n; x339([d1, d2]); +>x339 : Symbol(x339, Decl(generatedContextualTyping.ts, 336, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 336, 12)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 336, 12)) +>x339 : Symbol(x339, Decl(generatedContextualTyping.ts, 336, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x340 = (n: Array) => n; x340([d1, d2]); +>x340 : Symbol(x340, Decl(generatedContextualTyping.ts, 337, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 337, 12)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 337, 12)) +>x340 : Symbol(x340, Decl(generatedContextualTyping.ts, 337, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x341 = (n: { [n: number]: Base; }) => n; x341([d1, d2]); +>x341 : Symbol(x341, Decl(generatedContextualTyping.ts, 338, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 12)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 18)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 338, 12)) +>x341 : Symbol(x341, Decl(generatedContextualTyping.ts, 338, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x342 = (n: {n: Base[]; } ) => n; x342({ n: [d1, d2] }); +>x342 : Symbol(x342, Decl(generatedContextualTyping.ts, 339, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 12)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 12)) +>x342 : Symbol(x342, Decl(generatedContextualTyping.ts, 339, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 339, 43)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; }); +>x343 : Symbol(x343, Decl(generatedContextualTyping.ts, 340, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 12)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 340, 16)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 12)) +>x343 : Symbol(x343, Decl(generatedContextualTyping.ts, 340, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 46), Decl(generatedContextualTyping.ts, 340, 56)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 340, 46), Decl(generatedContextualTyping.ts, 340, 56)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); +>x344 : Symbol(x344, Decl(generatedContextualTyping.ts, 341, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 12)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 12)) +>x344 : Symbol(x344, Decl(generatedContextualTyping.ts, 341, 3)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 341, 41)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 341, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x345 = function(n: () => Base[]) { }; x345(() => [d1, d2]); +>x345 : Symbol(x345, Decl(generatedContextualTyping.ts, 342, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 342, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x345 : Symbol(x345, Decl(generatedContextualTyping.ts, 342, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x346 = function(n: () => Base[]) { }; x346(function() { return [d1, d2] }); +>x346 : Symbol(x346, Decl(generatedContextualTyping.ts, 343, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 343, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x346 : Symbol(x346, Decl(generatedContextualTyping.ts, 343, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x347 = function(n: () => Base[]) { }; x347(function named() { return [d1, d2] }); +>x347 : Symbol(x347, Decl(generatedContextualTyping.ts, 344, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 344, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x347 : Symbol(x347, Decl(generatedContextualTyping.ts, 344, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 344, 47)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x348 = function(n: { (): Base[]; }) { }; x348(() => [d1, d2]); +>x348 : Symbol(x348, Decl(generatedContextualTyping.ts, 345, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 345, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x348 : Symbol(x348, Decl(generatedContextualTyping.ts, 345, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x349 = function(n: { (): Base[]; }) { }; x349(function() { return [d1, d2] }); +>x349 : Symbol(x349, Decl(generatedContextualTyping.ts, 346, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 346, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x349 : Symbol(x349, Decl(generatedContextualTyping.ts, 346, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x350 = function(n: { (): Base[]; }) { }; x350(function named() { return [d1, d2] }); +>x350 : Symbol(x350, Decl(generatedContextualTyping.ts, 347, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 347, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x350 : Symbol(x350, Decl(generatedContextualTyping.ts, 347, 3)) +>named : Symbol(named, Decl(generatedContextualTyping.ts, 347, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x351 = function(n: Base[]) { }; x351([d1, d2]); +>x351 : Symbol(x351, Decl(generatedContextualTyping.ts, 348, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 348, 20)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x351 : Symbol(x351, Decl(generatedContextualTyping.ts, 348, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x352 = function(n: Array) { }; x352([d1, d2]); +>x352 : Symbol(x352, Decl(generatedContextualTyping.ts, 349, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 349, 20)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x352 : Symbol(x352, Decl(generatedContextualTyping.ts, 349, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x353 = function(n: { [n: number]: Base; }) { }; x353([d1, d2]); +>x353 : Symbol(x353, Decl(generatedContextualTyping.ts, 350, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 350, 20)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 350, 26)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x353 : Symbol(x353, Decl(generatedContextualTyping.ts, 350, 3)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x354 = function(n: {n: Base[]; } ) { }; x354({ n: [d1, d2] }); +>x354 : Symbol(x354, Decl(generatedContextualTyping.ts, 351, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 20)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x354 : Symbol(x354, Decl(generatedContextualTyping.ts, 351, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 351, 50)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + +var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; return null; }); +>x355 : Symbol(x355, Decl(generatedContextualTyping.ts, 352, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 20)) +>s : Symbol(s, Decl(generatedContextualTyping.ts, 352, 24)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x355 : Symbol(x355, Decl(generatedContextualTyping.ts, 352, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 53), Decl(generatedContextualTyping.ts, 352, 63)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 352, 53), Decl(generatedContextualTyping.ts, 352, 63)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) + +var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); +>x356 : Symbol(x356, Decl(generatedContextualTyping.ts, 353, 3)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 353, 20)) +>Genric : Symbol(Genric, Decl(generatedContextualTyping.ts, 2, 42)) +>Base : Symbol(Base, Decl(generatedContextualTyping.ts, 0, 0)) +>x356 : Symbol(x356, Decl(generatedContextualTyping.ts, 353, 3)) +>func : Symbol(func, Decl(generatedContextualTyping.ts, 353, 48)) +>n : Symbol(n, Decl(generatedContextualTyping.ts, 353, 54)) +>d1 : Symbol(d1, Decl(generatedContextualTyping.ts, 4, 19)) +>d2 : Symbol(d2, Decl(generatedContextualTyping.ts, 4, 40)) + diff --git a/tests/baselines/reference/generatedContextualTyping.types b/tests/baselines/reference/generatedContextualTyping.types index 423c5d6653b..e8f434d31a8 100644 --- a/tests/baselines/reference/generatedContextualTyping.types +++ b/tests/baselines/reference/generatedContextualTyping.types @@ -122,6 +122,7 @@ var x11: (s: Base[]) => any = n => { var n: Base[]; return null; }; >n : Base[] >n : Base[] >Base : Base +>null : null var x12: Genric = { func: n => { return [d1, d2]; } }; >x12 : Genric @@ -237,6 +238,7 @@ class x23 { member: (s: Base[]) => any = n => { var n: Base[]; return null; } } >n : Base[] >n : Base[] >Base : Base +>null : null class x24 { member: Genric = { func: n => { return [d1, d2]; } } } >x24 : x24 @@ -353,6 +355,7 @@ class x35 { private member: (s: Base[]) => any = n => { var n: Base[]; return nu >n : Base[] >n : Base[] >Base : Base +>null : null class x36 { private member: Genric = { func: n => { return [d1, d2]; } } } >x36 : x36 @@ -469,6 +472,7 @@ class x47 { public member: (s: Base[]) => any = n => { var n: Base[]; return nul >n : Base[] >n : Base[] >Base : Base +>null : null class x48 { public member: Genric = { func: n => { return [d1, d2]; } } } >x48 : x48 @@ -585,6 +589,7 @@ class x59 { static member: (s: Base[]) => any = n => { var n: Base[]; return nul >n : Base[] >n : Base[] >Base : Base +>null : null class x60 { static member: Genric = { func: n => { return [d1, d2]; } } } >x60 : x60 @@ -701,6 +706,7 @@ class x71 { private static member: (s: Base[]) => any = n => { var n: Base[]; re >n : Base[] >n : Base[] >Base : Base +>null : null class x72 { private static member: Genric = { func: n => { return [d1, d2]; } } } >x72 : x72 @@ -817,6 +823,7 @@ class x83 { public static member: (s: Base[]) => any = n => { var n: Base[]; ret >n : Base[] >n : Base[] >Base : Base +>null : null class x84 { public static member: Genric = { func: n => { return [d1, d2]; } } } >x84 : x84 @@ -933,6 +940,7 @@ class x95 { constructor(parm: (s: Base[]) => any = n => { var n: Base[]; return >n : Base[] >n : Base[] >Base : Base +>null : null class x96 { constructor(parm: Genric = { func: n => { return [d1, d2]; } }) { } } >x96 : x96 @@ -1049,6 +1057,7 @@ class x107 { constructor(public parm: (s: Base[]) => any = n => { var n: Base[]; >n : Base[] >n : Base[] >Base : Base +>null : null class x108 { constructor(public parm: Genric = { func: n => { return [d1, d2]; } }) { } } >x108 : x108 @@ -1165,6 +1174,7 @@ class x119 { constructor(private parm: (s: Base[]) => any = n => { var n: Base[] >n : Base[] >n : Base[] >Base : Base +>null : null class x120 { constructor(private parm: Genric = { func: n => { return [d1, d2]; } }) { } } >x120 : x120 @@ -1281,6 +1291,7 @@ function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { >n : Base[] >n : Base[] >Base : Base +>null : null function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } >x132 : (parm?: Genric) => void @@ -1386,6 +1397,7 @@ function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; >n : Base[] >n : Base[] >Base : Base +>null : null function x144(): Genric { return { func: n => { return [d1, d2]; } }; } >x144 : () => Genric @@ -1530,10 +1542,12 @@ function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; >n : Base[] >n : Base[] >Base : Base +>null : null >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base +>null : null function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } >x156 : () => Genric @@ -1656,6 +1670,7 @@ var x167: () => (s: Base[]) => any = () => { return n => { var n: Base[]; return >n : Base[] >n : Base[] >Base : Base +>null : null var x168: () => Genric = () => { return { func: n => { return [d1, d2]; } }; }; >x168 : () => Genric @@ -1772,6 +1787,7 @@ var x179: () => (s: Base[]) => any = function() { return n => { var n: Base[]; r >n : Base[] >n : Base[] >Base : Base +>null : null var x180: () => Genric = function() { return { func: n => { return [d1, d2]; } }; }; >x180 : () => Genric @@ -1888,6 +1904,7 @@ module x191 { var t: (s: Base[]) => any = n => { var n: Base[]; return null; }; >n : Base[] >n : Base[] >Base : Base +>null : null module x192 { var t: Genric = { func: n => { return [d1, d2]; } }; } >x192 : typeof x192 @@ -2004,6 +2021,7 @@ module x203 { export var t: (s: Base[]) => any = n => { var n: Base[]; return nu >n : Base[] >n : Base[] >Base : Base +>null : null module x204 { export var t: Genric = { func: n => { return [d1, d2]; } }; } >x204 : typeof x204 @@ -2318,6 +2336,7 @@ var x235: (s: Base[]) => any; x235 = n => { var n: Base[]; return null; }; >n : Base[] >n : Base[] >Base : Base +>null : null var x236: Genric; x236 = { func: n => { return [d1, d2]; } }; >x236 : Genric @@ -2457,6 +2476,7 @@ var x247: { n: (s: Base[]) => any; } = { n: n => { var n: Base[]; return null; } >n : Base[] >n : Base[] >Base : Base +>null : null var x248: { n: Genric; } = { n: { func: n => { return [d1, d2]; } } }; >x248 : { n: Genric; } @@ -2828,6 +2848,7 @@ var x285: () => Base[] = true ? () => [d1, d2] : () => [d1, d2]; >x285 : () => Base[] >Base : Base >true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2841,6 +2862,7 @@ var x286: () => Base[] = true ? function() { return [d1, d2] } : function() { re >x286 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2854,6 +2876,7 @@ var x287: () => Base[] = true ? function named() { return [d1, d2] } : function >x287 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2869,6 +2892,7 @@ var x288: { (): Base[]; } = true ? () => [d1, d2] : () => [d1, d2]; >x288 : () => Base[] >Base : Base >true ? () => [d1, d2] : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2882,6 +2906,7 @@ var x289: { (): Base[]; } = true ? function() { return [d1, d2] } : function() { >x289 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -2895,6 +2920,7 @@ var x290: { (): Base[]; } = true ? function named() { return [d1, d2] } : functi >x290 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2910,6 +2936,7 @@ var x291: Base[] = true ? [d1, d2] : [d1, d2]; >x291 : Base[] >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2922,6 +2949,7 @@ var x292: Array = true ? [d1, d2] : [d1, d2]; >Array : T[] >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2934,6 +2962,7 @@ var x293: { [n: number]: Base; } = true ? [d1, d2] : [d1, d2]; >n : number >Base : Base >true ? [d1, d2] : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -2946,6 +2975,7 @@ var x294: {n: Base[]; } = true ? { n: [d1, d2] } : { n: [d1, d2] }; >n : Base[] >Base : Base >true ? { n: [d1, d2] } : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>true : boolean >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -2962,20 +2992,24 @@ var x295: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : n = >s : Base[] >Base : Base >true ? n => { var n: Base[]; return null; } : n => { var n: Base[]; return null; } : (n: Base[]) => any +>true : boolean >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base +>null : null >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base +>null : null var x296: Genric = true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } }; >x296 : Genric >Genric : Genric >Base : Base >true ? { func: n => { return [d1, d2]; } } : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>true : boolean >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] >n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] @@ -2995,6 +3029,7 @@ var x297: () => Base[] = true ? undefined : () => [d1, d2]; >x297 : () => Base[] >Base : Base >true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3005,6 +3040,7 @@ var x298: () => Base[] = true ? undefined : function() { return [d1, d2] }; >x298 : () => Base[] >Base : Base >true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3015,6 +3051,7 @@ var x299: () => Base[] = true ? undefined : function named() { return [d1, d2] } >x299 : () => Base[] >Base : Base >true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] @@ -3026,6 +3063,7 @@ var x300: { (): Base[]; } = true ? undefined : () => [d1, d2]; >x300 : () => Base[] >Base : Base >true ? undefined : () => [d1, d2] : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3036,6 +3074,7 @@ var x301: { (): Base[]; } = true ? undefined : function() { return [d1, d2] }; >x301 : () => Base[] >Base : Base >true ? undefined : function() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3046,6 +3085,7 @@ var x302: { (): Base[]; } = true ? undefined : function named() { return [d1, d2 >x302 : () => Base[] >Base : Base >true ? undefined : function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] @@ -3057,6 +3097,7 @@ var x303: Base[] = true ? undefined : [d1, d2]; >x303 : Base[] >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3067,6 +3108,7 @@ var x304: Array = true ? undefined : [d1, d2]; >Array : T[] >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3077,6 +3119,7 @@ var x305: { [n: number]: Base; } = true ? undefined : [d1, d2]; >n : number >Base : Base >true ? undefined : [d1, d2] : (Derived1 | Derived2)[] +>true : boolean >undefined : undefined >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3087,6 +3130,7 @@ var x306: {n: Base[]; } = true ? undefined : { n: [d1, d2] }; >n : Base[] >Base : Base >true ? undefined : { n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } +>true : boolean >undefined : undefined >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] @@ -3099,17 +3143,20 @@ var x307: (s: Base[]) => any = true ? undefined : n => { var n: Base[]; return n >s : Base[] >Base : Base >true ? undefined : n => { var n: Base[]; return null; } : (n: Base[]) => any +>true : boolean >undefined : undefined >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base +>null : null var x308: Genric = true ? undefined : { func: n => { return [d1, d2]; } }; >x308 : Genric >Genric : Genric >Base : Base >true ? undefined : { func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>true : boolean >undefined : undefined >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] @@ -3123,6 +3170,7 @@ var x309: () => Base[] = true ? () => [d1, d2] : undefined; >x309 : () => Base[] >Base : Base >true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] +>true : boolean >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3133,6 +3181,7 @@ var x310: () => Base[] = true ? function() { return [d1, d2] } : undefined; >x310 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3143,6 +3192,7 @@ var x311: () => Base[] = true ? function named() { return [d1, d2] } : undefined >x311 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3154,6 +3204,7 @@ var x312: { (): Base[]; } = true ? () => [d1, d2] : undefined; >x312 : () => Base[] >Base : Base >true ? () => [d1, d2] : undefined : () => (Derived1 | Derived2)[] +>true : boolean >() => [d1, d2] : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3164,6 +3215,7 @@ var x313: { (): Base[]; } = true ? function() { return [d1, d2] } : undefined; >x313 : () => Base[] >Base : Base >true ? function() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean >function() { return [d1, d2] } : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 @@ -3174,6 +3226,7 @@ var x314: { (): Base[]; } = true ? function named() { return [d1, d2] } : undefi >x314 : () => Base[] >Base : Base >true ? function named() { return [d1, d2] } : undefined : () => (Derived1 | Derived2)[] +>true : boolean >function named() { return [d1, d2] } : () => (Derived1 | Derived2)[] >named : () => (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3185,6 +3238,7 @@ var x315: Base[] = true ? [d1, d2] : undefined; >x315 : Base[] >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3195,6 +3249,7 @@ var x316: Array = true ? [d1, d2] : undefined; >Array : T[] >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3205,6 +3260,7 @@ var x317: { [n: number]: Base; } = true ? [d1, d2] : undefined; >n : number >Base : Base >true ? [d1, d2] : undefined : (Derived1 | Derived2)[] +>true : boolean >[d1, d2] : (Derived1 | Derived2)[] >d1 : Derived1 >d2 : Derived2 @@ -3215,6 +3271,7 @@ var x318: {n: Base[]; } = true ? { n: [d1, d2] } : undefined; >n : Base[] >Base : Base >true ? { n: [d1, d2] } : undefined : { n: (Derived1 | Derived2)[]; } +>true : boolean >{ n: [d1, d2] } : { n: (Derived1 | Derived2)[]; } >n : (Derived1 | Derived2)[] >[d1, d2] : (Derived1 | Derived2)[] @@ -3227,10 +3284,12 @@ var x319: (s: Base[]) => any = true ? n => { var n: Base[]; return null; } : und >s : Base[] >Base : Base >true ? n => { var n: Base[]; return null; } : undefined : (n: Base[]) => any +>true : boolean >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base +>null : null >undefined : undefined var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; @@ -3238,6 +3297,7 @@ var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; >Genric : Genric >Base : Base >true ? { func: n => { return [d1, d2]; } } : undefined : { func: (n: Base[]) => (Derived1 | Derived2)[]; } +>true : boolean >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => (Derived1 | Derived2)[]; } >func : (n: Base[]) => (Derived1 | Derived2)[] >n => { return [d1, d2]; } : (n: Base[]) => (Derived1 | Derived2)[] @@ -3371,6 +3431,7 @@ function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null >n : Base[] >n : Base[] >Base : Base +>null : null function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); >x332 : (n: Genric) => void @@ -3533,6 +3594,7 @@ var x343 = (n: (s: Base[]) => any) => n; x343(n => { var n: Base[]; return null; >n : Base[] >n : Base[] >Base : Base +>null : null var x344 = (n: Genric) => n; x344({ func: n => { return [d1, d2]; } }); >x344 : (n: Genric) => Genric @@ -3686,6 +3748,7 @@ var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; retur >n : Base[] >n : Base[] >Base : Base +>null : null var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); >x356 : (n: Genric) => void diff --git a/tests/baselines/reference/generativeRecursionWithTypeOf.symbols b/tests/baselines/reference/generativeRecursionWithTypeOf.symbols new file mode 100644 index 00000000000..630923d2c59 --- /dev/null +++ b/tests/baselines/reference/generativeRecursionWithTypeOf.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/generativeRecursionWithTypeOf.ts === +class C { +>C : Symbol(C, Decl(generativeRecursionWithTypeOf.ts, 0, 0)) +>T : Symbol(T, Decl(generativeRecursionWithTypeOf.ts, 0, 8)) + + static foo(x: number) { } +>foo : Symbol(C.foo, Decl(generativeRecursionWithTypeOf.ts, 0, 12)) +>x : Symbol(x, Decl(generativeRecursionWithTypeOf.ts, 1, 15)) + + type: T; +>type : Symbol(type, Decl(generativeRecursionWithTypeOf.ts, 1, 29)) +>T : Symbol(T, Decl(generativeRecursionWithTypeOf.ts, 0, 8)) +} + +module M { +>M : Symbol(M, Decl(generativeRecursionWithTypeOf.ts, 3, 1)) + + export function f(x: typeof C) { +>f : Symbol(f, Decl(generativeRecursionWithTypeOf.ts, 5, 10)) +>x : Symbol(x, Decl(generativeRecursionWithTypeOf.ts, 6, 22)) +>C : Symbol(C, Decl(generativeRecursionWithTypeOf.ts, 0, 0)) + + return new x(); +>x : Symbol(x, Decl(generativeRecursionWithTypeOf.ts, 6, 22)) +>x : Symbol(x, Decl(generativeRecursionWithTypeOf.ts, 6, 22)) + } +} diff --git a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.symbols b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.symbols new file mode 100644 index 00000000000..05b131090c0 --- /dev/null +++ b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.symbols @@ -0,0 +1,54 @@ +=== tests/cases/conformance/interfaces/declarationMerging/genericAndNonGenericInterfaceWithTheSameName2.ts === +// generic and non-generic interfaces with the same name do not merge + +module M { +>M : Symbol(M, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 0, 0)) + + interface A { +>A : Symbol(A, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 2, 10)) +>T : Symbol(T, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 3, 16)) + + bar: T; +>bar : Symbol(bar, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 3, 20)) +>T : Symbol(T, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 3, 16)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 6, 1)) + + interface A { // ok +>A : Symbol(A, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 8, 11)) + + foo: string; +>foo : Symbol(foo, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 9, 17)) + } +} + +module N { +>N : Symbol(N, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 12, 1)) + + module M { +>M : Symbol(M, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 14, 10)) + + interface A { +>A : Symbol(A, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 15, 14)) +>T : Symbol(T, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 16, 20)) + + bar: T; +>bar : Symbol(bar, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 16, 24)) +>T : Symbol(T, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 16, 20)) + } + } + + module M2 { +>M2 : Symbol(M2, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 19, 5)) + + interface A { // ok +>A : Symbol(A, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 21, 15)) + + foo: string; +>foo : Symbol(foo, Decl(genericAndNonGenericInterfaceWithTheSameName2.ts, 22, 21)) + } + } +} diff --git a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.types b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.types index b15da5e995c..623ac0f9705 100644 --- a/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.types +++ b/tests/baselines/reference/genericAndNonGenericInterfaceWithTheSameName2.types @@ -2,7 +2,7 @@ // generic and non-generic interfaces with the same name do not merge module M { ->M : unknown +>M : any interface A { >A : A @@ -15,7 +15,7 @@ module M { } module M2 { ->M2 : unknown +>M2 : any interface A { // ok >A : A @@ -26,10 +26,10 @@ module M2 { } module N { ->N : unknown +>N : any module M { ->M : unknown +>M : any interface A { >A : A @@ -42,7 +42,7 @@ module N { } module M2 { ->M2 : unknown +>M2 : any interface A { // ok >A : A diff --git a/tests/baselines/reference/genericAndNonGenericOverload1.symbols b/tests/baselines/reference/genericAndNonGenericOverload1.symbols new file mode 100644 index 00000000000..dff05785114 --- /dev/null +++ b/tests/baselines/reference/genericAndNonGenericOverload1.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/genericAndNonGenericOverload1.ts === +interface callable2 { +>callable2 : Symbol(callable2, Decl(genericAndNonGenericOverload1.ts, 0, 0)) +>T : Symbol(T, Decl(genericAndNonGenericOverload1.ts, 0, 20)) + + (a: T): T; +>a : Symbol(a, Decl(genericAndNonGenericOverload1.ts, 1, 5)) +>T : Symbol(T, Decl(genericAndNonGenericOverload1.ts, 0, 20)) +>T : Symbol(T, Decl(genericAndNonGenericOverload1.ts, 0, 20)) + + (a: T): Z; +>Z : Symbol(Z, Decl(genericAndNonGenericOverload1.ts, 2, 5)) +>a : Symbol(a, Decl(genericAndNonGenericOverload1.ts, 2, 8)) +>T : Symbol(T, Decl(genericAndNonGenericOverload1.ts, 0, 20)) +>Z : Symbol(Z, Decl(genericAndNonGenericOverload1.ts, 2, 5)) +} +var c2: callable2; +>c2 : Symbol(c2, Decl(genericAndNonGenericOverload1.ts, 4, 3)) +>callable2 : Symbol(callable2, Decl(genericAndNonGenericOverload1.ts, 0, 0)) + +c2(1); +>c2 : Symbol(c2, Decl(genericAndNonGenericOverload1.ts, 4, 3)) + diff --git a/tests/baselines/reference/genericAndNonGenericOverload1.types b/tests/baselines/reference/genericAndNonGenericOverload1.types index 67cc8a01f18..28eeb2d4da0 100644 --- a/tests/baselines/reference/genericAndNonGenericOverload1.types +++ b/tests/baselines/reference/genericAndNonGenericOverload1.types @@ -21,4 +21,5 @@ var c2: callable2; c2(1); >c2(1) : string >c2 : callable2 +>1 : number diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.symbols b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.symbols new file mode 100644 index 00000000000..b38008c38ce --- /dev/null +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/genericArgumentCallSigAssignmentCompat.ts === +module Underscore { +>Underscore : Symbol(Underscore, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 0)) + + export interface Iterator { +>Iterator : Symbol(Iterator, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 19)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 30)) +>U : Symbol(U, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 32)) + + (value: T, index: any, list: any): U; +>value : Symbol(value, Decl(genericArgumentCallSigAssignmentCompat.ts, 2, 9)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 30)) +>index : Symbol(index, Decl(genericArgumentCallSigAssignmentCompat.ts, 2, 18)) +>list : Symbol(list, Decl(genericArgumentCallSigAssignmentCompat.ts, 2, 30)) +>U : Symbol(U, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 32)) + } + + export interface Static { +>Static : Symbol(Static, Decl(genericArgumentCallSigAssignmentCompat.ts, 3, 5)) + + all(list: T[], iterator?: Iterator, context?: any): boolean; +>all : Symbol(all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 12)) +>list : Symbol(list, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 15)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 12)) +>iterator : Symbol(iterator, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 25)) +>Iterator : Symbol(Iterator, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 19)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 12)) +>context : Symbol(context, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 58)) + + identity(value: T): T; +>identity : Symbol(identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 17)) +>value : Symbol(value, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 20)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 17)) +>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 17)) + } +} + +declare var _: Underscore.Static; +>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11)) +>Underscore : Symbol(Underscore, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 0)) +>Static : Symbol(Underscore.Static, Decl(genericArgumentCallSigAssignmentCompat.ts, 3, 5)) + +// No error, Call signatures of types '(value: T) => T' and 'Underscore.Iterator<{}, boolean>' are compatible when instantiated with any. +// Ideally, we would not have a generic signature here, because it should be instantiated with {} during inferential typing +_.all([true, 1, null, 'yes'], _.identity); +>_.all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29)) +>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83)) +>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83)) + +// Ok, because fixing makes us infer boolean for T +_.all([true], _.identity); +>_.all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29)) +>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83)) +>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83)) + diff --git a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types index 768b8846880..c5fd984d327 100644 --- a/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types +++ b/tests/baselines/reference/genericArgumentCallSigAssignmentCompat.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericArgumentCallSigAssignmentCompat.ts === module Underscore { ->Underscore : unknown +>Underscore : any export interface Iterator { >Iterator : Iterator @@ -39,7 +39,7 @@ module Underscore { declare var _: Underscore.Static; >_ : Underscore.Static ->Underscore : unknown +>Underscore : any >Static : Underscore.Static // No error, Call signatures of types '(value: T) => T' and 'Underscore.Iterator<{}, boolean>' are compatible when instantiated with any. @@ -50,6 +50,10 @@ _.all([true, 1, null, 'yes'], _.identity); >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean >[true, 1, null, 'yes'] : (string | number | boolean)[] +>true : boolean +>1 : number +>null : null +>'yes' : string >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -61,6 +65,7 @@ _.all([true], _.identity); >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => boolean >[true] : boolean[] +>true : boolean >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericArray0.symbols b/tests/baselines/reference/genericArray0.symbols new file mode 100644 index 00000000000..8870d60cde8 --- /dev/null +++ b/tests/baselines/reference/genericArray0.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericArray0.ts === + + +var x:number[]; +>x : Symbol(x, Decl(genericArray0.ts, 2, 3)) + + +var y = x; +>y : Symbol(y, Decl(genericArray0.ts, 5, 3)) +>x : Symbol(x, Decl(genericArray0.ts, 2, 3)) + +function map() { +>map : Symbol(map, Decl(genericArray0.ts, 5, 10)) +>U : Symbol(U, Decl(genericArray0.ts, 7, 13)) + + var ys: U[] = []; +>ys : Symbol(ys, Decl(genericArray0.ts, 8, 7)) +>U : Symbol(U, Decl(genericArray0.ts, 7, 13)) +} + diff --git a/tests/baselines/reference/genericArray1.symbols b/tests/baselines/reference/genericArray1.symbols new file mode 100644 index 00000000000..b403bd2b720 --- /dev/null +++ b/tests/baselines/reference/genericArray1.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/genericArray1.ts === +/* +var n: number[]; + +interface Array { +map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; +} + +interface String{ + length: number; +} +*/ + +var lengths = ["a", "b", "c"].map(x => x.length); +>lengths : Symbol(lengths, Decl(genericArray1.ts, 12, 3)) +>["a", "b", "c"].map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>x : Symbol(x, Decl(genericArray1.ts, 12, 34)) +>x.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>x : Symbol(x, Decl(genericArray1.ts, 12, 34)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + diff --git a/tests/baselines/reference/genericArray1.types b/tests/baselines/reference/genericArray1.types index 09dbc55771d..bf44c88f518 100644 --- a/tests/baselines/reference/genericArray1.types +++ b/tests/baselines/reference/genericArray1.types @@ -16,6 +16,9 @@ var lengths = ["a", "b", "c"].map(x => x.length); >["a", "b", "c"].map(x => x.length) : number[] >["a", "b", "c"].map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >["a", "b", "c"] : string[] +>"a" : string +>"b" : string +>"c" : string >map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/genericArrayPropertyAssignment.symbols b/tests/baselines/reference/genericArrayPropertyAssignment.symbols new file mode 100644 index 00000000000..2c2c202779b --- /dev/null +++ b/tests/baselines/reference/genericArrayPropertyAssignment.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/genericArrayPropertyAssignment.ts === +function isEmpty(list: {length:number;}) +>isEmpty : Symbol(isEmpty, Decl(genericArrayPropertyAssignment.ts, 0, 0)) +>list : Symbol(list, Decl(genericArrayPropertyAssignment.ts, 0, 17)) +>length : Symbol(length, Decl(genericArrayPropertyAssignment.ts, 0, 24)) +{ +return list.length ===0; +>list.length : Symbol(length, Decl(genericArrayPropertyAssignment.ts, 0, 24)) +>list : Symbol(list, Decl(genericArrayPropertyAssignment.ts, 0, 17)) +>length : Symbol(length, Decl(genericArrayPropertyAssignment.ts, 0, 24)) +} + +isEmpty([]); // error +>isEmpty : Symbol(isEmpty, Decl(genericArrayPropertyAssignment.ts, 0, 0)) + + diff --git a/tests/baselines/reference/genericArrayPropertyAssignment.types b/tests/baselines/reference/genericArrayPropertyAssignment.types index ab3f47de813..6db56dde381 100644 --- a/tests/baselines/reference/genericArrayPropertyAssignment.types +++ b/tests/baselines/reference/genericArrayPropertyAssignment.types @@ -9,6 +9,7 @@ return list.length ===0; >list.length : number >list : { length: number; } >length : number +>0 : number } isEmpty([]); // error diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty.symbols b/tests/baselines/reference/genericBaseClassLiteralProperty.symbols new file mode 100644 index 00000000000..f499e243eaa --- /dev/null +++ b/tests/baselines/reference/genericBaseClassLiteralProperty.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/genericBaseClassLiteralProperty.ts === +class BaseClass { +>BaseClass : Symbol(BaseClass, Decl(genericBaseClassLiteralProperty.ts, 0, 0)) +>T : Symbol(T, Decl(genericBaseClassLiteralProperty.ts, 0, 16)) + + public _getValue1: { (): T; }; +>_getValue1 : Symbol(_getValue1, Decl(genericBaseClassLiteralProperty.ts, 0, 20)) +>T : Symbol(T, Decl(genericBaseClassLiteralProperty.ts, 0, 16)) + + public _getValue2: () => T; +>_getValue2 : Symbol(_getValue2, Decl(genericBaseClassLiteralProperty.ts, 1, 34)) +>T : Symbol(T, Decl(genericBaseClassLiteralProperty.ts, 0, 16)) +} + +class SubClass extends BaseClass { +>SubClass : Symbol(SubClass, Decl(genericBaseClassLiteralProperty.ts, 3, 1)) +>BaseClass : Symbol(BaseClass, Decl(genericBaseClassLiteralProperty.ts, 0, 0)) + + public Error(): void { +>Error : Symbol(Error, Decl(genericBaseClassLiteralProperty.ts, 5, 42)) + + var x : number = this._getValue1(); +>x : Symbol(x, Decl(genericBaseClassLiteralProperty.ts, 8, 11)) +>this._getValue1 : Symbol(BaseClass._getValue1, Decl(genericBaseClassLiteralProperty.ts, 0, 20)) +>this : Symbol(SubClass, Decl(genericBaseClassLiteralProperty.ts, 3, 1)) +>_getValue1 : Symbol(BaseClass._getValue1, Decl(genericBaseClassLiteralProperty.ts, 0, 20)) + + var y : number = this._getValue2(); +>y : Symbol(y, Decl(genericBaseClassLiteralProperty.ts, 9, 11)) +>this._getValue2 : Symbol(BaseClass._getValue2, Decl(genericBaseClassLiteralProperty.ts, 1, 34)) +>this : Symbol(SubClass, Decl(genericBaseClassLiteralProperty.ts, 3, 1)) +>_getValue2 : Symbol(BaseClass._getValue2, Decl(genericBaseClassLiteralProperty.ts, 1, 34)) + } +} diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.symbols b/tests/baselines/reference/genericBaseClassLiteralProperty2.symbols new file mode 100644 index 00000000000..5ddccd40e38 --- /dev/null +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/genericBaseClassLiteralProperty2.ts === +class CollectionItem2 { } +>CollectionItem2 : Symbol(CollectionItem2, Decl(genericBaseClassLiteralProperty2.ts, 0, 0)) + +class BaseCollection2 { +>BaseCollection2 : Symbol(BaseCollection2, Decl(genericBaseClassLiteralProperty2.ts, 0, 25)) +>TItem : Symbol(TItem, Decl(genericBaseClassLiteralProperty2.ts, 2, 22)) +>CollectionItem2 : Symbol(CollectionItem2, Decl(genericBaseClassLiteralProperty2.ts, 0, 0)) + + _itemsByKey: { [key: string]: TItem; }; +>_itemsByKey : Symbol(_itemsByKey, Decl(genericBaseClassLiteralProperty2.ts, 2, 54)) +>key : Symbol(key, Decl(genericBaseClassLiteralProperty2.ts, 3, 20)) +>TItem : Symbol(TItem, Decl(genericBaseClassLiteralProperty2.ts, 2, 22)) + + constructor() { + this._itemsByKey = {}; +>this._itemsByKey : Symbol(_itemsByKey, Decl(genericBaseClassLiteralProperty2.ts, 2, 54)) +>this : Symbol(BaseCollection2, Decl(genericBaseClassLiteralProperty2.ts, 0, 25)) +>_itemsByKey : Symbol(_itemsByKey, Decl(genericBaseClassLiteralProperty2.ts, 2, 54)) + } +} + +class DataView2 extends BaseCollection2 { +>DataView2 : Symbol(DataView2, Decl(genericBaseClassLiteralProperty2.ts, 7, 1)) +>BaseCollection2 : Symbol(BaseCollection2, Decl(genericBaseClassLiteralProperty2.ts, 0, 25)) +>CollectionItem2 : Symbol(CollectionItem2, Decl(genericBaseClassLiteralProperty2.ts, 0, 0)) + + fillItems(item: CollectionItem2) { +>fillItems : Symbol(fillItems, Decl(genericBaseClassLiteralProperty2.ts, 9, 58)) +>item : Symbol(item, Decl(genericBaseClassLiteralProperty2.ts, 10, 14)) +>CollectionItem2 : Symbol(CollectionItem2, Decl(genericBaseClassLiteralProperty2.ts, 0, 0)) + + this._itemsByKey['dummy'] = item; +>this._itemsByKey : Symbol(BaseCollection2._itemsByKey, Decl(genericBaseClassLiteralProperty2.ts, 2, 54)) +>this : Symbol(DataView2, Decl(genericBaseClassLiteralProperty2.ts, 7, 1)) +>_itemsByKey : Symbol(BaseCollection2._itemsByKey, Decl(genericBaseClassLiteralProperty2.ts, 2, 54)) +>item : Symbol(item, Decl(genericBaseClassLiteralProperty2.ts, 10, 14)) + } +} + diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.types b/tests/baselines/reference/genericBaseClassLiteralProperty2.types index 2ade6437fe7..4576ffb05de 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.types +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.types @@ -38,6 +38,7 @@ class DataView2 extends BaseCollection2 { >this._itemsByKey : { [key: string]: CollectionItem2; } >this : DataView2 >_itemsByKey : { [key: string]: CollectionItem2; } +>'dummy' : string >item : CollectionItem2 } } diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.symbols b/tests/baselines/reference/genericCallTypeArgumentInference.symbols new file mode 100644 index 00000000000..2e86bda4ca4 --- /dev/null +++ b/tests/baselines/reference/genericCallTypeArgumentInference.symbols @@ -0,0 +1,346 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallTypeArgumentInference.ts === +// Basic type inference with generic calls, no errors expected + +function foo(t: T) { +>foo : Symbol(foo, Decl(genericCallTypeArgumentInference.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 2, 13)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 2, 16)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 2, 13)) + + return t; +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 2, 16)) +} + +var r = foo(''); // string +>r : Symbol(r, Decl(genericCallTypeArgumentInference.ts, 6, 3)) +>foo : Symbol(foo, Decl(genericCallTypeArgumentInference.ts, 0, 0)) + +function foo2(t: T, u: U) { +>foo2 : Symbol(foo2, Decl(genericCallTypeArgumentInference.ts, 6, 16)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 8, 14)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 8, 16)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 8, 20)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 8, 14)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 8, 25)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 8, 16)) + + return u; +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 8, 25)) +} + +function foo2b(u: U) { +>foo2b : Symbol(foo2b, Decl(genericCallTypeArgumentInference.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 12, 15)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 12, 17)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 12, 21)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 12, 17)) + + var x: T; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 13, 7)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 12, 15)) + + return x; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 13, 7)) +} + +var r2 = foo2('', 1); // number +>r2 : Symbol(r2, Decl(genericCallTypeArgumentInference.ts, 17, 3)) +>foo2 : Symbol(foo2, Decl(genericCallTypeArgumentInference.ts, 6, 16)) + +var r3 = foo2b(1); // {} +>r3 : Symbol(r3, Decl(genericCallTypeArgumentInference.ts, 18, 3)) +>foo2b : Symbol(foo2b, Decl(genericCallTypeArgumentInference.ts, 10, 1)) + +class C { +>C : Symbol(C, Decl(genericCallTypeArgumentInference.ts, 18, 18)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 20, 8)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 20, 10)) + + constructor(public t: T, public u: U) { +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 21, 16)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 20, 8)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 21, 28)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 20, 10)) + } + + foo(t: T, u: U) { +>foo : Symbol(foo, Decl(genericCallTypeArgumentInference.ts, 22, 5)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 24, 8)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 20, 8)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 24, 13)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 20, 10)) + + return t; +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 24, 8)) + } + + foo2(t: T, u: U) { +>foo2 : Symbol(foo2, Decl(genericCallTypeArgumentInference.ts, 26, 5)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 28, 9)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 20, 8)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 28, 14)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 20, 10)) + + return u; +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 28, 14)) + } + + foo3(t: T, u: U) { +>foo3 : Symbol(foo3, Decl(genericCallTypeArgumentInference.ts, 30, 5)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 32, 9)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 32, 12)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 32, 9)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 32, 17)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 20, 10)) + + return t; +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 32, 12)) + } + + foo4(t: T, u: U) { +>foo4 : Symbol(foo4, Decl(genericCallTypeArgumentInference.ts, 34, 5)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 36, 9)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 36, 12)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 20, 8)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 36, 17)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 36, 9)) + + return t; +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 36, 12)) + } + + foo5(t: T, u: U) { +>foo5 : Symbol(foo5, Decl(genericCallTypeArgumentInference.ts, 38, 5)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 40, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 40, 11)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 40, 14)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 40, 9)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 40, 19)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 40, 11)) + + return t; +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 40, 14)) + } + + foo6() { +>foo6 : Symbol(foo6, Decl(genericCallTypeArgumentInference.ts, 42, 5)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 44, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 44, 11)) + + var x: T; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 45, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 44, 9)) + + return x; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 45, 11)) + } + + foo7(u: U) { +>foo7 : Symbol(foo7, Decl(genericCallTypeArgumentInference.ts, 47, 5)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 49, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 49, 11)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 49, 15)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 49, 11)) + + var x: T; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 50, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 49, 9)) + + return x; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 50, 11)) + } + + foo8() { +>foo8 : Symbol(foo8, Decl(genericCallTypeArgumentInference.ts, 52, 5)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 54, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 54, 11)) + + var x: T; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 55, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 54, 9)) + + return x; +>x : Symbol(x, Decl(genericCallTypeArgumentInference.ts, 55, 11)) + } +} + +var c = new C('', 1); +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>C : Symbol(C, Decl(genericCallTypeArgumentInference.ts, 18, 18)) + +var r4 = c.foo('', 1); // string +>r4 : Symbol(r4, Decl(genericCallTypeArgumentInference.ts, 61, 3), Decl(genericCallTypeArgumentInference.ts, 83, 3)) +>c.foo : Symbol(C.foo, Decl(genericCallTypeArgumentInference.ts, 22, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo : Symbol(C.foo, Decl(genericCallTypeArgumentInference.ts, 22, 5)) + +var r5 = c.foo2('', 1); // number +>r5 : Symbol(r5, Decl(genericCallTypeArgumentInference.ts, 62, 3), Decl(genericCallTypeArgumentInference.ts, 84, 3)) +>c.foo2 : Symbol(C.foo2, Decl(genericCallTypeArgumentInference.ts, 26, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo2 : Symbol(C.foo2, Decl(genericCallTypeArgumentInference.ts, 26, 5)) + +var r6 = c.foo3(true, 1); // boolean +>r6 : Symbol(r6, Decl(genericCallTypeArgumentInference.ts, 63, 3), Decl(genericCallTypeArgumentInference.ts, 85, 3)) +>c.foo3 : Symbol(C.foo3, Decl(genericCallTypeArgumentInference.ts, 30, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo3 : Symbol(C.foo3, Decl(genericCallTypeArgumentInference.ts, 30, 5)) + +var r7 = c.foo4('', true); // string +>r7 : Symbol(r7, Decl(genericCallTypeArgumentInference.ts, 64, 3), Decl(genericCallTypeArgumentInference.ts, 86, 3)) +>c.foo4 : Symbol(C.foo4, Decl(genericCallTypeArgumentInference.ts, 34, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo4 : Symbol(C.foo4, Decl(genericCallTypeArgumentInference.ts, 34, 5)) + +var r8 = c.foo5(true, 1); // boolean +>r8 : Symbol(r8, Decl(genericCallTypeArgumentInference.ts, 65, 3), Decl(genericCallTypeArgumentInference.ts, 87, 3)) +>c.foo5 : Symbol(C.foo5, Decl(genericCallTypeArgumentInference.ts, 38, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo5 : Symbol(C.foo5, Decl(genericCallTypeArgumentInference.ts, 38, 5)) + +var r9 = c.foo6(); // {} +>r9 : Symbol(r9, Decl(genericCallTypeArgumentInference.ts, 66, 3), Decl(genericCallTypeArgumentInference.ts, 88, 3)) +>c.foo6 : Symbol(C.foo6, Decl(genericCallTypeArgumentInference.ts, 42, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo6 : Symbol(C.foo6, Decl(genericCallTypeArgumentInference.ts, 42, 5)) + +var r10 = c.foo7(''); // {} +>r10 : Symbol(r10, Decl(genericCallTypeArgumentInference.ts, 67, 3), Decl(genericCallTypeArgumentInference.ts, 89, 3)) +>c.foo7 : Symbol(C.foo7, Decl(genericCallTypeArgumentInference.ts, 47, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo7 : Symbol(C.foo7, Decl(genericCallTypeArgumentInference.ts, 47, 5)) + +var r11 = c.foo8(); // {} +>r11 : Symbol(r11, Decl(genericCallTypeArgumentInference.ts, 68, 3), Decl(genericCallTypeArgumentInference.ts, 90, 3)) +>c.foo8 : Symbol(C.foo8, Decl(genericCallTypeArgumentInference.ts, 52, 5)) +>c : Symbol(c, Decl(genericCallTypeArgumentInference.ts, 60, 3)) +>foo8 : Symbol(C.foo8, Decl(genericCallTypeArgumentInference.ts, 52, 5)) + +interface I { +>I : Symbol(I, Decl(genericCallTypeArgumentInference.ts, 68, 19)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) + + new (t: T, u: U); +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 71, 9)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 71, 14)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) + + foo(t: T, u: U): T; +>foo : Symbol(foo, Decl(genericCallTypeArgumentInference.ts, 71, 21)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 72, 8)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 72, 13)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) + + foo2(t: T, u: U): U; +>foo2 : Symbol(foo2, Decl(genericCallTypeArgumentInference.ts, 72, 23)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 73, 9)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 73, 14)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) + + foo3(t: T, u: U): T; +>foo3 : Symbol(foo3, Decl(genericCallTypeArgumentInference.ts, 73, 24)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 74, 9)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 74, 12)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 74, 9)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 74, 17)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 70, 14)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 74, 9)) + + foo4(t: T, u: U): T; +>foo4 : Symbol(foo4, Decl(genericCallTypeArgumentInference.ts, 74, 27)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 75, 9)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 75, 12)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 75, 17)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 75, 9)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 70, 12)) + + foo5(t: T, u: U): T; +>foo5 : Symbol(foo5, Decl(genericCallTypeArgumentInference.ts, 75, 27)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 76, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 76, 11)) +>t : Symbol(t, Decl(genericCallTypeArgumentInference.ts, 76, 15)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 76, 9)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 76, 20)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 76, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 76, 9)) + + foo6(): T; +>foo6 : Symbol(foo6, Decl(genericCallTypeArgumentInference.ts, 76, 30)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 77, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 77, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 77, 9)) + + foo7(u: U): T; +>foo7 : Symbol(foo7, Decl(genericCallTypeArgumentInference.ts, 77, 20)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 78, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 78, 11)) +>u : Symbol(u, Decl(genericCallTypeArgumentInference.ts, 78, 15)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 78, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 78, 9)) + + foo8(): T; +>foo8 : Symbol(foo8, Decl(genericCallTypeArgumentInference.ts, 78, 24)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 79, 9)) +>U : Symbol(U, Decl(genericCallTypeArgumentInference.ts, 79, 11)) +>T : Symbol(T, Decl(genericCallTypeArgumentInference.ts, 79, 9)) +} + +var i: I; +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>I : Symbol(I, Decl(genericCallTypeArgumentInference.ts, 68, 19)) + +var r4 = i.foo('', 1); // string +>r4 : Symbol(r4, Decl(genericCallTypeArgumentInference.ts, 61, 3), Decl(genericCallTypeArgumentInference.ts, 83, 3)) +>i.foo : Symbol(I.foo, Decl(genericCallTypeArgumentInference.ts, 71, 21)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo : Symbol(I.foo, Decl(genericCallTypeArgumentInference.ts, 71, 21)) + +var r5 = i.foo2('', 1); // number +>r5 : Symbol(r5, Decl(genericCallTypeArgumentInference.ts, 62, 3), Decl(genericCallTypeArgumentInference.ts, 84, 3)) +>i.foo2 : Symbol(I.foo2, Decl(genericCallTypeArgumentInference.ts, 72, 23)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo2 : Symbol(I.foo2, Decl(genericCallTypeArgumentInference.ts, 72, 23)) + +var r6 = i.foo3(true, 1); // boolean +>r6 : Symbol(r6, Decl(genericCallTypeArgumentInference.ts, 63, 3), Decl(genericCallTypeArgumentInference.ts, 85, 3)) +>i.foo3 : Symbol(I.foo3, Decl(genericCallTypeArgumentInference.ts, 73, 24)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo3 : Symbol(I.foo3, Decl(genericCallTypeArgumentInference.ts, 73, 24)) + +var r7 = i.foo4('', true); // string +>r7 : Symbol(r7, Decl(genericCallTypeArgumentInference.ts, 64, 3), Decl(genericCallTypeArgumentInference.ts, 86, 3)) +>i.foo4 : Symbol(I.foo4, Decl(genericCallTypeArgumentInference.ts, 74, 27)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo4 : Symbol(I.foo4, Decl(genericCallTypeArgumentInference.ts, 74, 27)) + +var r8 = i.foo5(true, 1); // boolean +>r8 : Symbol(r8, Decl(genericCallTypeArgumentInference.ts, 65, 3), Decl(genericCallTypeArgumentInference.ts, 87, 3)) +>i.foo5 : Symbol(I.foo5, Decl(genericCallTypeArgumentInference.ts, 75, 27)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo5 : Symbol(I.foo5, Decl(genericCallTypeArgumentInference.ts, 75, 27)) + +var r9 = i.foo6(); // {} +>r9 : Symbol(r9, Decl(genericCallTypeArgumentInference.ts, 66, 3), Decl(genericCallTypeArgumentInference.ts, 88, 3)) +>i.foo6 : Symbol(I.foo6, Decl(genericCallTypeArgumentInference.ts, 76, 30)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo6 : Symbol(I.foo6, Decl(genericCallTypeArgumentInference.ts, 76, 30)) + +var r10 = i.foo7(''); // {} +>r10 : Symbol(r10, Decl(genericCallTypeArgumentInference.ts, 67, 3), Decl(genericCallTypeArgumentInference.ts, 89, 3)) +>i.foo7 : Symbol(I.foo7, Decl(genericCallTypeArgumentInference.ts, 77, 20)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo7 : Symbol(I.foo7, Decl(genericCallTypeArgumentInference.ts, 77, 20)) + +var r11 = i.foo8(); // {} +>r11 : Symbol(r11, Decl(genericCallTypeArgumentInference.ts, 68, 3), Decl(genericCallTypeArgumentInference.ts, 90, 3)) +>i.foo8 : Symbol(I.foo8, Decl(genericCallTypeArgumentInference.ts, 78, 24)) +>i : Symbol(i, Decl(genericCallTypeArgumentInference.ts, 82, 3)) +>foo8 : Symbol(I.foo8, Decl(genericCallTypeArgumentInference.ts, 78, 24)) + diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.types b/tests/baselines/reference/genericCallTypeArgumentInference.types index ced2daee38d..0208ec74f1e 100644 --- a/tests/baselines/reference/genericCallTypeArgumentInference.types +++ b/tests/baselines/reference/genericCallTypeArgumentInference.types @@ -15,6 +15,7 @@ var r = foo(''); // string >r : string >foo('') : string >foo : (t: T) => T +>'' : string function foo2(t: T, u: U) { >foo2 : (t: T, u: U) => U @@ -48,11 +49,14 @@ var r2 = foo2('', 1); // number >r2 : number >foo2('', 1) : number >foo2 : (t: T, u: U) => U +>'' : string +>1 : number var r3 = foo2b(1); // {} >r3 : {} >foo2b(1) : {} >foo2b : (u: U) => T +>1 : number class C { >C : C @@ -171,6 +175,8 @@ var c = new C('', 1); >c : C >new C('', 1) : C >C : typeof C +>'' : string +>1 : number var r4 = c.foo('', 1); // string >r4 : string @@ -178,6 +184,8 @@ var r4 = c.foo('', 1); // string >c.foo : (t: string, u: number) => string >c : C >foo : (t: string, u: number) => string +>'' : string +>1 : number var r5 = c.foo2('', 1); // number >r5 : number @@ -185,6 +193,8 @@ var r5 = c.foo2('', 1); // number >c.foo2 : (t: string, u: number) => number >c : C >foo2 : (t: string, u: number) => number +>'' : string +>1 : number var r6 = c.foo3(true, 1); // boolean >r6 : boolean @@ -192,6 +202,8 @@ var r6 = c.foo3(true, 1); // boolean >c.foo3 : (t: T, u: number) => T >c : C >foo3 : (t: T, u: number) => T +>true : boolean +>1 : number var r7 = c.foo4('', true); // string >r7 : string @@ -199,6 +211,8 @@ var r7 = c.foo4('', true); // string >c.foo4 : (t: string, u: U) => string >c : C >foo4 : (t: string, u: U) => string +>'' : string +>true : boolean var r8 = c.foo5(true, 1); // boolean >r8 : boolean @@ -206,6 +220,8 @@ var r8 = c.foo5(true, 1); // boolean >c.foo5 : (t: T, u: U) => T >c : C >foo5 : (t: T, u: U) => T +>true : boolean +>1 : number var r9 = c.foo6(); // {} >r9 : {} @@ -220,6 +236,7 @@ var r10 = c.foo7(''); // {} >c.foo7 : (u: U) => T >c : C >foo7 : (u: U) => T +>'' : string var r11 = c.foo8(); // {} >r11 : {} @@ -314,6 +331,8 @@ var r4 = i.foo('', 1); // string >i.foo : (t: string, u: number) => string >i : I >foo : (t: string, u: number) => string +>'' : string +>1 : number var r5 = i.foo2('', 1); // number >r5 : number @@ -321,6 +340,8 @@ var r5 = i.foo2('', 1); // number >i.foo2 : (t: string, u: number) => number >i : I >foo2 : (t: string, u: number) => number +>'' : string +>1 : number var r6 = i.foo3(true, 1); // boolean >r6 : boolean @@ -328,6 +349,8 @@ var r6 = i.foo3(true, 1); // boolean >i.foo3 : (t: T, u: number) => T >i : I >foo3 : (t: T, u: number) => T +>true : boolean +>1 : number var r7 = i.foo4('', true); // string >r7 : string @@ -335,6 +358,8 @@ var r7 = i.foo4('', true); // string >i.foo4 : (t: string, u: U) => string >i : I >foo4 : (t: string, u: U) => string +>'' : string +>true : boolean var r8 = i.foo5(true, 1); // boolean >r8 : boolean @@ -342,6 +367,8 @@ var r8 = i.foo5(true, 1); // boolean >i.foo5 : (t: T, u: U) => T >i : I >foo5 : (t: T, u: U) => T +>true : boolean +>1 : number var r9 = i.foo6(); // {} >r9 : {} @@ -356,6 +383,7 @@ var r10 = i.foo7(''); // {} >i.foo7 : (u: U) => T >i : I >foo7 : (u: U) => T +>'' : string var r11 = i.foo8(); // {} >r11 : {} diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.symbols b/tests/baselines/reference/genericCallWithArrayLiteralArgs.symbols new file mode 100644 index 00000000000..49ccf7ad595 --- /dev/null +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.symbols @@ -0,0 +1,44 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithArrayLiteralArgs.ts === +function foo(t: T) { +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithArrayLiteralArgs.ts, 0, 13)) +>t : Symbol(t, Decl(genericCallWithArrayLiteralArgs.ts, 0, 16)) +>T : Symbol(T, Decl(genericCallWithArrayLiteralArgs.ts, 0, 13)) + + return t; +>t : Symbol(t, Decl(genericCallWithArrayLiteralArgs.ts, 0, 16)) +} + +var r = foo([1, 2]); // number[] +>r : Symbol(r, Decl(genericCallWithArrayLiteralArgs.ts, 4, 3), Decl(genericCallWithArrayLiteralArgs.ts, 5, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r = foo([1, 2]); // number[] +>r : Symbol(r, Decl(genericCallWithArrayLiteralArgs.ts, 4, 3), Decl(genericCallWithArrayLiteralArgs.ts, 5, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var ra = foo([1, 2]); // any[] +>ra : Symbol(ra, Decl(genericCallWithArrayLiteralArgs.ts, 6, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r2 = foo([]); // any[] +>r2 : Symbol(r2, Decl(genericCallWithArrayLiteralArgs.ts, 7, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r3 = foo([]); // number[] +>r3 : Symbol(r3, Decl(genericCallWithArrayLiteralArgs.ts, 8, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r4 = foo([1, '']); // {}[] +>r4 : Symbol(r4, Decl(genericCallWithArrayLiteralArgs.ts, 9, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r5 = foo([1, '']); // any[] +>r5 : Symbol(r5, Decl(genericCallWithArrayLiteralArgs.ts, 10, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) + +var r6 = foo([1, '']); // Object[] +>r6 : Symbol(r6, Decl(genericCallWithArrayLiteralArgs.ts, 11, 3)) +>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types index f4965940436..48a7150ef44 100644 --- a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types @@ -14,18 +14,24 @@ var r = foo([1, 2]); // number[] >foo([1, 2]) : number[] >foo : (t: T) => T >[1, 2] : number[] +>1 : number +>2 : number var r = foo([1, 2]); // number[] >r : number[] >foo([1, 2]) : number[] >foo : (t: T) => T >[1, 2] : number[] +>1 : number +>2 : number var ra = foo([1, 2]); // any[] >ra : any[] >foo([1, 2]) : any[] >foo : (t: T) => T >[1, 2] : number[] +>1 : number +>2 : number var r2 = foo([]); // any[] >r2 : any[] @@ -44,12 +50,16 @@ var r4 = foo([1, '']); // {}[] >foo([1, '']) : (string | number)[] >foo : (t: T) => T >[1, ''] : (string | number)[] +>1 : number +>'' : string var r5 = foo([1, '']); // any[] >r5 : any[] >foo([1, '']) : any[] >foo : (t: T) => T >[1, ''] : (string | number)[] +>1 : number +>'' : string var r6 = foo([1, '']); // Object[] >r6 : Object[] @@ -57,4 +67,6 @@ var r6 = foo([1, '']); // Object[] >foo : (t: T) => T >Object : Object >[1, ''] : (string | number)[] +>1 : number +>'' : string diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.symbols b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.symbols new file mode 100644 index 00000000000..5d419b8f992 --- /dev/null +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.symbols @@ -0,0 +1,465 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference.ts === +// Basic type inference with generic calls and constraints, no errors expected + +class Base { foo: string; } +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>bar : Symbol(bar, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 28)) + +class Derived2 extends Derived { baz: string; } +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>baz : Symbol(baz, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 4, 32)) + +var b: Base; +>b : Symbol(b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 5, 3)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) + +var d1: Derived; +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + +var d2: Derived2; +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) + +function foo(t: T) { +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 17)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 9, 13)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 9, 29)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 9, 13)) + + return t; +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 9, 29)) +} + +var r = foo(b); // Base +>r : Symbol(r, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 13, 3)) +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 17)) +>b : Symbol(b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 5, 3)) + +var r2 = foo(d1); // Derived +>r2 : Symbol(r2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 14, 3)) +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 17)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +function foo2(t: T, u: U) { +>foo2 : Symbol(foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 14, 17)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 14)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 29)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 49)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 14)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 54)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 29)) + + return u; +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 16, 54)) +} + +function foo2b(u: U) { +>foo2b : Symbol(foo2b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 18, 1)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 20, 15)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 20, 30)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 20, 50)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 20, 30)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 21, 7)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 20, 15)) + + return x; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 21, 7)) +} + +function foo2c() { +>foo2c : Symbol(foo2c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 23, 1)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 25, 15)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 25, 30)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 26, 7)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 25, 15)) + + return x; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 26, 7)) +} + +var r3 = foo2b(d1); // Base +>r3 : Symbol(r3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 30, 3)) +>foo2b : Symbol(foo2b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 18, 1)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r3b = foo2c(); // Base +>r3b : Symbol(r3b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 31, 3)) +>foo2c : Symbol(foo2c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 23, 1)) + +class C { +>C : Symbol(C, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 31, 18)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 8)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 23)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + + constructor(public t: T, public u: U) { +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 34, 16)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 8)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 34, 28)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 23)) + } + + foo(t: T, u: U) { +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 35, 5)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 37, 8)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 8)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 37, 13)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 23)) + + return t; +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 37, 8)) + } + + foo2(t: T, u: U) { +>foo2 : Symbol(foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 39, 5)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 41, 9)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 8)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 41, 14)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 23)) + + return u; +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 41, 14)) + } + + foo3(t: T, u: U) { +>foo3 : Symbol(foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 43, 5)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 45, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 45, 28)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 45, 9)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 45, 33)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 23)) + + return t; +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 45, 28)) + } + + foo4(t: T, u: U) { +>foo4 : Symbol(foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 47, 5)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 49, 9)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 49, 29)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 33, 8)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 49, 34)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 49, 9)) + + return t; +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 49, 29)) + } + + foo5(t: T, u: U) { +>foo5 : Symbol(foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 51, 5)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 27)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 48)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 9)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 53)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 27)) + + return t; +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 53, 48)) + } + + foo6() { +>foo6 : Symbol(foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 55, 5)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 57, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 57, 27)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 58, 11)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 57, 9)) + + return x; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 58, 11)) + } + + foo7(u: U) { +>foo7 : Symbol(foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 60, 5)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 62, 9)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 62, 24)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 62, 44)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 62, 24)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 63, 11)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 62, 9)) + + return x; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 63, 11)) + } + + foo8() { +>foo8 : Symbol(foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 65, 5)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 67, 9)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 67, 24)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 68, 11)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 67, 9)) + + return x; +>x : Symbol(x, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 68, 11)) + } +} + +var c = new C(b, d1); +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>C : Symbol(C, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 31, 18)) +>b : Symbol(b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 5, 3)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r4 = c.foo(d1, d2); // Base +>r4 : Symbol(r4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 74, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 97, 3)) +>c.foo : Symbol(C.foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 35, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo : Symbol(C.foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 35, 5)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r5 = c.foo2(b, d2); // Derived +>r5 : Symbol(r5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 75, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 98, 3)) +>c.foo2 : Symbol(C.foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 39, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo2 : Symbol(C.foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 39, 5)) +>b : Symbol(b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 5, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r6 = c.foo3(d1, d1); // Derived +>r6 : Symbol(r6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 76, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 99, 3)) +>c.foo3 : Symbol(C.foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 43, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo3 : Symbol(C.foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 43, 5)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r7 = c.foo4(d1, d2); // Base +>r7 : Symbol(r7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 77, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 100, 3)) +>c.foo4 : Symbol(C.foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 47, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo4 : Symbol(C.foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 47, 5)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r8 = c.foo5(d1, d2); // Derived +>r8 : Symbol(r8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 78, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 101, 3)) +>c.foo5 : Symbol(C.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 51, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo5 : Symbol(C.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 51, 5)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r8b = c.foo5(d2, d2); // Derived2 +>r8b : Symbol(r8b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 79, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 102, 3)) +>c.foo5 : Symbol(C.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 51, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo5 : Symbol(C.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 51, 5)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r9 = c.foo6(); // Derived +>r9 : Symbol(r9, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 80, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 103, 3)) +>c.foo6 : Symbol(C.foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 55, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo6 : Symbol(C.foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 55, 5)) + +var r10 = c.foo7(d1); // Base +>r10 : Symbol(r10, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 81, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 104, 3)) +>c.foo7 : Symbol(C.foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 60, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo7 : Symbol(C.foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 60, 5)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r11 = c.foo8(); // Base +>r11 : Symbol(r11, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 82, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 105, 3)) +>c.foo8 : Symbol(C.foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 65, 5)) +>c : Symbol(c, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 73, 3)) +>foo8 : Symbol(C.foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 65, 5)) + +interface I { +>I : Symbol(I, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 82, 19)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + + new (t: T, u: U); +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 85, 9)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 85, 14)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) + + foo(t: T, u: U): T; +>foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 85, 21)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 86, 8)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 86, 13)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) + + foo2(t: T, u: U): U; +>foo2 : Symbol(foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 86, 23)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 87, 9)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 87, 14)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) + + foo3(t: T, u: U): T; +>foo3 : Symbol(foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 87, 24)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 28)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 9)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 33)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 27)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 9)) + + foo4(t: T, u: U): T; +>foo4 : Symbol(foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 43)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 9)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 29)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 34)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 9)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 84, 12)) + + foo5(t: T, u: U): T; +>foo5 : Symbol(foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 44)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 27)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>t : Symbol(t, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 48)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 9)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 53)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 27)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 9)) + + foo6(): T; +>foo6 : Symbol(foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 63)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 9)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 27)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 3, 43)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 9)) + + foo7(u: U): T; +>foo7 : Symbol(foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 53)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 9)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 24)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>u : Symbol(u, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 44)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 24)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 9)) + + foo8(): T; +>foo8 : Symbol(foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 53)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 93, 9)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 93, 24)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) +>T : Symbol(T, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 93, 9)) +} + +var i: I; +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>I : Symbol(I, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 82, 19)) +>Base : Symbol(Base, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 2, 27)) + +var r4 = i.foo(d1, d2); // Base +>r4 : Symbol(r4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 74, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 97, 3)) +>i.foo : Symbol(I.foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 85, 21)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo : Symbol(I.foo, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 85, 21)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r5 = i.foo2(b, d2); // Derived +>r5 : Symbol(r5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 75, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 98, 3)) +>i.foo2 : Symbol(I.foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 86, 23)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo2 : Symbol(I.foo2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 86, 23)) +>b : Symbol(b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 5, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r6 = i.foo3(d1, d1); // Derived +>r6 : Symbol(r6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 76, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 99, 3)) +>i.foo3 : Symbol(I.foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 87, 24)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo3 : Symbol(I.foo3, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 87, 24)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r7 = i.foo4(d1, d2); // Base +>r7 : Symbol(r7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 77, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 100, 3)) +>i.foo4 : Symbol(I.foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 43)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo4 : Symbol(I.foo4, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 88, 43)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r8 = i.foo5(d1, d2); // Derived +>r8 : Symbol(r8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 78, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 101, 3)) +>i.foo5 : Symbol(I.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 44)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo5 : Symbol(I.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 44)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r8b = i.foo5(d2, d2); // Derived2 +>r8b : Symbol(r8b, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 79, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 102, 3)) +>i.foo5 : Symbol(I.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 44)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo5 : Symbol(I.foo5, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 89, 44)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) +>d2 : Symbol(d2, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 7, 3)) + +var r9 = i.foo6(); // Derived +>r9 : Symbol(r9, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 80, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 103, 3)) +>i.foo6 : Symbol(I.foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 63)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo6 : Symbol(I.foo6, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 90, 63)) + +var r10 = i.foo7(d1); // Base +>r10 : Symbol(r10, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 81, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 104, 3)) +>i.foo7 : Symbol(I.foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 53)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo7 : Symbol(I.foo7, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 91, 53)) +>d1 : Symbol(d1, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 6, 3)) + +var r11 = i.foo8(); // Base +>r11 : Symbol(r11, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 82, 3), Decl(genericCallWithConstraintsTypeArgumentInference.ts, 105, 3)) +>i.foo8 : Symbol(I.foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 53)) +>i : Symbol(i, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 96, 3)) +>foo8 : Symbol(I.foo8, Decl(genericCallWithConstraintsTypeArgumentInference.ts, 92, 53)) + diff --git a/tests/baselines/reference/genericCallWithFixedArguments.symbols b/tests/baselines/reference/genericCallWithFixedArguments.symbols new file mode 100644 index 00000000000..c47c5ef8f06 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFixedArguments.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/genericCallWithFixedArguments.ts === +class A { foo() { } } +>A : Symbol(A, Decl(genericCallWithFixedArguments.ts, 0, 0)) +>foo : Symbol(foo, Decl(genericCallWithFixedArguments.ts, 0, 9)) + +class B { bar() { }} +>B : Symbol(B, Decl(genericCallWithFixedArguments.ts, 0, 21)) +>bar : Symbol(bar, Decl(genericCallWithFixedArguments.ts, 1, 9)) + +function g(x) { } +>g : Symbol(g, Decl(genericCallWithFixedArguments.ts, 1, 20)) +>T : Symbol(T, Decl(genericCallWithFixedArguments.ts, 3, 11)) +>U : Symbol(U, Decl(genericCallWithFixedArguments.ts, 3, 13)) +>x : Symbol(x, Decl(genericCallWithFixedArguments.ts, 3, 17)) + +g(7) // the parameter list is fixed, so this should not error +>g : Symbol(g, Decl(genericCallWithFixedArguments.ts, 1, 20)) +>A : Symbol(A, Decl(genericCallWithFixedArguments.ts, 0, 0)) +>B : Symbol(B, Decl(genericCallWithFixedArguments.ts, 0, 21)) + + diff --git a/tests/baselines/reference/genericCallWithFixedArguments.types b/tests/baselines/reference/genericCallWithFixedArguments.types index acfad45a0f2..f22dbc01252 100644 --- a/tests/baselines/reference/genericCallWithFixedArguments.types +++ b/tests/baselines/reference/genericCallWithFixedArguments.types @@ -18,5 +18,6 @@ g(7) // the parameter list is fixed, so this should not error >g : (x: any) => void >A : A >B : B +>7 : number diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments3.symbols b/tests/baselines/reference/genericCallWithFunctionTypedArguments3.symbols new file mode 100644 index 00000000000..c8b34a73471 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments3.symbols @@ -0,0 +1,54 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments3.ts === +// No inference is made from function typed arguments which have multiple call signatures + +var a: { +>a : Symbol(a, Decl(genericCallWithFunctionTypedArguments3.ts, 2, 3)) + + (x: boolean): boolean; +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 3, 5)) + + (x: string): any; +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 4, 5)) +} + +function foo4(cb: (x: T) => U) { +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments3.ts, 5, 1)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 14)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 16)) +>cb : Symbol(cb, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 20)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 25)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 14)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 16)) + + var u: U; +>u : Symbol(u, Decl(genericCallWithFunctionTypedArguments3.ts, 8, 7)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments3.ts, 7, 16)) + + return u; +>u : Symbol(u, Decl(genericCallWithFunctionTypedArguments3.ts, 8, 7)) +} + +var r = foo4(a); // T is {} (candidates boolean and string), U is any (candidates any and boolean) +>r : Symbol(r, Decl(genericCallWithFunctionTypedArguments3.ts, 12, 3)) +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments3.ts, 5, 1)) +>a : Symbol(a, Decl(genericCallWithFunctionTypedArguments3.ts, 2, 3)) + +var b: { +>b : Symbol(b, Decl(genericCallWithFunctionTypedArguments3.ts, 14, 3)) + + (x: boolean): T; +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 15, 5)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 15, 8)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 15, 5)) + + (x: T): any; +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 16, 5)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments3.ts, 16, 8)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments3.ts, 16, 5)) +} + +var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {}) +>r2 : Symbol(r2, Decl(genericCallWithFunctionTypedArguments3.ts, 19, 3)) +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments3.ts, 5, 1)) +>b : Symbol(b, Decl(genericCallWithFunctionTypedArguments3.ts, 14, 3)) + diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments4.symbols b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.symbols new file mode 100644 index 00000000000..9aa87c28240 --- /dev/null +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.symbols @@ -0,0 +1,64 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments4.ts === +// No inference is made from function typed arguments which have multiple call signatures + +class C { foo: string } +>C : Symbol(C, Decl(genericCallWithFunctionTypedArguments4.ts, 0, 0)) +>foo : Symbol(foo, Decl(genericCallWithFunctionTypedArguments4.ts, 2, 9)) + +class D { bar: string } +>D : Symbol(D, Decl(genericCallWithFunctionTypedArguments4.ts, 2, 23)) +>bar : Symbol(bar, Decl(genericCallWithFunctionTypedArguments4.ts, 3, 9)) + +var a: { +>a : Symbol(a, Decl(genericCallWithFunctionTypedArguments4.ts, 4, 3)) + + new(x: boolean): C; +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments4.ts, 5, 8)) +>C : Symbol(C, Decl(genericCallWithFunctionTypedArguments4.ts, 0, 0)) + + new(x: string): D; +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments4.ts, 6, 8)) +>D : Symbol(D, Decl(genericCallWithFunctionTypedArguments4.ts, 2, 23)) +} + +function foo4(cb: new(x: T) => U) { +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments4.ts, 7, 1)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 14)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 16)) +>cb : Symbol(cb, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 20)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 28)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 14)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 16)) + + var u: U; +>u : Symbol(u, Decl(genericCallWithFunctionTypedArguments4.ts, 10, 7)) +>U : Symbol(U, Decl(genericCallWithFunctionTypedArguments4.ts, 9, 16)) + + return u; +>u : Symbol(u, Decl(genericCallWithFunctionTypedArguments4.ts, 10, 7)) +} + +var r = foo4(a); // T is {} (candidates boolean and string), U is {} (candidates C and D) +>r : Symbol(r, Decl(genericCallWithFunctionTypedArguments4.ts, 14, 3)) +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments4.ts, 7, 1)) +>a : Symbol(a, Decl(genericCallWithFunctionTypedArguments4.ts, 4, 3)) + +var b: { +>b : Symbol(b, Decl(genericCallWithFunctionTypedArguments4.ts, 16, 3)) + + new(x: boolean): T; +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 17, 8)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments4.ts, 17, 11)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 17, 8)) + + new(x: T): any; +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 18, 8)) +>x : Symbol(x, Decl(genericCallWithFunctionTypedArguments4.ts, 18, 11)) +>T : Symbol(T, Decl(genericCallWithFunctionTypedArguments4.ts, 18, 8)) +} + +var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {}) +>r2 : Symbol(r2, Decl(genericCallWithFunctionTypedArguments4.ts, 21, 3)) +>foo4 : Symbol(foo4, Decl(genericCallWithFunctionTypedArguments4.ts, 7, 1)) +>b : Symbol(b, Decl(genericCallWithFunctionTypedArguments4.ts, 16, 3)) + diff --git a/tests/baselines/reference/genericCallWithNonGenericArgs1.symbols b/tests/baselines/reference/genericCallWithNonGenericArgs1.symbols new file mode 100644 index 00000000000..78a0bec0108 --- /dev/null +++ b/tests/baselines/reference/genericCallWithNonGenericArgs1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/genericCallWithNonGenericArgs1.ts === +function f(x: any) { } +>f : Symbol(f, Decl(genericCallWithNonGenericArgs1.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithNonGenericArgs1.ts, 0, 11)) +>x : Symbol(x, Decl(genericCallWithNonGenericArgs1.ts, 0, 14)) + +f(null) +>f : Symbol(f, Decl(genericCallWithNonGenericArgs1.ts, 0, 0)) + diff --git a/tests/baselines/reference/genericCallWithNonGenericArgs1.types b/tests/baselines/reference/genericCallWithNonGenericArgs1.types index f08f8503075..75d86728132 100644 --- a/tests/baselines/reference/genericCallWithNonGenericArgs1.types +++ b/tests/baselines/reference/genericCallWithNonGenericArgs1.types @@ -7,4 +7,5 @@ function f(x: any) { } f(null) >f(null) : void >f : (x: any) => void +>null : null diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgs2.symbols new file mode 100644 index 00000000000..f567499d4c9 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgs2.ts === +class Base { +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 0, 12)) +} +class Derived extends Base { +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgs2.ts, 2, 1)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) + + y: string; +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 3, 28)) +} +class Derived2 extends Base { +>Derived2 : Symbol(Derived2, Decl(genericCallWithObjectTypeArgs2.ts, 5, 1)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) + + z: string; +>z : Symbol(z, Decl(genericCallWithObjectTypeArgs2.ts, 6, 29)) +} + +// returns {}[] +function f(a: { x: T; y: U }) { +>f : Symbol(f, Decl(genericCallWithObjectTypeArgs2.ts, 8, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 11, 11)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 11, 26)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgs2.ts, 11, 43)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 11, 47)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 11, 11)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 11, 53)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 11, 26)) + + return [a.x, a.y]; +>a.x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 11, 47)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgs2.ts, 11, 43)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 11, 47)) +>a.y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 11, 53)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgs2.ts, 11, 43)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 11, 53)) +} + +var r = f({ x: new Derived(), y: new Derived2() }); // {}[] +>r : Symbol(r, Decl(genericCallWithObjectTypeArgs2.ts, 15, 3)) +>f : Symbol(f, Decl(genericCallWithObjectTypeArgs2.ts, 8, 1)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 15, 11)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgs2.ts, 2, 1)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 15, 29)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithObjectTypeArgs2.ts, 5, 1)) + +var r2 = f({ x: new Base(), y: new Derived2() }); // {}[] +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgs2.ts, 16, 3)) +>f : Symbol(f, Decl(genericCallWithObjectTypeArgs2.ts, 8, 1)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 16, 12)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 16, 27)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithObjectTypeArgs2.ts, 5, 1)) + + +function f2(a: { x: T; y: U }) { +>f2 : Symbol(f2, Decl(genericCallWithObjectTypeArgs2.ts, 16, 49)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 19, 12)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 19, 27)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgs2.ts, 19, 44)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 19, 48)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 19, 12)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 19, 54)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 19, 27)) + + return (x: T) => a.y; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 20, 12)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 19, 12)) +>a.y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 19, 54)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgs2.ts, 19, 44)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 19, 54)) +} + +var r3 = f2({ x: new Derived(), y: new Derived2() }); // Derived => Derived2 +>r3 : Symbol(r3, Decl(genericCallWithObjectTypeArgs2.ts, 23, 3)) +>f2 : Symbol(f2, Decl(genericCallWithObjectTypeArgs2.ts, 16, 49)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 23, 13)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgs2.ts, 2, 1)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 23, 31)) +>Derived2 : Symbol(Derived2, Decl(genericCallWithObjectTypeArgs2.ts, 5, 1)) + +interface I { +>I : Symbol(I, Decl(genericCallWithObjectTypeArgs2.ts, 23, 53)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 25, 12)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 25, 14)) + + x: T; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgs2.ts, 25, 19)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgs2.ts, 25, 12)) + + y: U; +>y : Symbol(y, Decl(genericCallWithObjectTypeArgs2.ts, 26, 9)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgs2.ts, 25, 14)) +} + +var i: I; +>i : Symbol(i, Decl(genericCallWithObjectTypeArgs2.ts, 30, 3)) +>I : Symbol(I, Decl(genericCallWithObjectTypeArgs2.ts, 23, 53)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgs2.ts, 0, 0)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgs2.ts, 2, 1)) + +var r4 = f2(i); // Base => Derived +>r4 : Symbol(r4, Decl(genericCallWithObjectTypeArgs2.ts, 31, 3)) +>f2 : Symbol(f2, Decl(genericCallWithObjectTypeArgs2.ts, 16, 49)) +>i : Symbol(i, Decl(genericCallWithObjectTypeArgs2.ts, 30, 3)) + diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.symbols new file mode 100644 index 00000000000..50f20f55bea --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.symbols @@ -0,0 +1,102 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints.ts === +// Generic call with constraints infering type parameter from object member properties +// No errors expected + +class C { +>C : Symbol(C, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 3, 9)) +} + +class D { +>D : Symbol(D, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + x: string; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 7, 9)) + + y: string; +>y : Symbol(y, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 8, 14)) +} + +class X { +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 12, 8)) + + x: T; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 12, 12)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 12, 8)) +} + +function foo(t: X, t2: X) { +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 14, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 24)) +>t : Symbol(t, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 38)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) +>t2 : Symbol(t2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 46)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 17, 7)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 16, 13)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 17, 7)) +} + +var c1 = new X(); +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>C : Symbol(C, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 0, 0)) + +var d1 = new X(); +>d1 : Symbol(d1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 22, 3)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>D : Symbol(D, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 5, 1)) + +var r = foo(c1, d1); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 23, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 31, 3)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 14, 1)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) +>d1 : Symbol(d1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 22, 3)) + +var r2 = foo(c1, c1); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 32, 3)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 14, 1)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) + +function foo2(t: X, t2: X) { +>foo2 : Symbol(foo2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 21)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) +>C : Symbol(C, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 0, 0)) +>t : Symbol(t, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 27)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) +>t2 : Symbol(t2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 35)) +>X : Symbol(X, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) + + var x: T; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 27, 7)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 26, 14)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 27, 7)) +} + +var r = foo2(c1, d1); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 23, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 31, 3)) +>foo2 : Symbol(foo2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 21)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) +>d1 : Symbol(d1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 22, 3)) + +var r2 = foo2(c1, c1); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 3), Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 32, 3)) +>foo2 : Symbol(foo2, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 24, 21)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) +>c1 : Symbol(c1, Decl(genericCallWithObjectTypeArgsAndConstraints.ts, 21, 3)) + diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.symbols new file mode 100644 index 00000000000..864927a3a8c --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.symbols @@ -0,0 +1,124 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints2.ts === +// Generic call with constraints infering type parameter from object member properties +// No errors expected + +class Base { +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 3, 12)) +} +class Derived extends Base { +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) + + y: string; +>y : Symbol(y, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 6, 28)) +} + +function f(x: { foo: T; bar: T }) { +>f : Symbol(f, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 8, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 11)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 27)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 31)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 11)) +>bar : Symbol(bar, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 39)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 11)) + + var r: T; +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 11, 7)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 10, 11)) + + return r; +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 11, 7)) +} +var r = f({ foo: new Base(), bar: new Derived() }); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 14, 3)) +>f : Symbol(f, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 8, 1)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 14, 11)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) +>bar : Symbol(bar, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 14, 28)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) + +var r2 = f({ foo: new Derived(), bar: new Derived() }); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 3)) +>f : Symbol(f, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 8, 1)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 12)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) +>bar : Symbol(bar, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 32)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) + + +interface I { +>I : Symbol(I, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 55)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 18, 12)) + + a: T; +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 18, 16)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 18, 12)) +} +function f2(x: I) { +>f2 : Symbol(f2, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 20, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 21, 12)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 21, 28)) +>I : Symbol(I, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 55)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 21, 12)) + + var r: T; +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 22, 7)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 21, 12)) + + return r; +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 22, 7)) +} +var i: I; +>i : Symbol(i, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 25, 3)) +>I : Symbol(I, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 15, 55)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) + +var r3 = f2(i); +>r3 : Symbol(r3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 3)) +>f2 : Symbol(f2, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 20, 1)) +>i : Symbol(i, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 25, 3)) + + +function f3(x: T, y: (a: T) => T) { +>f3 : Symbol(f3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 15)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 12)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 28)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 12)) +>y : Symbol(y, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 33)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 38)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 12)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 12)) + + return y(null); +>y : Symbol(y, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 29, 33)) +} +var r4 = f3(new Base(), x => x); +>r4 : Symbol(r4, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 32, 3)) +>f3 : Symbol(f3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 15)) +>Base : Symbol(Base, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 0, 0)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 32, 23)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 32, 23)) + +var r5 = f3(new Derived(), x => x); +>r5 : Symbol(r5, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 33, 3)) +>f3 : Symbol(f3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 15)) +>Derived : Symbol(Derived, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 5, 1)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 33, 26)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 33, 26)) + +var r6 = f3(null, null); // any +>r6 : Symbol(r6, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 35, 3)) +>f3 : Symbol(f3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 15)) + +var r7 = f3(null, x => x); // any +>r7 : Symbol(r7, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 36, 3)) +>f3 : Symbol(f3, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 26, 15)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 36, 17)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndConstraints2.ts, 36, 17)) + diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types index 29706ba7e3d..8ffa07252bc 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types @@ -107,6 +107,7 @@ function f3(x: T, y: (a: T) => T) { return y(null); >y(null) : T >y : (a: T) => T +>null : null } var r4 = f3(new Base(), x => x); >r4 : Base @@ -132,11 +133,14 @@ var r6 = f3(null, null); // any >r6 : any >f3(null, null) : any >f3 : (x: T, y: (a: T) => T) => T +>null : null +>null : null var r7 = f3(null, x => x); // any >r7 : any >f3(null, x => x) : any >f3 : (x: T, y: (a: T) => T) => T +>null : null >x => x : (x: any) => any >x : any >x : any diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.symbols new file mode 100644 index 00000000000..14a91401efb --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexers.ts === +// Type inference infers from indexers in target type, no errors expected + +function foo(x: T) { +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 13)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 16)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 13)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 2, 16)) +} + +var a: { +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 6, 3)) + + [x: string]: Object; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 7, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: Date; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 8, 5)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +}; +var r = foo(a); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 10, 3)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 0, 0)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 6, 3)) + +function other(arg: T) { +>other : Symbol(other, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 10, 15)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 31)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15)) + + var b: { +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 13, 7)) + + [x: string]: Object; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 14, 9)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + [x: number]: T +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 15, 9)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15)) + + }; + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 17, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 13, 7)) + + var d = r2[1]; +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 18, 7)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 17, 7)) + + var e = r2['1']; +>e : Symbol(e, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 19, 7)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 17, 7)) +} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types index 9a7ca1dbb91..e1659323033 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types @@ -58,9 +58,11 @@ function other(arg: T) { >d : T >r2[1] : T >r2 : { [x: string]: Object; [x: number]: T; } +>1 : number var e = r2['1']; >e : Object >r2['1'] : Object >r2 : { [x: string]: Object; [x: number]: T; } +>'1' : string } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.symbols new file mode 100644 index 00000000000..77787e77299 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.symbols @@ -0,0 +1,95 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndNumericIndexer.ts === +// Type inference infers from indexers in target type, no errors expected + +function foo(x: T) { +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 2, 13)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 2, 16)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 2, 13)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 2, 16)) +} + +var a: { [x: number]: Date }; +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 6, 3)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 6, 10)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r = foo(a); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 7, 3)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 0, 0)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 6, 3)) + +function other(arg: T) { +>other : Symbol(other, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 7, 15)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 9, 15)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 9, 18)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 9, 15)) + + var b: { [x: number]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 10, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 10, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 9, 15)) + + var r2 = foo(b); // T +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 11, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 10, 7)) +} + +function other2(arg: T) { +>other2 : Symbol(other2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 12, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 16)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 32)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 16)) + + var b: { [x: number]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 15, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 15, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 16)) + + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 16, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 15, 7)) + + var d = r2[1]; +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 17, 7)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 16, 7)) +} + +function other3(arg: T) { +>other3 : Symbol(other3, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 18, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 16)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 31)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 48)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 16)) + + var b: { [x: number]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 21, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 21, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 16)) + + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 22, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 21, 7)) + + var d = r2[1]; +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 23, 7)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 22, 7)) + + // BUG 821629 + //var u: U = r2[1]; // ok +} +//function other3(arg: T) { +// var b: { [x: number]: T }; +// var r2 = foo(b); +// var d = r2[1]; +// // BUG 821629 +// //var u: U = r2[1]; // ok +//} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types index f4b3f5960f0..71e943c1ad3 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types @@ -62,6 +62,7 @@ function other2(arg: T) { >d : T >r2[1] : T >r2 : { [x: number]: T; } +>1 : number } function other3(arg: T) { @@ -88,6 +89,7 @@ function other3(arg: T) { >d : T >r2[1] : T >r2 : { [x: number]: T; } +>1 : number // BUG 821629 //var u: U = r2[1]; // ok diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.symbols new file mode 100644 index 00000000000..62b7c82b8e3 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.symbols @@ -0,0 +1,98 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndStringIndexer.ts === +// Type inference infers from indexers in target type, no errors expected + +function foo(x: T) { +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 2, 13)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 2, 16)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 2, 13)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 2, 16)) +} + +var a: { [x: string]: Date }; +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 6, 3)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 6, 10)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r = foo(a); +>r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 7, 3)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 0, 0)) +>a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 6, 3)) + +function other(arg: T) { +>other : Symbol(other, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 7, 15)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 9, 15)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 9, 18)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 9, 15)) + + var b: { [x: string]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 10, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 10, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 9, 15)) + + var r2 = foo(b); // T +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 11, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 10, 7)) +} + +function other2(arg: T) { +>other2 : Symbol(other2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 12, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 16)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 32)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 16)) + + var b: { [x: string]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 15, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 15, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 16)) + + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 16, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 15, 7)) + + var d: Date = r2['hm']; // ok +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 17, 7)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 16, 7)) +} + +function other3(arg: T) { +>other3 : Symbol(other3, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 18, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 16)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 31)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 48)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 16)) + + var b: { [x: string]: T }; +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 21, 7)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 21, 14)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 16)) + + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 22, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 21, 7)) + + var d: Date = r2['hm']; // ok +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 23, 7)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 22, 7)) + + // BUG 821629 + //var u: U = r2['hm']; // ok +} + +//function other3(arg: T) { +// var b: { [x: string]: T }; +// var r2 = foo(b); +// var d: Date = r2['hm']; // ok +// // BUG 821629 +// //var u: U = r2['hm']; // ok +//} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types index e52e6cff113..196103f422b 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types @@ -63,6 +63,7 @@ function other2(arg: T) { >Date : Date >r2['hm'] : T >r2 : { [x: string]: T; } +>'hm' : string } function other3(arg: T) { @@ -90,6 +91,7 @@ function other3(arg: T) { >Date : Date >r2['hm'] : T >r2 : { [x: string]: T; } +>'hm' : string // BUG 821629 //var u: U = r2['hm']; // ok diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.symbols b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.symbols new file mode 100644 index 00000000000..1d32c55fd33 --- /dev/null +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.symbols @@ -0,0 +1,163 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments.ts === +// Function typed arguments with multiple signatures must be passed an implementation that matches all of them +// Inferences are made quadratic-pairwise to and from these overload sets + +module NonGenericParameter { +>NonGenericParameter : Symbol(NonGenericParameter, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 0, 0)) + + var a: { +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 4, 7)) + + (x: boolean): boolean; +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 5, 9)) + + (x: string): string; +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 6, 9)) + } + + function foo4(cb: typeof a) { +>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5)) +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 9, 18)) +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 4, 7)) + + return cb; +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 9, 18)) + } + + var r = foo4(a); +>r : Symbol(r, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 13, 7)) +>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5)) +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 4, 7)) + + var r2 = foo4((x: T) => x); +>r2 : Symbol(r2, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 7)) +>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 19)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 22)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 19)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 22)) + + var r4 = foo4(x => x); +>r4 : Symbol(r4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 15, 7)) +>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 15, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 15, 18)) +} + +module GenericParameter { +>GenericParameter : Symbol(GenericParameter, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 16, 1)) + + function foo5(cb: { (x: T): string; (x: number): T }) { +>foo5 : Symbol(foo5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 18, 25)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 18)) +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 21)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 28)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 44)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 18)) + + return cb; +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 21)) + } + + var r5 = foo5(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any +>r5 : Symbol(r5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 23, 7)) +>foo5 : Symbol(foo5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 18, 25)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 23, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 23, 18)) + + var a: { (x: T): string; (x: number): T; } +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 14)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 17)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 14)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 33)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 36)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 33)) + + var r7 = foo5(a); // any => string (+1 overload) +>r7 : Symbol(r7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 7)) +>foo5 : Symbol(foo5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 18, 25)) +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7)) + + function foo6(cb: { (x: T): string; (x: T, y?: T): string }) { +>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18)) +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 21)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 28)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 44)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18)) +>y : Symbol(y, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 49)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18)) + + return cb; +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 21)) + } + + var r8 = foo6(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any +>r8 : Symbol(r8, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 31, 7)) +>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 31, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 31, 18)) + + var r9 = foo6((x: T) => ''); // any => string (+1 overload) +>r9 : Symbol(r9, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 7)) +>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 19)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 22)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 19)) + + var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) +>r11 : Symbol(r11, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 7)) +>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 20)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 23)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 20)) +>y : Symbol(y, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 28)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 20)) + + function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { +>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 21)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18)) +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 25)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 33)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 49)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18)) +>y : Symbol(y, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 54)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18)) + + return cb; +>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 25)) + } + + var r12 = foo7(1, (x) => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] +>r12 : Symbol(r12, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 39, 7)) +>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 39, 23)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 39, 23)) + + var r13 = foo7(1, (x: T) => ''); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] +>r13 : Symbol(r13, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 7)) +>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 23)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 26)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 23)) + + var a: { (x: T): string; (x: number): T; } +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 14)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 17)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 14)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 33)) +>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 36)) +>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 33)) + + var r14 = foo7(1, a); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] +>r14 : Symbol(r14, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 42, 7)) +>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43)) +>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7)) +} diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types index ad491206be6..dbdecbec3e4 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types @@ -119,6 +119,7 @@ module GenericParameter { >T : T >x : T >T : T +>'' : string var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) >r11 : { (x: any): string; (x: any, y?: any): string; } @@ -130,6 +131,7 @@ module GenericParameter { >T : T >y : T >T : T +>'' : string function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } @@ -152,6 +154,7 @@ module GenericParameter { >r12 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, (x) => x) : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>1 : number >(x) => x : (x: any) => any >x : any >x : any @@ -160,10 +163,12 @@ module GenericParameter { >r13 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, (x: T) => '') : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>1 : number >(x: T) => '' : (x: T) => string >T : T >x : T >T : T +>'' : string var a: { (x: T): string; (x: number): T; } >a : { (x: T): string; (x: number): T; } @@ -178,5 +183,6 @@ module GenericParameter { >r14 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, a) : { (x: any): string; (x: any, y?: any): string; } >foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>1 : number >a : { (x: T): string; (x: number): T; } } diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.symbols b/tests/baselines/reference/genericCallbacksAndClassHierarchy.symbols new file mode 100644 index 00000000000..be46c49a9ca --- /dev/null +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.symbols @@ -0,0 +1,79 @@ +=== tests/cases/compiler/genericCallbacksAndClassHierarchy.ts === +module M { +>M : Symbol(M, Decl(genericCallbacksAndClassHierarchy.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(genericCallbacksAndClassHierarchy.ts, 0, 10)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 1, 23)) + + subscribe(callback: (newValue: T) => void ): any; +>subscribe : Symbol(subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 1, 27)) +>callback : Symbol(callback, Decl(genericCallbacksAndClassHierarchy.ts, 2, 18)) +>newValue : Symbol(newValue, Decl(genericCallbacksAndClassHierarchy.ts, 2, 29)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 1, 23)) + } + export class C1 { +>C1 : Symbol(C1, Decl(genericCallbacksAndClassHierarchy.ts, 3, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 4, 20)) + + public value: I; +>value : Symbol(value, Decl(genericCallbacksAndClassHierarchy.ts, 4, 24)) +>I : Symbol(I, Decl(genericCallbacksAndClassHierarchy.ts, 0, 10)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 4, 20)) + } + export class A { +>A : Symbol(A, Decl(genericCallbacksAndClassHierarchy.ts, 6, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 7, 19)) + + public dummy: any; +>dummy : Symbol(dummy, Decl(genericCallbacksAndClassHierarchy.ts, 7, 23)) + } + export class B extends C1> { } +>B : Symbol(B, Decl(genericCallbacksAndClassHierarchy.ts, 9, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 10, 19)) +>C1 : Symbol(C1, Decl(genericCallbacksAndClassHierarchy.ts, 3, 5)) +>A : Symbol(A, Decl(genericCallbacksAndClassHierarchy.ts, 6, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 10, 19)) + + export class D { +>D : Symbol(D, Decl(genericCallbacksAndClassHierarchy.ts, 10, 42)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 11, 19)) + + _subscribe(viewModel: B): void { +>_subscribe : Symbol(_subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 11, 23)) +>viewModel : Symbol(viewModel, Decl(genericCallbacksAndClassHierarchy.ts, 12, 19)) +>B : Symbol(B, Decl(genericCallbacksAndClassHierarchy.ts, 9, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 11, 19)) + + var f = (newValue: A) => { }; +>f : Symbol(f, Decl(genericCallbacksAndClassHierarchy.ts, 13, 15)) +>newValue : Symbol(newValue, Decl(genericCallbacksAndClassHierarchy.ts, 13, 21)) +>A : Symbol(A, Decl(genericCallbacksAndClassHierarchy.ts, 6, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 11, 19)) + + var v: I> = viewModel.value; +>v : Symbol(v, Decl(genericCallbacksAndClassHierarchy.ts, 15, 15)) +>I : Symbol(I, Decl(genericCallbacksAndClassHierarchy.ts, 0, 10)) +>A : Symbol(A, Decl(genericCallbacksAndClassHierarchy.ts, 6, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 11, 19)) +>viewModel.value : Symbol(C1.value, Decl(genericCallbacksAndClassHierarchy.ts, 4, 24)) +>viewModel : Symbol(viewModel, Decl(genericCallbacksAndClassHierarchy.ts, 12, 19)) +>value : Symbol(C1.value, Decl(genericCallbacksAndClassHierarchy.ts, 4, 24)) + + // both of these should work + v.subscribe(f); +>v.subscribe : Symbol(I.subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 1, 27)) +>v : Symbol(v, Decl(genericCallbacksAndClassHierarchy.ts, 15, 15)) +>subscribe : Symbol(I.subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 1, 27)) +>f : Symbol(f, Decl(genericCallbacksAndClassHierarchy.ts, 13, 15)) + + v.subscribe((newValue: A) => { }); +>v.subscribe : Symbol(I.subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 1, 27)) +>v : Symbol(v, Decl(genericCallbacksAndClassHierarchy.ts, 15, 15)) +>subscribe : Symbol(I.subscribe, Decl(genericCallbacksAndClassHierarchy.ts, 1, 27)) +>newValue : Symbol(newValue, Decl(genericCallbacksAndClassHierarchy.ts, 19, 25)) +>A : Symbol(A, Decl(genericCallbacksAndClassHierarchy.ts, 6, 5)) +>T : Symbol(T, Decl(genericCallbacksAndClassHierarchy.ts, 11, 19)) + } + } +} diff --git a/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.symbols b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.symbols new file mode 100644 index 00000000000..ba75ebdc045 --- /dev/null +++ b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericClassImplementingGenericInterfaceFromAnotherModule.ts === +module foo { +>foo : Symbol(foo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 0, 0)) + + export interface IFoo { } +>IFoo : Symbol(IFoo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 0, 12)) +>T : Symbol(T, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 1, 26)) +} +module bar { +>bar : Symbol(bar, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 2, 1)) + + export class Foo implements foo.IFoo { } +>Foo : Symbol(Foo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 3, 12)) +>T : Symbol(T, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 4, 21)) +>foo.IFoo : Symbol(foo.IFoo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 0, 12)) +>foo : Symbol(foo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 0, 0)) +>IFoo : Symbol(foo.IFoo, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 0, 12)) +>T : Symbol(T, Decl(genericClassImplementingGenericInterfaceFromAnotherModule.ts, 4, 21)) +} + diff --git a/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.types b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.types index 337485dee2c..b5552cd36a8 100644 --- a/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.types +++ b/tests/baselines/reference/genericClassImplementingGenericInterfaceFromAnotherModule.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericClassImplementingGenericInterfaceFromAnotherModule.ts === module foo { ->foo : unknown +>foo : any export interface IFoo { } >IFoo : IFoo @@ -12,7 +12,8 @@ module bar { export class Foo implements foo.IFoo { } >Foo : Foo >T : T ->foo : unknown +>foo.IFoo : any +>foo : any >IFoo : foo.IFoo >T : T } diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.symbols b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.symbols new file mode 100644 index 00000000000..d2e173b8078 --- /dev/null +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/genericClassInheritsConstructorFromNonGenericClass.ts === +class A extends B { } +>A : Symbol(A, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 0, 0)) +>B : Symbol(B, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 0, 29)) + +class B extends C { } +>B : Symbol(B, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 0, 29)) +>U : Symbol(U, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 1, 8)) +>C : Symbol(C, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 1, 24)) + +class C { +>C : Symbol(C, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 1, 24)) + + constructor(p: string) { } +>p : Symbol(p, Decl(genericClassInheritsConstructorFromNonGenericClass.ts, 3, 16)) +} diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.symbols b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.symbols new file mode 100644 index 00000000000..291f439c9a9 --- /dev/null +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.symbols @@ -0,0 +1,256 @@ +=== tests/cases/compiler/genericClassPropertyInheritanceSpecialization.ts === +interface KnockoutObservableBase { +>KnockoutObservableBase : Symbol(KnockoutObservableBase, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 0)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 33)) + + peek(): T; +>peek : Symbol(peek, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 37)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 33)) + + (): T; +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 33)) + + (value: T): void; +>value : Symbol(value, Decl(genericClassPropertyInheritanceSpecialization.ts, 3, 5)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 33)) +} + +interface KnockoutObservable extends KnockoutObservableBase { +>KnockoutObservable : Symbol(KnockoutObservable, Decl(genericClassPropertyInheritanceSpecialization.ts, 4, 1)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 6, 29)) +>KnockoutObservableBase : Symbol(KnockoutObservableBase, Decl(genericClassPropertyInheritanceSpecialization.ts, 0, 0)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 6, 29)) + + equalityComparer(a: T, b: T): boolean; +>equalityComparer : Symbol(equalityComparer, Decl(genericClassPropertyInheritanceSpecialization.ts, 6, 67)) +>a : Symbol(a, Decl(genericClassPropertyInheritanceSpecialization.ts, 7, 21)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 6, 29)) +>b : Symbol(b, Decl(genericClassPropertyInheritanceSpecialization.ts, 7, 26)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 6, 29)) + + valueHasMutated(): void; +>valueHasMutated : Symbol(valueHasMutated, Decl(genericClassPropertyInheritanceSpecialization.ts, 7, 42)) + + valueWillMutate(): void; +>valueWillMutate : Symbol(valueWillMutate, Decl(genericClassPropertyInheritanceSpecialization.ts, 8, 28)) +} + +interface KnockoutObservableArray extends KnockoutObservable { +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(genericClassPropertyInheritanceSpecialization.ts, 4, 1)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + indexOf(searchElement: T, fromIndex?: number): number; +>indexOf : Symbol(indexOf, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 70)) +>searchElement : Symbol(searchElement, Decl(genericClassPropertyInheritanceSpecialization.ts, 13, 12)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>fromIndex : Symbol(fromIndex, Decl(genericClassPropertyInheritanceSpecialization.ts, 13, 29)) + + slice(start: number, end?: number): T[]; +>slice : Symbol(slice, Decl(genericClassPropertyInheritanceSpecialization.ts, 13, 58)) +>start : Symbol(start, Decl(genericClassPropertyInheritanceSpecialization.ts, 14, 10)) +>end : Symbol(end, Decl(genericClassPropertyInheritanceSpecialization.ts, 14, 24)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + splice(start: number, deleteCount?: number, ...items: T[]): T[]; +>splice : Symbol(splice, Decl(genericClassPropertyInheritanceSpecialization.ts, 14, 44)) +>start : Symbol(start, Decl(genericClassPropertyInheritanceSpecialization.ts, 15, 11)) +>deleteCount : Symbol(deleteCount, Decl(genericClassPropertyInheritanceSpecialization.ts, 15, 25)) +>items : Symbol(items, Decl(genericClassPropertyInheritanceSpecialization.ts, 15, 47)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + pop(): T; +>pop : Symbol(pop, Decl(genericClassPropertyInheritanceSpecialization.ts, 15, 68)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + push(...items: T[]): void; +>push : Symbol(push, Decl(genericClassPropertyInheritanceSpecialization.ts, 16, 13)) +>items : Symbol(items, Decl(genericClassPropertyInheritanceSpecialization.ts, 17, 9)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + shift(): T; +>shift : Symbol(shift, Decl(genericClassPropertyInheritanceSpecialization.ts, 17, 30)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + unshift(...items: T[]): number; +>unshift : Symbol(unshift, Decl(genericClassPropertyInheritanceSpecialization.ts, 18, 15)) +>items : Symbol(items, Decl(genericClassPropertyInheritanceSpecialization.ts, 19, 12)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + reverse(): T[]; +>reverse : Symbol(reverse, Decl(genericClassPropertyInheritanceSpecialization.ts, 19, 35)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + sort(compareFunction?: (a: T, b: T) => number): void; +>sort : Symbol(sort, Decl(genericClassPropertyInheritanceSpecialization.ts, 20, 19)) +>compareFunction : Symbol(compareFunction, Decl(genericClassPropertyInheritanceSpecialization.ts, 21, 9)) +>a : Symbol(a, Decl(genericClassPropertyInheritanceSpecialization.ts, 21, 28)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>b : Symbol(b, Decl(genericClassPropertyInheritanceSpecialization.ts, 21, 33)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + replace(oldItem: T, newItem: T): void; +>replace : Symbol(replace, Decl(genericClassPropertyInheritanceSpecialization.ts, 21, 57)) +>oldItem : Symbol(oldItem, Decl(genericClassPropertyInheritanceSpecialization.ts, 22, 12)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>newItem : Symbol(newItem, Decl(genericClassPropertyInheritanceSpecialization.ts, 22, 23)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + remove(item: T): T[]; +>remove : Symbol(remove, Decl(genericClassPropertyInheritanceSpecialization.ts, 22, 42)) +>item : Symbol(item, Decl(genericClassPropertyInheritanceSpecialization.ts, 23, 11)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + removeAll(items?: T[]): T[]; +>removeAll : Symbol(removeAll, Decl(genericClassPropertyInheritanceSpecialization.ts, 23, 25)) +>items : Symbol(items, Decl(genericClassPropertyInheritanceSpecialization.ts, 24, 14)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + destroy(item: T): void; +>destroy : Symbol(destroy, Decl(genericClassPropertyInheritanceSpecialization.ts, 24, 32)) +>item : Symbol(item, Decl(genericClassPropertyInheritanceSpecialization.ts, 25, 12)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) + + destroyAll(items?: T[]): void; +>destroyAll : Symbol(destroyAll, Decl(genericClassPropertyInheritanceSpecialization.ts, 25, 27)) +>items : Symbol(items, Decl(genericClassPropertyInheritanceSpecialization.ts, 26, 15)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 12, 34)) +} + +interface KnockoutObservableArrayStatic { +>KnockoutObservableArrayStatic : Symbol(KnockoutObservableArrayStatic, Decl(genericClassPropertyInheritanceSpecialization.ts, 27, 1)) + + fn: KnockoutObservableArray; +>fn : Symbol(fn, Decl(genericClassPropertyInheritanceSpecialization.ts, 29, 41)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 10, 1)) + + (value?: T[]): KnockoutObservableArray; +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 32, 5)) +>value : Symbol(value, Decl(genericClassPropertyInheritanceSpecialization.ts, 32, 8)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 32, 5)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassPropertyInheritanceSpecialization.ts, 32, 5)) +} + +declare module ko { +>ko : Symbol(ko, Decl(genericClassPropertyInheritanceSpecialization.ts, 33, 1)) + + export var observableArray: KnockoutObservableArrayStatic; +>observableArray : Symbol(observableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 36, 14)) +>KnockoutObservableArrayStatic : Symbol(KnockoutObservableArrayStatic, Decl(genericClassPropertyInheritanceSpecialization.ts, 27, 1)) +} + +module Portal.Controls.Validators { +>Portal : Symbol(Portal, Decl(genericClassPropertyInheritanceSpecialization.ts, 37, 1)) +>Controls : Symbol(Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 14)) +>Validators : Symbol(Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 23)) + + export class Validator { +>Validator : Symbol(Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 35)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 41, 27)) + + private _subscription; +>_subscription : Symbol(_subscription, Decl(genericClassPropertyInheritanceSpecialization.ts, 41, 36)) + + public message: KnockoutObservable; +>message : Symbol(message, Decl(genericClassPropertyInheritanceSpecialization.ts, 42, 30)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(genericClassPropertyInheritanceSpecialization.ts, 4, 1)) + + public validationState: KnockoutObservable; +>validationState : Symbol(validationState, Decl(genericClassPropertyInheritanceSpecialization.ts, 43, 51)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(genericClassPropertyInheritanceSpecialization.ts, 4, 1)) + + public validate: KnockoutObservable; +>validate : Symbol(validate, Decl(genericClassPropertyInheritanceSpecialization.ts, 44, 59)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(genericClassPropertyInheritanceSpecialization.ts, 4, 1)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 41, 27)) + + constructor(message?: string) { } +>message : Symbol(message, Decl(genericClassPropertyInheritanceSpecialization.ts, 46, 20)) + + public destroy(): void { } +>destroy : Symbol(destroy, Decl(genericClassPropertyInheritanceSpecialization.ts, 46, 41)) + + public _validate(value: TValue): number {return 0 } +>_validate : Symbol(_validate, Decl(genericClassPropertyInheritanceSpecialization.ts, 47, 34)) +>value : Symbol(value, Decl(genericClassPropertyInheritanceSpecialization.ts, 48, 25)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 41, 27)) + } +} + +module PortalFx.ViewModels.Controls.Validators { +>PortalFx : Symbol(PortalFx, Decl(genericClassPropertyInheritanceSpecialization.ts, 50, 1)) +>ViewModels : Symbol(ViewModels, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 16)) +>Controls : Symbol(Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 27)) +>Validators : Symbol(Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 36)) + + export class Validator extends Portal.Controls.Validators.Validator { +>Validator : Symbol(Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 48)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 54, 27)) +>Portal.Controls.Validators.Validator : Symbol(Portal.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 35)) +>Portal.Controls.Validators : Symbol(Portal.Controls.Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 23)) +>Portal.Controls : Symbol(Portal.Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 14)) +>Portal : Symbol(Portal, Decl(genericClassPropertyInheritanceSpecialization.ts, 37, 1)) +>Controls : Symbol(Portal.Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 14)) +>Validators : Symbol(Portal.Controls.Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 23)) +>Validator : Symbol(Portal.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 35)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 54, 27)) + + constructor(message?: string) { +>message : Symbol(message, Decl(genericClassPropertyInheritanceSpecialization.ts, 56, 20)) + + super(message); +>super : Symbol(Portal.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 39, 35)) +>message : Symbol(message, Decl(genericClassPropertyInheritanceSpecialization.ts, 56, 20)) + } + } + +} + +interface Contract { +>Contract : Symbol(Contract, Decl(genericClassPropertyInheritanceSpecialization.ts, 61, 1)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 63, 19)) + + validators: KnockoutObservableArray>; +>validators : Symbol(validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 63, 28)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 10, 1)) +>PortalFx : Symbol(PortalFx, Decl(genericClassPropertyInheritanceSpecialization.ts, 50, 1)) +>ViewModels : Symbol(PortalFx.ViewModels, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 16)) +>Controls : Symbol(PortalFx.ViewModels.Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 27)) +>Validators : Symbol(PortalFx.ViewModels.Controls.Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 36)) +>Validator : Symbol(PortalFx.ViewModels.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 48)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 63, 19)) +} + + +class ViewModel implements Contract { +>ViewModel : Symbol(ViewModel, Decl(genericClassPropertyInheritanceSpecialization.ts, 66, 1)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 69, 16)) +>Contract : Symbol(Contract, Decl(genericClassPropertyInheritanceSpecialization.ts, 61, 1)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 69, 16)) + + public validators: KnockoutObservableArray> = ko.observableArray>(); +>validators : Symbol(validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 69, 53)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 10, 1)) +>PortalFx : Symbol(PortalFx, Decl(genericClassPropertyInheritanceSpecialization.ts, 50, 1)) +>ViewModels : Symbol(PortalFx.ViewModels, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 16)) +>Controls : Symbol(PortalFx.ViewModels.Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 27)) +>Validators : Symbol(PortalFx.ViewModels.Controls.Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 36)) +>Validator : Symbol(PortalFx.ViewModels.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 48)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 69, 16)) +>ko.observableArray : Symbol(ko.observableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 36, 14)) +>ko : Symbol(ko, Decl(genericClassPropertyInheritanceSpecialization.ts, 33, 1)) +>observableArray : Symbol(ko.observableArray, Decl(genericClassPropertyInheritanceSpecialization.ts, 36, 14)) +>PortalFx : Symbol(PortalFx, Decl(genericClassPropertyInheritanceSpecialization.ts, 50, 1)) +>ViewModels : Symbol(PortalFx.ViewModels, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 16)) +>Controls : Symbol(PortalFx.ViewModels.Controls, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 27)) +>Validators : Symbol(PortalFx.ViewModels.Controls.Validators, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 36)) +>Validator : Symbol(PortalFx.ViewModels.Controls.Validators.Validator, Decl(genericClassPropertyInheritanceSpecialization.ts, 52, 48)) +>TValue : Symbol(TValue, Decl(genericClassPropertyInheritanceSpecialization.ts, 69, 16)) +} + + diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types index 1867d390703..6ba27a66399 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.types @@ -179,6 +179,7 @@ module Portal.Controls.Validators { >_validate : (value: TValue) => number >value : TValue >TValue : TValue +>0 : number } } @@ -191,6 +192,9 @@ module PortalFx.ViewModels.Controls.Validators { export class Validator extends Portal.Controls.Validators.Validator { >Validator : Validator >TValue : TValue +>Portal.Controls.Validators.Validator : any +>Portal.Controls.Validators : typeof Portal.Controls.Validators +>Portal.Controls : typeof Portal.Controls >Portal : typeof Portal >Controls : typeof Portal.Controls >Validators : typeof Portal.Controls.Validators @@ -216,10 +220,10 @@ interface Contract { validators: KnockoutObservableArray>; >validators : KnockoutObservableArray> >KnockoutObservableArray : KnockoutObservableArray ->PortalFx : unknown ->ViewModels : unknown ->Controls : unknown ->Validators : unknown +>PortalFx : any +>ViewModels : any +>Controls : any +>Validators : any >Validator : PortalFx.ViewModels.Controls.Validators.Validator >TValue : TValue } @@ -234,20 +238,20 @@ class ViewModel implements Contract { public validators: KnockoutObservableArray> = ko.observableArray>(); >validators : KnockoutObservableArray> >KnockoutObservableArray : KnockoutObservableArray ->PortalFx : unknown ->ViewModels : unknown ->Controls : unknown ->Validators : unknown +>PortalFx : any +>ViewModels : any +>Controls : any +>Validators : any >Validator : PortalFx.ViewModels.Controls.Validators.Validator >TValue : TValue >ko.observableArray>() : KnockoutObservableArray> >ko.observableArray : KnockoutObservableArrayStatic >ko : typeof ko >observableArray : KnockoutObservableArrayStatic ->PortalFx : unknown ->ViewModels : unknown ->Controls : unknown ->Validators : unknown +>PortalFx : any +>ViewModels : any +>Controls : any +>Validators : any >Validator : PortalFx.ViewModels.Controls.Validators.Validator >TValue : TValue } diff --git a/tests/baselines/reference/genericClassStaticMethod.symbols b/tests/baselines/reference/genericClassStaticMethod.symbols new file mode 100644 index 00000000000..b4ebd9d2ce9 --- /dev/null +++ b/tests/baselines/reference/genericClassStaticMethod.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/genericClassStaticMethod.ts === +class Foo { +>Foo : Symbol(Foo, Decl(genericClassStaticMethod.ts, 0, 0)) +>T : Symbol(T, Decl(genericClassStaticMethod.ts, 0, 10)) + + static getFoo() { +>getFoo : Symbol(Foo.getFoo, Decl(genericClassStaticMethod.ts, 0, 14)) + } +} + +class Bar extends Foo { +>Bar : Symbol(Bar, Decl(genericClassStaticMethod.ts, 3, 1)) +>T : Symbol(T, Decl(genericClassStaticMethod.ts, 5, 10)) +>Foo : Symbol(Foo, Decl(genericClassStaticMethod.ts, 0, 0)) +>T : Symbol(T, Decl(genericClassStaticMethod.ts, 5, 10)) + + static getFoo() { +>getFoo : Symbol(Bar.getFoo, Decl(genericClassStaticMethod.ts, 5, 29)) + } +} + diff --git a/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.symbols b/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.symbols new file mode 100644 index 00000000000..a178f5b97e8 --- /dev/null +++ b/tests/baselines/reference/genericClassWithObjectTypeArgsAndConstraints.symbols @@ -0,0 +1,228 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericClassWithObjectTypeArgsAndConstraints.ts === +// Generic call with constraints infering type parameter from object member properties +// No errors expected + +class C { +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 3, 9)) +} + +class D { +>D : Symbol(D, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + x: string; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 7, 9)) + + y: string; +>y : Symbol(y, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 8, 14)) +} + +class X { +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 12, 8)) + + x: T; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 12, 12)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 12, 8)) +} + +module Class { +>Class : Symbol(Class, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 14, 1)) + + class G { +>G : Symbol(G, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 16, 14)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 12)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 23)) + + foo(t: X, t2: X) { +>foo : Symbol(foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 38)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 12)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 23)) +>t : Symbol(t, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 37)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 12)) +>t2 : Symbol(t2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 45)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 12)) + + var x: T; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 19, 15)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 18, 12)) + + return x; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 19, 15)) + } + } + + var c1 = new X(); +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + var d1 = new X(); +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 25, 7)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>D : Symbol(D, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + var g: G<{ x: string; y: string }>; +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 26, 7)) +>G : Symbol(G, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 16, 14)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 26, 14)) +>y : Symbol(y, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 26, 25)) + + var r = g.foo(c1, d1); +>r : Symbol(r, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 27, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 37, 7)) +>g.foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 38)) +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 26, 7)) +>foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 38)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 25, 7)) + + var r2 = g.foo(c1, c1); +>r2 : Symbol(r2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 28, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 38, 7)) +>g.foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 38)) +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 26, 7)) +>foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 17, 38)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) + + class G2 { +>G2 : Symbol(G2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 28, 27)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 13)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + foo2(t: X, t2: X) { +>foo2 : Symbol(foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 27)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 13)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) +>t : Symbol(t, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 26)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 13)) +>t2 : Symbol(t2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 34)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 13)) + + var x: T; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 32, 15)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 31, 13)) + + return x; +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 32, 15)) + } + } + var g2: G2; +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 36, 7)) +>G2 : Symbol(G2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 28, 27)) +>D : Symbol(D, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + var r = g2.foo2(c1, d1); +>r : Symbol(r, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 27, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 37, 7)) +>g2.foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 27)) +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 36, 7)) +>foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 27)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 25, 7)) + + var r2 = g2.foo2(c1, c1); +>r2 : Symbol(r2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 28, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 38, 7)) +>g2.foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 27)) +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 36, 7)) +>foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 30, 27)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 24, 7)) +} + +module Interface { +>Interface : Symbol(Interface, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 39, 1)) + + interface G { +>G : Symbol(G, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 41, 18)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 16)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 27)) + + foo(t: X, t2: X): T; +>foo : Symbol(foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 42)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 12)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 23)) +>t : Symbol(t, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 37)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 12)) +>t2 : Symbol(t2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 45)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 12)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 43, 12)) + } + + var c1 = new X(); +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + var d1 = new X(); +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 47, 7)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>D : Symbol(D, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + var g: G<{ x: string; y: string }>; +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 48, 7)) +>G : Symbol(G, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 41, 18)) +>x : Symbol(x, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 48, 14)) +>y : Symbol(y, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 48, 25)) + + var r = g.foo(c1, d1); +>r : Symbol(r, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 49, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 57, 7)) +>g.foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 42)) +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 48, 7)) +>foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 42)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 47, 7)) + + var r2 = g.foo(c1, c1); +>r2 : Symbol(r2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 50, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 58, 7)) +>g.foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 42)) +>g : Symbol(g, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 48, 7)) +>foo : Symbol(G.foo, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 42, 42)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) + + interface G2 { +>G2 : Symbol(G2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 50, 27)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 17)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) + + foo2(t: X, t2: X): T; +>foo2 : Symbol(foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 31)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 13)) +>C : Symbol(C, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 0, 0)) +>t : Symbol(t, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 26)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 13)) +>t2 : Symbol(t2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 34)) +>X : Symbol(X, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 13)) +>T : Symbol(T, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 53, 13)) + } + + var g2: G2; +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 56, 7)) +>G2 : Symbol(G2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 50, 27)) +>D : Symbol(D, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 5, 1)) + + var r = g2.foo2(c1, d1); +>r : Symbol(r, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 49, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 57, 7)) +>g2.foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 31)) +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 56, 7)) +>foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 31)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +>d1 : Symbol(d1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 47, 7)) + + var r2 = g2.foo2(c1, c1); +>r2 : Symbol(r2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 50, 7), Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 58, 7)) +>g2.foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 31)) +>g2 : Symbol(g2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 56, 7)) +>foo2 : Symbol(G2.foo2, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 52, 31)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +>c1 : Symbol(c1, Decl(genericClassWithObjectTypeArgsAndConstraints.ts, 46, 7)) +} diff --git a/tests/baselines/reference/genericClassWithStaticFactory.symbols b/tests/baselines/reference/genericClassWithStaticFactory.symbols new file mode 100644 index 00000000000..37ee9c638e9 --- /dev/null +++ b/tests/baselines/reference/genericClassWithStaticFactory.symbols @@ -0,0 +1,548 @@ +=== tests/cases/compiler/genericClassWithStaticFactory.ts === +module Editor { +>Editor : Symbol(Editor, Decl(genericClassWithStaticFactory.ts, 0, 0)) + + export class List { +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + public next: List; +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + public prev: List; +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + private listFactory: ListFactory; +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>ListFactory : Symbol(ListFactory, Decl(genericClassWithStaticFactory.ts, 106, 5)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + constructor(public isHead: boolean, public data: T) { +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 7, 43)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + this.listFactory = new ListFactory(); +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>ListFactory : Symbol(ListFactory, Decl(genericClassWithStaticFactory.ts, 106, 5)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + } + + public add(data: T): List { +>add : Symbol(add, Decl(genericClassWithStaticFactory.ts, 10, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 12, 19)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + var entry = this.listFactory.MakeEntry(data); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) +>this.listFactory.MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 12, 19)) + + this.prev.next = entry; +>this.prev.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) + + entry.next = this; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + entry.prev = this.prev; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) + + this.prev = entry; +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 13, 15)) + } + + public count(): number { +>count : Symbol(count, Decl(genericClassWithStaticFactory.ts, 20, 9)) + + var entry: List; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 23, 15)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + var i: number; +>i : Symbol(i, Decl(genericClassWithStaticFactory.ts, 24, 15)) + + entry = this.next; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 23, 15)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + + for (i = 0; !(entry.isHead); i++) { +>i : Symbol(i, Decl(genericClassWithStaticFactory.ts, 24, 15)) +>entry.isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 23, 15)) +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>i : Symbol(i, Decl(genericClassWithStaticFactory.ts, 24, 15)) + + entry = entry.next; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 23, 15)) +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 23, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + } + + return (i); +>i : Symbol(i, Decl(genericClassWithStaticFactory.ts, 24, 15)) + } + + public isEmpty(): boolean { +>isEmpty : Symbol(isEmpty, Decl(genericClassWithStaticFactory.ts, 32, 9)) + + return (this.next == this); +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + } + + public first(): T { +>first : Symbol(first, Decl(genericClassWithStaticFactory.ts, 36, 9)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + if (this.isEmpty()) +>this.isEmpty : Symbol(isEmpty, Decl(genericClassWithStaticFactory.ts, 32, 9)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>isEmpty : Symbol(isEmpty, Decl(genericClassWithStaticFactory.ts, 32, 9)) + { + return this.next.data; +>this.next.data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 7, 43)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 7, 43)) + } + else { + return null; + } + } + + public pushEntry(entry: List): void { +>pushEntry : Symbol(pushEntry, Decl(genericClassWithStaticFactory.ts, 46, 9)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + entry.isHead = false; +>entry.isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) + + entry.next = this.next; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + + entry.prev = this; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + this.next = entry; +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) + + entry.next.prev = entry; // entry.next.prev does not show intellisense, but entry.prev.prev does +>entry.next.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 48, 25)) + } + + public push(data: T): void { +>push : Symbol(push, Decl(genericClassWithStaticFactory.ts, 54, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 56, 20)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + var entry = this.listFactory.MakeEntry(data); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>this.listFactory.MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 56, 20)) + + entry.data = data; +>entry.data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 7, 43)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 7, 43)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 56, 20)) + + entry.isHead = false; +>entry.isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) + + entry.next = this.next; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + + entry.prev = this; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + this.next = entry; +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) + + entry.next.prev = entry; // entry.next.prev does not show intellisense, but entry.prev.prev does +>entry.next.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 57, 15)) + } + + public popEntry(head: List): List { +>popEntry : Symbol(popEntry, Decl(genericClassWithStaticFactory.ts, 64, 9)) +>head : Symbol(head, Decl(genericClassWithStaticFactory.ts, 66, 24)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + if (this.next.isHead) { +>this.next.isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) + + return null; + } + else { + return this.listFactory.RemoveEntry(this.next); +>this.listFactory.RemoveEntry : Symbol(ListFactory.RemoveEntry, Decl(genericClassWithStaticFactory.ts, 122, 9)) +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>RemoveEntry : Symbol(ListFactory.RemoveEntry, Decl(genericClassWithStaticFactory.ts, 122, 9)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + } + } + + public insertEntry(entry: List): List { +>insertEntry : Symbol(insertEntry, Decl(genericClassWithStaticFactory.ts, 73, 9)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + entry.isHead = false; +>entry.isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) +>isHead : Symbol(isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) + + this.prev.next = entry; +>this.prev.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) + + entry.next = this; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + entry.prev = this.prev; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) + + this.prev = entry; +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 75, 27)) + } + + public insertAfter(data: T): List { +>insertAfter : Symbol(insertAfter, Decl(genericClassWithStaticFactory.ts, 82, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 84, 27)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + var entry: List = this.listFactory.MakeEntry(data); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>this.listFactory.MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 84, 27)) + + entry.next = this.next; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + + entry.prev = this; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + this.next = entry; +>this.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) + + entry.next.prev = entry;// entry.next.prev does not show intellisense, but entry.prev.prev does +>entry.next.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 85, 15)) + } + + public insertEntryBefore(entry: List): List { +>insertEntryBefore : Symbol(insertEntryBefore, Decl(genericClassWithStaticFactory.ts, 91, 9)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + this.prev.next = entry; +>this.prev.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) + + entry.next = this; +>entry.next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) +>next : Symbol(next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) + + entry.prev = this.prev; +>entry.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) + + this.prev = entry; +>this.prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>prev : Symbol(prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 93, 33)) + } + + public insertBefore(data: T): List { +>insertBefore : Symbol(insertBefore, Decl(genericClassWithStaticFactory.ts, 100, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 102, 28)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 2, 22)) + + var entry = this.listFactory.MakeEntry(data); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 103, 15)) +>this.listFactory.MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>this.listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>listFactory : Symbol(listFactory, Decl(genericClassWithStaticFactory.ts, 4, 29)) +>MakeEntry : Symbol(ListFactory.MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 102, 28)) + + return this.insertEntryBefore(entry); +>this.insertEntryBefore : Symbol(insertEntryBefore, Decl(genericClassWithStaticFactory.ts, 91, 9)) +>this : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>insertEntryBefore : Symbol(insertEntryBefore, Decl(genericClassWithStaticFactory.ts, 91, 9)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 103, 15)) + } + } + + export class ListFactory { +>ListFactory : Symbol(ListFactory, Decl(genericClassWithStaticFactory.ts, 106, 5)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 108, 29)) + + public MakeHead(): List { +>MakeHead : Symbol(MakeHead, Decl(genericClassWithStaticFactory.ts, 108, 33)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 110, 24)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 110, 24)) + + var entry: List = new List(true, null); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 110, 24)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 110, 24)) + + entry.prev = entry; +>entry.prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) +>prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) + + entry.next = entry; +>entry.next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) +>next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 111, 15)) + } + + public MakeEntry(data: T): List { +>MakeEntry : Symbol(MakeEntry, Decl(genericClassWithStaticFactory.ts, 115, 9)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 117, 25)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 117, 28)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 117, 25)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 117, 25)) + + var entry: List = new List(false, data); +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 117, 25)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 117, 25)) +>data : Symbol(data, Decl(genericClassWithStaticFactory.ts, 117, 28)) + + entry.prev = entry; +>entry.prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) +>prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) + + entry.next = entry; +>entry.next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) +>next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 118, 15)) + } + + public RemoveEntry(entry: List): List { +>RemoveEntry : Symbol(RemoveEntry, Decl(genericClassWithStaticFactory.ts, 122, 9)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 124, 27)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 124, 27)) +>List : Symbol(List, Decl(genericClassWithStaticFactory.ts, 0, 15)) +>T : Symbol(T, Decl(genericClassWithStaticFactory.ts, 124, 27)) + + if (entry == null) { +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) + + return null; + } + else if (entry.isHead) { +>entry.isHead : Symbol(List.isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>isHead : Symbol(List.isHead, Decl(genericClassWithStaticFactory.ts, 7, 20)) + + // Can't remove the head of a list! + return null; + } + else { + entry.next.prev = entry.prev; +>entry.next.prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry.next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry.prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) + + entry.prev.next = entry.next; +>entry.prev.next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry.prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>prev : Symbol(List.prev, Decl(genericClassWithStaticFactory.ts, 3, 29)) +>next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry.next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) +>next : Symbol(List.next, Decl(genericClassWithStaticFactory.ts, 2, 26)) + + return entry; +>entry : Symbol(entry, Decl(genericClassWithStaticFactory.ts, 124, 30)) + } + } + } +} diff --git a/tests/baselines/reference/genericClassWithStaticFactory.types b/tests/baselines/reference/genericClassWithStaticFactory.types index b0df737ee68..34d0c4aeaae 100644 --- a/tests/baselines/reference/genericClassWithStaticFactory.types +++ b/tests/baselines/reference/genericClassWithStaticFactory.types @@ -111,6 +111,7 @@ module Editor { for (i = 0; !(entry.isHead); i++) { >i = 0 : number >i : number +>0 : number >!(entry.isHead) : boolean >(entry.isHead) : boolean >entry.isHead : boolean @@ -163,6 +164,7 @@ module Editor { } else { return null; +>null : null } } @@ -177,6 +179,7 @@ module Editor { >entry.isHead : boolean >entry : List >isHead : boolean +>false : boolean entry.next = this.next; >entry.next = this.next : List @@ -238,6 +241,7 @@ module Editor { >entry.isHead : boolean >entry : List >isHead : boolean +>false : boolean entry.next = this.next; >entry.next = this.next : List @@ -288,6 +292,7 @@ module Editor { >isHead : boolean return null; +>null : null } else { return this.listFactory.RemoveEntry(this.next); @@ -316,6 +321,7 @@ module Editor { >entry.isHead : boolean >entry : List >isHead : boolean +>false : boolean this.prev.next = entry; >this.prev.next = entry : List @@ -495,6 +501,8 @@ module Editor { >new List(true, null) : List >List : typeof List >T : T +>true : boolean +>null : null entry.prev = entry; >entry.prev = entry : List @@ -529,6 +537,7 @@ module Editor { >new List(false, data) : List >List : typeof List >T : T +>false : boolean >data : T entry.prev = entry; @@ -561,8 +570,10 @@ module Editor { if (entry == null) { >entry == null : boolean >entry : List +>null : null return null; +>null : null } else if (entry.isHead) { >entry.isHead : boolean @@ -571,6 +582,7 @@ module Editor { // Can't remove the head of a list! return null; +>null : null } else { entry.next.prev = entry.prev; diff --git a/tests/baselines/reference/genericClasses0.symbols b/tests/baselines/reference/genericClasses0.symbols new file mode 100644 index 00000000000..764cd04c962 --- /dev/null +++ b/tests/baselines/reference/genericClasses0.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericClasses0.ts === +class C { +>C : Symbol(C, Decl(genericClasses0.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses0.ts, 0, 8)) + + public x: T; +>x : Symbol(x, Decl(genericClasses0.ts, 0, 12)) +>T : Symbol(T, Decl(genericClasses0.ts, 0, 8)) +} + +var v1 : C; +>v1 : Symbol(v1, Decl(genericClasses0.ts, 4, 3)) +>C : Symbol(C, Decl(genericClasses0.ts, 0, 0)) + +var y = v1.x; // should be 'string' +>y : Symbol(y, Decl(genericClasses0.ts, 6, 3)) +>v1.x : Symbol(C.x, Decl(genericClasses0.ts, 0, 12)) +>v1 : Symbol(v1, Decl(genericClasses0.ts, 4, 3)) +>x : Symbol(C.x, Decl(genericClasses0.ts, 0, 12)) + diff --git a/tests/baselines/reference/genericClasses1.symbols b/tests/baselines/reference/genericClasses1.symbols new file mode 100644 index 00000000000..d2100b5e3b3 --- /dev/null +++ b/tests/baselines/reference/genericClasses1.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericClasses1.ts === +class C { +>C : Symbol(C, Decl(genericClasses1.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses1.ts, 0, 8)) + + public x: T; +>x : Symbol(x, Decl(genericClasses1.ts, 0, 12)) +>T : Symbol(T, Decl(genericClasses1.ts, 0, 8)) +} + +var v1 = new C(); +>v1 : Symbol(v1, Decl(genericClasses1.ts, 4, 3)) +>C : Symbol(C, Decl(genericClasses1.ts, 0, 0)) + +var y = v1.x; // should be 'string' +>y : Symbol(y, Decl(genericClasses1.ts, 6, 3)) +>v1.x : Symbol(C.x, Decl(genericClasses1.ts, 0, 12)) +>v1 : Symbol(v1, Decl(genericClasses1.ts, 4, 3)) +>x : Symbol(C.x, Decl(genericClasses1.ts, 0, 12)) + diff --git a/tests/baselines/reference/genericClasses2.symbols b/tests/baselines/reference/genericClasses2.symbols new file mode 100644 index 00000000000..e9af0c44941 --- /dev/null +++ b/tests/baselines/reference/genericClasses2.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/genericClasses2.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(genericClasses2.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses2.ts, 0, 14)) + + a: T; +>a : Symbol(a, Decl(genericClasses2.ts, 0, 18)) +>T : Symbol(T, Decl(genericClasses2.ts, 0, 14)) +} + +class C { +>C : Symbol(C, Decl(genericClasses2.ts, 2, 1)) +>T : Symbol(T, Decl(genericClasses2.ts, 4, 8)) + + public x: T; +>x : Symbol(x, Decl(genericClasses2.ts, 4, 12)) +>T : Symbol(T, Decl(genericClasses2.ts, 4, 8)) + + public y: Foo; +>y : Symbol(y, Decl(genericClasses2.ts, 5, 13)) +>Foo : Symbol(Foo, Decl(genericClasses2.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses2.ts, 4, 8)) + + public z: Foo; +>z : Symbol(z, Decl(genericClasses2.ts, 6, 18)) +>Foo : Symbol(Foo, Decl(genericClasses2.ts, 0, 0)) +} + +var v1 : C; +>v1 : Symbol(v1, Decl(genericClasses2.ts, 10, 3)) +>C : Symbol(C, Decl(genericClasses2.ts, 2, 1)) + +var y = v1.x; // should be 'string' +>y : Symbol(y, Decl(genericClasses2.ts, 12, 3)) +>v1.x : Symbol(C.x, Decl(genericClasses2.ts, 4, 12)) +>v1 : Symbol(v1, Decl(genericClasses2.ts, 10, 3)) +>x : Symbol(C.x, Decl(genericClasses2.ts, 4, 12)) + +var w = v1.y.a; // should be 'string' +>w : Symbol(w, Decl(genericClasses2.ts, 13, 3)) +>v1.y.a : Symbol(Foo.a, Decl(genericClasses2.ts, 0, 18)) +>v1.y : Symbol(C.y, Decl(genericClasses2.ts, 5, 13)) +>v1 : Symbol(v1, Decl(genericClasses2.ts, 10, 3)) +>y : Symbol(C.y, Decl(genericClasses2.ts, 5, 13)) +>a : Symbol(Foo.a, Decl(genericClasses2.ts, 0, 18)) + +var z = v1.z.a; // should be 'number' +>z : Symbol(z, Decl(genericClasses2.ts, 14, 3)) +>v1.z.a : Symbol(Foo.a, Decl(genericClasses2.ts, 0, 18)) +>v1.z : Symbol(C.z, Decl(genericClasses2.ts, 6, 18)) +>v1 : Symbol(v1, Decl(genericClasses2.ts, 10, 3)) +>z : Symbol(C.z, Decl(genericClasses2.ts, 6, 18)) +>a : Symbol(Foo.a, Decl(genericClasses2.ts, 0, 18)) + diff --git a/tests/baselines/reference/genericClasses3.symbols b/tests/baselines/reference/genericClasses3.symbols new file mode 100644 index 00000000000..06b0d8437d5 --- /dev/null +++ b/tests/baselines/reference/genericClasses3.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/genericClasses3.ts === +class B { +>B : Symbol(B, Decl(genericClasses3.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses3.ts, 0, 8)) + + a: T; +>a : Symbol(a, Decl(genericClasses3.ts, 0, 12)) +>T : Symbol(T, Decl(genericClasses3.ts, 0, 8)) + + b: T; +>b : Symbol(b, Decl(genericClasses3.ts, 1, 9)) +>T : Symbol(T, Decl(genericClasses3.ts, 0, 8)) +} + +class C extends B { +>C : Symbol(C, Decl(genericClasses3.ts, 3, 1)) +>T : Symbol(T, Decl(genericClasses3.ts, 5, 8)) +>B : Symbol(B, Decl(genericClasses3.ts, 0, 0)) +>T : Symbol(T, Decl(genericClasses3.ts, 5, 8)) + + public x: T; +>x : Symbol(x, Decl(genericClasses3.ts, 5, 25)) +>T : Symbol(T, Decl(genericClasses3.ts, 5, 8)) +} + +var v2: C ; +>v2 : Symbol(v2, Decl(genericClasses3.ts, 9, 3)) +>C : Symbol(C, Decl(genericClasses3.ts, 3, 1)) + +var y = v2.x; // should be 'string' +>y : Symbol(y, Decl(genericClasses3.ts, 11, 3)) +>v2.x : Symbol(C.x, Decl(genericClasses3.ts, 5, 25)) +>v2 : Symbol(v2, Decl(genericClasses3.ts, 9, 3)) +>x : Symbol(C.x, Decl(genericClasses3.ts, 5, 25)) + +var u = v2.a; // should be 'string' +>u : Symbol(u, Decl(genericClasses3.ts, 12, 3)) +>v2.a : Symbol(B.a, Decl(genericClasses3.ts, 0, 12)) +>v2 : Symbol(v2, Decl(genericClasses3.ts, 9, 3)) +>a : Symbol(B.a, Decl(genericClasses3.ts, 0, 12)) + +var z = v2.b; +>z : Symbol(z, Decl(genericClasses3.ts, 14, 3)) +>v2.b : Symbol(B.b, Decl(genericClasses3.ts, 1, 9)) +>v2 : Symbol(v2, Decl(genericClasses3.ts, 9, 3)) +>b : Symbol(B.b, Decl(genericClasses3.ts, 1, 9)) + + diff --git a/tests/baselines/reference/genericClasses4.symbols b/tests/baselines/reference/genericClasses4.symbols new file mode 100644 index 00000000000..d910cbc152d --- /dev/null +++ b/tests/baselines/reference/genericClasses4.symbols @@ -0,0 +1,92 @@ +=== tests/cases/compiler/genericClasses4.ts === +// once caused stack overflow +class Vec2_T +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>A : Symbol(A, Decl(genericClasses4.ts, 1, 13)) +{ + constructor(public x: A, public y: A) { } +>x : Symbol(x, Decl(genericClasses4.ts, 3, 16)) +>A : Symbol(A, Decl(genericClasses4.ts, 1, 13)) +>y : Symbol(y, Decl(genericClasses4.ts, 3, 28)) +>A : Symbol(A, Decl(genericClasses4.ts, 1, 13)) + + fmap(f: (a: A) => B): Vec2_T { +>fmap : Symbol(fmap, Decl(genericClasses4.ts, 3, 45)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) +>f : Symbol(f, Decl(genericClasses4.ts, 4, 12)) +>a : Symbol(a, Decl(genericClasses4.ts, 4, 16)) +>A : Symbol(A, Decl(genericClasses4.ts, 1, 13)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) + + var x:B = f(this.x); +>x : Symbol(x, Decl(genericClasses4.ts, 5, 11)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) +>f : Symbol(f, Decl(genericClasses4.ts, 4, 12)) +>this.x : Symbol(x, Decl(genericClasses4.ts, 3, 16)) +>this : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>x : Symbol(x, Decl(genericClasses4.ts, 3, 16)) + + var y:B = f(this.y); +>y : Symbol(y, Decl(genericClasses4.ts, 6, 11)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) +>f : Symbol(f, Decl(genericClasses4.ts, 4, 12)) +>this.y : Symbol(y, Decl(genericClasses4.ts, 3, 28)) +>this : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>y : Symbol(y, Decl(genericClasses4.ts, 3, 28)) + + var retval: Vec2_T = new Vec2_T(x, y); +>retval : Symbol(retval, Decl(genericClasses4.ts, 7, 11)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>B : Symbol(B, Decl(genericClasses4.ts, 4, 9)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>x : Symbol(x, Decl(genericClasses4.ts, 5, 11)) +>y : Symbol(y, Decl(genericClasses4.ts, 6, 11)) + + return retval; +>retval : Symbol(retval, Decl(genericClasses4.ts, 7, 11)) + } + apply(f: Vec2_T<(a: A) => B>): Vec2_T { +>apply : Symbol(apply, Decl(genericClasses4.ts, 9, 5)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) +>f : Symbol(f, Decl(genericClasses4.ts, 10, 13)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>a : Symbol(a, Decl(genericClasses4.ts, 10, 24)) +>A : Symbol(A, Decl(genericClasses4.ts, 1, 13)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) + + var x:B = f.x(this.x); +>x : Symbol(x, Decl(genericClasses4.ts, 11, 11)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) +>f.x : Symbol(Vec2_T.x, Decl(genericClasses4.ts, 3, 16)) +>f : Symbol(f, Decl(genericClasses4.ts, 10, 13)) +>x : Symbol(Vec2_T.x, Decl(genericClasses4.ts, 3, 16)) +>this.x : Symbol(x, Decl(genericClasses4.ts, 3, 16)) +>this : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>x : Symbol(x, Decl(genericClasses4.ts, 3, 16)) + + var y:B = f.y(this.y); +>y : Symbol(y, Decl(genericClasses4.ts, 12, 11)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) +>f.y : Symbol(Vec2_T.y, Decl(genericClasses4.ts, 3, 28)) +>f : Symbol(f, Decl(genericClasses4.ts, 10, 13)) +>y : Symbol(Vec2_T.y, Decl(genericClasses4.ts, 3, 28)) +>this.y : Symbol(y, Decl(genericClasses4.ts, 3, 28)) +>this : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>y : Symbol(y, Decl(genericClasses4.ts, 3, 28)) + + var retval: Vec2_T = new Vec2_T(x, y); +>retval : Symbol(retval, Decl(genericClasses4.ts, 13, 11)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>B : Symbol(B, Decl(genericClasses4.ts, 10, 10)) +>Vec2_T : Symbol(Vec2_T, Decl(genericClasses4.ts, 0, 0)) +>x : Symbol(x, Decl(genericClasses4.ts, 11, 11)) +>y : Symbol(y, Decl(genericClasses4.ts, 12, 11)) + + return retval; +>retval : Symbol(retval, Decl(genericClasses4.ts, 13, 11)) + } +} diff --git a/tests/baselines/reference/genericClassesInModule.symbols b/tests/baselines/reference/genericClassesInModule.symbols new file mode 100644 index 00000000000..f097eac36f1 --- /dev/null +++ b/tests/baselines/reference/genericClassesInModule.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/genericClassesInModule.ts === + +module Foo { +>Foo : Symbol(Foo, Decl(genericClassesInModule.ts, 0, 0)) + + export class B{ } +>B : Symbol(B, Decl(genericClassesInModule.ts, 1, 12)) +>T : Symbol(T, Decl(genericClassesInModule.ts, 3, 19)) + + export class A { } +>A : Symbol(A, Decl(genericClassesInModule.ts, 3, 24)) +} + +var a = new Foo.B(); +>a : Symbol(a, Decl(genericClassesInModule.ts, 8, 3)) +>Foo.B : Symbol(Foo.B, Decl(genericClassesInModule.ts, 1, 12)) +>Foo : Symbol(Foo, Decl(genericClassesInModule.ts, 0, 0)) +>B : Symbol(Foo.B, Decl(genericClassesInModule.ts, 1, 12)) +>Foo : Symbol(Foo, Decl(genericClassesInModule.ts, 0, 0)) +>A : Symbol(Foo.A, Decl(genericClassesInModule.ts, 3, 24)) + diff --git a/tests/baselines/reference/genericClassesInModule.types b/tests/baselines/reference/genericClassesInModule.types index 8c25523803c..128decac570 100644 --- a/tests/baselines/reference/genericClassesInModule.types +++ b/tests/baselines/reference/genericClassesInModule.types @@ -17,6 +17,6 @@ var a = new Foo.B(); >Foo.B : typeof Foo.B >Foo : typeof Foo >B : typeof Foo.B ->Foo : unknown +>Foo : any >A : Foo.A diff --git a/tests/baselines/reference/genericClassesInModule2.symbols b/tests/baselines/reference/genericClassesInModule2.symbols new file mode 100644 index 00000000000..a767d64de07 --- /dev/null +++ b/tests/baselines/reference/genericClassesInModule2.symbols @@ -0,0 +1,61 @@ +=== tests/cases/compiler/genericClassesInModule2.ts === +export class A{ +>A : Symbol(A, Decl(genericClassesInModule2.ts, 0, 0)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 0, 15)) + + constructor( public callback: (self: A) => void) { +>callback : Symbol(callback, Decl(genericClassesInModule2.ts, 1, 16)) +>self : Symbol(self, Decl(genericClassesInModule2.ts, 1, 35)) +>A : Symbol(A, Decl(genericClassesInModule2.ts, 0, 0)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 0, 15)) + + var child = new B(this); +>child : Symbol(child, Decl(genericClassesInModule2.ts, 2, 11)) +>B : Symbol(B, Decl(genericClassesInModule2.ts, 13, 1)) +>this : Symbol(A, Decl(genericClassesInModule2.ts, 0, 0)) + } + AAA( callback: (self: A) => void) { +>AAA : Symbol(AAA, Decl(genericClassesInModule2.ts, 3, 5)) +>callback : Symbol(callback, Decl(genericClassesInModule2.ts, 4, 8)) +>self : Symbol(self, Decl(genericClassesInModule2.ts, 4, 20)) +>A : Symbol(A, Decl(genericClassesInModule2.ts, 0, 0)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 0, 15)) + + var child = new B(this); +>child : Symbol(child, Decl(genericClassesInModule2.ts, 5, 11)) +>B : Symbol(B, Decl(genericClassesInModule2.ts, 13, 1)) +>this : Symbol(A, Decl(genericClassesInModule2.ts, 0, 0)) + } +} + +export interface C{ +>C : Symbol(C, Decl(genericClassesInModule2.ts, 7, 1)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 9, 19)) + + child: B; +>child : Symbol(child, Decl(genericClassesInModule2.ts, 9, 23)) +>B : Symbol(B, Decl(genericClassesInModule2.ts, 13, 1)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 9, 19)) + + (self: C): void; +>self : Symbol(self, Decl(genericClassesInModule2.ts, 11, 5)) +>C : Symbol(C, Decl(genericClassesInModule2.ts, 7, 1)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 9, 19)) + + new(callback: (self: C) => void) +>callback : Symbol(callback, Decl(genericClassesInModule2.ts, 12, 8)) +>self : Symbol(self, Decl(genericClassesInModule2.ts, 12, 19)) +>C : Symbol(C, Decl(genericClassesInModule2.ts, 7, 1)) +>T1 : Symbol(T1, Decl(genericClassesInModule2.ts, 9, 19)) +} + +export class B { +>B : Symbol(B, Decl(genericClassesInModule2.ts, 13, 1)) +>T2 : Symbol(T2, Decl(genericClassesInModule2.ts, 15, 15)) + + constructor(public parent: T2) { } +>parent : Symbol(parent, Decl(genericClassesInModule2.ts, 16, 16)) +>T2 : Symbol(T2, Decl(genericClassesInModule2.ts, 15, 15)) +} + + diff --git a/tests/baselines/reference/genericCloduleInModule.symbols b/tests/baselines/reference/genericCloduleInModule.symbols new file mode 100644 index 00000000000..0becc7469a1 --- /dev/null +++ b/tests/baselines/reference/genericCloduleInModule.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/genericCloduleInModule.ts === +module A { +>A : Symbol(A, Decl(genericCloduleInModule.ts, 0, 0)) + + export class B { +>B : Symbol(B, Decl(genericCloduleInModule.ts, 0, 10), Decl(genericCloduleInModule.ts, 4, 5)) +>T : Symbol(T, Decl(genericCloduleInModule.ts, 1, 19)) + + foo() { } +>foo : Symbol(foo, Decl(genericCloduleInModule.ts, 1, 23)) + + static bar() { } +>bar : Symbol(B.bar, Decl(genericCloduleInModule.ts, 2, 17)) + } + export module B { +>B : Symbol(B, Decl(genericCloduleInModule.ts, 0, 10), Decl(genericCloduleInModule.ts, 4, 5)) + + export var x = 1; +>x : Symbol(x, Decl(genericCloduleInModule.ts, 6, 18)) + } +} + +var b: A.B; +>b : Symbol(b, Decl(genericCloduleInModule.ts, 10, 3)) +>A : Symbol(A, Decl(genericCloduleInModule.ts, 0, 0)) +>B : Symbol(A.B, Decl(genericCloduleInModule.ts, 0, 10), Decl(genericCloduleInModule.ts, 4, 5)) + +b.foo(); +>b.foo : Symbol(A.B.foo, Decl(genericCloduleInModule.ts, 1, 23)) +>b : Symbol(b, Decl(genericCloduleInModule.ts, 10, 3)) +>foo : Symbol(A.B.foo, Decl(genericCloduleInModule.ts, 1, 23)) + diff --git a/tests/baselines/reference/genericCloduleInModule.types b/tests/baselines/reference/genericCloduleInModule.types index 108dc34c2f7..3ae3a8cf06d 100644 --- a/tests/baselines/reference/genericCloduleInModule.types +++ b/tests/baselines/reference/genericCloduleInModule.types @@ -17,12 +17,13 @@ module A { export var x = 1; >x : number +>1 : number } } var b: A.B; >b : A.B ->A : unknown +>A : any >B : A.B b.foo(); diff --git a/tests/baselines/reference/genericConstraintDeclaration.symbols b/tests/baselines/reference/genericConstraintDeclaration.symbols new file mode 100644 index 00000000000..0b962f08b70 --- /dev/null +++ b/tests/baselines/reference/genericConstraintDeclaration.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/genericConstraintDeclaration.ts === +class List{ +>List : Symbol(List, Decl(genericConstraintDeclaration.ts, 0, 0)) +>T : Symbol(T, Decl(genericConstraintDeclaration.ts, 0, 11)) + + static empty(): List{return null;} +>empty : Symbol(List.empty, Decl(genericConstraintDeclaration.ts, 0, 25)) +>T : Symbol(T, Decl(genericConstraintDeclaration.ts, 1, 17)) +>List : Symbol(List, Decl(genericConstraintDeclaration.ts, 0, 0)) +>T : Symbol(T, Decl(genericConstraintDeclaration.ts, 1, 17)) +} + + + + + diff --git a/tests/baselines/reference/genericConstraintDeclaration.types b/tests/baselines/reference/genericConstraintDeclaration.types index 126da138d4e..aaa7d1de77a 100644 --- a/tests/baselines/reference/genericConstraintDeclaration.types +++ b/tests/baselines/reference/genericConstraintDeclaration.types @@ -8,6 +8,7 @@ class List{ >T : T >List : List >T : T +>null : null } diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.symbols b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.symbols new file mode 100644 index 00000000000..3ce4f709b7d --- /dev/null +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/genericConstraintOnExtendedBuiltinTypes.ts === +declare module EndGate { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 17, 1)) + + export interface ICloneable { +>ICloneable : Symbol(ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 24)) + + Clone(): any; +>Clone : Symbol(Clone, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 1, 33)) + } +} + +interface Number extends EndGate.ICloneable { } +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 4, 1)) +>EndGate.ICloneable : Symbol(EndGate.ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 24)) +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 17, 1)) +>ICloneable : Symbol(EndGate.ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 24)) + +module EndGate.Tweening { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 17, 1)) +>Tweening : Symbol(Tweening, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 15), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 19, 15)) + + export class Tween{ +>Tween : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 25)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 23)) +>ICloneable : Symbol(ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 24)) + + private _from: T; +>_from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 45)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 23)) + + + constructor(from: T) { +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 13, 20)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 23)) + + this._from = from.Clone(); +>this._from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 45)) +>this : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 25)) +>_from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 9, 45)) +>from.Clone : Symbol(ICloneable.Clone, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 1, 33)) +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 13, 20)) +>Clone : Symbol(ICloneable.Clone, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 1, 33)) + } + } +} + +module EndGate.Tweening { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 17, 1)) +>Tweening : Symbol(Tweening, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 15), Decl(genericConstraintOnExtendedBuiltinTypes.ts, 19, 15)) + + export class NumberTween extends Tween{ +>NumberTween : Symbol(NumberTween, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 19, 25)) +>Tween : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 25)) + + constructor(from: number) { +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 21, 20)) + + super(from); +>super : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 8, 25)) +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes.ts, 21, 20)) + } + } +} diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types index eadf43d226a..f1041cfa80f 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.types @@ -12,6 +12,7 @@ declare module EndGate { interface Number extends EndGate.ICloneable { } >Number : Number +>EndGate.ICloneable : any >EndGate : typeof EndGate >ICloneable : EndGate.ICloneable diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.symbols b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.symbols new file mode 100644 index 00000000000..be96d92c357 --- /dev/null +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/genericConstraintOnExtendedBuiltinTypes2.ts === +module EndGate { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 16, 1)) + + export interface ICloneable { +>ICloneable : Symbol(ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 16)) + + Clone(): any; +>Clone : Symbol(Clone, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 1, 33)) + } +} + +interface Number extends EndGate.ICloneable { } +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 4, 1)) +>EndGate.ICloneable : Symbol(EndGate.ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 16)) +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 16, 1)) +>ICloneable : Symbol(EndGate.ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 16)) + +module EndGate.Tweening { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 16, 1)) +>Tweening : Symbol(Tweening, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 15), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 18, 15)) + + export class Tween{ +>Tween : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 25)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 23)) +>ICloneable : Symbol(ICloneable, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 16)) + + private _from: T; +>_from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 45)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 23)) + + constructor(from: T) { +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 12, 20)) +>T : Symbol(T, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 23)) + + this._from = from.Clone(); +>this._from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 45)) +>this : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 25)) +>_from : Symbol(_from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 9, 45)) +>from.Clone : Symbol(ICloneable.Clone, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 1, 33)) +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 12, 20)) +>Clone : Symbol(ICloneable.Clone, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 1, 33)) + } + } +} + +module EndGate.Tweening { +>EndGate : Symbol(EndGate, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 0, 0), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 6, 47), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 16, 1)) +>Tweening : Symbol(Tweening, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 15), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 18, 15)) + + export class NumberTween extends Tween{ +>NumberTween : Symbol(NumberTween, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 18, 25)) +>Tween : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 25)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11), Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 4, 1)) + + constructor(from: number) { +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 20, 20)) + + super(from); +>super : Symbol(Tween, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 8, 25)) +>from : Symbol(from, Decl(genericConstraintOnExtendedBuiltinTypes2.ts, 20, 20)) + } + } +} diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types index 80e1a963d5f..92ffa7c5c03 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.types @@ -12,6 +12,7 @@ module EndGate { interface Number extends EndGate.ICloneable { } >Number : Number +>EndGate.ICloneable : any >EndGate : typeof EndGate >ICloneable : EndGate.ICloneable diff --git a/tests/baselines/reference/genericConstructSignatureInInterface.symbols b/tests/baselines/reference/genericConstructSignatureInInterface.symbols new file mode 100644 index 00000000000..18b5feee6ff --- /dev/null +++ b/tests/baselines/reference/genericConstructSignatureInInterface.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/genericConstructSignatureInInterface.ts === +interface C { +>C : Symbol(C, Decl(genericConstructSignatureInInterface.ts, 0, 0)) + + new (x: T); +>T : Symbol(T, Decl(genericConstructSignatureInInterface.ts, 1, 9)) +>x : Symbol(x, Decl(genericConstructSignatureInInterface.ts, 1, 12)) +>T : Symbol(T, Decl(genericConstructSignatureInInterface.ts, 1, 9)) +} + +var v: C; +>v : Symbol(v, Decl(genericConstructSignatureInInterface.ts, 4, 3)) +>C : Symbol(C, Decl(genericConstructSignatureInInterface.ts, 0, 0)) + +var r = new v(1); +>r : Symbol(r, Decl(genericConstructSignatureInInterface.ts, 5, 3)) +>v : Symbol(v, Decl(genericConstructSignatureInInterface.ts, 4, 3)) + diff --git a/tests/baselines/reference/genericConstructSignatureInInterface.types b/tests/baselines/reference/genericConstructSignatureInInterface.types index 5318edb5bf1..c6653a0d90d 100644 --- a/tests/baselines/reference/genericConstructSignatureInInterface.types +++ b/tests/baselines/reference/genericConstructSignatureInInterface.types @@ -16,4 +16,5 @@ var r = new v(1); >r : any >new v(1) : any >v : C +>1 : number diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.symbols b/tests/baselines/reference/genericContextualTypingSpecialization.symbols new file mode 100644 index 00000000000..05312d889c9 --- /dev/null +++ b/tests/baselines/reference/genericContextualTypingSpecialization.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/genericContextualTypingSpecialization.ts === +var b: number[]; +>b : Symbol(b, Decl(genericContextualTypingSpecialization.ts, 0, 3)) + +b.reduce((c, d) => c + d, 0); // should not error on '+' +>b.reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>b : Symbol(b, Decl(genericContextualTypingSpecialization.ts, 0, 3)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, 1129, 93), Decl(lib.d.ts, 1136, 120)) +>c : Symbol(c, Decl(genericContextualTypingSpecialization.ts, 1, 18)) +>d : Symbol(d, Decl(genericContextualTypingSpecialization.ts, 1, 20)) +>c : Symbol(c, Decl(genericContextualTypingSpecialization.ts, 1, 18)) +>d : Symbol(d, Decl(genericContextualTypingSpecialization.ts, 1, 20)) + diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.types b/tests/baselines/reference/genericContextualTypingSpecialization.types index 890da96c260..561370a6a32 100644 --- a/tests/baselines/reference/genericContextualTypingSpecialization.types +++ b/tests/baselines/reference/genericContextualTypingSpecialization.types @@ -13,4 +13,5 @@ b.reduce((c, d) => c + d, 0); // should not error on '+' >c + d : number >c : number >d : number +>0 : number diff --git a/tests/baselines/reference/genericFunctionHasFreshTypeArgs.symbols b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.symbols new file mode 100644 index 00000000000..0baf9eda80f --- /dev/null +++ b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/genericFunctionHasFreshTypeArgs.ts === +function f(p: (x: T) => void) { }; +>f : Symbol(f, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 0)) +>p : Symbol(p, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 11)) +>T : Symbol(T, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 15)) +>x : Symbol(x, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 18)) +>T : Symbol(T, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 15)) + +f(x => f(y => x = y)); +>f : Symbol(f, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 0)) +>x : Symbol(x, Decl(genericFunctionHasFreshTypeArgs.ts, 1, 2)) +>f : Symbol(f, Decl(genericFunctionHasFreshTypeArgs.ts, 0, 0)) +>y : Symbol(y, Decl(genericFunctionHasFreshTypeArgs.ts, 1, 9)) +>x : Symbol(x, Decl(genericFunctionHasFreshTypeArgs.ts, 1, 2)) +>y : Symbol(y, Decl(genericFunctionHasFreshTypeArgs.ts, 1, 9)) + diff --git a/tests/baselines/reference/genericFunctionSpecializations1.symbols b/tests/baselines/reference/genericFunctionSpecializations1.symbols new file mode 100644 index 00000000000..e3c21ea418b --- /dev/null +++ b/tests/baselines/reference/genericFunctionSpecializations1.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/genericFunctionSpecializations1.ts === +function foo3(test: string); // error +>foo3 : Symbol(foo3, Decl(genericFunctionSpecializations1.ts, 0, 0), Decl(genericFunctionSpecializations1.ts, 0, 31)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 0, 14)) +>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 0, 17)) + +function foo3(test: T) { } +>foo3 : Symbol(foo3, Decl(genericFunctionSpecializations1.ts, 0, 0), Decl(genericFunctionSpecializations1.ts, 0, 31)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 1, 14)) +>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 1, 17)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 1, 14)) + +function foo4(test: string); // valid +>foo4 : Symbol(foo4, Decl(genericFunctionSpecializations1.ts, 1, 29), Decl(genericFunctionSpecializations1.ts, 3, 31)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 3, 14)) +>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 3, 17)) + +function foo4(test: T) { } +>foo4 : Symbol(foo4, Decl(genericFunctionSpecializations1.ts, 1, 29), Decl(genericFunctionSpecializations1.ts, 3, 31)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 4, 14)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>test : Symbol(test, Decl(genericFunctionSpecializations1.ts, 4, 32)) +>T : Symbol(T, Decl(genericFunctionSpecializations1.ts, 4, 14)) + diff --git a/tests/baselines/reference/genericFunctions0.symbols b/tests/baselines/reference/genericFunctions0.symbols new file mode 100644 index 00000000000..50eab4fe7d3 --- /dev/null +++ b/tests/baselines/reference/genericFunctions0.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/genericFunctions0.ts === +function foo (x: T) { return x; } +>foo : Symbol(foo, Decl(genericFunctions0.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions0.ts, 0, 13)) +>x : Symbol(x, Decl(genericFunctions0.ts, 0, 18)) +>T : Symbol(T, Decl(genericFunctions0.ts, 0, 13)) +>x : Symbol(x, Decl(genericFunctions0.ts, 0, 18)) + +var x = foo(5); // 'x' should be number +>x : Symbol(x, Decl(genericFunctions0.ts, 2, 3)) +>foo : Symbol(foo, Decl(genericFunctions0.ts, 0, 0)) + diff --git a/tests/baselines/reference/genericFunctions0.types b/tests/baselines/reference/genericFunctions0.types index 045224a7aaa..aac759af092 100644 --- a/tests/baselines/reference/genericFunctions0.types +++ b/tests/baselines/reference/genericFunctions0.types @@ -10,4 +10,5 @@ var x = foo(5); // 'x' should be number >x : number >foo(5) : number >foo : (x: T) => T +>5 : number diff --git a/tests/baselines/reference/genericFunctions1.symbols b/tests/baselines/reference/genericFunctions1.symbols new file mode 100644 index 00000000000..6f4470492cd --- /dev/null +++ b/tests/baselines/reference/genericFunctions1.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/genericFunctions1.ts === +function foo (x: T) { return x; } +>foo : Symbol(foo, Decl(genericFunctions1.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions1.ts, 0, 13)) +>x : Symbol(x, Decl(genericFunctions1.ts, 0, 18)) +>T : Symbol(T, Decl(genericFunctions1.ts, 0, 13)) +>x : Symbol(x, Decl(genericFunctions1.ts, 0, 18)) + +var x = foo(5); // 'x' should be number +>x : Symbol(x, Decl(genericFunctions1.ts, 2, 3)) +>foo : Symbol(foo, Decl(genericFunctions1.ts, 0, 0)) + diff --git a/tests/baselines/reference/genericFunctions1.types b/tests/baselines/reference/genericFunctions1.types index aed264c78e1..602ee6b81a4 100644 --- a/tests/baselines/reference/genericFunctions1.types +++ b/tests/baselines/reference/genericFunctions1.types @@ -10,4 +10,5 @@ var x = foo(5); // 'x' should be number >x : number >foo(5) : number >foo : (x: T) => T +>5 : number diff --git a/tests/baselines/reference/genericFunctions2.symbols b/tests/baselines/reference/genericFunctions2.symbols new file mode 100644 index 00000000000..59068cbd8dd --- /dev/null +++ b/tests/baselines/reference/genericFunctions2.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/genericFunctions2.ts === +declare function map (items: T[], f: (x: T) => U): U[]; +>map : Symbol(map, Decl(genericFunctions2.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions2.ts, 0, 22)) +>U : Symbol(U, Decl(genericFunctions2.ts, 0, 24)) +>items : Symbol(items, Decl(genericFunctions2.ts, 0, 30)) +>T : Symbol(T, Decl(genericFunctions2.ts, 0, 22)) +>f : Symbol(f, Decl(genericFunctions2.ts, 0, 41)) +>x : Symbol(x, Decl(genericFunctions2.ts, 0, 46)) +>T : Symbol(T, Decl(genericFunctions2.ts, 0, 22)) +>U : Symbol(U, Decl(genericFunctions2.ts, 0, 24)) +>U : Symbol(U, Decl(genericFunctions2.ts, 0, 24)) + +var myItems: string[]; +>myItems : Symbol(myItems, Decl(genericFunctions2.ts, 2, 3)) + +var lengths = map(myItems, x => x.length); +>lengths : Symbol(lengths, Decl(genericFunctions2.ts, 3, 3)) +>map : Symbol(map, Decl(genericFunctions2.ts, 0, 0)) +>myItems : Symbol(myItems, Decl(genericFunctions2.ts, 2, 3)) +>x : Symbol(x, Decl(genericFunctions2.ts, 3, 26)) +>x.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>x : Symbol(x, Decl(genericFunctions2.ts, 3, 26)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + diff --git a/tests/baselines/reference/genericFunctions3.symbols b/tests/baselines/reference/genericFunctions3.symbols new file mode 100644 index 00000000000..8b257500325 --- /dev/null +++ b/tests/baselines/reference/genericFunctions3.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/genericFunctions3.ts === +interface Query { +>Query : Symbol(Query, Decl(genericFunctions3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions3.ts, 0, 16)) + + foo(x: string): Query; +>foo : Symbol(foo, Decl(genericFunctions3.ts, 0, 20)) +>x : Symbol(x, Decl(genericFunctions3.ts, 1, 8)) +>Query : Symbol(Query, Decl(genericFunctions3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions3.ts, 0, 16)) +} + +function from(arg: boolean): Query; // was Error: Overload signature is not compatible with function definition. +>from : Symbol(from, Decl(genericFunctions3.ts, 2, 1), Decl(genericFunctions3.ts, 4, 41)) +>T : Symbol(T, Decl(genericFunctions3.ts, 4, 14)) +>arg : Symbol(arg, Decl(genericFunctions3.ts, 4, 17)) +>Query : Symbol(Query, Decl(genericFunctions3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions3.ts, 4, 14)) + +function from(arg: any): Query { +>from : Symbol(from, Decl(genericFunctions3.ts, 2, 1), Decl(genericFunctions3.ts, 4, 41)) +>T : Symbol(T, Decl(genericFunctions3.ts, 5, 14)) +>arg : Symbol(arg, Decl(genericFunctions3.ts, 5, 17)) +>Query : Symbol(Query, Decl(genericFunctions3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctions3.ts, 5, 14)) + + return undefined; +>undefined : Symbol(undefined) +} + diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters1.symbols b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.symbols new file mode 100644 index 00000000000..fa04763f2ab --- /dev/null +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/genericFunctionsWithOptionalParameters1.ts === +interface Utils { +>Utils : Symbol(Utils, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 0)) + + fold(c?: Array, folder?: (s: S, t: T) => T, init?: S): T; +>fold : Symbol(fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 8)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 10)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 14)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 8)) +>folder : Symbol(folder, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 27)) +>s : Symbol(s, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 38)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 10)) +>t : Symbol(t, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 43)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 8)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 8)) +>init : Symbol(init, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 55)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 10)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters1.ts, 1, 8)) +} + +var utils: Utils; +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters1.ts, 4, 3)) +>Utils : Symbol(Utils, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 0)) + +utils.fold(); // no error +>utils.fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters1.ts, 4, 3)) +>fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) + +utils.fold(null); // no error +>utils.fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters1.ts, 4, 3)) +>fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) + +utils.fold(null, null); // no error +>utils.fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters1.ts, 4, 3)) +>fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) + +utils.fold(null, null, null); // no error +>utils.fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters1.ts, 4, 3)) +>fold : Symbol(Utils.fold, Decl(genericFunctionsWithOptionalParameters1.ts, 0, 17)) + diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types index 74b8b5e6858..3d5257812ae 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters1.types @@ -35,16 +35,22 @@ utils.fold(null); // no error >utils.fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T +>null : null utils.fold(null, null); // no error >utils.fold(null, null) : {} >utils.fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T +>null : null +>null : null utils.fold(null, null, null); // no error >utils.fold(null, null, null) : {} >utils.fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T >utils : Utils >fold : (c?: T[], folder?: (s: S, t: T) => T, init?: S) => T +>null : null +>null : null +>null : null diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.symbols b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.symbols new file mode 100644 index 00000000000..2fe7e295a0d --- /dev/null +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.symbols @@ -0,0 +1,95 @@ +=== tests/cases/compiler/genericFunctionsWithOptionalParameters3.ts === +class Collection { +>Collection : Symbol(Collection, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 17)) + + public add(x: T) { } +>add : Symbol(add, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 21)) +>x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 1, 15)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 17)) +} +interface Utils { +>Utils : Symbol(Utils, Decl(genericFunctionsWithOptionalParameters3.ts, 2, 1)) + + fold(c?: Collection, folder?: (s: S, t: T) => T, init?: S): T; +>fold : Symbol(fold, Decl(genericFunctionsWithOptionalParameters3.ts, 3, 17)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 9)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 11)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 15)) +>Collection : Symbol(Collection, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 9)) +>folder : Symbol(folder, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 33)) +>s : Symbol(s, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 44)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 11)) +>t : Symbol(t, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 49)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 9)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 9)) +>init : Symbol(init, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 61)) +>S : Symbol(S, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 11)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 9)) + + mapReduce(c: Collection, mapper: (x: T) => U, reducer: (y: U) => V): Collection; +>mapReduce : Symbol(mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 14)) +>U : Symbol(U, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 16)) +>V : Symbol(V, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 19)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 23)) +>Collection : Symbol(Collection, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 0)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 14)) +>mapper : Symbol(mapper, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 40)) +>x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 50)) +>T : Symbol(T, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 14)) +>U : Symbol(U, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 16)) +>reducer : Symbol(reducer, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 61)) +>y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 72)) +>U : Symbol(U, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 16)) +>V : Symbol(V, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 19)) +>Collection : Symbol(Collection, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 0)) +>V : Symbol(V, Decl(genericFunctionsWithOptionalParameters3.ts, 5, 19)) +} +var utils: Utils; +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters3.ts, 7, 3)) +>Utils : Symbol(Utils, Decl(genericFunctionsWithOptionalParameters3.ts, 2, 1)) + +var c = new Collection(); +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 8, 3)) +>Collection : Symbol(Collection, Decl(genericFunctionsWithOptionalParameters3.ts, 0, 0)) + +var r3 = utils.mapReduce(c, (x) => { return 1 }, (y) => { return new Date() }); +>r3 : Symbol(r3, Decl(genericFunctionsWithOptionalParameters3.ts, 9, 3)) +>utils.mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters3.ts, 7, 3)) +>mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 8, 3)) +>x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 9, 29)) +>y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 9, 50)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return new Date() }); +>r4 : Symbol(r4, Decl(genericFunctionsWithOptionalParameters3.ts, 10, 3)) +>utils.mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters3.ts, 7, 3)) +>mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 8, 3)) +>x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 10, 29)) +>y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 10, 58)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var f1 = (x: string) => { return 1 }; +>f1 : Symbol(f1, Decl(genericFunctionsWithOptionalParameters3.ts, 11, 3)) +>x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 11, 10)) + +var f2 = (y: number) => { return new Date() }; +>f2 : Symbol(f2, Decl(genericFunctionsWithOptionalParameters3.ts, 12, 3)) +>y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 12, 10)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r5 = utils.mapReduce(c, f1, f2); +>r5 : Symbol(r5, Decl(genericFunctionsWithOptionalParameters3.ts, 13, 3)) +>utils.mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>utils : Symbol(utils, Decl(genericFunctionsWithOptionalParameters3.ts, 7, 3)) +>mapReduce : Symbol(Utils.mapReduce, Decl(genericFunctionsWithOptionalParameters3.ts, 4, 75)) +>c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 8, 3)) +>f1 : Symbol(f1, Decl(genericFunctionsWithOptionalParameters3.ts, 11, 3)) +>f2 : Symbol(f2, Decl(genericFunctionsWithOptionalParameters3.ts, 12, 3)) + diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types index fbb4780274f..627181e5d05 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.types @@ -65,6 +65,7 @@ var r3 = utils.mapReduce(c, (x) => { return 1 }, (y) => { return new Date() }); >c : Collection >(x) => { return 1 } : (x: string) => number >x : string +>1 : number >(y) => { return new Date() } : (y: number) => Date >y : number >new Date() : Date @@ -79,6 +80,7 @@ var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return >c : Collection >(x: string) => { return 1 } : (x: string) => number >x : string +>1 : number >(y: number) => { return new Date() } : (y: number) => Date >y : number >new Date() : Date @@ -88,6 +90,7 @@ var f1 = (x: string) => { return 1 }; >f1 : (x: string) => number >(x: string) => { return 1 } : (x: string) => number >x : string +>1 : number var f2 = (y: number) => { return new Date() }; >f2 : (y: number) => Date diff --git a/tests/baselines/reference/genericImplements.symbols b/tests/baselines/reference/genericImplements.symbols new file mode 100644 index 00000000000..b3bffdc1b6d --- /dev/null +++ b/tests/baselines/reference/genericImplements.symbols @@ -0,0 +1,60 @@ +=== tests/cases/compiler/genericImplements.ts === +class A { a; }; +>A : Symbol(A, Decl(genericImplements.ts, 0, 0)) +>a : Symbol(a, Decl(genericImplements.ts, 0, 9)) + +class B { b; }; +>B : Symbol(B, Decl(genericImplements.ts, 0, 15)) +>b : Symbol(b, Decl(genericImplements.ts, 1, 9)) + +interface I { +>I : Symbol(I, Decl(genericImplements.ts, 1, 15)) + + f(): T; +>f : Symbol(f, Decl(genericImplements.ts, 2, 13)) +>T : Symbol(T, Decl(genericImplements.ts, 3, 6)) +>A : Symbol(A, Decl(genericImplements.ts, 0, 0)) +>T : Symbol(T, Decl(genericImplements.ts, 3, 6)) + +} // { f: () => { a; } } + +// OK +class X implements I { +>X : Symbol(X, Decl(genericImplements.ts, 4, 1)) +>I : Symbol(I, Decl(genericImplements.ts, 1, 15)) + + f(): T { return undefined; } +>f : Symbol(f, Decl(genericImplements.ts, 7, 22)) +>T : Symbol(T, Decl(genericImplements.ts, 8, 6)) +>B : Symbol(B, Decl(genericImplements.ts, 0, 15)) +>T : Symbol(T, Decl(genericImplements.ts, 8, 6)) +>undefined : Symbol(undefined) + +} // { f: () => { b; } } + +// OK +class Y implements I { +>Y : Symbol(Y, Decl(genericImplements.ts, 9, 1)) +>I : Symbol(I, Decl(genericImplements.ts, 1, 15)) + + f(): T { return undefined; } +>f : Symbol(f, Decl(genericImplements.ts, 12, 22)) +>T : Symbol(T, Decl(genericImplements.ts, 13, 6)) +>A : Symbol(A, Decl(genericImplements.ts, 0, 0)) +>T : Symbol(T, Decl(genericImplements.ts, 13, 6)) +>undefined : Symbol(undefined) + +} // { f: () => { a; } } + +// OK +class Z implements I { +>Z : Symbol(Z, Decl(genericImplements.ts, 14, 1)) +>I : Symbol(I, Decl(genericImplements.ts, 1, 15)) + + f(): T { return undefined; } +>f : Symbol(f, Decl(genericImplements.ts, 17, 22)) +>T : Symbol(T, Decl(genericImplements.ts, 18, 6)) +>T : Symbol(T, Decl(genericImplements.ts, 18, 6)) +>undefined : Symbol(undefined) + +} // { f: () => T } diff --git a/tests/baselines/reference/genericInference1.symbols b/tests/baselines/reference/genericInference1.symbols new file mode 100644 index 00000000000..6980668c6eb --- /dev/null +++ b/tests/baselines/reference/genericInference1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/genericInference1.ts === +['a', 'b', 'c'].map(x => x.length); +>['a', 'b', 'c'].map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>x : Symbol(x, Decl(genericInference1.ts, 0, 20)) +>x.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>x : Symbol(x, Decl(genericInference1.ts, 0, 20)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + diff --git a/tests/baselines/reference/genericInference1.types b/tests/baselines/reference/genericInference1.types index f83a1dcd361..eeed8aa9f3e 100644 --- a/tests/baselines/reference/genericInference1.types +++ b/tests/baselines/reference/genericInference1.types @@ -3,6 +3,9 @@ >['a', 'b', 'c'].map(x => x.length) : number[] >['a', 'b', 'c'].map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >['a', 'b', 'c'] : string[] +>'a' : string +>'b' : string +>'c' : string >map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/genericInference2.symbols b/tests/baselines/reference/genericInference2.symbols new file mode 100644 index 00000000000..83b371005f7 --- /dev/null +++ b/tests/baselines/reference/genericInference2.symbols @@ -0,0 +1,93 @@ +=== tests/cases/compiler/genericInference2.ts === + declare module ko { +>ko : Symbol(ko, Decl(genericInference2.ts, 0, 0)) + + export interface Observable { +>Observable : Symbol(Observable, Decl(genericInference2.ts, 0, 23)) +>T : Symbol(T, Decl(genericInference2.ts, 1, 35)) + + (): T; +>T : Symbol(T, Decl(genericInference2.ts, 1, 35)) + + (value: T): any; +>value : Symbol(value, Decl(genericInference2.ts, 3, 12)) +>T : Symbol(T, Decl(genericInference2.ts, 1, 35)) + + N: number; +>N : Symbol(N, Decl(genericInference2.ts, 3, 27)) + + g: boolean; +>g : Symbol(g, Decl(genericInference2.ts, 4, 21)) + + r: T; +>r : Symbol(r, Decl(genericInference2.ts, 5, 22)) +>T : Symbol(T, Decl(genericInference2.ts, 1, 35)) + } + export function observable(value: T): Observable; +>observable : Symbol(observable, Decl(genericInference2.ts, 7, 8)) +>T : Symbol(T, Decl(genericInference2.ts, 8, 34)) +>value : Symbol(value, Decl(genericInference2.ts, 8, 37)) +>T : Symbol(T, Decl(genericInference2.ts, 8, 34)) +>Observable : Symbol(Observable, Decl(genericInference2.ts, 0, 23)) +>T : Symbol(T, Decl(genericInference2.ts, 8, 34)) + } + var o = { +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) + + name: ko.observable("Bob"), +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>ko.observable : Symbol(ko.observable, Decl(genericInference2.ts, 7, 8)) +>ko : Symbol(ko, Decl(genericInference2.ts, 0, 0)) +>observable : Symbol(ko.observable, Decl(genericInference2.ts, 7, 8)) + + age: ko.observable(37) +>age : Symbol(age, Decl(genericInference2.ts, 11, 34)) +>ko.observable : Symbol(ko.observable, Decl(genericInference2.ts, 7, 8)) +>ko : Symbol(ko, Decl(genericInference2.ts, 0, 0)) +>observable : Symbol(ko.observable, Decl(genericInference2.ts, 7, 8)) + + }; + var x_v = o.name().length; // should be 'number' +>x_v : Symbol(x_v, Decl(genericInference2.ts, 14, 7)) +>o.name().length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>o.name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + + var age_v = o.age(); // should be 'number' +>age_v : Symbol(age_v, Decl(genericInference2.ts, 15, 7)) +>o.age : Symbol(age, Decl(genericInference2.ts, 11, 34)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>age : Symbol(age, Decl(genericInference2.ts, 11, 34)) + + var name_v = o.name("Robert"); // should be 'any' +>name_v : Symbol(name_v, Decl(genericInference2.ts, 16, 7)) +>o.name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) + + var zz_v = o.name.N; // should be 'number' +>zz_v : Symbol(zz_v, Decl(genericInference2.ts, 17, 7)) +>o.name.N : Symbol(ko.Observable.N, Decl(genericInference2.ts, 3, 27)) +>o.name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>N : Symbol(ko.Observable.N, Decl(genericInference2.ts, 3, 27)) + + var yy_v = o.name.g; // should be 'boolean' +>yy_v : Symbol(yy_v, Decl(genericInference2.ts, 18, 7)) +>o.name.g : Symbol(ko.Observable.g, Decl(genericInference2.ts, 4, 21)) +>o.name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>g : Symbol(ko.Observable.g, Decl(genericInference2.ts, 4, 21)) + + var rr_v = o.name.r; // should be 'string' +>rr_v : Symbol(rr_v, Decl(genericInference2.ts, 19, 7)) +>o.name.r : Symbol(ko.Observable.r, Decl(genericInference2.ts, 5, 22)) +>o.name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>o : Symbol(o, Decl(genericInference2.ts, 10, 7)) +>name : Symbol(name, Decl(genericInference2.ts, 10, 13)) +>r : Symbol(ko.Observable.r, Decl(genericInference2.ts, 5, 22)) + diff --git a/tests/baselines/reference/genericInference2.types b/tests/baselines/reference/genericInference2.types index 2616c0de2c4..e5c7052b0db 100644 --- a/tests/baselines/reference/genericInference2.types +++ b/tests/baselines/reference/genericInference2.types @@ -41,6 +41,7 @@ >ko.observable : (value: T) => ko.Observable >ko : typeof ko >observable : (value: T) => ko.Observable +>"Bob" : string age: ko.observable(37) >age : ko.Observable @@ -48,6 +49,7 @@ >ko.observable : (value: T) => ko.Observable >ko : typeof ko >observable : (value: T) => ko.Observable +>37 : number }; var x_v = o.name().length; // should be 'number' @@ -72,6 +74,7 @@ >o.name : ko.Observable >o : { name: ko.Observable; age: ko.Observable; } >name : ko.Observable +>"Robert" : string var zz_v = o.name.N; // should be 'number' >zz_v : number diff --git a/tests/baselines/reference/genericInstanceOf.symbols b/tests/baselines/reference/genericInstanceOf.symbols new file mode 100644 index 00000000000..c1636724892 --- /dev/null +++ b/tests/baselines/reference/genericInstanceOf.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/genericInstanceOf.ts === +interface F { +>F : Symbol(F, Decl(genericInstanceOf.ts, 0, 0)) + + (): number; +} + +class C { +>C : Symbol(C, Decl(genericInstanceOf.ts, 2, 1)) +>T : Symbol(T, Decl(genericInstanceOf.ts, 4, 8)) + + constructor(public a: T, public b: F) {} +>a : Symbol(a, Decl(genericInstanceOf.ts, 5, 16)) +>T : Symbol(T, Decl(genericInstanceOf.ts, 4, 8)) +>b : Symbol(b, Decl(genericInstanceOf.ts, 5, 28)) +>F : Symbol(F, Decl(genericInstanceOf.ts, 0, 0)) + + foo() { +>foo : Symbol(foo, Decl(genericInstanceOf.ts, 5, 44)) + + if (this.a instanceof this.b) { +>this.a : Symbol(a, Decl(genericInstanceOf.ts, 5, 16)) +>this : Symbol(C, Decl(genericInstanceOf.ts, 2, 1)) +>a : Symbol(a, Decl(genericInstanceOf.ts, 5, 16)) +>this.b : Symbol(b, Decl(genericInstanceOf.ts, 5, 28)) +>this : Symbol(C, Decl(genericInstanceOf.ts, 2, 1)) +>b : Symbol(b, Decl(genericInstanceOf.ts, 5, 28)) + } + } +} diff --git a/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.symbols b/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.symbols new file mode 100644 index 00000000000..51579bad2d5 --- /dev/null +++ b/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/types/namedTypes/genericInstantiationEquivalentToObjectLiteral.ts === +interface Pair { first: T1; second: T2; } +>Pair : Symbol(Pair, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 0)) +>T1 : Symbol(T1, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 15)) +>T2 : Symbol(T2, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 18)) +>first : Symbol(first, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 24)) +>T1 : Symbol(T1, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 15)) +>second : Symbol(second, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 35)) +>T2 : Symbol(T2, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 18)) + +var x: Pair +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 1, 3)) +>Pair : Symbol(Pair, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 0)) + +var y: { first: string; second: number; } +>y : Symbol(y, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 3)) +>first : Symbol(first, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 8)) +>second : Symbol(second, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 23)) + +x = y; +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 1, 3)) +>y : Symbol(y, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 3)) + +y = x; +>y : Symbol(y, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 3)) +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 1, 3)) + +declare function f(x: Pair); +>f : Symbol(f, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 5, 6)) +>T : Symbol(T, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 19)) +>U : Symbol(U, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 21)) +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 25)) +>Pair : Symbol(Pair, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 0, 0)) +>T : Symbol(T, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 19)) +>U : Symbol(U, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 21)) + +declare function f2(x: { first: T; second: U; }); +>f2 : Symbol(f2, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 40)) +>T : Symbol(T, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 20)) +>U : Symbol(U, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 22)) +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 26)) +>first : Symbol(first, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 30)) +>T : Symbol(T, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 20)) +>second : Symbol(second, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 40)) +>U : Symbol(U, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 8, 22)) + +f(x); +>f : Symbol(f, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 5, 6)) +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 1, 3)) + +f(y); +>f : Symbol(f, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 5, 6)) +>y : Symbol(y, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 3)) + +f2(x); +>f2 : Symbol(f2, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 40)) +>x : Symbol(x, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 1, 3)) + +f2(y); +>f2 : Symbol(f2, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 7, 40)) +>y : Symbol(y, Decl(genericInstantiationEquivalentToObjectLiteral.ts, 2, 3)) + diff --git a/tests/baselines/reference/genericInterfaceFunctionTypeParameter.symbols b/tests/baselines/reference/genericInterfaceFunctionTypeParameter.symbols new file mode 100644 index 00000000000..b204a252a10 --- /dev/null +++ b/tests/baselines/reference/genericInterfaceFunctionTypeParameter.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericInterfaceFunctionTypeParameter.ts === +export interface IFoo { } +>IFoo : Symbol(IFoo, Decl(genericInterfaceFunctionTypeParameter.ts, 0, 0)) +>A : Symbol(A, Decl(genericInterfaceFunctionTypeParameter.ts, 0, 22)) + +export function foo(fn: (ifoo: IFoo) => void) { +>foo : Symbol(foo, Decl(genericInterfaceFunctionTypeParameter.ts, 0, 28)) +>A : Symbol(A, Decl(genericInterfaceFunctionTypeParameter.ts, 1, 20)) +>fn : Symbol(fn, Decl(genericInterfaceFunctionTypeParameter.ts, 1, 23)) +>ifoo : Symbol(ifoo, Decl(genericInterfaceFunctionTypeParameter.ts, 1, 28)) +>IFoo : Symbol(IFoo, Decl(genericInterfaceFunctionTypeParameter.ts, 0, 0)) +>A : Symbol(A, Decl(genericInterfaceFunctionTypeParameter.ts, 1, 20)) + + foo(fn); // Invocation is necessary to repro (!) +>foo : Symbol(foo, Decl(genericInterfaceFunctionTypeParameter.ts, 0, 28)) +>fn : Symbol(fn, Decl(genericInterfaceFunctionTypeParameter.ts, 1, 23)) +} + + + diff --git a/tests/baselines/reference/genericInterfaceImplementation.symbols b/tests/baselines/reference/genericInterfaceImplementation.symbols new file mode 100644 index 00000000000..5816396081f --- /dev/null +++ b/tests/baselines/reference/genericInterfaceImplementation.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/genericInterfaceImplementation.ts === +interface IOption { +>IOption : Symbol(IOption, Decl(genericInterfaceImplementation.ts, 0, 0)) +>A : Symbol(A, Decl(genericInterfaceImplementation.ts, 0, 18)) + + get(): A; +>get : Symbol(get, Decl(genericInterfaceImplementation.ts, 0, 22)) +>A : Symbol(A, Decl(genericInterfaceImplementation.ts, 0, 18)) + + flatten(): IOption; +>flatten : Symbol(flatten, Decl(genericInterfaceImplementation.ts, 1, 13)) +>B : Symbol(B, Decl(genericInterfaceImplementation.ts, 3, 12)) +>IOption : Symbol(IOption, Decl(genericInterfaceImplementation.ts, 0, 0)) +>B : Symbol(B, Decl(genericInterfaceImplementation.ts, 3, 12)) +} + +class None implements IOption{ +>None : Symbol(None, Decl(genericInterfaceImplementation.ts, 4, 1)) +>T : Symbol(T, Decl(genericInterfaceImplementation.ts, 6, 11)) +>IOption : Symbol(IOption, Decl(genericInterfaceImplementation.ts, 0, 0)) +>T : Symbol(T, Decl(genericInterfaceImplementation.ts, 6, 11)) + + get(): T { +>get : Symbol(get, Decl(genericInterfaceImplementation.ts, 6, 36)) +>T : Symbol(T, Decl(genericInterfaceImplementation.ts, 6, 11)) + + throw null; + } + + flatten() : IOption { +>flatten : Symbol(flatten, Decl(genericInterfaceImplementation.ts, 9, 5)) +>U : Symbol(U, Decl(genericInterfaceImplementation.ts, 11, 12)) +>IOption : Symbol(IOption, Decl(genericInterfaceImplementation.ts, 0, 0)) +>U : Symbol(U, Decl(genericInterfaceImplementation.ts, 11, 12)) + + return new None(); +>None : Symbol(None, Decl(genericInterfaceImplementation.ts, 4, 1)) +>U : Symbol(U, Decl(genericInterfaceImplementation.ts, 11, 12)) + } +} + diff --git a/tests/baselines/reference/genericInterfaceImplementation.types b/tests/baselines/reference/genericInterfaceImplementation.types index b075864634c..d7ca48c36c0 100644 --- a/tests/baselines/reference/genericInterfaceImplementation.types +++ b/tests/baselines/reference/genericInterfaceImplementation.types @@ -25,6 +25,7 @@ class None implements IOption{ >T : T throw null; +>null : null } flatten() : IOption { diff --git a/tests/baselines/reference/genericInterfaceTypeCall.symbols b/tests/baselines/reference/genericInterfaceTypeCall.symbols new file mode 100644 index 00000000000..e28ce8f8d80 --- /dev/null +++ b/tests/baselines/reference/genericInterfaceTypeCall.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/genericInterfaceTypeCall.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(genericInterfaceTypeCall.ts, 0, 0)) +>T : Symbol(T, Decl(genericInterfaceTypeCall.ts, 0, 14)) + + reject(arg: T): void; +>reject : Symbol(reject, Decl(genericInterfaceTypeCall.ts, 0, 18)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 1, 11)) +>T : Symbol(T, Decl(genericInterfaceTypeCall.ts, 0, 14)) +} +var foo: Foo +>foo : Symbol(foo, Decl(genericInterfaceTypeCall.ts, 3, 3)) +>Foo : Symbol(Foo, Decl(genericInterfaceTypeCall.ts, 0, 0)) + +interface bar { +>bar : Symbol(bar, Decl(genericInterfaceTypeCall.ts, 3, 20)) +>T : Symbol(T, Decl(genericInterfaceTypeCall.ts, 5, 14)) + + fail(func: (arg: T) => void ): void; +>fail : Symbol(fail, Decl(genericInterfaceTypeCall.ts, 5, 18)) +>func : Symbol(func, Decl(genericInterfaceTypeCall.ts, 6, 9)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 6, 16)) +>T : Symbol(T, Decl(genericInterfaceTypeCall.ts, 5, 14)) + + fail2(func2: { (arg: T): void; }): void; +>fail2 : Symbol(fail2, Decl(genericInterfaceTypeCall.ts, 6, 40)) +>func2 : Symbol(func2, Decl(genericInterfaceTypeCall.ts, 7, 10)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 7, 20)) +>T : Symbol(T, Decl(genericInterfaceTypeCall.ts, 5, 14)) +} +var test: bar; +>test : Symbol(test, Decl(genericInterfaceTypeCall.ts, 9, 3)) +>bar : Symbol(bar, Decl(genericInterfaceTypeCall.ts, 3, 20)) + +test.fail(arg => foo.reject(arg)); +>test.fail : Symbol(bar.fail, Decl(genericInterfaceTypeCall.ts, 5, 18)) +>test : Symbol(test, Decl(genericInterfaceTypeCall.ts, 9, 3)) +>fail : Symbol(bar.fail, Decl(genericInterfaceTypeCall.ts, 5, 18)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 11, 10)) +>foo.reject : Symbol(Foo.reject, Decl(genericInterfaceTypeCall.ts, 0, 18)) +>foo : Symbol(foo, Decl(genericInterfaceTypeCall.ts, 3, 3)) +>reject : Symbol(Foo.reject, Decl(genericInterfaceTypeCall.ts, 0, 18)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 11, 10)) + +test.fail2(arg => foo.reject(arg)); // Error: Supplied parameters do not match any signature of call target +>test.fail2 : Symbol(bar.fail2, Decl(genericInterfaceTypeCall.ts, 6, 40)) +>test : Symbol(test, Decl(genericInterfaceTypeCall.ts, 9, 3)) +>fail2 : Symbol(bar.fail2, Decl(genericInterfaceTypeCall.ts, 6, 40)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 12, 11)) +>foo.reject : Symbol(Foo.reject, Decl(genericInterfaceTypeCall.ts, 0, 18)) +>foo : Symbol(foo, Decl(genericInterfaceTypeCall.ts, 3, 3)) +>reject : Symbol(Foo.reject, Decl(genericInterfaceTypeCall.ts, 0, 18)) +>arg : Symbol(arg, Decl(genericInterfaceTypeCall.ts, 12, 11)) + diff --git a/tests/baselines/reference/genericMethodOverspecialization.symbols b/tests/baselines/reference/genericMethodOverspecialization.symbols new file mode 100644 index 00000000000..651aced0fcd --- /dev/null +++ b/tests/baselines/reference/genericMethodOverspecialization.symbols @@ -0,0 +1,72 @@ +=== tests/cases/compiler/genericMethodOverspecialization.ts === +var names = ["list", "table1", "table2", "table3", "summary"]; +>names : Symbol(names, Decl(genericMethodOverspecialization.ts, 0, 3)) + +interface HTMLElement { +>HTMLElement : Symbol(HTMLElement, Decl(genericMethodOverspecialization.ts, 0, 62)) + + clientWidth: number; +>clientWidth : Symbol(clientWidth, Decl(genericMethodOverspecialization.ts, 2, 23)) + + isDisabled: boolean; +>isDisabled : Symbol(isDisabled, Decl(genericMethodOverspecialization.ts, 3, 24)) +} + +declare var document: Document; +>document : Symbol(document, Decl(genericMethodOverspecialization.ts, 7, 11)) +>Document : Symbol(Document, Decl(genericMethodOverspecialization.ts, 7, 31)) + +interface Document { +>Document : Symbol(Document, Decl(genericMethodOverspecialization.ts, 7, 31)) + + getElementById(elementId: string): HTMLElement; +>getElementById : Symbol(getElementById, Decl(genericMethodOverspecialization.ts, 8, 20)) +>elementId : Symbol(elementId, Decl(genericMethodOverspecialization.ts, 9, 19)) +>HTMLElement : Symbol(HTMLElement, Decl(genericMethodOverspecialization.ts, 0, 62)) +} + +var elements = names.map(function (name) { +>elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) +>names.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>names : Symbol(names, Decl(genericMethodOverspecialization.ts, 0, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>name : Symbol(name, Decl(genericMethodOverspecialization.ts, 12, 35)) + + return document.getElementById(name); +>document.getElementById : Symbol(Document.getElementById, Decl(genericMethodOverspecialization.ts, 8, 20)) +>document : Symbol(document, Decl(genericMethodOverspecialization.ts, 7, 11)) +>getElementById : Symbol(Document.getElementById, Decl(genericMethodOverspecialization.ts, 8, 20)) +>name : Symbol(name, Decl(genericMethodOverspecialization.ts, 12, 35)) + +}); + + +var xxx = elements.filter(function (e) { +>xxx : Symbol(xxx, Decl(genericMethodOverspecialization.ts, 17, 3)) +>elements.filter : Symbol(Array.filter, Decl(lib.d.ts, 1122, 87)) +>elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) +>filter : Symbol(Array.filter, Decl(lib.d.ts, 1122, 87)) +>e : Symbol(e, Decl(genericMethodOverspecialization.ts, 17, 36)) + + return !e.isDisabled; +>e.isDisabled : Symbol(HTMLElement.isDisabled, Decl(genericMethodOverspecialization.ts, 3, 24)) +>e : Symbol(e, Decl(genericMethodOverspecialization.ts, 17, 36)) +>isDisabled : Symbol(HTMLElement.isDisabled, Decl(genericMethodOverspecialization.ts, 3, 24)) + +}); + +var widths:number[] = elements.map(function (e) { // should not error +>widths : Symbol(widths, Decl(genericMethodOverspecialization.ts, 21, 3)) +>elements.map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>e : Symbol(e, Decl(genericMethodOverspecialization.ts, 21, 45)) + + return e.clientWidth; +>e.clientWidth : Symbol(HTMLElement.clientWidth, Decl(genericMethodOverspecialization.ts, 2, 23)) +>e : Symbol(e, Decl(genericMethodOverspecialization.ts, 21, 45)) +>clientWidth : Symbol(HTMLElement.clientWidth, Decl(genericMethodOverspecialization.ts, 2, 23)) + +}); + + diff --git a/tests/baselines/reference/genericMethodOverspecialization.types b/tests/baselines/reference/genericMethodOverspecialization.types index 145a7b33381..0ad302da94e 100644 --- a/tests/baselines/reference/genericMethodOverspecialization.types +++ b/tests/baselines/reference/genericMethodOverspecialization.types @@ -2,6 +2,11 @@ var names = ["list", "table1", "table2", "table3", "summary"]; >names : string[] >["list", "table1", "table2", "table3", "summary"] : string[] +>"list" : string +>"table1" : string +>"table2" : string +>"table3" : string +>"summary" : string interface HTMLElement { >HTMLElement : HTMLElement diff --git a/tests/baselines/reference/genericObjectLitReturnType.symbols b/tests/baselines/reference/genericObjectLitReturnType.symbols new file mode 100644 index 00000000000..f3253bdf810 --- /dev/null +++ b/tests/baselines/reference/genericObjectLitReturnType.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/genericObjectLitReturnType.ts === +class X +>X : Symbol(X, Decl(genericObjectLitReturnType.ts, 0, 0)) +>T : Symbol(T, Decl(genericObjectLitReturnType.ts, 0, 8)) +{ + f(t: T) { return { a: t }; } +>f : Symbol(f, Decl(genericObjectLitReturnType.ts, 1, 1)) +>t : Symbol(t, Decl(genericObjectLitReturnType.ts, 2, 6)) +>T : Symbol(T, Decl(genericObjectLitReturnType.ts, 0, 8)) +>a : Symbol(a, Decl(genericObjectLitReturnType.ts, 2, 22)) +>t : Symbol(t, Decl(genericObjectLitReturnType.ts, 2, 6)) +} + + +var x: X; +>x : Symbol(x, Decl(genericObjectLitReturnType.ts, 6, 3)) +>X : Symbol(X, Decl(genericObjectLitReturnType.ts, 0, 0)) + +var t1 = x.f(5); +>t1 : Symbol(t1, Decl(genericObjectLitReturnType.ts, 7, 3)) +>x.f : Symbol(X.f, Decl(genericObjectLitReturnType.ts, 1, 1)) +>x : Symbol(x, Decl(genericObjectLitReturnType.ts, 6, 3)) +>f : Symbol(X.f, Decl(genericObjectLitReturnType.ts, 1, 1)) + +t1.a = 5; // Should not error: t1 should have type {a: number}, instead has type {a: T} +>t1.a : Symbol(a, Decl(genericObjectLitReturnType.ts, 2, 22)) +>t1 : Symbol(t1, Decl(genericObjectLitReturnType.ts, 7, 3)) +>a : Symbol(a, Decl(genericObjectLitReturnType.ts, 2, 22)) + + diff --git a/tests/baselines/reference/genericObjectLitReturnType.types b/tests/baselines/reference/genericObjectLitReturnType.types index 3ecb5706689..6bdc352cbc7 100644 --- a/tests/baselines/reference/genericObjectLitReturnType.types +++ b/tests/baselines/reference/genericObjectLitReturnType.types @@ -23,11 +23,13 @@ var t1 = x.f(5); >x.f : (t: number) => { a: number; } >x : X >f : (t: number) => { a: number; } +>5 : number t1.a = 5; // Should not error: t1 should have type {a: number}, instead has type {a: T} >t1.a = 5 : number >t1.a : number >t1 : { a: number; } >a : number +>5 : number diff --git a/tests/baselines/reference/genericOfACloduleType1.symbols b/tests/baselines/reference/genericOfACloduleType1.symbols new file mode 100644 index 00000000000..b2bb95a8ef1 --- /dev/null +++ b/tests/baselines/reference/genericOfACloduleType1.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/genericOfACloduleType1.ts === +class G{ bar(x: T) { return x; } } +>G : Symbol(G, Decl(genericOfACloduleType1.ts, 0, 0)) +>T : Symbol(T, Decl(genericOfACloduleType1.ts, 0, 8)) +>bar : Symbol(bar, Decl(genericOfACloduleType1.ts, 0, 11)) +>x : Symbol(x, Decl(genericOfACloduleType1.ts, 0, 16)) +>T : Symbol(T, Decl(genericOfACloduleType1.ts, 0, 8)) +>x : Symbol(x, Decl(genericOfACloduleType1.ts, 0, 16)) + +module M { +>M : Symbol(M, Decl(genericOfACloduleType1.ts, 0, 37)) + + export class C { foo() { } } +>C : Symbol(C, Decl(genericOfACloduleType1.ts, 1, 10), Decl(genericOfACloduleType1.ts, 2, 32)) +>foo : Symbol(foo, Decl(genericOfACloduleType1.ts, 2, 20)) + + export module C { +>C : Symbol(C, Decl(genericOfACloduleType1.ts, 1, 10), Decl(genericOfACloduleType1.ts, 2, 32)) + + export class X { +>X : Symbol(X, Decl(genericOfACloduleType1.ts, 3, 21)) + } + } + + var g1 = new G(); +>g1 : Symbol(g1, Decl(genericOfACloduleType1.ts, 8, 7)) +>G : Symbol(G, Decl(genericOfACloduleType1.ts, 0, 0)) +>C : Symbol(C, Decl(genericOfACloduleType1.ts, 1, 10), Decl(genericOfACloduleType1.ts, 2, 32)) + + g1.bar(null).foo(); +>g1.bar(null).foo : Symbol(C.foo, Decl(genericOfACloduleType1.ts, 2, 20)) +>g1.bar : Symbol(G.bar, Decl(genericOfACloduleType1.ts, 0, 11)) +>g1 : Symbol(g1, Decl(genericOfACloduleType1.ts, 8, 7)) +>bar : Symbol(G.bar, Decl(genericOfACloduleType1.ts, 0, 11)) +>foo : Symbol(C.foo, Decl(genericOfACloduleType1.ts, 2, 20)) +} +var g2 = new G() // was: error Type reference cannot refer to container 'M.C'. +>g2 : Symbol(g2, Decl(genericOfACloduleType1.ts, 11, 3)) +>G : Symbol(G, Decl(genericOfACloduleType1.ts, 0, 0)) +>M : Symbol(M, Decl(genericOfACloduleType1.ts, 0, 37)) +>C : Symbol(M.C, Decl(genericOfACloduleType1.ts, 1, 10), Decl(genericOfACloduleType1.ts, 2, 32)) + diff --git a/tests/baselines/reference/genericOfACloduleType1.types b/tests/baselines/reference/genericOfACloduleType1.types index afbef2f4180..5c19b5f9569 100644 --- a/tests/baselines/reference/genericOfACloduleType1.types +++ b/tests/baselines/reference/genericOfACloduleType1.types @@ -35,12 +35,13 @@ module M { >g1.bar : (x: C) => C >g1 : G >bar : (x: C) => C +>null : null >foo : () => void } var g2 = new G() // was: error Type reference cannot refer to container 'M.C'. >g2 : G >new G() : G >G : typeof G ->M : unknown +>M : any >C : M.C diff --git a/tests/baselines/reference/genericOfACloduleType2.symbols b/tests/baselines/reference/genericOfACloduleType2.symbols new file mode 100644 index 00000000000..2f4fe34818c --- /dev/null +++ b/tests/baselines/reference/genericOfACloduleType2.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/genericOfACloduleType2.ts === +class G{ bar(x: T) { return x; } } +>G : Symbol(G, Decl(genericOfACloduleType2.ts, 0, 0)) +>T : Symbol(T, Decl(genericOfACloduleType2.ts, 0, 8)) +>bar : Symbol(bar, Decl(genericOfACloduleType2.ts, 0, 11)) +>x : Symbol(x, Decl(genericOfACloduleType2.ts, 0, 16)) +>T : Symbol(T, Decl(genericOfACloduleType2.ts, 0, 8)) +>x : Symbol(x, Decl(genericOfACloduleType2.ts, 0, 16)) + +module M { +>M : Symbol(M, Decl(genericOfACloduleType2.ts, 0, 37)) + + export class C { foo() { } } +>C : Symbol(C, Decl(genericOfACloduleType2.ts, 1, 10), Decl(genericOfACloduleType2.ts, 2, 32)) +>foo : Symbol(foo, Decl(genericOfACloduleType2.ts, 2, 20)) + + export module C { +>C : Symbol(C, Decl(genericOfACloduleType2.ts, 1, 10), Decl(genericOfACloduleType2.ts, 2, 32)) + + export class X { +>X : Symbol(X, Decl(genericOfACloduleType2.ts, 3, 21)) + } + } + + var g1 = new G(); +>g1 : Symbol(g1, Decl(genericOfACloduleType2.ts, 8, 7)) +>G : Symbol(G, Decl(genericOfACloduleType2.ts, 0, 0)) +>C : Symbol(C, Decl(genericOfACloduleType2.ts, 1, 10), Decl(genericOfACloduleType2.ts, 2, 32)) + + g1.bar(null).foo(); // no error +>g1.bar(null).foo : Symbol(C.foo, Decl(genericOfACloduleType2.ts, 2, 20)) +>g1.bar : Symbol(G.bar, Decl(genericOfACloduleType2.ts, 0, 11)) +>g1 : Symbol(g1, Decl(genericOfACloduleType2.ts, 8, 7)) +>bar : Symbol(G.bar, Decl(genericOfACloduleType2.ts, 0, 11)) +>foo : Symbol(C.foo, Decl(genericOfACloduleType2.ts, 2, 20)) +} + +module N { +>N : Symbol(N, Decl(genericOfACloduleType2.ts, 10, 1)) + + var g2 = new G() +>g2 : Symbol(g2, Decl(genericOfACloduleType2.ts, 13, 7)) +>G : Symbol(G, Decl(genericOfACloduleType2.ts, 0, 0)) +>M : Symbol(M, Decl(genericOfACloduleType2.ts, 0, 37)) +>C : Symbol(M.C, Decl(genericOfACloduleType2.ts, 1, 10), Decl(genericOfACloduleType2.ts, 2, 32)) +} diff --git a/tests/baselines/reference/genericOfACloduleType2.types b/tests/baselines/reference/genericOfACloduleType2.types index 275af8c913b..2e857b26eda 100644 --- a/tests/baselines/reference/genericOfACloduleType2.types +++ b/tests/baselines/reference/genericOfACloduleType2.types @@ -35,6 +35,7 @@ module M { >g1.bar : (x: C) => C >g1 : G >bar : (x: C) => C +>null : null >foo : () => void } @@ -45,6 +46,6 @@ module N { >g2 : G >new G() : G >G : typeof G ->M : unknown +>M : any >C : M.C } diff --git a/tests/baselines/reference/genericOverloadSignatures.symbols b/tests/baselines/reference/genericOverloadSignatures.symbols new file mode 100644 index 00000000000..76343fb1898 --- /dev/null +++ b/tests/baselines/reference/genericOverloadSignatures.symbols @@ -0,0 +1,101 @@ +=== tests/cases/compiler/genericOverloadSignatures.ts === +interface A { +>A : Symbol(A, Decl(genericOverloadSignatures.ts, 0, 0)) + + (x: T): void; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 1, 5)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 1, 8)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 1, 5)) + + (x: T): void; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 2, 5)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 2, 8)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 2, 5)) +} + +function f(a: T); +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 3, 1), Decl(genericOverloadSignatures.ts, 5, 20), Decl(genericOverloadSignatures.ts, 6, 20)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 5, 11)) +>a : Symbol(a, Decl(genericOverloadSignatures.ts, 5, 14)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 5, 11)) + +function f(a: T); +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 3, 1), Decl(genericOverloadSignatures.ts, 5, 20), Decl(genericOverloadSignatures.ts, 6, 20)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 6, 11)) +>a : Symbol(a, Decl(genericOverloadSignatures.ts, 6, 14)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 6, 11)) + +function f(a) { } +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 3, 1), Decl(genericOverloadSignatures.ts, 5, 20), Decl(genericOverloadSignatures.ts, 6, 20)) +>a : Symbol(a, Decl(genericOverloadSignatures.ts, 7, 11)) + +interface I2 { +>I2 : Symbol(I2, Decl(genericOverloadSignatures.ts, 7, 17)) + + f(x: T): number; +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 9, 14), Decl(genericOverloadSignatures.ts, 10, 23)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 10, 6)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 10, 9)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 10, 6)) + + f(x: T): string; +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 9, 14), Decl(genericOverloadSignatures.ts, 10, 23)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 11, 6)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 11, 9)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 11, 6)) +} + +interface I3 { +>I3 : Symbol(I3, Decl(genericOverloadSignatures.ts, 12, 1)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 14, 13)) + + f(x: T): number; +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 14, 17), Decl(genericOverloadSignatures.ts, 15, 20)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 15, 6)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 14, 13)) + + f(x: T): string; +>f : Symbol(f, Decl(genericOverloadSignatures.ts, 14, 17), Decl(genericOverloadSignatures.ts, 15, 20)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 16, 6)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 14, 13)) +} + +class C2 { +>C2 : Symbol(C2, Decl(genericOverloadSignatures.ts, 17, 1)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 19, 9)) +} +var b: { +>b : Symbol(b, Decl(genericOverloadSignatures.ts, 21, 3)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 22, 9)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 22, 12)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 22, 9)) +>y : Symbol(y, Decl(genericOverloadSignatures.ts, 22, 17)) +>C2 : Symbol(C2, Decl(genericOverloadSignatures.ts, 17, 1)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 22, 9)) + + new (x: T, y: string): C2; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 23, 9)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 23, 12)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 23, 9)) +>y : Symbol(y, Decl(genericOverloadSignatures.ts, 23, 17)) +>C2 : Symbol(C2, Decl(genericOverloadSignatures.ts, 17, 1)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 23, 9)) +} + +interface D { +>D : Symbol(D, Decl(genericOverloadSignatures.ts, 24, 1)) + + (x: T): T; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 27, 5)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 27, 8)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 27, 5)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 27, 5)) + + (x: T): T; +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 28, 5)) +>x : Symbol(x, Decl(genericOverloadSignatures.ts, 28, 8)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 28, 5)) +>T : Symbol(T, Decl(genericOverloadSignatures.ts, 28, 5)) +} diff --git a/tests/baselines/reference/genericParameterAssignability1.symbols b/tests/baselines/reference/genericParameterAssignability1.symbols new file mode 100644 index 00000000000..766190aecab --- /dev/null +++ b/tests/baselines/reference/genericParameterAssignability1.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/genericParameterAssignability1.ts === +function f(x: T): T { return null; } +>f : Symbol(f, Decl(genericParameterAssignability1.ts, 0, 0)) +>T : Symbol(T, Decl(genericParameterAssignability1.ts, 0, 11)) +>x : Symbol(x, Decl(genericParameterAssignability1.ts, 0, 14)) +>T : Symbol(T, Decl(genericParameterAssignability1.ts, 0, 11)) +>T : Symbol(T, Decl(genericParameterAssignability1.ts, 0, 11)) + +var r = (x: T) => x; +>r : Symbol(r, Decl(genericParameterAssignability1.ts, 1, 3)) +>T : Symbol(T, Decl(genericParameterAssignability1.ts, 1, 9)) +>x : Symbol(x, Decl(genericParameterAssignability1.ts, 1, 12)) +>T : Symbol(T, Decl(genericParameterAssignability1.ts, 1, 9)) +>x : Symbol(x, Decl(genericParameterAssignability1.ts, 1, 12)) + +r = f; // should be allowed +>r : Symbol(r, Decl(genericParameterAssignability1.ts, 1, 3)) +>f : Symbol(f, Decl(genericParameterAssignability1.ts, 0, 0)) + diff --git a/tests/baselines/reference/genericParameterAssignability1.types b/tests/baselines/reference/genericParameterAssignability1.types index b7888014dea..50917e5db45 100644 --- a/tests/baselines/reference/genericParameterAssignability1.types +++ b/tests/baselines/reference/genericParameterAssignability1.types @@ -5,6 +5,7 @@ function f(x: T): T { return null; } >x : T >T : T >T : T +>null : null var r = (x: T) => x; >r : (x: T) => T diff --git a/tests/baselines/reference/genericPrototypeProperty.symbols b/tests/baselines/reference/genericPrototypeProperty.symbols new file mode 100644 index 00000000000..ca2fe000dce --- /dev/null +++ b/tests/baselines/reference/genericPrototypeProperty.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/genericPrototypeProperty.ts === +class C { +>C : Symbol(C, Decl(genericPrototypeProperty.ts, 0, 0)) +>T : Symbol(T, Decl(genericPrototypeProperty.ts, 0, 8)) + + x: T; +>x : Symbol(x, Decl(genericPrototypeProperty.ts, 0, 12)) +>T : Symbol(T, Decl(genericPrototypeProperty.ts, 0, 8)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(genericPrototypeProperty.ts, 1, 9)) +>x : Symbol(x, Decl(genericPrototypeProperty.ts, 2, 8)) +>T : Symbol(T, Decl(genericPrototypeProperty.ts, 0, 8)) +>T : Symbol(T, Decl(genericPrototypeProperty.ts, 0, 8)) +} + +var r = C.prototype; +>r : Symbol(r, Decl(genericPrototypeProperty.ts, 5, 3)) +>C.prototype : Symbol(C.prototype) +>C : Symbol(C, Decl(genericPrototypeProperty.ts, 0, 0)) +>prototype : Symbol(C.prototype) + +// should be any +var r2 = r.x +>r2 : Symbol(r2, Decl(genericPrototypeProperty.ts, 7, 3)) +>r.x : Symbol(C.x, Decl(genericPrototypeProperty.ts, 0, 12)) +>r : Symbol(r, Decl(genericPrototypeProperty.ts, 5, 3)) +>x : Symbol(C.x, Decl(genericPrototypeProperty.ts, 0, 12)) + +var r3 = r.foo(null); +>r3 : Symbol(r3, Decl(genericPrototypeProperty.ts, 8, 3)) +>r.foo : Symbol(C.foo, Decl(genericPrototypeProperty.ts, 1, 9)) +>r : Symbol(r, Decl(genericPrototypeProperty.ts, 5, 3)) +>foo : Symbol(C.foo, Decl(genericPrototypeProperty.ts, 1, 9)) + diff --git a/tests/baselines/reference/genericPrototypeProperty.types b/tests/baselines/reference/genericPrototypeProperty.types index a25914229b0..447f5e74890 100644 --- a/tests/baselines/reference/genericPrototypeProperty.types +++ b/tests/baselines/reference/genericPrototypeProperty.types @@ -12,6 +12,7 @@ class C { >x : T >T : T >T : T +>null : null } var r = C.prototype; @@ -33,4 +34,5 @@ var r3 = r.foo(null); >r.foo : (x: any) => any >r : C >foo : (x: any) => any +>null : null diff --git a/tests/baselines/reference/genericPrototypeProperty2.symbols b/tests/baselines/reference/genericPrototypeProperty2.symbols new file mode 100644 index 00000000000..f7d55162154 --- /dev/null +++ b/tests/baselines/reference/genericPrototypeProperty2.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/genericPrototypeProperty2.ts === +interface EventTarget { x } +>EventTarget : Symbol(EventTarget, Decl(genericPrototypeProperty2.ts, 0, 0)) +>x : Symbol(x, Decl(genericPrototypeProperty2.ts, 0, 23)) + +class BaseEvent { +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty2.ts, 0, 27)) + + target: EventTarget; +>target : Symbol(target, Decl(genericPrototypeProperty2.ts, 1, 17)) +>EventTarget : Symbol(EventTarget, Decl(genericPrototypeProperty2.ts, 0, 0)) +} + +class MyEvent extends BaseEvent { +>MyEvent : Symbol(MyEvent, Decl(genericPrototypeProperty2.ts, 3, 1)) +>T : Symbol(T, Decl(genericPrototypeProperty2.ts, 5, 14)) +>EventTarget : Symbol(EventTarget, Decl(genericPrototypeProperty2.ts, 0, 0)) +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty2.ts, 0, 27)) + + target: T; +>target : Symbol(target, Decl(genericPrototypeProperty2.ts, 5, 56)) +>T : Symbol(T, Decl(genericPrototypeProperty2.ts, 5, 14)) +} +class BaseEventWrapper { +>BaseEventWrapper : Symbol(BaseEventWrapper, Decl(genericPrototypeProperty2.ts, 7, 1)) + + t: BaseEvent; +>t : Symbol(t, Decl(genericPrototypeProperty2.ts, 8, 24)) +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty2.ts, 0, 27)) +} + +class MyEventWrapper extends BaseEventWrapper { +>MyEventWrapper : Symbol(MyEventWrapper, Decl(genericPrototypeProperty2.ts, 10, 1)) +>BaseEventWrapper : Symbol(BaseEventWrapper, Decl(genericPrototypeProperty2.ts, 7, 1)) + + t: MyEvent; // any satisfies constraint and passes assignability check between 'target' properties +>t : Symbol(t, Decl(genericPrototypeProperty2.ts, 12, 47)) +>MyEvent : Symbol(MyEvent, Decl(genericPrototypeProperty2.ts, 3, 1)) +} diff --git a/tests/baselines/reference/genericPrototypeProperty3.symbols b/tests/baselines/reference/genericPrototypeProperty3.symbols new file mode 100644 index 00000000000..fb28fbcc89d --- /dev/null +++ b/tests/baselines/reference/genericPrototypeProperty3.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/genericPrototypeProperty3.ts === +class BaseEvent { +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty3.ts, 0, 0)) + + target: {}; +>target : Symbol(target, Decl(genericPrototypeProperty3.ts, 0, 17)) +} + +class MyEvent extends BaseEvent { // T is instantiated to any in the prototype, which is assignable to {} +>MyEvent : Symbol(MyEvent, Decl(genericPrototypeProperty3.ts, 2, 1)) +>T : Symbol(T, Decl(genericPrototypeProperty3.ts, 4, 14)) +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty3.ts, 0, 0)) + + target: T; +>target : Symbol(target, Decl(genericPrototypeProperty3.ts, 4, 36)) +>T : Symbol(T, Decl(genericPrototypeProperty3.ts, 4, 14)) +} +class BaseEventWrapper { +>BaseEventWrapper : Symbol(BaseEventWrapper, Decl(genericPrototypeProperty3.ts, 6, 1)) + + t: BaseEvent; +>t : Symbol(t, Decl(genericPrototypeProperty3.ts, 7, 24)) +>BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty3.ts, 0, 0)) +} + +class MyEventWrapper extends BaseEventWrapper { +>MyEventWrapper : Symbol(MyEventWrapper, Decl(genericPrototypeProperty3.ts, 9, 1)) +>BaseEventWrapper : Symbol(BaseEventWrapper, Decl(genericPrototypeProperty3.ts, 6, 1)) + + t: MyEvent; +>t : Symbol(t, Decl(genericPrototypeProperty3.ts, 11, 47)) +>MyEvent : Symbol(MyEvent, Decl(genericPrototypeProperty3.ts, 2, 1)) +} diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.symbols b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.symbols new file mode 100644 index 00000000000..ff8d19ff6e6 --- /dev/null +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.symbols @@ -0,0 +1,68 @@ +=== tests/cases/compiler/genericRecursiveImplicitConstructorErrors2.ts === +module TypeScript2 { +>TypeScript2 : Symbol(TypeScript2, Decl(genericRecursiveImplicitConstructorErrors2.ts, 0, 0)) + + export interface DeclKind { }; +>DeclKind : Symbol(DeclKind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 0, 20)) + + export interface PullTypesymbol { }; +>PullTypesymbol : Symbol(PullTypesymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 1, 32)) + + export interface SymbolLinkKind { }; +>SymbolLinkKind : Symbol(SymbolLinkKind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 2, 38)) + + export enum PullSymbolVisibility { +>PullSymbolVisibility : Symbol(PullSymbolVisibility, Decl(genericRecursiveImplicitConstructorErrors2.ts, 3, 38)) + + Private, +>Private : Symbol(PullSymbolVisibility.Private, Decl(genericRecursiveImplicitConstructorErrors2.ts, 4, 36)) + + Public +>Public : Symbol(PullSymbolVisibility.Public, Decl(genericRecursiveImplicitConstructorErrors2.ts, 5, 12)) + } +  + export class PullSymbol { +>PullSymbol : Symbol(PullSymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 7, 3)) + + constructor (name: string, declKind: DeclKind) { +>name : Symbol(name, Decl(genericRecursiveImplicitConstructorErrors2.ts, 10, 17)) +>declKind : Symbol(declKind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 10, 30)) +>DeclKind : Symbol(DeclKind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 0, 20)) + + } + // link methods + public addOutgoingLink(linkTo: PullSymbol, kind: SymbolLinkKind) { +>addOutgoingLink : Symbol(addOutgoingLink, Decl(genericRecursiveImplicitConstructorErrors2.ts, 12, 5)) +>A : Symbol(A, Decl(genericRecursiveImplicitConstructorErrors2.ts, 14, 27)) +>B : Symbol(B, Decl(genericRecursiveImplicitConstructorErrors2.ts, 14, 29)) +>C : Symbol(C, Decl(genericRecursiveImplicitConstructorErrors2.ts, 14, 31)) +>linkTo : Symbol(linkTo, Decl(genericRecursiveImplicitConstructorErrors2.ts, 14, 34)) +>PullSymbol : Symbol(PullSymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 7, 3)) +>kind : Symbol(kind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 14, 53)) +>SymbolLinkKind : Symbol(SymbolLinkKind, Decl(genericRecursiveImplicitConstructorErrors2.ts, 2, 38)) + + } + + public getType(): PullTypeSymbol { +>getType : Symbol(getType, Decl(genericRecursiveImplicitConstructorErrors2.ts, 16, 5)) +>A : Symbol(A, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 19)) +>B : Symbol(B, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 21)) +>C : Symbol(C, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 23)) +>PullTypeSymbol : Symbol(PullTypeSymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 21, 3)) +>A : Symbol(A, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 19)) +>B : Symbol(B, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 21)) +>C : Symbol(C, Decl(genericRecursiveImplicitConstructorErrors2.ts, 18, 23)) + + return undefined; +>undefined : Symbol(undefined) + } + } + export class PullTypeSymbol extends PullSymbol { +>PullTypeSymbol : Symbol(PullTypeSymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 21, 3)) +>A : Symbol(A, Decl(genericRecursiveImplicitConstructorErrors2.ts, 22, 31)) +>B : Symbol(B, Decl(genericRecursiveImplicitConstructorErrors2.ts, 22, 33)) +>C : Symbol(C, Decl(genericRecursiveImplicitConstructorErrors2.ts, 22, 35)) +>PullSymbol : Symbol(PullSymbol, Decl(genericRecursiveImplicitConstructorErrors2.ts, 7, 3)) + } +} + diff --git a/tests/baselines/reference/genericReversingTypeParameters.symbols b/tests/baselines/reference/genericReversingTypeParameters.symbols new file mode 100644 index 00000000000..05eb102f36b --- /dev/null +++ b/tests/baselines/reference/genericReversingTypeParameters.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/genericReversingTypeParameters.ts === +class BiMap { +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters.ts, 0, 0)) +>K : Symbol(K, Decl(genericReversingTypeParameters.ts, 0, 12)) +>V : Symbol(V, Decl(genericReversingTypeParameters.ts, 0, 14)) + + private inverseBiMap: BiMap; +>inverseBiMap : Symbol(inverseBiMap, Decl(genericReversingTypeParameters.ts, 0, 19)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters.ts, 0, 0)) +>V : Symbol(V, Decl(genericReversingTypeParameters.ts, 0, 14)) +>K : Symbol(K, Decl(genericReversingTypeParameters.ts, 0, 12)) + + public get(key: K): V { return null; } +>get : Symbol(get, Decl(genericReversingTypeParameters.ts, 1, 38)) +>key : Symbol(key, Decl(genericReversingTypeParameters.ts, 2, 15)) +>K : Symbol(K, Decl(genericReversingTypeParameters.ts, 0, 12)) +>V : Symbol(V, Decl(genericReversingTypeParameters.ts, 0, 14)) + + public inverse(): BiMap { return null; } +>inverse : Symbol(inverse, Decl(genericReversingTypeParameters.ts, 2, 42)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters.ts, 0, 0)) +>V : Symbol(V, Decl(genericReversingTypeParameters.ts, 0, 14)) +>K : Symbol(K, Decl(genericReversingTypeParameters.ts, 0, 12)) +} + +var b = new BiMap(); +>b : Symbol(b, Decl(genericReversingTypeParameters.ts, 6, 3)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters.ts, 0, 0)) + +var r1 = b.get(''); +>r1 : Symbol(r1, Decl(genericReversingTypeParameters.ts, 7, 3)) +>b.get : Symbol(BiMap.get, Decl(genericReversingTypeParameters.ts, 1, 38)) +>b : Symbol(b, Decl(genericReversingTypeParameters.ts, 6, 3)) +>get : Symbol(BiMap.get, Decl(genericReversingTypeParameters.ts, 1, 38)) + +var i = b.inverse(); // used to get the type wrong here. +>i : Symbol(i, Decl(genericReversingTypeParameters.ts, 8, 3)) +>b.inverse : Symbol(BiMap.inverse, Decl(genericReversingTypeParameters.ts, 2, 42)) +>b : Symbol(b, Decl(genericReversingTypeParameters.ts, 6, 3)) +>inverse : Symbol(BiMap.inverse, Decl(genericReversingTypeParameters.ts, 2, 42)) + +var r2b = i.get(1); +>r2b : Symbol(r2b, Decl(genericReversingTypeParameters.ts, 9, 3)) +>i.get : Symbol(BiMap.get, Decl(genericReversingTypeParameters.ts, 1, 38)) +>i : Symbol(i, Decl(genericReversingTypeParameters.ts, 8, 3)) +>get : Symbol(BiMap.get, Decl(genericReversingTypeParameters.ts, 1, 38)) + diff --git a/tests/baselines/reference/genericReversingTypeParameters.types b/tests/baselines/reference/genericReversingTypeParameters.types index a95f6620082..524a2ebba03 100644 --- a/tests/baselines/reference/genericReversingTypeParameters.types +++ b/tests/baselines/reference/genericReversingTypeParameters.types @@ -15,12 +15,14 @@ class BiMap { >key : K >K : K >V : V +>null : null public inverse(): BiMap { return null; } >inverse : () => BiMap >BiMap : BiMap >V : V >K : K +>null : null } var b = new BiMap(); @@ -34,6 +36,7 @@ var r1 = b.get(''); >b.get : (key: string) => number >b : BiMap >get : (key: string) => number +>'' : string var i = b.inverse(); // used to get the type wrong here. >i : BiMap @@ -48,4 +51,5 @@ var r2b = i.get(1); >i.get : (key: number) => string >i : BiMap >get : (key: number) => string +>1 : number diff --git a/tests/baselines/reference/genericReversingTypeParameters2.symbols b/tests/baselines/reference/genericReversingTypeParameters2.symbols new file mode 100644 index 00000000000..d33dbd3a64b --- /dev/null +++ b/tests/baselines/reference/genericReversingTypeParameters2.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/genericReversingTypeParameters2.ts === +class BiMap { +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters2.ts, 0, 0)) +>K : Symbol(K, Decl(genericReversingTypeParameters2.ts, 0, 12)) +>V : Symbol(V, Decl(genericReversingTypeParameters2.ts, 0, 14)) + + private inverseBiMap: BiMap; +>inverseBiMap : Symbol(inverseBiMap, Decl(genericReversingTypeParameters2.ts, 0, 19)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters2.ts, 0, 0)) +>V : Symbol(V, Decl(genericReversingTypeParameters2.ts, 0, 14)) +>K : Symbol(K, Decl(genericReversingTypeParameters2.ts, 0, 12)) + + public get(key: K): V { return null; } +>get : Symbol(get, Decl(genericReversingTypeParameters2.ts, 1, 38)) +>key : Symbol(key, Decl(genericReversingTypeParameters2.ts, 2, 15)) +>K : Symbol(K, Decl(genericReversingTypeParameters2.ts, 0, 12)) +>V : Symbol(V, Decl(genericReversingTypeParameters2.ts, 0, 14)) + + public inverse(): BiMap { return null; } +>inverse : Symbol(inverse, Decl(genericReversingTypeParameters2.ts, 2, 42)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters2.ts, 0, 0)) +>V : Symbol(V, Decl(genericReversingTypeParameters2.ts, 0, 14)) +>K : Symbol(K, Decl(genericReversingTypeParameters2.ts, 0, 12)) +} + +var b = new BiMap(); +>b : Symbol(b, Decl(genericReversingTypeParameters2.ts, 6, 3)) +>BiMap : Symbol(BiMap, Decl(genericReversingTypeParameters2.ts, 0, 0)) + +var i = b.inverse(); // used to get the type wrong here. +>i : Symbol(i, Decl(genericReversingTypeParameters2.ts, 7, 3)) +>b.inverse : Symbol(BiMap.inverse, Decl(genericReversingTypeParameters2.ts, 2, 42)) +>b : Symbol(b, Decl(genericReversingTypeParameters2.ts, 6, 3)) +>inverse : Symbol(BiMap.inverse, Decl(genericReversingTypeParameters2.ts, 2, 42)) + +var r2b = i.get(1); +>r2b : Symbol(r2b, Decl(genericReversingTypeParameters2.ts, 8, 3)) +>i.get : Symbol(BiMap.get, Decl(genericReversingTypeParameters2.ts, 1, 38)) +>i : Symbol(i, Decl(genericReversingTypeParameters2.ts, 7, 3)) +>get : Symbol(BiMap.get, Decl(genericReversingTypeParameters2.ts, 1, 38)) + diff --git a/tests/baselines/reference/genericReversingTypeParameters2.types b/tests/baselines/reference/genericReversingTypeParameters2.types index 4356280f4d3..28c1f40ce9f 100644 --- a/tests/baselines/reference/genericReversingTypeParameters2.types +++ b/tests/baselines/reference/genericReversingTypeParameters2.types @@ -15,12 +15,14 @@ class BiMap { >key : K >K : K >V : V +>null : null public inverse(): BiMap { return null; } >inverse : () => BiMap >BiMap : BiMap >V : V >K : K +>null : null } var b = new BiMap(); @@ -41,4 +43,5 @@ var r2b = i.get(1); >i.get : (key: number) => string >i : BiMap >get : (key: number) => string +>1 : number diff --git a/tests/baselines/reference/genericSignatureInheritance.symbols b/tests/baselines/reference/genericSignatureInheritance.symbols new file mode 100644 index 00000000000..7157d7b9346 --- /dev/null +++ b/tests/baselines/reference/genericSignatureInheritance.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/genericSignatureInheritance.ts === +interface I { +>I : Symbol(I, Decl(genericSignatureInheritance.ts, 0, 0)) + + (x: T): string; +>T : Symbol(T, Decl(genericSignatureInheritance.ts, 1, 5)) +>x : Symbol(x, Decl(genericSignatureInheritance.ts, 1, 8)) +>T : Symbol(T, Decl(genericSignatureInheritance.ts, 1, 5)) +} + +interface I2 extends I { } +>I2 : Symbol(I2, Decl(genericSignatureInheritance.ts, 2, 1)) +>I : Symbol(I, Decl(genericSignatureInheritance.ts, 0, 0)) + diff --git a/tests/baselines/reference/genericSignatureInheritance2.symbols b/tests/baselines/reference/genericSignatureInheritance2.symbols new file mode 100644 index 00000000000..3c0e5e2603c --- /dev/null +++ b/tests/baselines/reference/genericSignatureInheritance2.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericSignatureInheritance2.ts === +interface I { +>I : Symbol(I, Decl(genericSignatureInheritance2.ts, 0, 0)) + + (x: T): string; +>T : Symbol(T, Decl(genericSignatureInheritance2.ts, 1, 5)) +>x : Symbol(x, Decl(genericSignatureInheritance2.ts, 1, 8)) +>T : Symbol(T, Decl(genericSignatureInheritance2.ts, 1, 5)) +} + +interface I2 extends I { +>I2 : Symbol(I2, Decl(genericSignatureInheritance2.ts, 2, 1)) +>I : Symbol(I, Decl(genericSignatureInheritance2.ts, 0, 0)) + + (x: T): void; +>T : Symbol(T, Decl(genericSignatureInheritance2.ts, 5, 5)) +>x : Symbol(x, Decl(genericSignatureInheritance2.ts, 5, 8)) +>T : Symbol(T, Decl(genericSignatureInheritance2.ts, 5, 5)) +} + diff --git a/tests/baselines/reference/genericSpecializationToTypeLiteral1.symbols b/tests/baselines/reference/genericSpecializationToTypeLiteral1.symbols new file mode 100644 index 00000000000..78203ddacf6 --- /dev/null +++ b/tests/baselines/reference/genericSpecializationToTypeLiteral1.symbols @@ -0,0 +1,178 @@ +=== tests/cases/compiler/genericSpecializationToTypeLiteral1.ts === +interface IEnumerable { +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + zip(second: IEnumerable, resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable; +>zip : Symbol(zip, Decl(genericSpecializationToTypeLiteral1.ts, 0, 26), Decl(genericSpecializationToTypeLiteral1.ts, 2, 128), Decl(genericSpecializationToTypeLiteral1.ts, 3, 117)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 2, 8)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 2, 17)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>resultSelector : Symbol(resultSelector, Decl(genericSpecializationToTypeLiteral1.ts, 2, 40)) +>first : Symbol(first, Decl(genericSpecializationToTypeLiteral1.ts, 2, 58)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 2, 67)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>index : Symbol(index, Decl(genericSpecializationToTypeLiteral1.ts, 2, 78)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 2, 8)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 2, 8)) + + zip(second: T[], resultSelector: (first: T, second: T, index: number) => TResult): IEnumerable; +>zip : Symbol(zip, Decl(genericSpecializationToTypeLiteral1.ts, 0, 26), Decl(genericSpecializationToTypeLiteral1.ts, 2, 128), Decl(genericSpecializationToTypeLiteral1.ts, 3, 117)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 3, 8)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 3, 17)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>resultSelector : Symbol(resultSelector, Decl(genericSpecializationToTypeLiteral1.ts, 3, 29)) +>first : Symbol(first, Decl(genericSpecializationToTypeLiteral1.ts, 3, 47)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 3, 56)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>index : Symbol(index, Decl(genericSpecializationToTypeLiteral1.ts, 3, 67)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 3, 8)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 3, 8)) + + zip(...params: any[]): IEnumerable; // last one is selector +>zip : Symbol(zip, Decl(genericSpecializationToTypeLiteral1.ts, 0, 26), Decl(genericSpecializationToTypeLiteral1.ts, 2, 128), Decl(genericSpecializationToTypeLiteral1.ts, 3, 117)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 4, 8)) +>params : Symbol(params, Decl(genericSpecializationToTypeLiteral1.ts, 4, 17)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 4, 8)) + + merge(...params: IEnumerable[]): IEnumerable; +>merge : Symbol(merge, Decl(genericSpecializationToTypeLiteral1.ts, 4, 57), Decl(genericSpecializationToTypeLiteral1.ts, 6, 64)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 6, 10)) +>params : Symbol(params, Decl(genericSpecializationToTypeLiteral1.ts, 6, 19)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + merge(...params: T[][]): IEnumerable; +>merge : Symbol(merge, Decl(genericSpecializationToTypeLiteral1.ts, 4, 57), Decl(genericSpecializationToTypeLiteral1.ts, 6, 64)) +>TResult : Symbol(TResult, Decl(genericSpecializationToTypeLiteral1.ts, 7, 10)) +>params : Symbol(params, Decl(genericSpecializationToTypeLiteral1.ts, 7, 19)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + + concat(...sequences: IEnumerable[]): IEnumerable; +>concat : Symbol(concat, Decl(genericSpecializationToTypeLiteral1.ts, 7, 53), Decl(genericSpecializationToTypeLiteral1.ts, 10, 59)) +>sequences : Symbol(sequences, Decl(genericSpecializationToTypeLiteral1.ts, 10, 11)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + concat(...sequences: T[]): IEnumerable; +>concat : Symbol(concat, Decl(genericSpecializationToTypeLiteral1.ts, 7, 53), Decl(genericSpecializationToTypeLiteral1.ts, 10, 59)) +>sequences : Symbol(sequences, Decl(genericSpecializationToTypeLiteral1.ts, 11, 11)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + insert(index: number, second: IEnumerable): IEnumerable; +>insert : Symbol(insert, Decl(genericSpecializationToTypeLiteral1.ts, 11, 46)) +>index : Symbol(index, Decl(genericSpecializationToTypeLiteral1.ts, 13, 11)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 13, 25)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + sequenceEqual(second: IEnumerable): boolean; +>sequenceEqual : Symbol(sequenceEqual, Decl(genericSpecializationToTypeLiteral1.ts, 13, 66), Decl(genericSpecializationToTypeLiteral1.ts, 15, 51), Decl(genericSpecializationToTypeLiteral1.ts, 16, 104), Decl(genericSpecializationToTypeLiteral1.ts, 17, 40)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 15, 18)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + sequenceEqual(second: IEnumerable, compareSelector: (element: T) => TCompare): boolean; +>sequenceEqual : Symbol(sequenceEqual, Decl(genericSpecializationToTypeLiteral1.ts, 13, 66), Decl(genericSpecializationToTypeLiteral1.ts, 15, 51), Decl(genericSpecializationToTypeLiteral1.ts, 16, 104), Decl(genericSpecializationToTypeLiteral1.ts, 17, 40)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 16, 18)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 16, 28)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>compareSelector : Symbol(compareSelector, Decl(genericSpecializationToTypeLiteral1.ts, 16, 51)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 16, 70)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 16, 18)) + + sequenceEqual(second: T[]): boolean; +>sequenceEqual : Symbol(sequenceEqual, Decl(genericSpecializationToTypeLiteral1.ts, 13, 66), Decl(genericSpecializationToTypeLiteral1.ts, 15, 51), Decl(genericSpecializationToTypeLiteral1.ts, 16, 104), Decl(genericSpecializationToTypeLiteral1.ts, 17, 40)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 17, 18)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) + + sequenceEqual(second: T[], compareSelector: (element: T) => TCompare): boolean; +>sequenceEqual : Symbol(sequenceEqual, Decl(genericSpecializationToTypeLiteral1.ts, 13, 66), Decl(genericSpecializationToTypeLiteral1.ts, 15, 51), Decl(genericSpecializationToTypeLiteral1.ts, 16, 104), Decl(genericSpecializationToTypeLiteral1.ts, 17, 40)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 18, 18)) +>second : Symbol(second, Decl(genericSpecializationToTypeLiteral1.ts, 18, 28)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>compareSelector : Symbol(compareSelector, Decl(genericSpecializationToTypeLiteral1.ts, 18, 40)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 18, 59)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 18, 18)) + + toDictionary(keySelector: (element: T) => TKey): IDictionary; +>toDictionary : Symbol(toDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 18, 93), Decl(genericSpecializationToTypeLiteral1.ts, 20, 82), Decl(genericSpecializationToTypeLiteral1.ts, 21, 134)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 20, 17)) +>keySelector : Symbol(keySelector, Decl(genericSpecializationToTypeLiteral1.ts, 20, 23)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 20, 37)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 20, 17)) +>IDictionary : Symbol(IDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 23, 1)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 20, 17)) + + toDictionary(keySelector: (element: T) => TKey, elementSelector: (element: T) => TValue): IDictionary; +>toDictionary : Symbol(toDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 18, 93), Decl(genericSpecializationToTypeLiteral1.ts, 20, 82), Decl(genericSpecializationToTypeLiteral1.ts, 21, 134)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 21, 17)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 21, 22)) +>keySelector : Symbol(keySelector, Decl(genericSpecializationToTypeLiteral1.ts, 21, 31)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 21, 45)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 21, 17)) +>elementSelector : Symbol(elementSelector, Decl(genericSpecializationToTypeLiteral1.ts, 21, 65)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 21, 84)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 21, 22)) +>IDictionary : Symbol(IDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 23, 1)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 21, 17)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 21, 22)) + + toDictionary(keySelector: (element: T) => TKey, elementSelector: (element: T) => TValue, compareSelector: (key: TKey) => TCompare): IDictionary; +>toDictionary : Symbol(toDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 18, 93), Decl(genericSpecializationToTypeLiteral1.ts, 20, 82), Decl(genericSpecializationToTypeLiteral1.ts, 21, 134)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 22, 17)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 22, 22)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 22, 30)) +>keySelector : Symbol(keySelector, Decl(genericSpecializationToTypeLiteral1.ts, 22, 41)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 22, 55)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 22, 17)) +>elementSelector : Symbol(elementSelector, Decl(genericSpecializationToTypeLiteral1.ts, 22, 75)) +>element : Symbol(element, Decl(genericSpecializationToTypeLiteral1.ts, 22, 94)) +>T : Symbol(T, Decl(genericSpecializationToTypeLiteral1.ts, 0, 22)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 22, 22)) +>compareSelector : Symbol(compareSelector, Decl(genericSpecializationToTypeLiteral1.ts, 22, 116)) +>key : Symbol(key, Decl(genericSpecializationToTypeLiteral1.ts, 22, 135)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 22, 17)) +>TCompare : Symbol(TCompare, Decl(genericSpecializationToTypeLiteral1.ts, 22, 30)) +>IDictionary : Symbol(IDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 23, 1)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 22, 17)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 22, 22)) +} + +interface IDictionary { +>IDictionary : Symbol(IDictionary, Decl(genericSpecializationToTypeLiteral1.ts, 23, 1)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 25, 22)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 25, 27)) + + toEnumerable(): IEnumerable<{ key: TKey; value: TValue }>; +>toEnumerable : Symbol(toEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 25, 37)) +>IEnumerable : Symbol(IEnumerable, Decl(genericSpecializationToTypeLiteral1.ts, 0, 0)) +>key : Symbol(key, Decl(genericSpecializationToTypeLiteral1.ts, 26, 33)) +>TKey : Symbol(TKey, Decl(genericSpecializationToTypeLiteral1.ts, 25, 22)) +>value : Symbol(value, Decl(genericSpecializationToTypeLiteral1.ts, 26, 44)) +>TValue : Symbol(TValue, Decl(genericSpecializationToTypeLiteral1.ts, 25, 27)) +} diff --git a/tests/baselines/reference/genericSpecializations1.symbols b/tests/baselines/reference/genericSpecializations1.symbols new file mode 100644 index 00000000000..87f31276b3f --- /dev/null +++ b/tests/baselines/reference/genericSpecializations1.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/genericSpecializations1.ts === +interface IFoo { +>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 0, 15)) + + foo(x: T): T; // no error on implementors because IFoo's T is different from foo's T +>foo : Symbol(foo, Decl(genericSpecializations1.ts, 0, 19)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 1, 8)) +>x : Symbol(x, Decl(genericSpecializations1.ts, 1, 11)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 1, 8)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 1, 8)) +} + +class IntFooBad implements IFoo { +>IntFooBad : Symbol(IntFooBad, Decl(genericSpecializations1.ts, 2, 1)) +>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(genericSpecializations1.ts, 4, 41)) +>x : Symbol(x, Decl(genericSpecializations1.ts, 5, 8)) +} + +class StringFoo2 implements IFoo { +>StringFoo2 : Symbol(StringFoo2, Decl(genericSpecializations1.ts, 6, 1)) +>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(genericSpecializations1.ts, 8, 42)) +>x : Symbol(x, Decl(genericSpecializations1.ts, 9, 8)) +} + +class StringFoo3 implements IFoo { +>StringFoo3 : Symbol(StringFoo3, Decl(genericSpecializations1.ts, 10, 1)) +>IFoo : Symbol(IFoo, Decl(genericSpecializations1.ts, 0, 0)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(genericSpecializations1.ts, 12, 42)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 13, 8)) +>x : Symbol(x, Decl(genericSpecializations1.ts, 13, 11)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 13, 8)) +>T : Symbol(T, Decl(genericSpecializations1.ts, 13, 8)) +} diff --git a/tests/baselines/reference/genericSpecializations1.types b/tests/baselines/reference/genericSpecializations1.types index 3b60a3b9987..87f32d86d52 100644 --- a/tests/baselines/reference/genericSpecializations1.types +++ b/tests/baselines/reference/genericSpecializations1.types @@ -18,6 +18,7 @@ class IntFooBad implements IFoo { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class StringFoo2 implements IFoo { @@ -27,6 +28,7 @@ class StringFoo2 implements IFoo { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class StringFoo3 implements IFoo { @@ -39,4 +41,5 @@ class StringFoo3 implements IFoo { >x : T >T : T >T : T +>null : null } diff --git a/tests/baselines/reference/genericStaticAnyTypeFunction.symbols b/tests/baselines/reference/genericStaticAnyTypeFunction.symbols new file mode 100644 index 00000000000..21008a38698 --- /dev/null +++ b/tests/baselines/reference/genericStaticAnyTypeFunction.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/genericStaticAnyTypeFunction.ts === +class A { +>A : Symbol(A, Decl(genericStaticAnyTypeFunction.ts, 0, 0)) + + static one(source: T, value: number): T { +>one : Symbol(A.one, Decl(genericStaticAnyTypeFunction.ts, 0, 9)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 2, 15)) +>source : Symbol(source, Decl(genericStaticAnyTypeFunction.ts, 2, 18)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 2, 15)) +>value : Symbol(value, Decl(genericStaticAnyTypeFunction.ts, 2, 28)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 2, 15)) + + return source; +>source : Symbol(source, Decl(genericStaticAnyTypeFunction.ts, 2, 18)) + + } + static goo() { return 0; } +>goo : Symbol(A.goo, Decl(genericStaticAnyTypeFunction.ts, 6, 5)) + + static two(source: T): T { +>two : Symbol(A.two, Decl(genericStaticAnyTypeFunction.ts, 7, 30)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 9, 15)) +>source : Symbol(source, Decl(genericStaticAnyTypeFunction.ts, 9, 18)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 9, 15)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 9, 15)) + + return this.one(source, 42); // should not error +>this.one : Symbol(A.one, Decl(genericStaticAnyTypeFunction.ts, 0, 9)) +>this : Symbol(A, Decl(genericStaticAnyTypeFunction.ts, 0, 0)) +>one : Symbol(A.one, Decl(genericStaticAnyTypeFunction.ts, 0, 9)) +>T : Symbol(T, Decl(genericStaticAnyTypeFunction.ts, 9, 15)) +>source : Symbol(source, Decl(genericStaticAnyTypeFunction.ts, 9, 18)) + + } + +} + + + diff --git a/tests/baselines/reference/genericStaticAnyTypeFunction.types b/tests/baselines/reference/genericStaticAnyTypeFunction.types index 9cf511ca0d9..38b3c3708e7 100644 --- a/tests/baselines/reference/genericStaticAnyTypeFunction.types +++ b/tests/baselines/reference/genericStaticAnyTypeFunction.types @@ -16,6 +16,7 @@ class A { } static goo() { return 0; } >goo : () => number +>0 : number static two(source: T): T { >two : (source: T) => T @@ -31,6 +32,7 @@ class A { >one : (source: T, value: number) => T >T : T >source : T +>42 : number } diff --git a/tests/baselines/reference/genericTypeArgumentInference1.symbols b/tests/baselines/reference/genericTypeArgumentInference1.symbols new file mode 100644 index 00000000000..7b88a84337e --- /dev/null +++ b/tests/baselines/reference/genericTypeArgumentInference1.symbols @@ -0,0 +1,79 @@ +=== tests/cases/compiler/genericTypeArgumentInference1.ts === +module Underscore { +>Underscore : Symbol(Underscore, Decl(genericTypeArgumentInference1.ts, 0, 0)) + + export interface Iterator { +>Iterator : Symbol(Iterator, Decl(genericTypeArgumentInference1.ts, 0, 19)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 1, 30)) +>U : Symbol(U, Decl(genericTypeArgumentInference1.ts, 1, 32)) + + (value: T, index: any, list: any): U; +>value : Symbol(value, Decl(genericTypeArgumentInference1.ts, 2, 9)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 1, 30)) +>index : Symbol(index, Decl(genericTypeArgumentInference1.ts, 2, 18)) +>list : Symbol(list, Decl(genericTypeArgumentInference1.ts, 2, 30)) +>U : Symbol(U, Decl(genericTypeArgumentInference1.ts, 1, 32)) + } + export interface Static { +>Static : Symbol(Static, Decl(genericTypeArgumentInference1.ts, 3, 5)) + + all(list: T[], iterator?: Iterator, context?: any): T; +>all : Symbol(all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 5, 12)) +>list : Symbol(list, Decl(genericTypeArgumentInference1.ts, 5, 15)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 5, 12)) +>iterator : Symbol(iterator, Decl(genericTypeArgumentInference1.ts, 5, 25)) +>Iterator : Symbol(Iterator, Decl(genericTypeArgumentInference1.ts, 0, 19)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 5, 12)) +>context : Symbol(context, Decl(genericTypeArgumentInference1.ts, 5, 58)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 5, 12)) + + identity(value: T): T; +>identity : Symbol(identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 6, 17)) +>value : Symbol(value, Decl(genericTypeArgumentInference1.ts, 6, 20)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 6, 17)) +>T : Symbol(T, Decl(genericTypeArgumentInference1.ts, 6, 17)) + } +} +declare var _: Underscore.Static; +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>Underscore : Symbol(Underscore, Decl(genericTypeArgumentInference1.ts, 0, 0)) +>Static : Symbol(Underscore.Static, Decl(genericTypeArgumentInference1.ts, 3, 5)) + +var r = _.all([true, 1, null, 'yes'], _.identity); +>r : Symbol(r, Decl(genericTypeArgumentInference1.ts, 11, 3)) +>_.all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) + +var r2 = _.all([true], _.identity); +>r2 : Symbol(r2, Decl(genericTypeArgumentInference1.ts, 12, 3)) +>_.all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) + +var r3 = _.all([], _.identity); +>r3 : Symbol(r3, Decl(genericTypeArgumentInference1.ts, 13, 3)) +>_.all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) + +var r4 = _.all([true], _.identity); +>r4 : Symbol(r4, Decl(genericTypeArgumentInference1.ts, 14, 3)) +>_.all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>all : Symbol(Underscore.Static.all, Decl(genericTypeArgumentInference1.ts, 4, 29)) +>_.identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) +>_ : Symbol(_, Decl(genericTypeArgumentInference1.ts, 9, 11)) +>identity : Symbol(Underscore.Static.identity, Decl(genericTypeArgumentInference1.ts, 5, 77)) + diff --git a/tests/baselines/reference/genericTypeArgumentInference1.types b/tests/baselines/reference/genericTypeArgumentInference1.types index c718ccca620..2d64c8f5c58 100644 --- a/tests/baselines/reference/genericTypeArgumentInference1.types +++ b/tests/baselines/reference/genericTypeArgumentInference1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericTypeArgumentInference1.ts === module Underscore { ->Underscore : unknown +>Underscore : any export interface Iterator { >Iterator : Iterator @@ -38,7 +38,7 @@ module Underscore { } declare var _: Underscore.Static; >_ : Underscore.Static ->Underscore : unknown +>Underscore : any >Static : Underscore.Static var r = _.all([true, 1, null, 'yes'], _.identity); @@ -48,6 +48,10 @@ var r = _.all([true, 1, null, 'yes'], _.identity); >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >[true, 1, null, 'yes'] : (string | number | boolean)[] +>true : boolean +>1 : number +>null : null +>'yes' : string >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -59,6 +63,7 @@ var r2 = _.all([true], _.identity); >_ : Underscore.Static >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >[true] : boolean[] +>true : boolean >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T @@ -82,6 +87,7 @@ var r4 = _.all([true], _.identity); >all : (list: T[], iterator?: Underscore.Iterator, context?: any) => T >[true] : any[] >true : any +>true : boolean >_.identity : (value: T) => T >_ : Underscore.Static >identity : (value: T) => T diff --git a/tests/baselines/reference/genericTypeAssertions3.symbols b/tests/baselines/reference/genericTypeAssertions3.symbols new file mode 100644 index 00000000000..4d19f156200 --- /dev/null +++ b/tests/baselines/reference/genericTypeAssertions3.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/genericTypeAssertions3.ts === +var r = < (x: T) => T > ((x) => { return null; }); // bug was 'could not find dotted symbol T' on x's annotation in the type assertion instead of no error +>r : Symbol(r, Decl(genericTypeAssertions3.ts, 0, 3)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 0, 11)) +>x : Symbol(x, Decl(genericTypeAssertions3.ts, 0, 14)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 0, 11)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 0, 11)) +>x : Symbol(x, Decl(genericTypeAssertions3.ts, 0, 29)) + +var s = < (x: T) => T > ((x: any) => { return null; }); // no error +>s : Symbol(s, Decl(genericTypeAssertions3.ts, 1, 3)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 1, 11)) +>x : Symbol(x, Decl(genericTypeAssertions3.ts, 1, 14)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 1, 11)) +>T : Symbol(T, Decl(genericTypeAssertions3.ts, 1, 11)) +>x : Symbol(x, Decl(genericTypeAssertions3.ts, 1, 29)) + diff --git a/tests/baselines/reference/genericTypeAssertions3.types b/tests/baselines/reference/genericTypeAssertions3.types index 53435145939..9f7facc8d47 100644 --- a/tests/baselines/reference/genericTypeAssertions3.types +++ b/tests/baselines/reference/genericTypeAssertions3.types @@ -9,6 +9,7 @@ var r = < (x: T) => T > ((x) => { return null; }); // bug was 'could not find >((x) => { return null; }) : (x: any) => any >(x) => { return null; } : (x: any) => any >x : any +>null : null var s = < (x: T) => T > ((x: any) => { return null; }); // no error >s : (x: T) => T @@ -20,4 +21,5 @@ var s = < (x: T) => T > ((x: any) => { return null; }); // no error >((x: any) => { return null; }) : (x: any) => any >(x: any) => { return null; } : (x: any) => any >x : any +>null : null diff --git a/tests/baselines/reference/genericTypeParameterEquivalence2.symbols b/tests/baselines/reference/genericTypeParameterEquivalence2.symbols new file mode 100644 index 00000000000..056b4ce96ab --- /dev/null +++ b/tests/baselines/reference/genericTypeParameterEquivalence2.symbols @@ -0,0 +1,192 @@ +=== tests/cases/compiler/genericTypeParameterEquivalence2.ts === +// compose :: (b->c) -> (a->b) -> (a->c) +function compose(f: (b: B) => C, g: (a:A) => B): (a:A) => C { +>compose : Symbol(compose, Decl(genericTypeParameterEquivalence2.ts, 0, 0)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 1, 17)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 1, 19)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 1, 22)) +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 1, 26)) +>b : Symbol(b, Decl(genericTypeParameterEquivalence2.ts, 1, 30)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 1, 19)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 1, 22)) +>g : Symbol(g, Decl(genericTypeParameterEquivalence2.ts, 1, 41)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 1, 46)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 1, 17)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 1, 19)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 1, 59)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 1, 17)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 1, 22)) + + return function (a:A) : C { +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 2, 21)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 1, 17)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 1, 22)) + + return f(g.apply(null, a)); +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 1, 26)) +>g.apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) +>g : Symbol(g, Decl(genericTypeParameterEquivalence2.ts, 1, 41)) +>apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 2, 21)) + + }; +} + +// forEach :: [a] -> (a -> ()) -> () +function forEach(list: A[], f: (a: A, n?: number) => void ): void { +>forEach : Symbol(forEach, Decl(genericTypeParameterEquivalence2.ts, 5, 1)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 8, 17)) +>list : Symbol(list, Decl(genericTypeParameterEquivalence2.ts, 8, 20)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 8, 17)) +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 8, 30)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 8, 35)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 8, 17)) +>n : Symbol(n, Decl(genericTypeParameterEquivalence2.ts, 8, 40)) + + for (var i = 0; i < list.length; ++i) { +>i : Symbol(i, Decl(genericTypeParameterEquivalence2.ts, 9, 12)) +>i : Symbol(i, Decl(genericTypeParameterEquivalence2.ts, 9, 12)) +>list.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>list : Symbol(list, Decl(genericTypeParameterEquivalence2.ts, 8, 20)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>i : Symbol(i, Decl(genericTypeParameterEquivalence2.ts, 9, 12)) + + f(list[i], i); +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 8, 30)) +>list : Symbol(list, Decl(genericTypeParameterEquivalence2.ts, 8, 20)) +>i : Symbol(i, Decl(genericTypeParameterEquivalence2.ts, 9, 12)) +>i : Symbol(i, Decl(genericTypeParameterEquivalence2.ts, 9, 12)) + } +} + +// filter :: (a->bool) -> [a] -> [a] +function filter(f: (a: A) => boolean, ar: A[]): A[] { +>filter : Symbol(filter, Decl(genericTypeParameterEquivalence2.ts, 12, 1)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 15, 16)) +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 15, 19)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 15, 23)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 15, 16)) +>ar : Symbol(ar, Decl(genericTypeParameterEquivalence2.ts, 15, 40)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 15, 16)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 15, 16)) + + var ret = []; +>ret : Symbol(ret, Decl(genericTypeParameterEquivalence2.ts, 16, 7)) + + forEach(ar, (el) => { +>forEach : Symbol(forEach, Decl(genericTypeParameterEquivalence2.ts, 5, 1)) +>ar : Symbol(ar, Decl(genericTypeParameterEquivalence2.ts, 15, 40)) +>el : Symbol(el, Decl(genericTypeParameterEquivalence2.ts, 17, 17)) + + if (f(el)) { +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 15, 19)) +>el : Symbol(el, Decl(genericTypeParameterEquivalence2.ts, 17, 17)) + + ret.push(el); +>ret.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>ret : Symbol(ret, Decl(genericTypeParameterEquivalence2.ts, 16, 7)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>el : Symbol(el, Decl(genericTypeParameterEquivalence2.ts, 17, 17)) + } + } ); + + return ret; +>ret : Symbol(ret, Decl(genericTypeParameterEquivalence2.ts, 16, 7)) +} + +// length :: [a] -> Num +function length2(ar: A[]): number { +>length2 : Symbol(length2, Decl(genericTypeParameterEquivalence2.ts, 24, 1)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 27, 17)) +>ar : Symbol(ar, Decl(genericTypeParameterEquivalence2.ts, 27, 20)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 27, 17)) + + return ar.length; +>ar.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>ar : Symbol(ar, Decl(genericTypeParameterEquivalence2.ts, 27, 20)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +} + +// curry1 :: ((a,b)->c) -> (a->(b->c)) +function curry1(f: (a: A, b: B) => C): (ax: A) => (bx: B) => C { +>curry1 : Symbol(curry1, Decl(genericTypeParameterEquivalence2.ts, 29, 1)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 32, 16)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 32, 18)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 32, 21)) +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 32, 25)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 32, 29)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 32, 16)) +>b : Symbol(b, Decl(genericTypeParameterEquivalence2.ts, 32, 34)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 32, 18)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 32, 21)) +>ax : Symbol(ax, Decl(genericTypeParameterEquivalence2.ts, 32, 49)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 32, 16)) +>bx : Symbol(bx, Decl(genericTypeParameterEquivalence2.ts, 32, 60)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 32, 18)) +>C : Symbol(C, Decl(genericTypeParameterEquivalence2.ts, 32, 21)) + + return function (ay: A) { +>ay : Symbol(ay, Decl(genericTypeParameterEquivalence2.ts, 33, 21)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 32, 16)) + + return function (by: B) { +>by : Symbol(by, Decl(genericTypeParameterEquivalence2.ts, 34, 25)) +>B : Symbol(B, Decl(genericTypeParameterEquivalence2.ts, 32, 18)) + + return f(ay, by); +>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 32, 25)) +>ay : Symbol(ay, Decl(genericTypeParameterEquivalence2.ts, 33, 21)) +>by : Symbol(by, Decl(genericTypeParameterEquivalence2.ts, 34, 25)) + + }; + }; +} + +var cfilter = curry1(filter); +>cfilter : Symbol(cfilter, Decl(genericTypeParameterEquivalence2.ts, 40, 3)) +>curry1 : Symbol(curry1, Decl(genericTypeParameterEquivalence2.ts, 29, 1)) +>filter : Symbol(filter, Decl(genericTypeParameterEquivalence2.ts, 12, 1)) + +// compose :: (b->c) -> (a->b) -> (a->c) +// length :: [a] -> Num +// cfilter :: {} -> {} -> [{}] +// pred :: a -> Bool +// cfilter(pred) :: {} -> [{}] +// length2 :: [a] -> Num +// countWhere :: (a -> Bool) -> [a] -> Num + +function countWhere_1(pred: (a: A) => boolean): (a: A[]) => number { +>countWhere_1 : Symbol(countWhere_1, Decl(genericTypeParameterEquivalence2.ts, 40, 29)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 50, 22)) +>pred : Symbol(pred, Decl(genericTypeParameterEquivalence2.ts, 50, 25)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 50, 32)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 50, 22)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 50, 52)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 50, 22)) + + return compose(length2, cfilter(pred)); +>compose : Symbol(compose, Decl(genericTypeParameterEquivalence2.ts, 0, 0)) +>length2 : Symbol(length2, Decl(genericTypeParameterEquivalence2.ts, 24, 1)) +>cfilter : Symbol(cfilter, Decl(genericTypeParameterEquivalence2.ts, 40, 3)) +>pred : Symbol(pred, Decl(genericTypeParameterEquivalence2.ts, 50, 25)) +} + +function countWhere_2(pred: (a: A) => boolean): (a: A[]) => number { +>countWhere_2 : Symbol(countWhere_2, Decl(genericTypeParameterEquivalence2.ts, 52, 1)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 54, 22)) +>pred : Symbol(pred, Decl(genericTypeParameterEquivalence2.ts, 54, 25)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 54, 32)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 54, 22)) +>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 54, 52)) +>A : Symbol(A, Decl(genericTypeParameterEquivalence2.ts, 54, 22)) + + var where = cfilter(pred); +>where : Symbol(where, Decl(genericTypeParameterEquivalence2.ts, 55, 7)) +>cfilter : Symbol(cfilter, Decl(genericTypeParameterEquivalence2.ts, 40, 3)) +>pred : Symbol(pred, Decl(genericTypeParameterEquivalence2.ts, 54, 25)) + + return compose(length2, where); +>compose : Symbol(compose, Decl(genericTypeParameterEquivalence2.ts, 0, 0)) +>length2 : Symbol(length2, Decl(genericTypeParameterEquivalence2.ts, 24, 1)) +>where : Symbol(where, Decl(genericTypeParameterEquivalence2.ts, 55, 7)) +} diff --git a/tests/baselines/reference/genericTypeParameterEquivalence2.types b/tests/baselines/reference/genericTypeParameterEquivalence2.types index 09e13b12f7b..3b2c533543d 100644 --- a/tests/baselines/reference/genericTypeParameterEquivalence2.types +++ b/tests/baselines/reference/genericTypeParameterEquivalence2.types @@ -30,6 +30,7 @@ function compose(f: (b: B) => C, g: (a:A) => B): (a:A) => C { >g.apply : (thisArg: any, argArray?: any) => any >g : (a: A) => B >apply : (thisArg: any, argArray?: any) => any +>null : null >a : A }; @@ -48,6 +49,7 @@ function forEach(list: A[], f: (a: A, n?: number) => void ): void { for (var i = 0; i < list.length; ++i) { >i : number +>0 : number >i < list.length : boolean >i : number >list.length : number diff --git a/tests/baselines/reference/genericTypeWithCallableMembers.symbols b/tests/baselines/reference/genericTypeWithCallableMembers.symbols new file mode 100644 index 00000000000..f162ddf64cc --- /dev/null +++ b/tests/baselines/reference/genericTypeWithCallableMembers.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/genericTypeWithCallableMembers.ts === +interface Constructable { +>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0)) + + new (): Constructable; +>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0)) +} + +class C { +>C : Symbol(C, Decl(genericTypeWithCallableMembers.ts, 2, 1)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers.ts, 4, 8)) +>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0)) + + constructor(public data: T, public data2: Constructable) { } +>data : Symbol(data, Decl(genericTypeWithCallableMembers.ts, 5, 16)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers.ts, 4, 8)) +>data2 : Symbol(data2, Decl(genericTypeWithCallableMembers.ts, 5, 31)) +>Constructable : Symbol(Constructable, Decl(genericTypeWithCallableMembers.ts, 0, 0)) + + create() { +>create : Symbol(create, Decl(genericTypeWithCallableMembers.ts, 5, 64)) + + var x = new this.data(); // no error +>x : Symbol(x, Decl(genericTypeWithCallableMembers.ts, 7, 11)) +>this.data : Symbol(data, Decl(genericTypeWithCallableMembers.ts, 5, 16)) +>this : Symbol(C, Decl(genericTypeWithCallableMembers.ts, 2, 1)) +>data : Symbol(data, Decl(genericTypeWithCallableMembers.ts, 5, 16)) + + var x2 = new this.data2(); // was error, shouldn't be +>x2 : Symbol(x2, Decl(genericTypeWithCallableMembers.ts, 8, 11)) +>this.data2 : Symbol(data2, Decl(genericTypeWithCallableMembers.ts, 5, 31)) +>this : Symbol(C, Decl(genericTypeWithCallableMembers.ts, 2, 1)) +>data2 : Symbol(data2, Decl(genericTypeWithCallableMembers.ts, 5, 31)) + } +} + diff --git a/tests/baselines/reference/genericTypeWithCallableMembers2.symbols b/tests/baselines/reference/genericTypeWithCallableMembers2.symbols new file mode 100644 index 00000000000..746e5d77be2 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithCallableMembers2.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericTypeWithCallableMembers2.ts === +function foo1(f: T) { +>foo1 : Symbol(foo1, Decl(genericTypeWithCallableMembers2.ts, 0, 0)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers2.ts, 0, 14)) +>f : Symbol(f, Decl(genericTypeWithCallableMembers2.ts, 0, 41)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers2.ts, 0, 14)) + + return f(); // should return 'string', once returned 'any' +>f : Symbol(f, Decl(genericTypeWithCallableMembers2.ts, 0, 41)) +} + +function foo2(f: T) { +>foo2 : Symbol(foo2, Decl(genericTypeWithCallableMembers2.ts, 2, 1)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers2.ts, 4, 14)) +>f : Symbol(f, Decl(genericTypeWithCallableMembers2.ts, 4, 45)) +>T : Symbol(T, Decl(genericTypeWithCallableMembers2.ts, 4, 14)) + + return new f(); // should be legal, once was an error +>f : Symbol(f, Decl(genericTypeWithCallableMembers2.ts, 4, 45)) +} diff --git a/tests/baselines/reference/genericTypeWithMultipleBases1.symbols b/tests/baselines/reference/genericTypeWithMultipleBases1.symbols new file mode 100644 index 00000000000..f38f47e9038 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithMultipleBases1.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/genericTypeWithMultipleBases1.ts === +export interface I1 { +>I1 : Symbol(I1, Decl(genericTypeWithMultipleBases1.ts, 0, 0)) + + m1: () => void; +>m1 : Symbol(m1, Decl(genericTypeWithMultipleBases1.ts, 0, 21)) +} + +export interface I2 { +>I2 : Symbol(I2, Decl(genericTypeWithMultipleBases1.ts, 2, 1)) + + m2: () => void; +>m2 : Symbol(m2, Decl(genericTypeWithMultipleBases1.ts, 4, 21)) +} + +export interface I3 extends I1, I2 { +>I3 : Symbol(I3, Decl(genericTypeWithMultipleBases1.ts, 6, 1)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases1.ts, 8, 20)) +>I1 : Symbol(I1, Decl(genericTypeWithMultipleBases1.ts, 0, 0)) +>I2 : Symbol(I2, Decl(genericTypeWithMultipleBases1.ts, 2, 1)) + +//export interface I3 extends I2, I1 { + p1: T; +>p1 : Symbol(p1, Decl(genericTypeWithMultipleBases1.ts, 8, 39)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases1.ts, 8, 20)) +} + +var x: I3; +>x : Symbol(x, Decl(genericTypeWithMultipleBases1.ts, 13, 3)) +>I3 : Symbol(I3, Decl(genericTypeWithMultipleBases1.ts, 6, 1)) + +x.p1; +>x.p1 : Symbol(I3.p1, Decl(genericTypeWithMultipleBases1.ts, 8, 39)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases1.ts, 13, 3)) +>p1 : Symbol(I3.p1, Decl(genericTypeWithMultipleBases1.ts, 8, 39)) + +x.m1(); +>x.m1 : Symbol(I1.m1, Decl(genericTypeWithMultipleBases1.ts, 0, 21)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases1.ts, 13, 3)) +>m1 : Symbol(I1.m1, Decl(genericTypeWithMultipleBases1.ts, 0, 21)) + +x.m2(); +>x.m2 : Symbol(I2.m2, Decl(genericTypeWithMultipleBases1.ts, 4, 21)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases1.ts, 13, 3)) +>m2 : Symbol(I2.m2, Decl(genericTypeWithMultipleBases1.ts, 4, 21)) + + diff --git a/tests/baselines/reference/genericTypeWithMultipleBases2.symbols b/tests/baselines/reference/genericTypeWithMultipleBases2.symbols new file mode 100644 index 00000000000..e5b97ce73fa --- /dev/null +++ b/tests/baselines/reference/genericTypeWithMultipleBases2.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/genericTypeWithMultipleBases2.ts === +export interface I1 { +>I1 : Symbol(I1, Decl(genericTypeWithMultipleBases2.ts, 0, 0)) + + m1: () => void; +>m1 : Symbol(m1, Decl(genericTypeWithMultipleBases2.ts, 0, 21)) +} + +export interface I2 { +>I2 : Symbol(I2, Decl(genericTypeWithMultipleBases2.ts, 2, 1)) + + m2: () => void; +>m2 : Symbol(m2, Decl(genericTypeWithMultipleBases2.ts, 4, 21)) +} + +export interface I3 extends I2, I1 { +>I3 : Symbol(I3, Decl(genericTypeWithMultipleBases2.ts, 6, 1)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases2.ts, 8, 20)) +>I2 : Symbol(I2, Decl(genericTypeWithMultipleBases2.ts, 2, 1)) +>I1 : Symbol(I1, Decl(genericTypeWithMultipleBases2.ts, 0, 0)) + + p1: T; +>p1 : Symbol(p1, Decl(genericTypeWithMultipleBases2.ts, 8, 39)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases2.ts, 8, 20)) +} + +var x: I3; +>x : Symbol(x, Decl(genericTypeWithMultipleBases2.ts, 12, 3)) +>I3 : Symbol(I3, Decl(genericTypeWithMultipleBases2.ts, 6, 1)) + +x.p1; +>x.p1 : Symbol(I3.p1, Decl(genericTypeWithMultipleBases2.ts, 8, 39)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases2.ts, 12, 3)) +>p1 : Symbol(I3.p1, Decl(genericTypeWithMultipleBases2.ts, 8, 39)) + +x.m1(); +>x.m1 : Symbol(I1.m1, Decl(genericTypeWithMultipleBases2.ts, 0, 21)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases2.ts, 12, 3)) +>m1 : Symbol(I1.m1, Decl(genericTypeWithMultipleBases2.ts, 0, 21)) + +x.m2(); +>x.m2 : Symbol(I2.m2, Decl(genericTypeWithMultipleBases2.ts, 4, 21)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases2.ts, 12, 3)) +>m2 : Symbol(I2.m2, Decl(genericTypeWithMultipleBases2.ts, 4, 21)) + + diff --git a/tests/baselines/reference/genericTypeWithMultipleBases3.symbols b/tests/baselines/reference/genericTypeWithMultipleBases3.symbols new file mode 100644 index 00000000000..024ddcdf374 --- /dev/null +++ b/tests/baselines/reference/genericTypeWithMultipleBases3.symbols @@ -0,0 +1,49 @@ +=== tests/cases/compiler/genericTypeWithMultipleBases3.ts === +interface IA { +>IA : Symbol(IA, Decl(genericTypeWithMultipleBases3.ts, 0, 0)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 0, 13)) + +foo(x: T): T; +>foo : Symbol(foo, Decl(genericTypeWithMultipleBases3.ts, 0, 17)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases3.ts, 2, 4)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 0, 13)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 0, 13)) + +} + +interface IB { +>IB : Symbol(IB, Decl(genericTypeWithMultipleBases3.ts, 4, 1)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 6, 13)) + +bar(x: T): T; +>bar : Symbol(bar, Decl(genericTypeWithMultipleBases3.ts, 6, 17)) +>x : Symbol(x, Decl(genericTypeWithMultipleBases3.ts, 8, 4)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 6, 13)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 6, 13)) + +} + +interface IC extends IA, IB { } +>IC : Symbol(IC, Decl(genericTypeWithMultipleBases3.ts, 10, 1)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 12, 13)) +>IA : Symbol(IA, Decl(genericTypeWithMultipleBases3.ts, 0, 0)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 12, 13)) +>IB : Symbol(IB, Decl(genericTypeWithMultipleBases3.ts, 4, 1)) +>T : Symbol(T, Decl(genericTypeWithMultipleBases3.ts, 12, 13)) + +var c: IC; +>c : Symbol(c, Decl(genericTypeWithMultipleBases3.ts, 14, 3)) +>IC : Symbol(IC, Decl(genericTypeWithMultipleBases3.ts, 10, 1)) + +var x = c.foo; +>x : Symbol(x, Decl(genericTypeWithMultipleBases3.ts, 16, 3)) +>c.foo : Symbol(IA.foo, Decl(genericTypeWithMultipleBases3.ts, 0, 17)) +>c : Symbol(c, Decl(genericTypeWithMultipleBases3.ts, 14, 3)) +>foo : Symbol(IA.foo, Decl(genericTypeWithMultipleBases3.ts, 0, 17)) + +var y = c.bar; +>y : Symbol(y, Decl(genericTypeWithMultipleBases3.ts, 18, 3)) +>c.bar : Symbol(IB.bar, Decl(genericTypeWithMultipleBases3.ts, 6, 17)) +>c : Symbol(c, Decl(genericTypeWithMultipleBases3.ts, 14, 3)) +>bar : Symbol(IB.bar, Decl(genericTypeWithMultipleBases3.ts, 6, 17)) + diff --git a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.symbols b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.symbols new file mode 100644 index 00000000000..02e73f4819e --- /dev/null +++ b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/genericWithCallSignatureReturningSpecialization.ts === +interface B { +>B : Symbol(B, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 0)) +>T : Symbol(T, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 12)) + + f(): B; +>f : Symbol(f, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 16)) +>B : Symbol(B, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 0)) + + (value: T): void; +>value : Symbol(value, Decl(genericWithCallSignatureReturningSpecialization.ts, 2, 5)) +>T : Symbol(T, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 12)) +} +var x: B; +>x : Symbol(x, Decl(genericWithCallSignatureReturningSpecialization.ts, 4, 3)) +>B : Symbol(B, Decl(genericWithCallSignatureReturningSpecialization.ts, 0, 0)) + +x(true); // was error +>x : Symbol(x, Decl(genericWithCallSignatureReturningSpecialization.ts, 4, 3)) + diff --git a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types index 824ada50b89..c58d56e3a75 100644 --- a/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types +++ b/tests/baselines/reference/genericWithCallSignatureReturningSpecialization.types @@ -18,4 +18,5 @@ var x: B; x(true); // was error >x(true) : void >x : B +>true : boolean diff --git a/tests/baselines/reference/genericWithCallSignatures1.symbols b/tests/baselines/reference/genericWithCallSignatures1.symbols new file mode 100644 index 00000000000..d791308b46e --- /dev/null +++ b/tests/baselines/reference/genericWithCallSignatures1.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/genericWithCallSignatures_1.ts === +/// +class MyClass { +>MyClass : Symbol(MyClass, Decl(genericWithCallSignatures_1.ts, 0, 0)) + + public callableThing: CallableExtention; +>callableThing : Symbol(callableThing, Decl(genericWithCallSignatures_1.ts, 1, 15)) +>CallableExtention : Symbol(CallableExtention, Decl(genericWithCallSignatures_0.ts, 3, 1)) + + public myMethod() { +>myMethod : Symbol(myMethod, Decl(genericWithCallSignatures_1.ts, 2, 52)) + + var x = this.callableThing(); +>x : Symbol(x, Decl(genericWithCallSignatures_1.ts, 5, 11)) +>this.callableThing : Symbol(callableThing, Decl(genericWithCallSignatures_1.ts, 1, 15)) +>this : Symbol(MyClass, Decl(genericWithCallSignatures_1.ts, 0, 0)) +>callableThing : Symbol(callableThing, Decl(genericWithCallSignatures_1.ts, 1, 15)) + } +} +=== tests/cases/compiler/genericWithCallSignatures_0.ts === +interface Callable { +>Callable : Symbol(Callable, Decl(genericWithCallSignatures_0.ts, 0, 0)) +>T : Symbol(T, Decl(genericWithCallSignatures_0.ts, 0, 19)) + + (): T; +>T : Symbol(T, Decl(genericWithCallSignatures_0.ts, 0, 19)) + + (value: T): void; +>value : Symbol(value, Decl(genericWithCallSignatures_0.ts, 2, 5)) +>T : Symbol(T, Decl(genericWithCallSignatures_0.ts, 0, 19)) +} + +interface CallableExtention extends Callable { } +>CallableExtention : Symbol(CallableExtention, Decl(genericWithCallSignatures_0.ts, 3, 1)) +>T : Symbol(T, Decl(genericWithCallSignatures_0.ts, 5, 28)) +>Callable : Symbol(Callable, Decl(genericWithCallSignatures_0.ts, 0, 0)) +>T : Symbol(T, Decl(genericWithCallSignatures_0.ts, 5, 28)) + diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.symbols b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.symbols new file mode 100644 index 00000000000..26918e9ebfb --- /dev/null +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/genericWithIndexerOfTypeParameterType1.ts === +class LazyArray { +>LazyArray : Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0)) +>T : Symbol(T, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 16)) + + private objects = <{ [objectId: string]: T; }>{}; +>objects : Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20)) +>objectId : Symbol(objectId, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 26)) +>T : Symbol(T, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 16)) + + array() { +>array : Symbol(array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53)) + + return this.objects; +>this.objects : Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20)) +>this : Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0)) +>objects : Symbol(objects, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 20)) + } +} +var lazyArray = new LazyArray(); +>lazyArray : Symbol(lazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 6, 3)) +>LazyArray : Symbol(LazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 0, 0)) + +var value: string = lazyArray.array()["test"]; // used to be an error +>value : Symbol(value, Decl(genericWithIndexerOfTypeParameterType1.ts, 7, 3)) +>lazyArray.array : Symbol(LazyArray.array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53)) +>lazyArray : Symbol(lazyArray, Decl(genericWithIndexerOfTypeParameterType1.ts, 6, 3)) +>array : Symbol(LazyArray.array, Decl(genericWithIndexerOfTypeParameterType1.ts, 1, 53)) + diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types index ef42c1c6029..3e281f6072a 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.types @@ -31,4 +31,5 @@ var value: string = lazyArray.array()["test"]; // used to be an error >lazyArray.array : () => { [objectId: string]: string; } >lazyArray : LazyArray >array : () => { [objectId: string]: string; } +>"test" : string diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.symbols b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.symbols new file mode 100644 index 00000000000..d09abef57be --- /dev/null +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/genericWithIndexerOfTypeParameterType2.ts === +export class Collection { +>Collection : Symbol(Collection, Decl(genericWithIndexerOfTypeParameterType2.ts, 0, 0)) +>TItem : Symbol(TItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 0, 24)) +>CollectionItem : Symbol(CollectionItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 6, 1)) + + _itemsByKey: { [key: string]: TItem; }; +>_itemsByKey : Symbol(_itemsByKey, Decl(genericWithIndexerOfTypeParameterType2.ts, 0, 55)) +>key : Symbol(key, Decl(genericWithIndexerOfTypeParameterType2.ts, 1, 20)) +>TItem : Symbol(TItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 0, 24)) +} + +export class List extends Collection{ +>List : Symbol(List, Decl(genericWithIndexerOfTypeParameterType2.ts, 2, 1)) +>Collection : Symbol(Collection, Decl(genericWithIndexerOfTypeParameterType2.ts, 0, 0)) +>ListItem : Symbol(ListItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 8, 30)) + + Bar() {} +>Bar : Symbol(Bar, Decl(genericWithIndexerOfTypeParameterType2.ts, 4, 47)) +} + +export class CollectionItem {} +>CollectionItem : Symbol(CollectionItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 6, 1)) + +export class ListItem extends CollectionItem { +>ListItem : Symbol(ListItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 8, 30)) +>CollectionItem : Symbol(CollectionItem, Decl(genericWithIndexerOfTypeParameterType2.ts, 6, 1)) + + __isNew: boolean; +>__isNew : Symbol(__isNew, Decl(genericWithIndexerOfTypeParameterType2.ts, 10, 46)) +} + diff --git a/tests/baselines/reference/generics0.symbols b/tests/baselines/reference/generics0.symbols new file mode 100644 index 00000000000..801b56fe718 --- /dev/null +++ b/tests/baselines/reference/generics0.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/generics0.ts === +interface G { +>G : Symbol(G, Decl(generics0.ts, 0, 0)) +>T : Symbol(T, Decl(generics0.ts, 0, 12)) + + x: T; +>x : Symbol(x, Decl(generics0.ts, 0, 16)) +>T : Symbol(T, Decl(generics0.ts, 0, 12)) +} + +var v2: G; +>v2 : Symbol(v2, Decl(generics0.ts, 4, 3)) +>G : Symbol(G, Decl(generics0.ts, 0, 0)) + +var z = v2.x; // 'y' should be of type 'string' +>z : Symbol(z, Decl(generics0.ts, 6, 3)) +>v2.x : Symbol(G.x, Decl(generics0.ts, 0, 16)) +>v2 : Symbol(v2, Decl(generics0.ts, 4, 3)) +>x : Symbol(G.x, Decl(generics0.ts, 0, 16)) + diff --git a/tests/baselines/reference/generics1NoError.symbols b/tests/baselines/reference/generics1NoError.symbols new file mode 100644 index 00000000000..fcf820f79c4 --- /dev/null +++ b/tests/baselines/reference/generics1NoError.symbols @@ -0,0 +1,49 @@ +=== tests/cases/compiler/generics1NoError.ts === +interface A { a: string; } +>A : Symbol(A, Decl(generics1NoError.ts, 0, 0)) +>a : Symbol(a, Decl(generics1NoError.ts, 0, 13)) + +interface B extends A { b: string; } +>B : Symbol(B, Decl(generics1NoError.ts, 0, 26)) +>A : Symbol(A, Decl(generics1NoError.ts, 0, 0)) +>b : Symbol(b, Decl(generics1NoError.ts, 1, 23)) + +interface C extends B { c: string; } +>C : Symbol(C, Decl(generics1NoError.ts, 1, 36)) +>B : Symbol(B, Decl(generics1NoError.ts, 0, 26)) +>c : Symbol(c, Decl(generics1NoError.ts, 2, 23)) + +interface G { +>G : Symbol(G, Decl(generics1NoError.ts, 2, 36)) +>T : Symbol(T, Decl(generics1NoError.ts, 3, 12)) +>U : Symbol(U, Decl(generics1NoError.ts, 3, 14)) +>B : Symbol(B, Decl(generics1NoError.ts, 0, 26)) + + x: T; +>x : Symbol(x, Decl(generics1NoError.ts, 3, 29)) +>T : Symbol(T, Decl(generics1NoError.ts, 3, 12)) + + y: U; +>y : Symbol(y, Decl(generics1NoError.ts, 4, 9)) +>U : Symbol(U, Decl(generics1NoError.ts, 3, 14)) +} +var v1: G; // Ok +>v1 : Symbol(v1, Decl(generics1NoError.ts, 7, 3)) +>G : Symbol(G, Decl(generics1NoError.ts, 2, 36)) +>A : Symbol(A, Decl(generics1NoError.ts, 0, 0)) +>C : Symbol(C, Decl(generics1NoError.ts, 1, 36)) + +var v2: G<{ a: string }, C>; // Ok, equivalent to G +>v2 : Symbol(v2, Decl(generics1NoError.ts, 8, 3)) +>G : Symbol(G, Decl(generics1NoError.ts, 2, 36)) +>a : Symbol(a, Decl(generics1NoError.ts, 8, 11)) +>C : Symbol(C, Decl(generics1NoError.ts, 1, 36)) + +var v4: G, C>; // Ok +>v4 : Symbol(v4, Decl(generics1NoError.ts, 9, 3)) +>G : Symbol(G, Decl(generics1NoError.ts, 2, 36)) +>G : Symbol(G, Decl(generics1NoError.ts, 2, 36)) +>A : Symbol(A, Decl(generics1NoError.ts, 0, 0)) +>B : Symbol(B, Decl(generics1NoError.ts, 0, 26)) +>C : Symbol(C, Decl(generics1NoError.ts, 1, 36)) + diff --git a/tests/baselines/reference/generics2NoError.symbols b/tests/baselines/reference/generics2NoError.symbols new file mode 100644 index 00000000000..165eb435a50 --- /dev/null +++ b/tests/baselines/reference/generics2NoError.symbols @@ -0,0 +1,61 @@ +=== tests/cases/compiler/generics2NoError.ts === +interface A { a: string; } +>A : Symbol(A, Decl(generics2NoError.ts, 0, 0)) +>a : Symbol(a, Decl(generics2NoError.ts, 0, 13)) + +interface B extends A { b: string; } +>B : Symbol(B, Decl(generics2NoError.ts, 0, 26)) +>A : Symbol(A, Decl(generics2NoError.ts, 0, 0)) +>b : Symbol(b, Decl(generics2NoError.ts, 1, 23)) + +interface C extends B { c: string; } +>C : Symbol(C, Decl(generics2NoError.ts, 1, 36)) +>B : Symbol(B, Decl(generics2NoError.ts, 0, 26)) +>c : Symbol(c, Decl(generics2NoError.ts, 2, 23)) + +interface G { +>G : Symbol(G, Decl(generics2NoError.ts, 2, 36)) +>T : Symbol(T, Decl(generics2NoError.ts, 3, 12)) +>U : Symbol(U, Decl(generics2NoError.ts, 3, 14)) +>B : Symbol(B, Decl(generics2NoError.ts, 0, 26)) + + x: T; +>x : Symbol(x, Decl(generics2NoError.ts, 3, 29)) +>T : Symbol(T, Decl(generics2NoError.ts, 3, 12)) + + y: U; +>y : Symbol(y, Decl(generics2NoError.ts, 4, 9)) +>U : Symbol(U, Decl(generics2NoError.ts, 3, 14)) +} + + +var v1: { +>v1 : Symbol(v1, Decl(generics2NoError.ts, 9, 3)) + + x: { a: string; } +>x : Symbol(x, Decl(generics2NoError.ts, 9, 9)) +>a : Symbol(a, Decl(generics2NoError.ts, 10, 8)) + + y: { a: string; b: string; c: string }; +>y : Symbol(y, Decl(generics2NoError.ts, 10, 21)) +>a : Symbol(a, Decl(generics2NoError.ts, 11, 8)) +>b : Symbol(b, Decl(generics2NoError.ts, 11, 19)) +>c : Symbol(c, Decl(generics2NoError.ts, 11, 30)) + +}; // Ok + + +var v2: G<{ a: string }, C>; // Ok, equivalent to G +>v2 : Symbol(v2, Decl(generics2NoError.ts, 15, 3)) +>G : Symbol(G, Decl(generics2NoError.ts, 2, 36)) +>a : Symbol(a, Decl(generics2NoError.ts, 15, 11)) +>C : Symbol(C, Decl(generics2NoError.ts, 1, 36)) + +var v4: G, C>; // Ok +>v4 : Symbol(v4, Decl(generics2NoError.ts, 16, 3)) +>G : Symbol(G, Decl(generics2NoError.ts, 2, 36)) +>G : Symbol(G, Decl(generics2NoError.ts, 2, 36)) +>A : Symbol(A, Decl(generics2NoError.ts, 0, 0)) +>B : Symbol(B, Decl(generics2NoError.ts, 0, 26)) +>C : Symbol(C, Decl(generics2NoError.ts, 1, 36)) + diff --git a/tests/baselines/reference/generics3.symbols b/tests/baselines/reference/generics3.symbols new file mode 100644 index 00000000000..be9c583ff5f --- /dev/null +++ b/tests/baselines/reference/generics3.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/generics3.ts === +class C { private x: T; } +>C : Symbol(C, Decl(generics3.ts, 0, 0)) +>T : Symbol(T, Decl(generics3.ts, 0, 8)) +>x : Symbol(x, Decl(generics3.ts, 0, 12)) +>T : Symbol(T, Decl(generics3.ts, 0, 8)) + +interface X { f(): string; } +>X : Symbol(X, Decl(generics3.ts, 0, 28)) +>f : Symbol(f, Decl(generics3.ts, 1, 13)) + +interface Y { f(): string; } +>Y : Symbol(Y, Decl(generics3.ts, 1, 28)) +>f : Symbol(f, Decl(generics3.ts, 2, 13)) + +var a: C; +>a : Symbol(a, Decl(generics3.ts, 3, 3)) +>C : Symbol(C, Decl(generics3.ts, 0, 0)) +>X : Symbol(X, Decl(generics3.ts, 0, 28)) + +var b: C; +>b : Symbol(b, Decl(generics3.ts, 4, 3)) +>C : Symbol(C, Decl(generics3.ts, 0, 0)) +>Y : Symbol(Y, Decl(generics3.ts, 1, 28)) + +a = b; // Ok - should be identical +>a : Symbol(a, Decl(generics3.ts, 3, 3)) +>b : Symbol(b, Decl(generics3.ts, 4, 3)) + diff --git a/tests/baselines/reference/generics4NoError.symbols b/tests/baselines/reference/generics4NoError.symbols new file mode 100644 index 00000000000..9ea547d4db9 --- /dev/null +++ b/tests/baselines/reference/generics4NoError.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/generics4NoError.ts === +class C { private x: T; } +>C : Symbol(C, Decl(generics4NoError.ts, 0, 0)) +>T : Symbol(T, Decl(generics4NoError.ts, 0, 8)) +>x : Symbol(x, Decl(generics4NoError.ts, 0, 12)) +>T : Symbol(T, Decl(generics4NoError.ts, 0, 8)) + +interface X { f(): string; } +>X : Symbol(X, Decl(generics4NoError.ts, 0, 28)) +>f : Symbol(f, Decl(generics4NoError.ts, 1, 13)) + +interface Y { f(): boolean; } +>Y : Symbol(Y, Decl(generics4NoError.ts, 1, 28)) +>f : Symbol(f, Decl(generics4NoError.ts, 2, 13)) + +var a: C; +>a : Symbol(a, Decl(generics4NoError.ts, 3, 3)) +>C : Symbol(C, Decl(generics4NoError.ts, 0, 0)) +>X : Symbol(X, Decl(generics4NoError.ts, 0, 28)) + +var b: C; +>b : Symbol(b, Decl(generics4NoError.ts, 4, 3)) +>C : Symbol(C, Decl(generics4NoError.ts, 0, 0)) +>Y : Symbol(Y, Decl(generics4NoError.ts, 1, 28)) + diff --git a/tests/baselines/reference/genericsAndHigherOrderFunctions.symbols b/tests/baselines/reference/genericsAndHigherOrderFunctions.symbols new file mode 100644 index 00000000000..a9f324278d6 --- /dev/null +++ b/tests/baselines/reference/genericsAndHigherOrderFunctions.symbols @@ -0,0 +1,114 @@ +=== tests/cases/compiler/genericsAndHigherOrderFunctions.ts === +// no errors expected + +var combine: (f: (_: T) => S) => +>combine : Symbol(combine, Decl(genericsAndHigherOrderFunctions.ts, 2, 3)) +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 2, 14)) +>S : Symbol(S, Decl(genericsAndHigherOrderFunctions.ts, 2, 16)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 2, 20)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 2, 24)) +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 2, 14)) +>S : Symbol(S, Decl(genericsAndHigherOrderFunctions.ts, 2, 16)) + + (g: (_: U) => T) => +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 3, 5)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 3, 8)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 3, 12)) +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 3, 5)) +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 2, 14)) + + (x: U) => S +>x : Symbol(x, Decl(genericsAndHigherOrderFunctions.ts, 4, 5)) +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 3, 5)) +>S : Symbol(S, Decl(genericsAndHigherOrderFunctions.ts, 2, 16)) + + = (f: (_: T) => S) => +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 6, 7)) +>S : Symbol(S, Decl(genericsAndHigherOrderFunctions.ts, 6, 9)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 6, 13)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 6, 17)) +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 6, 7)) +>S : Symbol(S, Decl(genericsAndHigherOrderFunctions.ts, 6, 9)) + + (g: (_: U) => T) => +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 7, 9)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 7, 12)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 7, 16)) +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 7, 9)) +>T : Symbol(T, Decl(genericsAndHigherOrderFunctions.ts, 6, 7)) + + (x: U) => f(g(x)) +>x : Symbol(x, Decl(genericsAndHigherOrderFunctions.ts, 8, 13)) +>U : Symbol(U, Decl(genericsAndHigherOrderFunctions.ts, 7, 9)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 6, 13)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 7, 12)) +>x : Symbol(x, Decl(genericsAndHigherOrderFunctions.ts, 8, 13)) + +var foo: (g: (x: K) => N) => +>foo : Symbol(foo, Decl(genericsAndHigherOrderFunctions.ts, 10, 3)) +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 10, 10)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 10, 12)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 10, 16)) +>x : Symbol(x, Decl(genericsAndHigherOrderFunctions.ts, 10, 20)) +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 10, 10)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 10, 12)) + + (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => +>h : Symbol(h, Decl(genericsAndHigherOrderFunctions.ts, 11, 5)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 11, 9)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 11, 12)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 11, 16)) +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 10, 10)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 11, 26)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 11, 9)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 11, 9)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 11, 42)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 11, 9)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 11, 9)) + + (f: (_: N) => (_: R) => R) => (_: R) => R +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 12, 5)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 12, 8)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 12, 12)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 10, 12)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 12, 22)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 12, 5)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 12, 5)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 12, 38)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 12, 5)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 12, 5)) + + = (g: (x: K) => N) => +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 14, 7)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 14, 9)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 14, 13)) +>x : Symbol(x, Decl(genericsAndHigherOrderFunctions.ts, 14, 17)) +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 14, 7)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 14, 9)) + + (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => +>h : Symbol(h, Decl(genericsAndHigherOrderFunctions.ts, 15, 9)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 15, 13)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 15, 16)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 15, 20)) +>K : Symbol(K, Decl(genericsAndHigherOrderFunctions.ts, 14, 7)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 15, 30)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 15, 13)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 15, 13)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 15, 46)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 15, 13)) +>M : Symbol(M, Decl(genericsAndHigherOrderFunctions.ts, 15, 13)) + + (f: (_: N) => (_: R) => R) => h(combine(f)(g)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 16, 13)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 16, 16)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 16, 20)) +>N : Symbol(N, Decl(genericsAndHigherOrderFunctions.ts, 14, 9)) +>_ : Symbol(_, Decl(genericsAndHigherOrderFunctions.ts, 16, 30)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 16, 13)) +>R : Symbol(R, Decl(genericsAndHigherOrderFunctions.ts, 16, 13)) +>h : Symbol(h, Decl(genericsAndHigherOrderFunctions.ts, 15, 9)) +>combine : Symbol(combine, Decl(genericsAndHigherOrderFunctions.ts, 2, 3)) +>f : Symbol(f, Decl(genericsAndHigherOrderFunctions.ts, 16, 16)) +>g : Symbol(g, Decl(genericsAndHigherOrderFunctions.ts, 14, 13)) + diff --git a/tests/baselines/reference/genericsManyTypeParameters.symbols b/tests/baselines/reference/genericsManyTypeParameters.symbols new file mode 100644 index 00000000000..ef80bf62da1 --- /dev/null +++ b/tests/baselines/reference/genericsManyTypeParameters.symbols @@ -0,0 +1,547 @@ +=== tests/cases/compiler/genericsManyTypeParameters.ts === +function Foo< +>Foo : Symbol(Foo, Decl(genericsManyTypeParameters.ts, 0, 0)) + + a1, a21, a31, a41, a51, a61, +>a1 : Symbol(a1, Decl(genericsManyTypeParameters.ts, 0, 13), Decl(genericsManyTypeParameters.ts, 20, 33)) +>a21 : Symbol(a21, Decl(genericsManyTypeParameters.ts, 1, 7)) +>a31 : Symbol(a31, Decl(genericsManyTypeParameters.ts, 1, 12)) +>a41 : Symbol(a41, Decl(genericsManyTypeParameters.ts, 1, 17)) +>a51 : Symbol(a51, Decl(genericsManyTypeParameters.ts, 1, 22)) +>a61 : Symbol(a61, Decl(genericsManyTypeParameters.ts, 1, 27)) + + a119, a22, a32, a42, a52, a62, +>a119 : Symbol(a119, Decl(genericsManyTypeParameters.ts, 1, 32)) +>a22 : Symbol(a22, Decl(genericsManyTypeParameters.ts, 2, 9)) +>a32 : Symbol(a32, Decl(genericsManyTypeParameters.ts, 2, 14)) +>a42 : Symbol(a42, Decl(genericsManyTypeParameters.ts, 2, 19)) +>a52 : Symbol(a52, Decl(genericsManyTypeParameters.ts, 2, 24)) +>a62 : Symbol(a62, Decl(genericsManyTypeParameters.ts, 2, 29)) + + a219, a23, a33, a43, a53, a63, +>a219 : Symbol(a219, Decl(genericsManyTypeParameters.ts, 2, 34)) +>a23 : Symbol(a23, Decl(genericsManyTypeParameters.ts, 3, 9)) +>a33 : Symbol(a33, Decl(genericsManyTypeParameters.ts, 3, 14)) +>a43 : Symbol(a43, Decl(genericsManyTypeParameters.ts, 3, 19)) +>a53 : Symbol(a53, Decl(genericsManyTypeParameters.ts, 3, 24)) +>a63 : Symbol(a63, Decl(genericsManyTypeParameters.ts, 3, 29)) + + a319, a24, a34, a44, a54, a64, +>a319 : Symbol(a319, Decl(genericsManyTypeParameters.ts, 3, 34)) +>a24 : Symbol(a24, Decl(genericsManyTypeParameters.ts, 4, 9)) +>a34 : Symbol(a34, Decl(genericsManyTypeParameters.ts, 4, 14)) +>a44 : Symbol(a44, Decl(genericsManyTypeParameters.ts, 4, 19)) +>a54 : Symbol(a54, Decl(genericsManyTypeParameters.ts, 4, 24)) +>a64 : Symbol(a64, Decl(genericsManyTypeParameters.ts, 4, 29)) + + a419, a25, a35, a45, a55, a65, +>a419 : Symbol(a419, Decl(genericsManyTypeParameters.ts, 4, 34)) +>a25 : Symbol(a25, Decl(genericsManyTypeParameters.ts, 5, 9)) +>a35 : Symbol(a35, Decl(genericsManyTypeParameters.ts, 5, 14)) +>a45 : Symbol(a45, Decl(genericsManyTypeParameters.ts, 5, 19)) +>a55 : Symbol(a55, Decl(genericsManyTypeParameters.ts, 5, 24)) +>a65 : Symbol(a65, Decl(genericsManyTypeParameters.ts, 5, 29)) + + a519, a26, a36, a46, a56, a66, +>a519 : Symbol(a519, Decl(genericsManyTypeParameters.ts, 5, 34)) +>a26 : Symbol(a26, Decl(genericsManyTypeParameters.ts, 6, 9)) +>a36 : Symbol(a36, Decl(genericsManyTypeParameters.ts, 6, 14)) +>a46 : Symbol(a46, Decl(genericsManyTypeParameters.ts, 6, 19)) +>a56 : Symbol(a56, Decl(genericsManyTypeParameters.ts, 6, 24)) +>a66 : Symbol(a66, Decl(genericsManyTypeParameters.ts, 6, 29)) + + a619, a27, a37, a47, a57, a67, +>a619 : Symbol(a619, Decl(genericsManyTypeParameters.ts, 6, 34)) +>a27 : Symbol(a27, Decl(genericsManyTypeParameters.ts, 7, 9)) +>a37 : Symbol(a37, Decl(genericsManyTypeParameters.ts, 7, 14)) +>a47 : Symbol(a47, Decl(genericsManyTypeParameters.ts, 7, 19)) +>a57 : Symbol(a57, Decl(genericsManyTypeParameters.ts, 7, 24)) +>a67 : Symbol(a67, Decl(genericsManyTypeParameters.ts, 7, 29)) + + a71, a28, a38, a48, a58, a68, +>a71 : Symbol(a71, Decl(genericsManyTypeParameters.ts, 7, 34)) +>a28 : Symbol(a28, Decl(genericsManyTypeParameters.ts, 8, 8)) +>a38 : Symbol(a38, Decl(genericsManyTypeParameters.ts, 8, 13)) +>a48 : Symbol(a48, Decl(genericsManyTypeParameters.ts, 8, 18)) +>a58 : Symbol(a58, Decl(genericsManyTypeParameters.ts, 8, 23)) +>a68 : Symbol(a68, Decl(genericsManyTypeParameters.ts, 8, 28)) + + a81, a29, a39, a49, a59, a69, +>a81 : Symbol(a81, Decl(genericsManyTypeParameters.ts, 8, 33)) +>a29 : Symbol(a29, Decl(genericsManyTypeParameters.ts, 9, 8)) +>a39 : Symbol(a39, Decl(genericsManyTypeParameters.ts, 9, 13)) +>a49 : Symbol(a49, Decl(genericsManyTypeParameters.ts, 9, 18)) +>a59 : Symbol(a59, Decl(genericsManyTypeParameters.ts, 9, 23)) +>a69 : Symbol(a69, Decl(genericsManyTypeParameters.ts, 9, 28)) + + a91, a210, a310, a410, a510, a610, +>a91 : Symbol(a91, Decl(genericsManyTypeParameters.ts, 9, 33)) +>a210 : Symbol(a210, Decl(genericsManyTypeParameters.ts, 10, 8)) +>a310 : Symbol(a310, Decl(genericsManyTypeParameters.ts, 10, 14)) +>a410 : Symbol(a410, Decl(genericsManyTypeParameters.ts, 10, 20)) +>a510 : Symbol(a510, Decl(genericsManyTypeParameters.ts, 10, 26)) +>a610 : Symbol(a610, Decl(genericsManyTypeParameters.ts, 10, 32)) + + a111, a211, a311, a411, a511, a611, +>a111 : Symbol(a111, Decl(genericsManyTypeParameters.ts, 10, 38)) +>a211 : Symbol(a211, Decl(genericsManyTypeParameters.ts, 11, 9)) +>a311 : Symbol(a311, Decl(genericsManyTypeParameters.ts, 11, 15)) +>a411 : Symbol(a411, Decl(genericsManyTypeParameters.ts, 11, 21)) +>a511 : Symbol(a511, Decl(genericsManyTypeParameters.ts, 11, 27)) +>a611 : Symbol(a611, Decl(genericsManyTypeParameters.ts, 11, 33)) + + a112, a212, a312, a412, a512, a612, +>a112 : Symbol(a112, Decl(genericsManyTypeParameters.ts, 11, 39)) +>a212 : Symbol(a212, Decl(genericsManyTypeParameters.ts, 12, 9)) +>a312 : Symbol(a312, Decl(genericsManyTypeParameters.ts, 12, 15)) +>a412 : Symbol(a412, Decl(genericsManyTypeParameters.ts, 12, 21)) +>a512 : Symbol(a512, Decl(genericsManyTypeParameters.ts, 12, 27)) +>a612 : Symbol(a612, Decl(genericsManyTypeParameters.ts, 12, 33)) + + a113, a213, a313, a413, a513, a613, +>a113 : Symbol(a113, Decl(genericsManyTypeParameters.ts, 12, 39)) +>a213 : Symbol(a213, Decl(genericsManyTypeParameters.ts, 13, 9)) +>a313 : Symbol(a313, Decl(genericsManyTypeParameters.ts, 13, 15)) +>a413 : Symbol(a413, Decl(genericsManyTypeParameters.ts, 13, 21)) +>a513 : Symbol(a513, Decl(genericsManyTypeParameters.ts, 13, 27)) +>a613 : Symbol(a613, Decl(genericsManyTypeParameters.ts, 13, 33)) + + a114, a214, a314, a414, a514, a614, +>a114 : Symbol(a114, Decl(genericsManyTypeParameters.ts, 13, 39)) +>a214 : Symbol(a214, Decl(genericsManyTypeParameters.ts, 14, 9)) +>a314 : Symbol(a314, Decl(genericsManyTypeParameters.ts, 14, 15)) +>a414 : Symbol(a414, Decl(genericsManyTypeParameters.ts, 14, 21)) +>a514 : Symbol(a514, Decl(genericsManyTypeParameters.ts, 14, 27)) +>a614 : Symbol(a614, Decl(genericsManyTypeParameters.ts, 14, 33)) + + a115, a215, a315, a415, a515, a615, +>a115 : Symbol(a115, Decl(genericsManyTypeParameters.ts, 14, 39)) +>a215 : Symbol(a215, Decl(genericsManyTypeParameters.ts, 15, 9)) +>a315 : Symbol(a315, Decl(genericsManyTypeParameters.ts, 15, 15)) +>a415 : Symbol(a415, Decl(genericsManyTypeParameters.ts, 15, 21)) +>a515 : Symbol(a515, Decl(genericsManyTypeParameters.ts, 15, 27)) +>a615 : Symbol(a615, Decl(genericsManyTypeParameters.ts, 15, 33)) + + a116, a216, a316, a416, a516, a616, +>a116 : Symbol(a116, Decl(genericsManyTypeParameters.ts, 15, 39)) +>a216 : Symbol(a216, Decl(genericsManyTypeParameters.ts, 16, 9)) +>a316 : Symbol(a316, Decl(genericsManyTypeParameters.ts, 16, 15)) +>a416 : Symbol(a416, Decl(genericsManyTypeParameters.ts, 16, 21)) +>a516 : Symbol(a516, Decl(genericsManyTypeParameters.ts, 16, 27)) +>a616 : Symbol(a616, Decl(genericsManyTypeParameters.ts, 16, 33)) + + a117, a217, a317, a417, a517, a617, +>a117 : Symbol(a117, Decl(genericsManyTypeParameters.ts, 16, 39)) +>a217 : Symbol(a217, Decl(genericsManyTypeParameters.ts, 17, 9)) +>a317 : Symbol(a317, Decl(genericsManyTypeParameters.ts, 17, 15)) +>a417 : Symbol(a417, Decl(genericsManyTypeParameters.ts, 17, 21)) +>a517 : Symbol(a517, Decl(genericsManyTypeParameters.ts, 17, 27)) +>a617 : Symbol(a617, Decl(genericsManyTypeParameters.ts, 17, 33)) + + a118, a218, a318, a418, a518, a618> +>a118 : Symbol(a118, Decl(genericsManyTypeParameters.ts, 17, 39)) +>a218 : Symbol(a218, Decl(genericsManyTypeParameters.ts, 18, 9)) +>a318 : Symbol(a318, Decl(genericsManyTypeParameters.ts, 18, 15)) +>a418 : Symbol(a418, Decl(genericsManyTypeParameters.ts, 18, 21)) +>a518 : Symbol(a518, Decl(genericsManyTypeParameters.ts, 18, 27)) +>a618 : Symbol(a618, Decl(genericsManyTypeParameters.ts, 18, 33)) + + ( + x1: a1, y1: a21, z1: a31, a1: a41, b1: a51, c1: a61, +>x1 : Symbol(x1, Decl(genericsManyTypeParameters.ts, 19, 5)) +>a1 : Symbol(a1, Decl(genericsManyTypeParameters.ts, 0, 13), Decl(genericsManyTypeParameters.ts, 20, 33)) +>y1 : Symbol(y1, Decl(genericsManyTypeParameters.ts, 20, 15)) +>a21 : Symbol(a21, Decl(genericsManyTypeParameters.ts, 1, 7)) +>z1 : Symbol(z1, Decl(genericsManyTypeParameters.ts, 20, 24)) +>a31 : Symbol(a31, Decl(genericsManyTypeParameters.ts, 1, 12)) +>a1 : Symbol(a1, Decl(genericsManyTypeParameters.ts, 0, 13), Decl(genericsManyTypeParameters.ts, 20, 33)) +>a41 : Symbol(a41, Decl(genericsManyTypeParameters.ts, 1, 17)) +>b1 : Symbol(b1, Decl(genericsManyTypeParameters.ts, 20, 42)) +>a51 : Symbol(a51, Decl(genericsManyTypeParameters.ts, 1, 22)) +>c1 : Symbol(c1, Decl(genericsManyTypeParameters.ts, 20, 51)) +>a61 : Symbol(a61, Decl(genericsManyTypeParameters.ts, 1, 27)) + + x2: a119, y2: a22, z2: a32, a2: a42, b2: a52, c2: a62, +>x2 : Symbol(x2, Decl(genericsManyTypeParameters.ts, 20, 60)) +>a119 : Symbol(a119, Decl(genericsManyTypeParameters.ts, 1, 32)) +>y2 : Symbol(y2, Decl(genericsManyTypeParameters.ts, 21, 17)) +>a22 : Symbol(a22, Decl(genericsManyTypeParameters.ts, 2, 9)) +>z2 : Symbol(z2, Decl(genericsManyTypeParameters.ts, 21, 26)) +>a32 : Symbol(a32, Decl(genericsManyTypeParameters.ts, 2, 14)) +>a2 : Symbol(a2, Decl(genericsManyTypeParameters.ts, 21, 35)) +>a42 : Symbol(a42, Decl(genericsManyTypeParameters.ts, 2, 19)) +>b2 : Symbol(b2, Decl(genericsManyTypeParameters.ts, 21, 44)) +>a52 : Symbol(a52, Decl(genericsManyTypeParameters.ts, 2, 24)) +>c2 : Symbol(c2, Decl(genericsManyTypeParameters.ts, 21, 53)) +>a62 : Symbol(a62, Decl(genericsManyTypeParameters.ts, 2, 29)) + + x3: a219, y3: a23, z3: a33, a3: a43, b3: a53, c3: a63, +>x3 : Symbol(x3, Decl(genericsManyTypeParameters.ts, 21, 62)) +>a219 : Symbol(a219, Decl(genericsManyTypeParameters.ts, 2, 34)) +>y3 : Symbol(y3, Decl(genericsManyTypeParameters.ts, 22, 17)) +>a23 : Symbol(a23, Decl(genericsManyTypeParameters.ts, 3, 9)) +>z3 : Symbol(z3, Decl(genericsManyTypeParameters.ts, 22, 26)) +>a33 : Symbol(a33, Decl(genericsManyTypeParameters.ts, 3, 14)) +>a3 : Symbol(a3, Decl(genericsManyTypeParameters.ts, 22, 35)) +>a43 : Symbol(a43, Decl(genericsManyTypeParameters.ts, 3, 19)) +>b3 : Symbol(b3, Decl(genericsManyTypeParameters.ts, 22, 44)) +>a53 : Symbol(a53, Decl(genericsManyTypeParameters.ts, 3, 24)) +>c3 : Symbol(c3, Decl(genericsManyTypeParameters.ts, 22, 53)) +>a63 : Symbol(a63, Decl(genericsManyTypeParameters.ts, 3, 29)) + + x4: a319, y4: a24, z4: a34, a4: a44, b4: a54, c4: a64, +>x4 : Symbol(x4, Decl(genericsManyTypeParameters.ts, 22, 62)) +>a319 : Symbol(a319, Decl(genericsManyTypeParameters.ts, 3, 34)) +>y4 : Symbol(y4, Decl(genericsManyTypeParameters.ts, 23, 17)) +>a24 : Symbol(a24, Decl(genericsManyTypeParameters.ts, 4, 9)) +>z4 : Symbol(z4, Decl(genericsManyTypeParameters.ts, 23, 26)) +>a34 : Symbol(a34, Decl(genericsManyTypeParameters.ts, 4, 14)) +>a4 : Symbol(a4, Decl(genericsManyTypeParameters.ts, 23, 35)) +>a44 : Symbol(a44, Decl(genericsManyTypeParameters.ts, 4, 19)) +>b4 : Symbol(b4, Decl(genericsManyTypeParameters.ts, 23, 44)) +>a54 : Symbol(a54, Decl(genericsManyTypeParameters.ts, 4, 24)) +>c4 : Symbol(c4, Decl(genericsManyTypeParameters.ts, 23, 53)) +>a64 : Symbol(a64, Decl(genericsManyTypeParameters.ts, 4, 29)) + + x5: a419, y5: a25, z5: a35, a5: a45, b5: a55, c5: a65, +>x5 : Symbol(x5, Decl(genericsManyTypeParameters.ts, 23, 62)) +>a419 : Symbol(a419, Decl(genericsManyTypeParameters.ts, 4, 34)) +>y5 : Symbol(y5, Decl(genericsManyTypeParameters.ts, 24, 17)) +>a25 : Symbol(a25, Decl(genericsManyTypeParameters.ts, 5, 9)) +>z5 : Symbol(z5, Decl(genericsManyTypeParameters.ts, 24, 26)) +>a35 : Symbol(a35, Decl(genericsManyTypeParameters.ts, 5, 14)) +>a5 : Symbol(a5, Decl(genericsManyTypeParameters.ts, 24, 35)) +>a45 : Symbol(a45, Decl(genericsManyTypeParameters.ts, 5, 19)) +>b5 : Symbol(b5, Decl(genericsManyTypeParameters.ts, 24, 44)) +>a55 : Symbol(a55, Decl(genericsManyTypeParameters.ts, 5, 24)) +>c5 : Symbol(c5, Decl(genericsManyTypeParameters.ts, 24, 53)) +>a65 : Symbol(a65, Decl(genericsManyTypeParameters.ts, 5, 29)) + + x6: a519, y6: a26, z6: a36, a6: a46, b6: a56, c6: a66, +>x6 : Symbol(x6, Decl(genericsManyTypeParameters.ts, 24, 62)) +>a519 : Symbol(a519, Decl(genericsManyTypeParameters.ts, 5, 34)) +>y6 : Symbol(y6, Decl(genericsManyTypeParameters.ts, 25, 17)) +>a26 : Symbol(a26, Decl(genericsManyTypeParameters.ts, 6, 9)) +>z6 : Symbol(z6, Decl(genericsManyTypeParameters.ts, 25, 26)) +>a36 : Symbol(a36, Decl(genericsManyTypeParameters.ts, 6, 14)) +>a6 : Symbol(a6, Decl(genericsManyTypeParameters.ts, 25, 35)) +>a46 : Symbol(a46, Decl(genericsManyTypeParameters.ts, 6, 19)) +>b6 : Symbol(b6, Decl(genericsManyTypeParameters.ts, 25, 44)) +>a56 : Symbol(a56, Decl(genericsManyTypeParameters.ts, 6, 24)) +>c6 : Symbol(c6, Decl(genericsManyTypeParameters.ts, 25, 53)) +>a66 : Symbol(a66, Decl(genericsManyTypeParameters.ts, 6, 29)) + + x7: a619, y7: a27, z7: a37, a7: a47, b7: a57, c7: a67, +>x7 : Symbol(x7, Decl(genericsManyTypeParameters.ts, 25, 62)) +>a619 : Symbol(a619, Decl(genericsManyTypeParameters.ts, 6, 34)) +>y7 : Symbol(y7, Decl(genericsManyTypeParameters.ts, 26, 17)) +>a27 : Symbol(a27, Decl(genericsManyTypeParameters.ts, 7, 9)) +>z7 : Symbol(z7, Decl(genericsManyTypeParameters.ts, 26, 26)) +>a37 : Symbol(a37, Decl(genericsManyTypeParameters.ts, 7, 14)) +>a7 : Symbol(a7, Decl(genericsManyTypeParameters.ts, 26, 35)) +>a47 : Symbol(a47, Decl(genericsManyTypeParameters.ts, 7, 19)) +>b7 : Symbol(b7, Decl(genericsManyTypeParameters.ts, 26, 44)) +>a57 : Symbol(a57, Decl(genericsManyTypeParameters.ts, 7, 24)) +>c7 : Symbol(c7, Decl(genericsManyTypeParameters.ts, 26, 53)) +>a67 : Symbol(a67, Decl(genericsManyTypeParameters.ts, 7, 29)) + + x8: a71, y8: a28, z8: a38, a8: a48, b8: a58, c8: a68, +>x8 : Symbol(x8, Decl(genericsManyTypeParameters.ts, 26, 62)) +>a71 : Symbol(a71, Decl(genericsManyTypeParameters.ts, 7, 34)) +>y8 : Symbol(y8, Decl(genericsManyTypeParameters.ts, 27, 16)) +>a28 : Symbol(a28, Decl(genericsManyTypeParameters.ts, 8, 8)) +>z8 : Symbol(z8, Decl(genericsManyTypeParameters.ts, 27, 25)) +>a38 : Symbol(a38, Decl(genericsManyTypeParameters.ts, 8, 13)) +>a8 : Symbol(a8, Decl(genericsManyTypeParameters.ts, 27, 34)) +>a48 : Symbol(a48, Decl(genericsManyTypeParameters.ts, 8, 18)) +>b8 : Symbol(b8, Decl(genericsManyTypeParameters.ts, 27, 43)) +>a58 : Symbol(a58, Decl(genericsManyTypeParameters.ts, 8, 23)) +>c8 : Symbol(c8, Decl(genericsManyTypeParameters.ts, 27, 52)) +>a68 : Symbol(a68, Decl(genericsManyTypeParameters.ts, 8, 28)) + + x9: a81, y9: a29, z9: a39, a9: a49, b9: a59, c9: a69, +>x9 : Symbol(x9, Decl(genericsManyTypeParameters.ts, 27, 61)) +>a81 : Symbol(a81, Decl(genericsManyTypeParameters.ts, 8, 33)) +>y9 : Symbol(y9, Decl(genericsManyTypeParameters.ts, 28, 16)) +>a29 : Symbol(a29, Decl(genericsManyTypeParameters.ts, 9, 8)) +>z9 : Symbol(z9, Decl(genericsManyTypeParameters.ts, 28, 25)) +>a39 : Symbol(a39, Decl(genericsManyTypeParameters.ts, 9, 13)) +>a9 : Symbol(a9, Decl(genericsManyTypeParameters.ts, 28, 34)) +>a49 : Symbol(a49, Decl(genericsManyTypeParameters.ts, 9, 18)) +>b9 : Symbol(b9, Decl(genericsManyTypeParameters.ts, 28, 43)) +>a59 : Symbol(a59, Decl(genericsManyTypeParameters.ts, 9, 23)) +>c9 : Symbol(c9, Decl(genericsManyTypeParameters.ts, 28, 52)) +>a69 : Symbol(a69, Decl(genericsManyTypeParameters.ts, 9, 28)) + + x10: a91, y12: a210, z10: a310, a10: a410, b10: a510, c10: a610, +>x10 : Symbol(x10, Decl(genericsManyTypeParameters.ts, 28, 61)) +>a91 : Symbol(a91, Decl(genericsManyTypeParameters.ts, 9, 33)) +>y12 : Symbol(y12, Decl(genericsManyTypeParameters.ts, 29, 17)) +>a210 : Symbol(a210, Decl(genericsManyTypeParameters.ts, 10, 8)) +>z10 : Symbol(z10, Decl(genericsManyTypeParameters.ts, 29, 28)) +>a310 : Symbol(a310, Decl(genericsManyTypeParameters.ts, 10, 14)) +>a10 : Symbol(a10, Decl(genericsManyTypeParameters.ts, 29, 39)) +>a410 : Symbol(a410, Decl(genericsManyTypeParameters.ts, 10, 20)) +>b10 : Symbol(b10, Decl(genericsManyTypeParameters.ts, 29, 50)) +>a510 : Symbol(a510, Decl(genericsManyTypeParameters.ts, 10, 26)) +>c10 : Symbol(c10, Decl(genericsManyTypeParameters.ts, 29, 61)) +>a610 : Symbol(a610, Decl(genericsManyTypeParameters.ts, 10, 32)) + + x11: a111, y13: a211, z11: a311, a11: a411, b11: a511, c11: a611, +>x11 : Symbol(x11, Decl(genericsManyTypeParameters.ts, 29, 72)) +>a111 : Symbol(a111, Decl(genericsManyTypeParameters.ts, 10, 38)) +>y13 : Symbol(y13, Decl(genericsManyTypeParameters.ts, 30, 18)) +>a211 : Symbol(a211, Decl(genericsManyTypeParameters.ts, 11, 9)) +>z11 : Symbol(z11, Decl(genericsManyTypeParameters.ts, 30, 29)) +>a311 : Symbol(a311, Decl(genericsManyTypeParameters.ts, 11, 15)) +>a11 : Symbol(a11, Decl(genericsManyTypeParameters.ts, 30, 40)) +>a411 : Symbol(a411, Decl(genericsManyTypeParameters.ts, 11, 21)) +>b11 : Symbol(b11, Decl(genericsManyTypeParameters.ts, 30, 51)) +>a511 : Symbol(a511, Decl(genericsManyTypeParameters.ts, 11, 27)) +>c11 : Symbol(c11, Decl(genericsManyTypeParameters.ts, 30, 62)) +>a611 : Symbol(a611, Decl(genericsManyTypeParameters.ts, 11, 33)) + + x12: a112, y14: a212, z12: a312, a12: a412, b12: a512, c12: a612, +>x12 : Symbol(x12, Decl(genericsManyTypeParameters.ts, 30, 73)) +>a112 : Symbol(a112, Decl(genericsManyTypeParameters.ts, 11, 39)) +>y14 : Symbol(y14, Decl(genericsManyTypeParameters.ts, 31, 18)) +>a212 : Symbol(a212, Decl(genericsManyTypeParameters.ts, 12, 9)) +>z12 : Symbol(z12, Decl(genericsManyTypeParameters.ts, 31, 29)) +>a312 : Symbol(a312, Decl(genericsManyTypeParameters.ts, 12, 15)) +>a12 : Symbol(a12, Decl(genericsManyTypeParameters.ts, 31, 40)) +>a412 : Symbol(a412, Decl(genericsManyTypeParameters.ts, 12, 21)) +>b12 : Symbol(b12, Decl(genericsManyTypeParameters.ts, 31, 51)) +>a512 : Symbol(a512, Decl(genericsManyTypeParameters.ts, 12, 27)) +>c12 : Symbol(c12, Decl(genericsManyTypeParameters.ts, 31, 62)) +>a612 : Symbol(a612, Decl(genericsManyTypeParameters.ts, 12, 33)) + + x13: a113, y15: a213, z13: a313, a13: a413, b13: a513, c13: a613, +>x13 : Symbol(x13, Decl(genericsManyTypeParameters.ts, 31, 73)) +>a113 : Symbol(a113, Decl(genericsManyTypeParameters.ts, 12, 39)) +>y15 : Symbol(y15, Decl(genericsManyTypeParameters.ts, 32, 18)) +>a213 : Symbol(a213, Decl(genericsManyTypeParameters.ts, 13, 9)) +>z13 : Symbol(z13, Decl(genericsManyTypeParameters.ts, 32, 29)) +>a313 : Symbol(a313, Decl(genericsManyTypeParameters.ts, 13, 15)) +>a13 : Symbol(a13, Decl(genericsManyTypeParameters.ts, 32, 40)) +>a413 : Symbol(a413, Decl(genericsManyTypeParameters.ts, 13, 21)) +>b13 : Symbol(b13, Decl(genericsManyTypeParameters.ts, 32, 51)) +>a513 : Symbol(a513, Decl(genericsManyTypeParameters.ts, 13, 27)) +>c13 : Symbol(c13, Decl(genericsManyTypeParameters.ts, 32, 62)) +>a613 : Symbol(a613, Decl(genericsManyTypeParameters.ts, 13, 33)) + + x14: a114, y16: a214, z14: a314, a14: a414, b14: a514, c14: a614, +>x14 : Symbol(x14, Decl(genericsManyTypeParameters.ts, 32, 73)) +>a114 : Symbol(a114, Decl(genericsManyTypeParameters.ts, 13, 39)) +>y16 : Symbol(y16, Decl(genericsManyTypeParameters.ts, 33, 18)) +>a214 : Symbol(a214, Decl(genericsManyTypeParameters.ts, 14, 9)) +>z14 : Symbol(z14, Decl(genericsManyTypeParameters.ts, 33, 29)) +>a314 : Symbol(a314, Decl(genericsManyTypeParameters.ts, 14, 15)) +>a14 : Symbol(a14, Decl(genericsManyTypeParameters.ts, 33, 40)) +>a414 : Symbol(a414, Decl(genericsManyTypeParameters.ts, 14, 21)) +>b14 : Symbol(b14, Decl(genericsManyTypeParameters.ts, 33, 51)) +>a514 : Symbol(a514, Decl(genericsManyTypeParameters.ts, 14, 27)) +>c14 : Symbol(c14, Decl(genericsManyTypeParameters.ts, 33, 62)) +>a614 : Symbol(a614, Decl(genericsManyTypeParameters.ts, 14, 33)) + + x15: a115, y17: a215, z15: a315, a15: a415, b15: a515, c15: a615, +>x15 : Symbol(x15, Decl(genericsManyTypeParameters.ts, 33, 73)) +>a115 : Symbol(a115, Decl(genericsManyTypeParameters.ts, 14, 39)) +>y17 : Symbol(y17, Decl(genericsManyTypeParameters.ts, 34, 18)) +>a215 : Symbol(a215, Decl(genericsManyTypeParameters.ts, 15, 9)) +>z15 : Symbol(z15, Decl(genericsManyTypeParameters.ts, 34, 29)) +>a315 : Symbol(a315, Decl(genericsManyTypeParameters.ts, 15, 15)) +>a15 : Symbol(a15, Decl(genericsManyTypeParameters.ts, 34, 40)) +>a415 : Symbol(a415, Decl(genericsManyTypeParameters.ts, 15, 21)) +>b15 : Symbol(b15, Decl(genericsManyTypeParameters.ts, 34, 51)) +>a515 : Symbol(a515, Decl(genericsManyTypeParameters.ts, 15, 27)) +>c15 : Symbol(c15, Decl(genericsManyTypeParameters.ts, 34, 62)) +>a615 : Symbol(a615, Decl(genericsManyTypeParameters.ts, 15, 33)) + + x16: a116, y18: a216, z16: a316, a16: a416, b16: a516, c16: a616, +>x16 : Symbol(x16, Decl(genericsManyTypeParameters.ts, 34, 73)) +>a116 : Symbol(a116, Decl(genericsManyTypeParameters.ts, 15, 39)) +>y18 : Symbol(y18, Decl(genericsManyTypeParameters.ts, 35, 18)) +>a216 : Symbol(a216, Decl(genericsManyTypeParameters.ts, 16, 9)) +>z16 : Symbol(z16, Decl(genericsManyTypeParameters.ts, 35, 29)) +>a316 : Symbol(a316, Decl(genericsManyTypeParameters.ts, 16, 15)) +>a16 : Symbol(a16, Decl(genericsManyTypeParameters.ts, 35, 40)) +>a416 : Symbol(a416, Decl(genericsManyTypeParameters.ts, 16, 21)) +>b16 : Symbol(b16, Decl(genericsManyTypeParameters.ts, 35, 51)) +>a516 : Symbol(a516, Decl(genericsManyTypeParameters.ts, 16, 27)) +>c16 : Symbol(c16, Decl(genericsManyTypeParameters.ts, 35, 62)) +>a616 : Symbol(a616, Decl(genericsManyTypeParameters.ts, 16, 33)) + + x17: a117, y19: a217, z17: a317, a17: a417, b17: a517, c17: a617, +>x17 : Symbol(x17, Decl(genericsManyTypeParameters.ts, 35, 73)) +>a117 : Symbol(a117, Decl(genericsManyTypeParameters.ts, 16, 39)) +>y19 : Symbol(y19, Decl(genericsManyTypeParameters.ts, 36, 18)) +>a217 : Symbol(a217, Decl(genericsManyTypeParameters.ts, 17, 9)) +>z17 : Symbol(z17, Decl(genericsManyTypeParameters.ts, 36, 29)) +>a317 : Symbol(a317, Decl(genericsManyTypeParameters.ts, 17, 15)) +>a17 : Symbol(a17, Decl(genericsManyTypeParameters.ts, 36, 40)) +>a417 : Symbol(a417, Decl(genericsManyTypeParameters.ts, 17, 21)) +>b17 : Symbol(b17, Decl(genericsManyTypeParameters.ts, 36, 51)) +>a517 : Symbol(a517, Decl(genericsManyTypeParameters.ts, 17, 27)) +>c17 : Symbol(c17, Decl(genericsManyTypeParameters.ts, 36, 62)) +>a617 : Symbol(a617, Decl(genericsManyTypeParameters.ts, 17, 33)) + + x18: a118, y10: a218, z18: a318, a18: a418, b18: a518, c18: a618 +>x18 : Symbol(x18, Decl(genericsManyTypeParameters.ts, 36, 73)) +>a118 : Symbol(a118, Decl(genericsManyTypeParameters.ts, 17, 39)) +>y10 : Symbol(y10, Decl(genericsManyTypeParameters.ts, 37, 18)) +>a218 : Symbol(a218, Decl(genericsManyTypeParameters.ts, 18, 9)) +>z18 : Symbol(z18, Decl(genericsManyTypeParameters.ts, 37, 29)) +>a318 : Symbol(a318, Decl(genericsManyTypeParameters.ts, 18, 15)) +>a18 : Symbol(a18, Decl(genericsManyTypeParameters.ts, 37, 40)) +>a418 : Symbol(a418, Decl(genericsManyTypeParameters.ts, 18, 21)) +>b18 : Symbol(b18, Decl(genericsManyTypeParameters.ts, 37, 51)) +>a518 : Symbol(a518, Decl(genericsManyTypeParameters.ts, 18, 27)) +>c18 : Symbol(c18, Decl(genericsManyTypeParameters.ts, 37, 62)) +>a618 : Symbol(a618, Decl(genericsManyTypeParameters.ts, 18, 33)) + + ) + { + return [x1 , y1 , z1 , a1 , b1 , c1, +>x1 : Symbol(x1, Decl(genericsManyTypeParameters.ts, 19, 5)) +>y1 : Symbol(y1, Decl(genericsManyTypeParameters.ts, 20, 15)) +>z1 : Symbol(z1, Decl(genericsManyTypeParameters.ts, 20, 24)) +>a1 : Symbol(a1, Decl(genericsManyTypeParameters.ts, 0, 13), Decl(genericsManyTypeParameters.ts, 20, 33)) +>b1 : Symbol(b1, Decl(genericsManyTypeParameters.ts, 20, 42)) +>c1 : Symbol(c1, Decl(genericsManyTypeParameters.ts, 20, 51)) + + x2 , y2 , z2 , a2 , b2 , c2, +>x2 : Symbol(x2, Decl(genericsManyTypeParameters.ts, 20, 60)) +>y2 : Symbol(y2, Decl(genericsManyTypeParameters.ts, 21, 17)) +>z2 : Symbol(z2, Decl(genericsManyTypeParameters.ts, 21, 26)) +>a2 : Symbol(a2, Decl(genericsManyTypeParameters.ts, 21, 35)) +>b2 : Symbol(b2, Decl(genericsManyTypeParameters.ts, 21, 44)) +>c2 : Symbol(c2, Decl(genericsManyTypeParameters.ts, 21, 53)) + + x3 , y3 , z3 , a3 , b3 , c3, +>x3 : Symbol(x3, Decl(genericsManyTypeParameters.ts, 21, 62)) +>y3 : Symbol(y3, Decl(genericsManyTypeParameters.ts, 22, 17)) +>z3 : Symbol(z3, Decl(genericsManyTypeParameters.ts, 22, 26)) +>a3 : Symbol(a3, Decl(genericsManyTypeParameters.ts, 22, 35)) +>b3 : Symbol(b3, Decl(genericsManyTypeParameters.ts, 22, 44)) +>c3 : Symbol(c3, Decl(genericsManyTypeParameters.ts, 22, 53)) + + x4 , y4 , z4 , a4 , b4 , c4, +>x4 : Symbol(x4, Decl(genericsManyTypeParameters.ts, 22, 62)) +>y4 : Symbol(y4, Decl(genericsManyTypeParameters.ts, 23, 17)) +>z4 : Symbol(z4, Decl(genericsManyTypeParameters.ts, 23, 26)) +>a4 : Symbol(a4, Decl(genericsManyTypeParameters.ts, 23, 35)) +>b4 : Symbol(b4, Decl(genericsManyTypeParameters.ts, 23, 44)) +>c4 : Symbol(c4, Decl(genericsManyTypeParameters.ts, 23, 53)) + + x5 , y5 , z5 , a5 , b5 , c5, +>x5 : Symbol(x5, Decl(genericsManyTypeParameters.ts, 23, 62)) +>y5 : Symbol(y5, Decl(genericsManyTypeParameters.ts, 24, 17)) +>z5 : Symbol(z5, Decl(genericsManyTypeParameters.ts, 24, 26)) +>a5 : Symbol(a5, Decl(genericsManyTypeParameters.ts, 24, 35)) +>b5 : Symbol(b5, Decl(genericsManyTypeParameters.ts, 24, 44)) +>c5 : Symbol(c5, Decl(genericsManyTypeParameters.ts, 24, 53)) + + x6 , y6 , z6 , a6 , b6 , c6, +>x6 : Symbol(x6, Decl(genericsManyTypeParameters.ts, 24, 62)) +>y6 : Symbol(y6, Decl(genericsManyTypeParameters.ts, 25, 17)) +>z6 : Symbol(z6, Decl(genericsManyTypeParameters.ts, 25, 26)) +>a6 : Symbol(a6, Decl(genericsManyTypeParameters.ts, 25, 35)) +>b6 : Symbol(b6, Decl(genericsManyTypeParameters.ts, 25, 44)) +>c6 : Symbol(c6, Decl(genericsManyTypeParameters.ts, 25, 53)) + + x7 , y7 , z7 , a7 , b7 , c7, +>x7 : Symbol(x7, Decl(genericsManyTypeParameters.ts, 25, 62)) +>y7 : Symbol(y7, Decl(genericsManyTypeParameters.ts, 26, 17)) +>z7 : Symbol(z7, Decl(genericsManyTypeParameters.ts, 26, 26)) +>a7 : Symbol(a7, Decl(genericsManyTypeParameters.ts, 26, 35)) +>b7 : Symbol(b7, Decl(genericsManyTypeParameters.ts, 26, 44)) +>c7 : Symbol(c7, Decl(genericsManyTypeParameters.ts, 26, 53)) + + x8 , y8 , z8 , a8 , b8 , c8, +>x8 : Symbol(x8, Decl(genericsManyTypeParameters.ts, 26, 62)) +>y8 : Symbol(y8, Decl(genericsManyTypeParameters.ts, 27, 16)) +>z8 : Symbol(z8, Decl(genericsManyTypeParameters.ts, 27, 25)) +>a8 : Symbol(a8, Decl(genericsManyTypeParameters.ts, 27, 34)) +>b8 : Symbol(b8, Decl(genericsManyTypeParameters.ts, 27, 43)) +>c8 : Symbol(c8, Decl(genericsManyTypeParameters.ts, 27, 52)) + + x9 , y9 , z9 , a9 , b9 , c9, +>x9 : Symbol(x9, Decl(genericsManyTypeParameters.ts, 27, 61)) +>y9 : Symbol(y9, Decl(genericsManyTypeParameters.ts, 28, 16)) +>z9 : Symbol(z9, Decl(genericsManyTypeParameters.ts, 28, 25)) +>a9 : Symbol(a9, Decl(genericsManyTypeParameters.ts, 28, 34)) +>b9 : Symbol(b9, Decl(genericsManyTypeParameters.ts, 28, 43)) +>c9 : Symbol(c9, Decl(genericsManyTypeParameters.ts, 28, 52)) + + x10 , y12 , z10 , a10 , b10 , c10, +>x10 : Symbol(x10, Decl(genericsManyTypeParameters.ts, 28, 61)) +>y12 : Symbol(y12, Decl(genericsManyTypeParameters.ts, 29, 17)) +>z10 : Symbol(z10, Decl(genericsManyTypeParameters.ts, 29, 28)) +>a10 : Symbol(a10, Decl(genericsManyTypeParameters.ts, 29, 39)) +>b10 : Symbol(b10, Decl(genericsManyTypeParameters.ts, 29, 50)) +>c10 : Symbol(c10, Decl(genericsManyTypeParameters.ts, 29, 61)) + + x11 , y13 , z11 , a11 , b11 , c11, +>x11 : Symbol(x11, Decl(genericsManyTypeParameters.ts, 29, 72)) +>y13 : Symbol(y13, Decl(genericsManyTypeParameters.ts, 30, 18)) +>z11 : Symbol(z11, Decl(genericsManyTypeParameters.ts, 30, 29)) +>a11 : Symbol(a11, Decl(genericsManyTypeParameters.ts, 30, 40)) +>b11 : Symbol(b11, Decl(genericsManyTypeParameters.ts, 30, 51)) +>c11 : Symbol(c11, Decl(genericsManyTypeParameters.ts, 30, 62)) + + x12 , y14 , z12 , a12 , b12 , c12, +>x12 : Symbol(x12, Decl(genericsManyTypeParameters.ts, 30, 73)) +>y14 : Symbol(y14, Decl(genericsManyTypeParameters.ts, 31, 18)) +>z12 : Symbol(z12, Decl(genericsManyTypeParameters.ts, 31, 29)) +>a12 : Symbol(a12, Decl(genericsManyTypeParameters.ts, 31, 40)) +>b12 : Symbol(b12, Decl(genericsManyTypeParameters.ts, 31, 51)) +>c12 : Symbol(c12, Decl(genericsManyTypeParameters.ts, 31, 62)) + + x13 , y15 , z13 , a13 , b13 , c13, +>x13 : Symbol(x13, Decl(genericsManyTypeParameters.ts, 31, 73)) +>y15 : Symbol(y15, Decl(genericsManyTypeParameters.ts, 32, 18)) +>z13 : Symbol(z13, Decl(genericsManyTypeParameters.ts, 32, 29)) +>a13 : Symbol(a13, Decl(genericsManyTypeParameters.ts, 32, 40)) +>b13 : Symbol(b13, Decl(genericsManyTypeParameters.ts, 32, 51)) +>c13 : Symbol(c13, Decl(genericsManyTypeParameters.ts, 32, 62)) + + x14 , y16 , z14 , a14 , b14 , c14, +>x14 : Symbol(x14, Decl(genericsManyTypeParameters.ts, 32, 73)) +>y16 : Symbol(y16, Decl(genericsManyTypeParameters.ts, 33, 18)) +>z14 : Symbol(z14, Decl(genericsManyTypeParameters.ts, 33, 29)) +>a14 : Symbol(a14, Decl(genericsManyTypeParameters.ts, 33, 40)) +>b14 : Symbol(b14, Decl(genericsManyTypeParameters.ts, 33, 51)) +>c14 : Symbol(c14, Decl(genericsManyTypeParameters.ts, 33, 62)) + + x15 , y17 , z15 , a15 , b15 , c15, +>x15 : Symbol(x15, Decl(genericsManyTypeParameters.ts, 33, 73)) +>y17 : Symbol(y17, Decl(genericsManyTypeParameters.ts, 34, 18)) +>z15 : Symbol(z15, Decl(genericsManyTypeParameters.ts, 34, 29)) +>a15 : Symbol(a15, Decl(genericsManyTypeParameters.ts, 34, 40)) +>b15 : Symbol(b15, Decl(genericsManyTypeParameters.ts, 34, 51)) +>c15 : Symbol(c15, Decl(genericsManyTypeParameters.ts, 34, 62)) + + x16 , y18 , z16 , a16 , b16 , c16, +>x16 : Symbol(x16, Decl(genericsManyTypeParameters.ts, 34, 73)) +>y18 : Symbol(y18, Decl(genericsManyTypeParameters.ts, 35, 18)) +>z16 : Symbol(z16, Decl(genericsManyTypeParameters.ts, 35, 29)) +>a16 : Symbol(a16, Decl(genericsManyTypeParameters.ts, 35, 40)) +>b16 : Symbol(b16, Decl(genericsManyTypeParameters.ts, 35, 51)) +>c16 : Symbol(c16, Decl(genericsManyTypeParameters.ts, 35, 62)) + + x17 , y19 , z17 , a17 , b17 , c17, +>x17 : Symbol(x17, Decl(genericsManyTypeParameters.ts, 35, 73)) +>y19 : Symbol(y19, Decl(genericsManyTypeParameters.ts, 36, 18)) +>z17 : Symbol(z17, Decl(genericsManyTypeParameters.ts, 36, 29)) +>a17 : Symbol(a17, Decl(genericsManyTypeParameters.ts, 36, 40)) +>b17 : Symbol(b17, Decl(genericsManyTypeParameters.ts, 36, 51)) +>c17 : Symbol(c17, Decl(genericsManyTypeParameters.ts, 36, 62)) + + x18 , y10 , z18 , a18 , b18 , c18]; +>x18 : Symbol(x18, Decl(genericsManyTypeParameters.ts, 36, 73)) +>y10 : Symbol(y10, Decl(genericsManyTypeParameters.ts, 37, 18)) +>z18 : Symbol(z18, Decl(genericsManyTypeParameters.ts, 37, 29)) +>a18 : Symbol(a18, Decl(genericsManyTypeParameters.ts, 37, 40)) +>b18 : Symbol(b18, Decl(genericsManyTypeParameters.ts, 37, 51)) +>c18 : Symbol(c18, Decl(genericsManyTypeParameters.ts, 37, 62)) + } diff --git a/tests/baselines/reference/getterSetterNonAccessor.symbols b/tests/baselines/reference/getterSetterNonAccessor.symbols new file mode 100644 index 00000000000..10ffc55480c --- /dev/null +++ b/tests/baselines/reference/getterSetterNonAccessor.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/getterSetterNonAccessor.ts === +function getFunc():any{return 0;} +>getFunc : Symbol(getFunc, Decl(getterSetterNonAccessor.ts, 0, 0)) + +function setFunc(v){} +>setFunc : Symbol(setFunc, Decl(getterSetterNonAccessor.ts, 0, 33)) +>v : Symbol(v, Decl(getterSetterNonAccessor.ts, 1, 17)) + +Object.defineProperty({}, "0", ({ +>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.d.ts, 160, 60)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.d.ts, 160, 60)) +>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(lib.d.ts, 79, 66)) + + get: getFunc, +>get : Symbol(get, Decl(getterSetterNonAccessor.ts, 3, 53)) +>getFunc : Symbol(getFunc, Decl(getterSetterNonAccessor.ts, 0, 0)) + + set: setFunc, +>set : Symbol(set, Decl(getterSetterNonAccessor.ts, 4, 23)) +>setFunc : Symbol(setFunc, Decl(getterSetterNonAccessor.ts, 0, 33)) + + configurable: true +>configurable : Symbol(configurable, Decl(getterSetterNonAccessor.ts, 5, 23)) + + })); + diff --git a/tests/baselines/reference/getterSetterNonAccessor.types b/tests/baselines/reference/getterSetterNonAccessor.types index f3e5d549cff..48d9f9c85e0 100644 --- a/tests/baselines/reference/getterSetterNonAccessor.types +++ b/tests/baselines/reference/getterSetterNonAccessor.types @@ -1,6 +1,7 @@ === tests/cases/compiler/getterSetterNonAccessor.ts === function getFunc():any{return 0;} >getFunc : () => any +>0 : number function setFunc(v){} >setFunc : (v: any) => void @@ -12,6 +13,7 @@ Object.defineProperty({}, "0", ({ >Object : ObjectConstructor >defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >{} : {} +>"0" : string >({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor >({ get: getFunc, set: setFunc, configurable: true }) : { get: () => any; set: (v: any) => void; configurable: boolean; } @@ -27,6 +29,7 @@ Object.defineProperty({}, "0", ({ configurable: true >configurable : boolean +>true : boolean })); diff --git a/tests/baselines/reference/global.symbols b/tests/baselines/reference/global.symbols new file mode 100644 index 00000000000..ec7ab7d0ef2 --- /dev/null +++ b/tests/baselines/reference/global.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/global.ts === +module M { +>M : Symbol(M, Decl(global.ts, 0, 0)) + + export function f(y:number) { +>f : Symbol(f, Decl(global.ts, 0, 10)) +>y : Symbol(y, Decl(global.ts, 1, 22)) + + return x+y; +>x : Symbol(x, Decl(global.ts, 6, 3)) +>y : Symbol(y, Decl(global.ts, 1, 22)) + } +} + +var x=10; +>x : Symbol(x, Decl(global.ts, 6, 3)) + +M.f(3); +>M.f : Symbol(M.f, Decl(global.ts, 0, 10)) +>M : Symbol(M, Decl(global.ts, 0, 0)) +>f : Symbol(M.f, Decl(global.ts, 0, 10)) + + diff --git a/tests/baselines/reference/global.types b/tests/baselines/reference/global.types index 86d5dd3c986..f866f062068 100644 --- a/tests/baselines/reference/global.types +++ b/tests/baselines/reference/global.types @@ -15,11 +15,13 @@ module M { var x=10; >x : number +>10 : number M.f(3); >M.f(3) : number >M.f : (y: number) => number >M : typeof M >f : (y: number) => number +>3 : number diff --git a/tests/baselines/reference/globalThis.symbols b/tests/baselines/reference/globalThis.symbols new file mode 100644 index 00000000000..77b65bbfa2b --- /dev/null +++ b/tests/baselines/reference/globalThis.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/globalThis.ts === +var __e = Math.E; // should not generate 'this.Math.E' +>__e : Symbol(__e, Decl(globalThis.ts, 0, 3)) +>Math.E : Symbol(Math.E, Decl(lib.d.ts, 524, 16)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>E : Symbol(Math.E, Decl(lib.d.ts, 524, 16)) + diff --git a/tests/baselines/reference/globalThisCapture.symbols b/tests/baselines/reference/globalThisCapture.symbols new file mode 100644 index 00000000000..bfb7bf147c0 --- /dev/null +++ b/tests/baselines/reference/globalThisCapture.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/globalThisCapture.ts === +// Add a lambda to ensure global 'this' capture is triggered +(()=>this.window); + +var parts = []; +>parts : Symbol(parts, Decl(globalThisCapture.ts, 3, 3)) + +// Ensure that the generated code is correct +parts[0]; +>parts : Symbol(parts, Decl(globalThisCapture.ts, 3, 3)) + diff --git a/tests/baselines/reference/globalThisCapture.types b/tests/baselines/reference/globalThisCapture.types index 71bb4e99853..b8ed146d8c4 100644 --- a/tests/baselines/reference/globalThisCapture.types +++ b/tests/baselines/reference/globalThisCapture.types @@ -15,4 +15,5 @@ var parts = []; parts[0]; >parts[0] : any >parts : any[] +>0 : number diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.symbols b/tests/baselines/reference/heterogeneousArrayLiterals.symbols new file mode 100644 index 00000000000..c7a73d56414 --- /dev/null +++ b/tests/baselines/reference/heterogeneousArrayLiterals.symbols @@ -0,0 +1,417 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/heterogeneousArrayLiterals.ts === +// type of an array is the best common type of its elements (plus its contextual type if it exists) + +var a = [1, '']; // {}[] +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 2, 3)) + +var b = [1, null]; // number[] +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 3, 3)) + +var c = [1, '', null]; // {}[] +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 4, 3)) + +var d = [{}, 1]; // {}[] +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 5, 3)) + +var e = [{}, Object]; // {}[] +>e : Symbol(e, Decl(heterogeneousArrayLiterals.ts, 6, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var f = [[], [1]]; // number[][] +>f : Symbol(f, Decl(heterogeneousArrayLiterals.ts, 8, 3)) + +var g = [[1], ['']]; // {}[] +>g : Symbol(g, Decl(heterogeneousArrayLiterals.ts, 9, 3)) + +var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] +>h : Symbol(h, Decl(heterogeneousArrayLiterals.ts, 11, 3)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 11, 10)) +>bar : Symbol(bar, Decl(heterogeneousArrayLiterals.ts, 11, 18)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 11, 31)) + +var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] +>i : Symbol(i, Decl(heterogeneousArrayLiterals.ts, 12, 3)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 12, 10)) +>bar : Symbol(bar, Decl(heterogeneousArrayLiterals.ts, 12, 18)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 12, 31)) + +var j = [() => 1, () => '']; // {}[] +>j : Symbol(j, Decl(heterogeneousArrayLiterals.ts, 14, 3)) + +var k = [() => 1, () => 1]; // { (): number }[] +>k : Symbol(k, Decl(heterogeneousArrayLiterals.ts, 15, 3)) + +var l = [() => 1, () => null]; // { (): any }[] +>l : Symbol(l, Decl(heterogeneousArrayLiterals.ts, 16, 3)) + +var m = [() => 1, () => '', () => null]; // { (): any }[] +>m : Symbol(m, Decl(heterogeneousArrayLiterals.ts, 17, 3)) + +var n = [[() => 1], [() => '']]; // {}[] +>n : Symbol(n, Decl(heterogeneousArrayLiterals.ts, 18, 3)) + +class Base { foo: string; } +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 20, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>bar : Symbol(bar, Decl(heterogeneousArrayLiterals.ts, 21, 28)) + +class Derived2 extends Base { baz: string; } +>Derived2 : Symbol(Derived2, Decl(heterogeneousArrayLiterals.ts, 21, 43)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>baz : Symbol(baz, Decl(heterogeneousArrayLiterals.ts, 22, 29)) + +var base: Base; +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) + +var derived: Derived; +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) + +var derived2: Derived2; +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) +>Derived2 : Symbol(Derived2, Decl(heterogeneousArrayLiterals.ts, 21, 43)) + +module Derived { +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) + + var h = [{ foo: base, basear: derived }, { foo: base }]; // {foo: Base}[] +>h : Symbol(h, Decl(heterogeneousArrayLiterals.ts, 28, 7)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 28, 14)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>basear : Symbol(basear, Decl(heterogeneousArrayLiterals.ts, 28, 25)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 28, 46)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var i = [{ foo: base, basear: derived }, { foo: derived }]; // {foo: Derived}[] +>i : Symbol(i, Decl(heterogeneousArrayLiterals.ts, 29, 7)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 29, 14)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>basear : Symbol(basear, Decl(heterogeneousArrayLiterals.ts, 29, 25)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 29, 46)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var j = [() => base, () => derived]; // { {}: Base } +>j : Symbol(j, Decl(heterogeneousArrayLiterals.ts, 31, 7)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var k = [() => base, () => 1]; // {}[]~ +>k : Symbol(k, Decl(heterogeneousArrayLiterals.ts, 32, 7)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var l = [() => base, () => null]; // { (): any }[] +>l : Symbol(l, Decl(heterogeneousArrayLiterals.ts, 33, 7)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var m = [() => base, () => derived, () => null]; // { (): any }[] +>m : Symbol(m, Decl(heterogeneousArrayLiterals.ts, 34, 7)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var n = [[() => base], [() => derived]]; // { (): Base }[] +>n : Symbol(n, Decl(heterogeneousArrayLiterals.ts, 35, 7)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var o = [derived, derived2]; // {}[] +>o : Symbol(o, Decl(heterogeneousArrayLiterals.ts, 36, 7)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) + + var p = [derived, derived2, base]; // Base[] +>p : Symbol(p, Decl(heterogeneousArrayLiterals.ts, 37, 7)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var q = [[() => derived2], [() => derived]]; // {}[] +>q : Symbol(q, Decl(heterogeneousArrayLiterals.ts, 38, 7)) +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +} + +module WithContextualType { +>WithContextualType : Symbol(WithContextualType, Decl(heterogeneousArrayLiterals.ts, 39, 1)) + + // no errors + var a: Base[] = [derived, derived2]; +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 43, 7)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) + + var b: Derived[] = [null]; +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 44, 7)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) + + var c: Derived[] = []; +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 45, 7)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) + + var d: { (): Base }[] = [() => derived, () => derived2]; +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 46, 7)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +>derived2 : Symbol(derived2, Decl(heterogeneousArrayLiterals.ts, 25, 3)) +} + +function foo(t: T, u: U) { +>foo : Symbol(foo, Decl(heterogeneousArrayLiterals.ts, 47, 1)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 49, 13)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 49, 15)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 49, 13)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 49, 24)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 49, 15)) + + var a = [t, t]; // T[] +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 50, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) + + var b = [t, null]; // T[] +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 51, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) + + var c = [t, u]; // {}[] +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 52, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 49, 24)) + + var d = [t, 1]; // {}[] +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 53, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) + + var e = [() => t, () => u]; // {}[] +>e : Symbol(e, Decl(heterogeneousArrayLiterals.ts, 54, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 49, 24)) + + var f = [() => t, () => u, () => null]; // { (): any }[] +>f : Symbol(f, Decl(heterogeneousArrayLiterals.ts, 55, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 49, 19)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 49, 24)) +} + +function foo2(t: T, u: U) { +>foo2 : Symbol(foo2, Decl(heterogeneousArrayLiterals.ts, 56, 1)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 58, 14)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 58, 29)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 58, 14)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 58, 29)) + + var a = [t, t]; // T[] +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 59, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) + + var b = [t, null]; // T[] +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 60, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) + + var c = [t, u]; // {}[] +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 61, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) + + var d = [t, 1]; // {}[] +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 62, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) + + var e = [() => t, () => u]; // {}[] +>e : Symbol(e, Decl(heterogeneousArrayLiterals.ts, 63, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) + + var f = [() => t, () => u, () => null]; // { (): any }[] +>f : Symbol(f, Decl(heterogeneousArrayLiterals.ts, 64, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) + + var g = [t, base]; // Base[] +>g : Symbol(g, Decl(heterogeneousArrayLiterals.ts, 66, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var h = [t, derived]; // Derived[] +>h : Symbol(h, Decl(heterogeneousArrayLiterals.ts, 67, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 58, 49)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var i = [u, base]; // Base[] +>i : Symbol(i, Decl(heterogeneousArrayLiterals.ts, 68, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var j = [u, derived]; // Derived[] +>j : Symbol(j, Decl(heterogeneousArrayLiterals.ts, 69, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 58, 54)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +} + +function foo3(t: T, u: U) { +>foo3 : Symbol(foo3, Decl(heterogeneousArrayLiterals.ts, 70, 1)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 72, 14)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 72, 32)) +>Derived : Symbol(Derived, Decl(heterogeneousArrayLiterals.ts, 20, 27), Decl(heterogeneousArrayLiterals.ts, 25, 23)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 72, 14)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 72, 32)) + + var a = [t, t]; // T[] +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 73, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) + + var b = [t, null]; // T[] +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 74, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) + + var c = [t, u]; // {}[] +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 75, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) + + var d = [t, 1]; // {}[] +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 76, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) + + var e = [() => t, () => u]; // {}[] +>e : Symbol(e, Decl(heterogeneousArrayLiterals.ts, 77, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) + + var f = [() => t, () => u, () => null]; // { (): any }[] +>f : Symbol(f, Decl(heterogeneousArrayLiterals.ts, 78, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) + + var g = [t, base]; // Base[] +>g : Symbol(g, Decl(heterogeneousArrayLiterals.ts, 80, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var h = [t, derived]; // Derived[] +>h : Symbol(h, Decl(heterogeneousArrayLiterals.ts, 81, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 72, 52)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var i = [u, base]; // Base[] +>i : Symbol(i, Decl(heterogeneousArrayLiterals.ts, 82, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var j = [u, derived]; // Derived[] +>j : Symbol(j, Decl(heterogeneousArrayLiterals.ts, 83, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 72, 57)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) +} + +function foo4(t: T, u: U) { +>foo4 : Symbol(foo4, Decl(heterogeneousArrayLiterals.ts, 84, 1)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 86, 14)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 86, 29)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>T : Symbol(T, Decl(heterogeneousArrayLiterals.ts, 86, 14)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) +>U : Symbol(U, Decl(heterogeneousArrayLiterals.ts, 86, 29)) + + var a = [t, t]; // T[] +>a : Symbol(a, Decl(heterogeneousArrayLiterals.ts, 87, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) + + var b = [t, null]; // T[] +>b : Symbol(b, Decl(heterogeneousArrayLiterals.ts, 88, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) + + var c = [t, u]; // BUG 821629 +>c : Symbol(c, Decl(heterogeneousArrayLiterals.ts, 89, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) + + var d = [t, 1]; // {}[] +>d : Symbol(d, Decl(heterogeneousArrayLiterals.ts, 90, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) + + var e = [() => t, () => u]; // {}[] +>e : Symbol(e, Decl(heterogeneousArrayLiterals.ts, 91, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) + + var f = [() => t, () => u, () => null]; // { (): any }[] +>f : Symbol(f, Decl(heterogeneousArrayLiterals.ts, 92, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) + + var g = [t, base]; // Base[] +>g : Symbol(g, Decl(heterogeneousArrayLiterals.ts, 94, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var h = [t, derived]; // Derived[] +>h : Symbol(h, Decl(heterogeneousArrayLiterals.ts, 95, 7)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var i = [u, base]; // Base[] +>i : Symbol(i, Decl(heterogeneousArrayLiterals.ts, 96, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) +>base : Symbol(base, Decl(heterogeneousArrayLiterals.ts, 23, 3)) + + var j = [u, derived]; // Derived[] +>j : Symbol(j, Decl(heterogeneousArrayLiterals.ts, 97, 7)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) +>derived : Symbol(derived, Decl(heterogeneousArrayLiterals.ts, 24, 3)) + + var k: Base[] = [t, u]; +>k : Symbol(k, Decl(heterogeneousArrayLiterals.ts, 99, 7)) +>Base : Symbol(Base, Decl(heterogeneousArrayLiterals.ts, 18, 32)) +>t : Symbol(t, Decl(heterogeneousArrayLiterals.ts, 86, 46)) +>u : Symbol(u, Decl(heterogeneousArrayLiterals.ts, 86, 51)) +} + +//function foo3(t: T, u: U) { +// var a = [t, t]; // T[] +// var b = [t, null]; // T[] +// var c = [t, u]; // {}[] +// var d = [t, 1]; // {}[] +// var e = [() => t, () => u]; // {}[] +// var f = [() => t, () => u, () => null]; // { (): any }[] + +// var g = [t, base]; // Base[] +// var h = [t, derived]; // Derived[] +// var i = [u, base]; // Base[] +// var j = [u, derived]; // Derived[] +//} + +//function foo4(t: T, u: U) { +// var a = [t, t]; // T[] +// var b = [t, null]; // T[] +// var c = [t, u]; // BUG 821629 +// var d = [t, 1]; // {}[] +// var e = [() => t, () => u]; // {}[] +// var f = [() => t, () => u, () => null]; // { (): any }[] + +// var g = [t, base]; // Base[] +// var h = [t, derived]; // Derived[] +// var i = [u, base]; // Base[] +// var j = [u, derived]; // Derived[] + +// var k: Base[] = [t, u]; +//} diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.types b/tests/baselines/reference/heterogeneousArrayLiterals.types index dc4e21d85ee..81fa915ab03 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.types +++ b/tests/baselines/reference/heterogeneousArrayLiterals.types @@ -4,19 +4,27 @@ var a = [1, '']; // {}[] >a : (string | number)[] >[1, ''] : (string | number)[] +>1 : number +>'' : string var b = [1, null]; // number[] >b : number[] >[1, null] : number[] +>1 : number +>null : null var c = [1, '', null]; // {}[] >c : (string | number)[] >[1, '', null] : (string | number)[] +>1 : number +>'' : string +>null : null var d = [{}, 1]; // {}[] >d : {}[] >[{}, 1] : {}[] >{} : {} +>1 : number var e = [{}, Object]; // {}[] >e : {}[] @@ -29,63 +37,83 @@ var f = [[], [1]]; // number[][] >[[], [1]] : number[][] >[] : undefined[] >[1] : number[] +>1 : number var g = [[1], ['']]; // {}[] >g : (string[] | number[])[] >[[1], ['']] : (string[] | number[])[] >[1] : number[] +>1 : number >[''] : string[] +>'' : string var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] >h : { foo: number; }[] >[{ foo: 1, bar: '' }, { foo: 2 }] : { foo: number; }[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number +>1 : number >bar : string +>'' : string >{ foo: 2 } : { foo: number; } >foo : number +>2 : number var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] >i : ({ foo: number; bar: string; } | { foo: string; })[] >[{ foo: 1, bar: '' }, { foo: '' }] : ({ foo: number; bar: string; } | { foo: string; })[] >{ foo: 1, bar: '' } : { foo: number; bar: string; } >foo : number +>1 : number >bar : string +>'' : string >{ foo: '' } : { foo: string; } >foo : string +>'' : string var j = [() => 1, () => '']; // {}[] >j : ((() => number) | (() => string))[] >[() => 1, () => ''] : ((() => number) | (() => string))[] >() => 1 : () => number +>1 : number >() => '' : () => string +>'' : string var k = [() => 1, () => 1]; // { (): number }[] >k : (() => number)[] >[() => 1, () => 1] : (() => number)[] >() => 1 : () => number +>1 : number >() => 1 : () => number +>1 : number var l = [() => 1, () => null]; // { (): any }[] >l : (() => any)[] >[() => 1, () => null] : (() => any)[] >() => 1 : () => number +>1 : number >() => null : () => any +>null : null var m = [() => 1, () => '', () => null]; // { (): any }[] >m : (() => any)[] >[() => 1, () => '', () => null] : (() => any)[] >() => 1 : () => number +>1 : number >() => '' : () => string +>'' : string >() => null : () => any +>null : null var n = [[() => 1], [() => '']]; // {}[] >n : ((() => number)[] | (() => string)[])[] >[[() => 1], [() => '']] : ((() => number)[] | (() => string)[])[] >[() => 1] : (() => number)[] >() => 1 : () => number +>1 : number >[() => ''] : (() => string)[] >() => '' : () => string +>'' : string class Base { foo: string; } >Base : Base @@ -154,6 +182,7 @@ module Derived { >() => base : () => Base >base : Base >() => 1 : () => number +>1 : number var l = [() => base, () => null]; // { (): any }[] >l : (() => any)[] @@ -161,6 +190,7 @@ module Derived { >() => base : () => Base >base : Base >() => null : () => any +>null : null var m = [() => base, () => derived, () => null]; // { (): any }[] >m : (() => any)[] @@ -170,6 +200,7 @@ module Derived { >() => derived : () => Derived >derived : Derived >() => null : () => any +>null : null var n = [[() => base], [() => derived]]; // { (): Base }[] >n : (() => Base)[][] @@ -220,6 +251,7 @@ module WithContextualType { >b : Derived[] >Derived : Derived >[null] : null[] +>null : null var c: Derived[] = []; >c : Derived[] @@ -255,6 +287,7 @@ function foo(t: T, u: U) { >b : T[] >[t, null] : T[] >t : T +>null : null var c = [t, u]; // {}[] >c : (T | U)[] @@ -266,6 +299,7 @@ function foo(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T +>1 : number var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -283,6 +317,7 @@ function foo(t: T, u: U) { >() => u : () => U >u : U >() => null : () => any +>null : null } function foo2(t: T, u: U) { @@ -306,6 +341,7 @@ function foo2(t: T, u: U) { >b : T[] >[t, null] : T[] >t : T +>null : null var c = [t, u]; // {}[] >c : (T | U)[] @@ -317,6 +353,7 @@ function foo2(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T +>1 : number var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -334,6 +371,7 @@ function foo2(t: T, u: U) { >() => u : () => U >u : U >() => null : () => any +>null : null var g = [t, base]; // Base[] >g : Base[] @@ -381,6 +419,7 @@ function foo3(t: T, u: U) { >b : T[] >[t, null] : T[] >t : T +>null : null var c = [t, u]; // {}[] >c : (T | U)[] @@ -392,6 +431,7 @@ function foo3(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T +>1 : number var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -409,6 +449,7 @@ function foo3(t: T, u: U) { >() => u : () => U >u : U >() => null : () => any +>null : null var g = [t, base]; // Base[] >g : Base[] @@ -456,6 +497,7 @@ function foo4(t: T, u: U) { >b : T[] >[t, null] : T[] >t : T +>null : null var c = [t, u]; // BUG 821629 >c : (T | U)[] @@ -467,6 +509,7 @@ function foo4(t: T, u: U) { >d : (number | T)[] >[t, 1] : (number | T)[] >t : T +>1 : number var e = [() => t, () => u]; // {}[] >e : ((() => T) | (() => U))[] @@ -484,6 +527,7 @@ function foo4(t: T, u: U) { >() => u : () => U >u : U >() => null : () => any +>null : null var g = [t, base]; // Base[] >g : Base[] diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.types.pull b/tests/baselines/reference/heterogeneousArrayLiterals.types.pull deleted file mode 100644 index e35caeed74a..00000000000 --- a/tests/baselines/reference/heterogeneousArrayLiterals.types.pull +++ /dev/null @@ -1,548 +0,0 @@ -=== tests/cases/conformance/types/typeRelationships/bestCommonType/heterogeneousArrayLiterals.ts === -// type of an array is the best common type of its elements (plus its contextual type if it exists) - -var a = [1, '']; // {}[] ->a : (string | number)[] ->[1, ''] : (string | number)[] - -var b = [1, null]; // number[] ->b : number[] ->[1, null] : number[] - -var c = [1, '', null]; // {}[] ->c : (string | number)[] ->[1, '', null] : (string | number)[] - -var d = [{}, 1]; // {}[] ->d : {}[] ->[{}, 1] : {}[] ->{} : {} - -var e = [{}, Object]; // {}[] ->e : {}[] ->[{}, Object] : {}[] ->{} : {} ->Object : ObjectConstructor - -var f = [[], [1]]; // number[][] ->f : number[][] ->[[], [1]] : number[][] ->[] : undefined[] ->[1] : number[] - -var g = [[1], ['']]; // {}[] ->g : (number[] | string[])[] ->[[1], ['']] : (number[] | string[])[] ->[1] : number[] ->[''] : string[] - -var h = [{ foo: 1, bar: '' }, { foo: 2 }]; // {foo: number}[] ->h : { foo: number; }[] ->[{ foo: 1, bar: '' }, { foo: 2 }] : { foo: number; }[] ->{ foo: 1, bar: '' } : { foo: number; bar: string; } ->foo : number ->bar : string ->{ foo: 2 } : { foo: number; } ->foo : number - -var i = [{ foo: 1, bar: '' }, { foo: '' }]; // {}[] ->i : ({ foo: number; bar: string; } | { foo: string; })[] ->[{ foo: 1, bar: '' }, { foo: '' }] : ({ foo: number; bar: string; } | { foo: string; })[] ->{ foo: 1, bar: '' } : { foo: number; bar: string; } ->foo : number ->bar : string ->{ foo: '' } : { foo: string; } ->foo : string - -var j = [() => 1, () => '']; // {}[] ->j : ((() => number) | (() => string))[] ->[() => 1, () => ''] : ((() => number) | (() => string))[] ->() => 1 : () => number ->() => '' : () => string - -var k = [() => 1, () => 1]; // { (): number }[] ->k : (() => number)[] ->[() => 1, () => 1] : (() => number)[] ->() => 1 : () => number ->() => 1 : () => number - -var l = [() => 1, () => null]; // { (): any }[] ->l : (() => any)[] ->[() => 1, () => null] : (() => any)[] ->() => 1 : () => number ->() => null : () => any - -var m = [() => 1, () => '', () => null]; // { (): any }[] ->m : (() => any)[] ->[() => 1, () => '', () => null] : (() => any)[] ->() => 1 : () => number ->() => '' : () => string ->() => null : () => any - -var n = [[() => 1], [() => '']]; // {}[] ->n : ((() => number)[] | (() => string)[])[] ->[[() => 1], [() => '']] : ((() => number)[] | (() => string)[])[] ->[() => 1] : (() => number)[] ->() => 1 : () => number ->[() => ''] : (() => string)[] ->() => '' : () => string - -class Base { foo: string; } ->Base : Base ->foo : string - -class Derived extends Base { bar: string; } ->Derived : Derived ->Base : Base ->bar : string - -class Derived2 extends Base { baz: string; } ->Derived2 : Derived2 ->Base : Base ->baz : string - -var base: Base; ->base : Base ->Base : Base - -var derived: Derived; ->derived : Derived ->Derived : Derived - -var derived2: Derived2; ->derived2 : Derived2 ->Derived2 : Derived2 - -module Derived { ->Derived : typeof Derived - - var h = [{ foo: base, basear: derived }, { foo: base }]; // {foo: Base}[] ->h : { foo: Base; }[] ->[{ foo: base, basear: derived }, { foo: base }] : { foo: Base; }[] ->{ foo: base, basear: derived } : { foo: Base; basear: Derived; } ->foo : Base ->base : Base ->basear : Derived ->derived : Derived ->{ foo: base } : { foo: Base; } ->foo : Base ->base : Base - - var i = [{ foo: base, basear: derived }, { foo: derived }]; // {foo: Derived}[] ->i : ({ foo: Base; basear: Derived; } | { foo: Derived; })[] ->[{ foo: base, basear: derived }, { foo: derived }] : ({ foo: Base; basear: Derived; } | { foo: Derived; })[] ->{ foo: base, basear: derived } : { foo: Base; basear: Derived; } ->foo : Base ->base : Base ->basear : Derived ->derived : Derived ->{ foo: derived } : { foo: Derived; } ->foo : Derived ->derived : Derived - - var j = [() => base, () => derived]; // { {}: Base } ->j : (() => Base)[] ->[() => base, () => derived] : (() => Base)[] ->() => base : () => Base ->base : Base ->() => derived : () => Derived ->derived : Derived - - var k = [() => base, () => 1]; // {}[]~ ->k : ((() => Base) | (() => number))[] ->[() => base, () => 1] : ((() => Base) | (() => number))[] ->() => base : () => Base ->base : Base ->() => 1 : () => number - - var l = [() => base, () => null]; // { (): any }[] ->l : (() => any)[] ->[() => base, () => null] : (() => any)[] ->() => base : () => Base ->base : Base ->() => null : () => any - - var m = [() => base, () => derived, () => null]; // { (): any }[] ->m : (() => any)[] ->[() => base, () => derived, () => null] : (() => any)[] ->() => base : () => Base ->base : Base ->() => derived : () => Derived ->derived : Derived ->() => null : () => any - - var n = [[() => base], [() => derived]]; // { (): Base }[] ->n : (() => Base)[][] ->[[() => base], [() => derived]] : (() => Base)[][] ->[() => base] : (() => Base)[] ->() => base : () => Base ->base : Base ->[() => derived] : (() => Derived)[] ->() => derived : () => Derived ->derived : Derived - - var o = [derived, derived2]; // {}[] ->o : (Derived | Derived2)[] ->[derived, derived2] : (Derived | Derived2)[] ->derived : Derived ->derived2 : Derived2 - - var p = [derived, derived2, base]; // Base[] ->p : Base[] ->[derived, derived2, base] : Base[] ->derived : Derived ->derived2 : Derived2 ->base : Base - - var q = [[() => derived2], [() => derived]]; // {}[] ->q : ((() => Derived2)[] | (() => Derived)[])[] ->[[() => derived2], [() => derived]] : ((() => Derived2)[] | (() => Derived)[])[] ->[() => derived2] : (() => Derived2)[] ->() => derived2 : () => Derived2 ->derived2 : Derived2 ->[() => derived] : (() => Derived)[] ->() => derived : () => Derived ->derived : Derived -} - -module WithContextualType { ->WithContextualType : typeof WithContextualType - - // no errors - var a: Base[] = [derived, derived2]; ->a : Base[] ->Base : Base ->[derived, derived2] : (Derived | Derived2)[] ->derived : Derived ->derived2 : Derived2 - - var b: Derived[] = [null]; ->b : Derived[] ->Derived : Derived ->[null] : null[] - - var c: Derived[] = []; ->c : Derived[] ->Derived : Derived ->[] : undefined[] - - var d: { (): Base }[] = [() => derived, () => derived2]; ->d : (() => Base)[] ->Base : Base ->[() => derived, () => derived2] : ((() => Derived) | (() => Derived2))[] ->() => derived : () => Derived ->derived : Derived ->() => derived2 : () => Derived2 ->derived2 : Derived2 -} - -function foo(t: T, u: U) { ->foo : (t: T, u: U) => void ->T : T ->U : U ->t : T ->T : T ->u : U ->U : U - - var a = [t, t]; // T[] ->a : T[] ->[t, t] : T[] ->t : T ->t : T - - var b = [t, null]; // T[] ->b : T[] ->[t, null] : T[] ->t : T - - var c = [t, u]; // {}[] ->c : (T | U)[] ->[t, u] : (T | U)[] ->t : T ->u : U - - var d = [t, 1]; // {}[] ->d : (number | T)[] ->[t, 1] : (number | T)[] ->t : T - - var e = [() => t, () => u]; // {}[] ->e : ((() => T) | (() => U))[] ->[() => t, () => u] : ((() => T) | (() => U))[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U - - var f = [() => t, () => u, () => null]; // { (): any }[] ->f : (() => any)[] ->[() => t, () => u, () => null] : (() => any)[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U ->() => null : () => any -} - -function foo2(t: T, u: U) { ->foo2 : (t: T, u: U) => void ->T : T ->Base : Base ->U : U ->Derived : Derived ->t : T ->T : T ->u : U ->U : U - - var a = [t, t]; // T[] ->a : T[] ->[t, t] : T[] ->t : T ->t : T - - var b = [t, null]; // T[] ->b : T[] ->[t, null] : T[] ->t : T - - var c = [t, u]; // {}[] ->c : (T | U)[] ->[t, u] : (T | U)[] ->t : T ->u : U - - var d = [t, 1]; // {}[] ->d : (number | T)[] ->[t, 1] : (number | T)[] ->t : T - - var e = [() => t, () => u]; // {}[] ->e : ((() => T) | (() => U))[] ->[() => t, () => u] : ((() => T) | (() => U))[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U - - var f = [() => t, () => u, () => null]; // { (): any }[] ->f : (() => any)[] ->[() => t, () => u, () => null] : (() => any)[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U ->() => null : () => any - - var g = [t, base]; // Base[] ->g : Base[] ->[t, base] : Base[] ->t : T ->base : Base - - var h = [t, derived]; // Derived[] ->h : (Derived | T)[] ->[t, derived] : (Derived | T)[] ->t : T ->derived : Derived - - var i = [u, base]; // Base[] ->i : Base[] ->[u, base] : Base[] ->u : U ->base : Base - - var j = [u, derived]; // Derived[] ->j : Derived[] ->[u, derived] : Derived[] ->u : U ->derived : Derived -} - -function foo3(t: T, u: U) { ->foo3 : (t: T, u: U) => void ->T : T ->Derived : Derived ->U : U ->Derived : Derived ->t : T ->T : T ->u : U ->U : U - - var a = [t, t]; // T[] ->a : T[] ->[t, t] : T[] ->t : T ->t : T - - var b = [t, null]; // T[] ->b : T[] ->[t, null] : T[] ->t : T - - var c = [t, u]; // {}[] ->c : (T | U)[] ->[t, u] : (T | U)[] ->t : T ->u : U - - var d = [t, 1]; // {}[] ->d : (number | T)[] ->[t, 1] : (number | T)[] ->t : T - - var e = [() => t, () => u]; // {}[] ->e : ((() => T) | (() => U))[] ->[() => t, () => u] : ((() => T) | (() => U))[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U - - var f = [() => t, () => u, () => null]; // { (): any }[] ->f : (() => any)[] ->[() => t, () => u, () => null] : (() => any)[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U ->() => null : () => any - - var g = [t, base]; // Base[] ->g : Base[] ->[t, base] : Base[] ->t : T ->base : Base - - var h = [t, derived]; // Derived[] ->h : Derived[] ->[t, derived] : Derived[] ->t : T ->derived : Derived - - var i = [u, base]; // Base[] ->i : Base[] ->[u, base] : Base[] ->u : U ->base : Base - - var j = [u, derived]; // Derived[] ->j : Derived[] ->[u, derived] : Derived[] ->u : U ->derived : Derived -} - -function foo4(t: T, u: U) { ->foo4 : (t: T, u: U) => void ->T : T ->Base : Base ->U : U ->Base : Base ->t : T ->T : T ->u : U ->U : U - - var a = [t, t]; // T[] ->a : T[] ->[t, t] : T[] ->t : T ->t : T - - var b = [t, null]; // T[] ->b : T[] ->[t, null] : T[] ->t : T - - var c = [t, u]; // BUG 821629 ->c : (T | U)[] ->[t, u] : (T | U)[] ->t : T ->u : U - - var d = [t, 1]; // {}[] ->d : (number | T)[] ->[t, 1] : (number | T)[] ->t : T - - var e = [() => t, () => u]; // {}[] ->e : ((() => T) | (() => U))[] ->[() => t, () => u] : ((() => T) | (() => U))[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U - - var f = [() => t, () => u, () => null]; // { (): any }[] ->f : (() => any)[] ->[() => t, () => u, () => null] : (() => any)[] ->() => t : () => T ->t : T ->() => u : () => U ->u : U ->() => null : () => any - - var g = [t, base]; // Base[] ->g : Base[] ->[t, base] : Base[] ->t : T ->base : Base - - var h = [t, derived]; // Derived[] ->h : (Derived | T)[] ->[t, derived] : (Derived | T)[] ->t : T ->derived : Derived - - var i = [u, base]; // Base[] ->i : Base[] ->[u, base] : Base[] ->u : U ->base : Base - - var j = [u, derived]; // Derived[] ->j : (Derived | U)[] ->[u, derived] : (Derived | U)[] ->u : U ->derived : Derived - - var k: Base[] = [t, u]; ->k : Base[] ->Base : Base ->[t, u] : (T | U)[] ->t : T ->u : U -} - -//function foo3(t: T, u: U) { -// var a = [t, t]; // T[] -// var b = [t, null]; // T[] -// var c = [t, u]; // {}[] -// var d = [t, 1]; // {}[] -// var e = [() => t, () => u]; // {}[] -// var f = [() => t, () => u, () => null]; // { (): any }[] - -// var g = [t, base]; // Base[] -// var h = [t, derived]; // Derived[] -// var i = [u, base]; // Base[] -// var j = [u, derived]; // Derived[] -//} - -//function foo4(t: T, u: U) { -// var a = [t, t]; // T[] -// var b = [t, null]; // T[] -// var c = [t, u]; // BUG 821629 -// var d = [t, 1]; // {}[] -// var e = [() => t, () => u]; // {}[] -// var f = [() => t, () => u, () => null]; // { (): any }[] - -// var g = [t, base]; // Base[] -// var h = [t, derived]; // Derived[] -// var i = [u, base]; // Base[] -// var j = [u, derived]; // Derived[] - -// var k: Base[] = [t, u]; -//} diff --git a/tests/baselines/reference/hidingCallSignatures.symbols b/tests/baselines/reference/hidingCallSignatures.symbols new file mode 100644 index 00000000000..5f6f057f6cd --- /dev/null +++ b/tests/baselines/reference/hidingCallSignatures.symbols @@ -0,0 +1,55 @@ +=== tests/cases/compiler/hidingCallSignatures.ts === +interface C { +>C : Symbol(C, Decl(hidingCallSignatures.ts, 0, 0)) + + new (a: string): string; +>a : Symbol(a, Decl(hidingCallSignatures.ts, 1, 9)) +} + +interface D extends C { +>D : Symbol(D, Decl(hidingCallSignatures.ts, 2, 1)) +>C : Symbol(C, Decl(hidingCallSignatures.ts, 0, 0)) + + (a: string): number; // Should be ok +>a : Symbol(a, Decl(hidingCallSignatures.ts, 5, 5)) +} + +interface E { +>E : Symbol(E, Decl(hidingCallSignatures.ts, 6, 1)) + + (a: string): {}; +>a : Symbol(a, Decl(hidingCallSignatures.ts, 9, 5)) +} + +interface F extends E { +>F : Symbol(F, Decl(hidingCallSignatures.ts, 10, 1)) +>E : Symbol(E, Decl(hidingCallSignatures.ts, 6, 1)) + + (a: string): string; +>a : Symbol(a, Decl(hidingCallSignatures.ts, 13, 5)) +} + +var d: D; +>d : Symbol(d, Decl(hidingCallSignatures.ts, 16, 3)) +>D : Symbol(D, Decl(hidingCallSignatures.ts, 2, 1)) + +d(""); // number +>d : Symbol(d, Decl(hidingCallSignatures.ts, 16, 3)) + +new d(""); // should be string +>d : Symbol(d, Decl(hidingCallSignatures.ts, 16, 3)) + +var f: F; +>f : Symbol(f, Decl(hidingCallSignatures.ts, 20, 3)) +>F : Symbol(F, Decl(hidingCallSignatures.ts, 10, 1)) + +f(""); // string +>f : Symbol(f, Decl(hidingCallSignatures.ts, 20, 3)) + +var e: E; +>e : Symbol(e, Decl(hidingCallSignatures.ts, 23, 3)) +>E : Symbol(E, Decl(hidingCallSignatures.ts, 6, 1)) + +e(""); // {} +>e : Symbol(e, Decl(hidingCallSignatures.ts, 23, 3)) + diff --git a/tests/baselines/reference/hidingCallSignatures.types b/tests/baselines/reference/hidingCallSignatures.types index 90428b8db76..c45cab69d8a 100644 --- a/tests/baselines/reference/hidingCallSignatures.types +++ b/tests/baselines/reference/hidingCallSignatures.types @@ -36,10 +36,12 @@ var d: D; d(""); // number >d("") : number >d : D +>"" : string new d(""); // should be string >new d("") : string >d : D +>"" : string var f: F; >f : F @@ -48,6 +50,7 @@ var f: F; f(""); // string >f("") : string >f : F +>"" : string var e: E; >e : E @@ -56,4 +59,5 @@ var e: E; e(""); // {} >e("") : {} >e : E +>"" : string diff --git a/tests/baselines/reference/hidingConstructSignatures.symbols b/tests/baselines/reference/hidingConstructSignatures.symbols new file mode 100644 index 00000000000..d398c79ef85 --- /dev/null +++ b/tests/baselines/reference/hidingConstructSignatures.symbols @@ -0,0 +1,55 @@ +=== tests/cases/compiler/hidingConstructSignatures.ts === +interface C { +>C : Symbol(C, Decl(hidingConstructSignatures.ts, 0, 0)) + + (a: string): string; +>a : Symbol(a, Decl(hidingConstructSignatures.ts, 1, 5)) +} + +interface D extends C { +>D : Symbol(D, Decl(hidingConstructSignatures.ts, 2, 1)) +>C : Symbol(C, Decl(hidingConstructSignatures.ts, 0, 0)) + + new (a: string): number; // Should be ok +>a : Symbol(a, Decl(hidingConstructSignatures.ts, 5, 9)) +} + +interface E { +>E : Symbol(E, Decl(hidingConstructSignatures.ts, 6, 1)) + + new (a: string): {}; +>a : Symbol(a, Decl(hidingConstructSignatures.ts, 9, 9)) +} + +interface F extends E { +>F : Symbol(F, Decl(hidingConstructSignatures.ts, 10, 1)) +>E : Symbol(E, Decl(hidingConstructSignatures.ts, 6, 1)) + + new (a: string): string; +>a : Symbol(a, Decl(hidingConstructSignatures.ts, 13, 9)) +} + +var d: D; +>d : Symbol(d, Decl(hidingConstructSignatures.ts, 16, 3)) +>D : Symbol(D, Decl(hidingConstructSignatures.ts, 2, 1)) + +d(""); // string +>d : Symbol(d, Decl(hidingConstructSignatures.ts, 16, 3)) + +new d(""); // should be number +>d : Symbol(d, Decl(hidingConstructSignatures.ts, 16, 3)) + +var f: F; +>f : Symbol(f, Decl(hidingConstructSignatures.ts, 20, 3)) +>F : Symbol(F, Decl(hidingConstructSignatures.ts, 10, 1)) + +new f(""); // string +>f : Symbol(f, Decl(hidingConstructSignatures.ts, 20, 3)) + +var e: E; +>e : Symbol(e, Decl(hidingConstructSignatures.ts, 23, 3)) +>E : Symbol(E, Decl(hidingConstructSignatures.ts, 6, 1)) + +new e(""); // {} +>e : Symbol(e, Decl(hidingConstructSignatures.ts, 23, 3)) + diff --git a/tests/baselines/reference/hidingConstructSignatures.types b/tests/baselines/reference/hidingConstructSignatures.types index 99781535b5d..0fd9860de25 100644 --- a/tests/baselines/reference/hidingConstructSignatures.types +++ b/tests/baselines/reference/hidingConstructSignatures.types @@ -36,10 +36,12 @@ var d: D; d(""); // string >d("") : string >d : D +>"" : string new d(""); // should be number >new d("") : number >d : D +>"" : string var f: F; >f : F @@ -48,6 +50,7 @@ var f: F; new f(""); // string >new f("") : string >f : F +>"" : string var e: E; >e : E @@ -56,4 +59,5 @@ var e: E; new e(""); // {} >new e("") : {} >e : E +>"" : string diff --git a/tests/baselines/reference/hidingIndexSignatures.symbols b/tests/baselines/reference/hidingIndexSignatures.symbols new file mode 100644 index 00000000000..0450a1c0e4b --- /dev/null +++ b/tests/baselines/reference/hidingIndexSignatures.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/hidingIndexSignatures.ts === +interface A { +>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0)) + + [a: string]: {}; +>a : Symbol(a, Decl(hidingIndexSignatures.ts, 1, 5)) +} + +interface B extends A { +>B : Symbol(B, Decl(hidingIndexSignatures.ts, 2, 1)) +>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0)) + + [a: string]: number; // Number is not a subtype of string. Should error. +>a : Symbol(a, Decl(hidingIndexSignatures.ts, 5, 5)) +} + +var b: B; +>b : Symbol(b, Decl(hidingIndexSignatures.ts, 8, 3)) +>B : Symbol(B, Decl(hidingIndexSignatures.ts, 2, 1)) + +b[""]; // Should be number +>b : Symbol(b, Decl(hidingIndexSignatures.ts, 8, 3)) + +var a: A; +>a : Symbol(a, Decl(hidingIndexSignatures.ts, 10, 3)) +>A : Symbol(A, Decl(hidingIndexSignatures.ts, 0, 0)) + +a[""]; // Should be {} +>a : Symbol(a, Decl(hidingIndexSignatures.ts, 10, 3)) + diff --git a/tests/baselines/reference/hidingIndexSignatures.types b/tests/baselines/reference/hidingIndexSignatures.types index fe1363d1598..9a6346ace7b 100644 --- a/tests/baselines/reference/hidingIndexSignatures.types +++ b/tests/baselines/reference/hidingIndexSignatures.types @@ -21,6 +21,7 @@ var b: B; b[""]; // Should be number >b[""] : number >b : B +>"" : string var a: A; >a : A @@ -29,4 +30,5 @@ var a: A; a[""]; // Should be {} >a[""] : {} >a : A +>"" : string diff --git a/tests/baselines/reference/icomparable.symbols b/tests/baselines/reference/icomparable.symbols new file mode 100644 index 00000000000..03eac6b5bec --- /dev/null +++ b/tests/baselines/reference/icomparable.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/icomparable.ts === + interface IComparable { +>IComparable : Symbol(IComparable, Decl(icomparable.ts, 0, 0)) +>T : Symbol(T, Decl(icomparable.ts, 0, 26)) + + compareTo(other: T); +>compareTo : Symbol(compareTo, Decl(icomparable.ts, 0, 30)) +>other : Symbol(other, Decl(icomparable.ts, 1, 17)) +>T : Symbol(T, Decl(icomparable.ts, 0, 26)) + } + + declare function sort>(items: U[]): U[]; +>sort : Symbol(sort, Decl(icomparable.ts, 2, 5)) +>U : Symbol(U, Decl(icomparable.ts, 4, 26)) +>IComparable : Symbol(IComparable, Decl(icomparable.ts, 0, 0)) +>items : Symbol(items, Decl(icomparable.ts, 4, 54)) +>U : Symbol(U, Decl(icomparable.ts, 4, 26)) +>U : Symbol(U, Decl(icomparable.ts, 4, 26)) + + interface StringComparable extends IComparable { +>StringComparable : Symbol(StringComparable, Decl(icomparable.ts, 4, 71)) +>IComparable : Symbol(IComparable, Decl(icomparable.ts, 0, 0)) + } + + var sc: StringComparable[]; +>sc : Symbol(sc, Decl(icomparable.ts, 9, 7)) +>StringComparable : Symbol(StringComparable, Decl(icomparable.ts, 4, 71)) + + var x = sort(sc); +>x : Symbol(x, Decl(icomparable.ts, 11, 7)) +>sort : Symbol(sort, Decl(icomparable.ts, 2, 5)) +>sc : Symbol(sc, Decl(icomparable.ts, 9, 7)) + diff --git a/tests/baselines/reference/idInProp.symbols b/tests/baselines/reference/idInProp.symbols new file mode 100644 index 00000000000..56d7318ab19 --- /dev/null +++ b/tests/baselines/reference/idInProp.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/idInProp.ts === +function f() { +>f : Symbol(f, Decl(idInProp.ts, 0, 0)) + +var t: { (f: any) : any; }; +>t : Symbol(t, Decl(idInProp.ts, 2, 3)) +>f : Symbol(f, Decl(idInProp.ts, 2, 10)) + +} + diff --git a/tests/baselines/reference/identicalCallSignatures.symbols b/tests/baselines/reference/identicalCallSignatures.symbols new file mode 100644 index 00000000000..ede05ffed1d --- /dev/null +++ b/tests/baselines/reference/identicalCallSignatures.symbols @@ -0,0 +1,61 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/identicalCallSignatures.ts === +// Each pair of call signatures in these types have a duplicate signature error. +// Identical call signatures should generate an error. +interface I { +>I : Symbol(I, Decl(identicalCallSignatures.ts, 0, 0)) + + (x): number; +>x : Symbol(x, Decl(identicalCallSignatures.ts, 3, 5)) + + (x: any): number; +>x : Symbol(x, Decl(identicalCallSignatures.ts, 4, 5)) + + (x: T): T; +>T : Symbol(T, Decl(identicalCallSignatures.ts, 5, 5)) +>x : Symbol(x, Decl(identicalCallSignatures.ts, 5, 8)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 5, 5)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 5, 5)) + + (x: U): U; // error +>U : Symbol(U, Decl(identicalCallSignatures.ts, 6, 5)) +>x : Symbol(x, Decl(identicalCallSignatures.ts, 6, 8)) +>U : Symbol(U, Decl(identicalCallSignatures.ts, 6, 5)) +>U : Symbol(U, Decl(identicalCallSignatures.ts, 6, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(identicalCallSignatures.ts, 7, 1)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13)) + + (x: T): T; +>x : Symbol(x, Decl(identicalCallSignatures.ts, 10, 5)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13)) + + (x: T): T; // error +>x : Symbol(x, Decl(identicalCallSignatures.ts, 11, 5)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13)) +} + +var a: { +>a : Symbol(a, Decl(identicalCallSignatures.ts, 14, 3)) + + (x): number; +>x : Symbol(x, Decl(identicalCallSignatures.ts, 15, 5)) + + (x: any): number; +>x : Symbol(x, Decl(identicalCallSignatures.ts, 16, 5)) + + (x: T): T; +>T : Symbol(T, Decl(identicalCallSignatures.ts, 17, 5)) +>x : Symbol(x, Decl(identicalCallSignatures.ts, 17, 8)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 17, 5)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 17, 5)) + + (x: T): T; // error +>T : Symbol(T, Decl(identicalCallSignatures.ts, 18, 5)) +>x : Symbol(x, Decl(identicalCallSignatures.ts, 18, 8)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 18, 5)) +>T : Symbol(T, Decl(identicalCallSignatures.ts, 18, 5)) +} diff --git a/tests/baselines/reference/identicalCallSignatures2.symbols b/tests/baselines/reference/identicalCallSignatures2.symbols new file mode 100644 index 00000000000..ad7dbcd3812 --- /dev/null +++ b/tests/baselines/reference/identicalCallSignatures2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/identicalCallSignatures2.ts === +// Normally it is an error to have multiple overloads with identical signatures in a single type declaration. +// Here the multiple overloads come from multiple bases. + +interface Base { +>Base : Symbol(Base, Decl(identicalCallSignatures2.ts, 0, 0)) +>T : Symbol(T, Decl(identicalCallSignatures2.ts, 3, 15)) + + (x: number): string; +>x : Symbol(x, Decl(identicalCallSignatures2.ts, 4, 5)) +} + +interface I extends Base, Base { } +>I : Symbol(I, Decl(identicalCallSignatures2.ts, 5, 1)) +>Base : Symbol(Base, Decl(identicalCallSignatures2.ts, 0, 0)) +>Base : Symbol(Base, Decl(identicalCallSignatures2.ts, 0, 0)) + +interface I2 extends Base, Base { } +>I2 : Symbol(I2, Decl(identicalCallSignatures2.ts, 7, 50)) +>T : Symbol(T, Decl(identicalCallSignatures2.ts, 9, 13)) +>Base : Symbol(Base, Decl(identicalCallSignatures2.ts, 0, 0)) +>Base : Symbol(Base, Decl(identicalCallSignatures2.ts, 0, 0)) + diff --git a/tests/baselines/reference/identicalCallSignatures3.symbols b/tests/baselines/reference/identicalCallSignatures3.symbols new file mode 100644 index 00000000000..dc2749c4e0f --- /dev/null +++ b/tests/baselines/reference/identicalCallSignatures3.symbols @@ -0,0 +1,33 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/identicalCallSignatures3.ts === +// Normally it is an error to have multiple overloads with identical signatures in a single type declaration. +// Here the multiple overloads come from multiple merged declarations, so we do not report errors. + +interface I { +>I : Symbol(I, Decl(identicalCallSignatures3.ts, 0, 0), Decl(identicalCallSignatures3.ts, 5, 1)) + + (x: number): string; +>x : Symbol(x, Decl(identicalCallSignatures3.ts, 4, 5)) +} + +interface I { +>I : Symbol(I, Decl(identicalCallSignatures3.ts, 0, 0), Decl(identicalCallSignatures3.ts, 5, 1)) + + (x: number): string; +>x : Symbol(x, Decl(identicalCallSignatures3.ts, 8, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(identicalCallSignatures3.ts, 9, 1), Decl(identicalCallSignatures3.ts, 13, 1)) +>T : Symbol(T, Decl(identicalCallSignatures3.ts, 11, 13), Decl(identicalCallSignatures3.ts, 15, 13)) + + (x: number): string; +>x : Symbol(x, Decl(identicalCallSignatures3.ts, 12, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(identicalCallSignatures3.ts, 9, 1), Decl(identicalCallSignatures3.ts, 13, 1)) +>T : Symbol(T, Decl(identicalCallSignatures3.ts, 11, 13), Decl(identicalCallSignatures3.ts, 15, 13)) + + (x: number): string; +>x : Symbol(x, Decl(identicalCallSignatures3.ts, 16, 5)) +} diff --git a/tests/baselines/reference/identityForSignaturesWithTypeParametersSwitched.symbols b/tests/baselines/reference/identityForSignaturesWithTypeParametersSwitched.symbols new file mode 100644 index 00000000000..268e5d276b1 --- /dev/null +++ b/tests/baselines/reference/identityForSignaturesWithTypeParametersSwitched.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/identityForSignaturesWithTypeParametersSwitched.ts === +var f: (x: T, y: U) => T; +>f : Symbol(f, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 3), Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 3)) +>T : Symbol(T, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 8)) +>U : Symbol(U, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 10)) +>x : Symbol(x, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 14)) +>T : Symbol(T, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 8)) +>y : Symbol(y, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 19)) +>U : Symbol(U, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 10)) +>T : Symbol(T, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 8)) + +var f: (x: U, y: T) => U; +>f : Symbol(f, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 0, 3), Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 3)) +>T : Symbol(T, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 8)) +>U : Symbol(U, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 10)) +>x : Symbol(x, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 14)) +>U : Symbol(U, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 10)) +>y : Symbol(y, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 19)) +>T : Symbol(T, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 8)) +>U : Symbol(U, Decl(identityForSignaturesWithTypeParametersSwitched.ts, 1, 10)) + diff --git a/tests/baselines/reference/ifDoWhileStatements.symbols b/tests/baselines/reference/ifDoWhileStatements.symbols new file mode 100644 index 00000000000..36a990010ef --- /dev/null +++ b/tests/baselines/reference/ifDoWhileStatements.symbols @@ -0,0 +1,336 @@ +=== tests/cases/conformance/statements/ifDoWhileStatements/ifDoWhileStatements.ts === +interface I { +>I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(ifDoWhileStatements.ts, 0, 13)) +} + +class C implements I { +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) +>I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(ifDoWhileStatements.ts, 4, 22)) + + name: string; +>name : Symbol(name, Decl(ifDoWhileStatements.ts, 5, 15)) +} + +class C2 extends C { +>C2 : Symbol(C2, Decl(ifDoWhileStatements.ts, 7, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + + valid: boolean; +>valid : Symbol(valid, Decl(ifDoWhileStatements.ts, 9, 20)) +} + +class D{ +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) + + source: T; +>source : Symbol(source, Decl(ifDoWhileStatements.ts, 13, 11)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) + + recurse: D; +>recurse : Symbol(recurse, Decl(ifDoWhileStatements.ts, 14, 14)) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) + + wrapped: D> +>wrapped : Symbol(wrapped, Decl(ifDoWhileStatements.ts, 15, 18)) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>T : Symbol(T, Decl(ifDoWhileStatements.ts, 13, 8)) +} + +function F(x: string): number { return 42; } +>F : Symbol(F, Decl(ifDoWhileStatements.ts, 17, 1)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 19, 11)) + +function F2(x: number): boolean { return x < 42; } +>F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 19, 44)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 20, 12)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 20, 12)) + +module M { +>M : Symbol(M, Decl(ifDoWhileStatements.ts, 20, 50)) + + export class A { +>A : Symbol(A, Decl(ifDoWhileStatements.ts, 22, 10)) + + name: string; +>name : Symbol(name, Decl(ifDoWhileStatements.ts, 23, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 25, 5)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 27, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 27, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} + +module N { +>N : Symbol(N, Decl(ifDoWhileStatements.ts, 28, 1)) + + export class A { +>A : Symbol(A, Decl(ifDoWhileStatements.ts, 30, 10)) + + id: number; +>id : Symbol(id, Decl(ifDoWhileStatements.ts, 31, 20)) + } + + export function F2(x: number): string { return x.toString(); } +>F2 : Symbol(F2, Decl(ifDoWhileStatements.ts, 33, 5)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 35, 23)) +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 35, 23)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +} + +// literals +if (true) { } +while (true) { } +do { }while(true) + +if (null) { } +while (null) { } +do { }while(null) + +if (undefined) { } +>undefined : Symbol(undefined) + +while (undefined) { } +>undefined : Symbol(undefined) + +do { }while(undefined) +>undefined : Symbol(undefined) + +if (0.0) { } +while (0.0) { } +do { }while(0.0) + +if ('a string') { } +while ('a string') { } +do { }while('a string') + +if ('') { } +while ('') { } +do { }while('') + +if (/[a-z]/) { } +while (/[a-z]/) { } +do { }while(/[a-z]/) + +if ([]) { } +while ([]) { } +do { }while([]) + +if ([1, 2]) { } +while ([1, 2]) { } +do { }while([1, 2]) + +if ({}) { } +while ({}) { } +do { }while({}) + +if ({ x: 1, y: 'a' }) { } +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 79, 5)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 79, 11)) + +while ({ x: 1, y: 'a' }) { } +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 80, 8)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 80, 14)) + +do { }while({ x: 1, y: 'a' }) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 81, 13)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 81, 19)) + +if (() => 43) { } +while (() => 43) { } +do { }while(() => 43) + +if (new C()) { } +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +while (new C()) { } +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +do { }while(new C()) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +if (new D()) { } +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +while (new D()) { } +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +do { }while(new D()) +>D : Symbol(D, Decl(ifDoWhileStatements.ts, 11, 1)) +>C : Symbol(C, Decl(ifDoWhileStatements.ts, 2, 1)) + +// references +var a = true; +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) + +if (a) { } +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) + +while (a) { } +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) + +do { }while(a) +>a : Symbol(a, Decl(ifDoWhileStatements.ts, 96, 3)) + +var b = null; +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) + +if (b) { } +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) + +while (b) { } +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) + +do { }while(b) +>b : Symbol(b, Decl(ifDoWhileStatements.ts, 101, 3)) + +var c = undefined; +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) +>undefined : Symbol(undefined) + +if (c) { } +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) + +while (c) { } +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) + +do { }while(c) +>c : Symbol(c, Decl(ifDoWhileStatements.ts, 106, 3)) + +var d = 0.0; +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) + +if (d) { } +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) + +while (d) { } +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) + +do { }while(d) +>d : Symbol(d, Decl(ifDoWhileStatements.ts, 111, 3)) + +var e = 'a string'; +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) + +if (e) { } +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) + +while (e) { } +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) + +do { }while(e) +>e : Symbol(e, Decl(ifDoWhileStatements.ts, 116, 3)) + +var f = ''; +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) + +if (f) { } +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) + +while (f) { } +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) + +do { }while(f) +>f : Symbol(f, Decl(ifDoWhileStatements.ts, 121, 3)) + +var g = /[a-z]/ +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) + +if (g) { } +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) + +while (g) { } +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) + +do { }while(g) +>g : Symbol(g, Decl(ifDoWhileStatements.ts, 126, 3)) + +var h = []; +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) + +if (h) { } +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) + +while (h) { } +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) + +do { }while(h) +>h : Symbol(h, Decl(ifDoWhileStatements.ts, 131, 3)) + +var i = [1, 2]; +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) + +if (i) { } +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) + +while (i) { } +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) + +do { }while(i) +>i : Symbol(i, Decl(ifDoWhileStatements.ts, 136, 3)) + +var j = {}; +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) + +if (j) { } +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) + +while (j) { } +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) + +do { }while(j) +>j : Symbol(j, Decl(ifDoWhileStatements.ts, 141, 3)) + +var k = { x: 1, y: 'a' }; +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 146, 9)) +>y : Symbol(y, Decl(ifDoWhileStatements.ts, 146, 15)) + +if (k) { } +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) + +while (k) { } +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) + +do { }while(k) +>k : Symbol(k, Decl(ifDoWhileStatements.ts, 146, 3)) + +function fn(x?: string): I { return null; } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) +>x : Symbol(x, Decl(ifDoWhileStatements.ts, 151, 12)) +>I : Symbol(I, Decl(ifDoWhileStatements.ts, 0, 0)) + +if (fn()) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + +while (fn()) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + +do { }while(fn()) +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + +if (fn) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + +while (fn) { } +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + +do { }while(fn) +>fn : Symbol(fn, Decl(ifDoWhileStatements.ts, 149, 14)) + + + diff --git a/tests/baselines/reference/ifDoWhileStatements.types b/tests/baselines/reference/ifDoWhileStatements.types index b4a3f7a70af..92a9df6a4dd 100644 --- a/tests/baselines/reference/ifDoWhileStatements.types +++ b/tests/baselines/reference/ifDoWhileStatements.types @@ -48,12 +48,14 @@ class D{ function F(x: string): number { return 42; } >F : (x: string) => number >x : string +>42 : number function F2(x: number): boolean { return x < 42; } >F2 : (x: number) => boolean >x : number >x < 42 : boolean >x : number +>42 : number module M { >M : typeof M @@ -95,12 +97,22 @@ module N { // literals if (true) { } +>true : boolean + while (true) { } +>true : boolean + do { }while(true) +>true : boolean if (null) { } +>null : null + while (null) { } +>null : null + do { }while(null) +>null : null if (undefined) { } >undefined : undefined @@ -112,20 +124,40 @@ do { }while(undefined) >undefined : undefined if (0.0) { } +>0.0 : number + while (0.0) { } +>0.0 : number + do { }while(0.0) +>0.0 : number if ('a string') { } +>'a string' : string + while ('a string') { } +>'a string' : string + do { }while('a string') +>'a string' : string if ('') { } +>'' : string + while ('') { } +>'' : string + do { }while('') +>'' : string if (/[a-z]/) { } +>/[a-z]/ : RegExp + while (/[a-z]/) { } +>/[a-z]/ : RegExp + do { }while(/[a-z]/) +>/[a-z]/ : RegExp if ([]) { } >[] : undefined[] @@ -138,12 +170,18 @@ do { }while([]) if ([1, 2]) { } >[1, 2] : number[] +>1 : number +>2 : number while ([1, 2]) { } >[1, 2] : number[] +>1 : number +>2 : number do { }while([1, 2]) >[1, 2] : number[] +>1 : number +>2 : number if ({}) { } >{} : {} @@ -157,26 +195,35 @@ do { }while({}) if ({ x: 1, y: 'a' }) { } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number +>1 : number >y : string +>'a' : string while ({ x: 1, y: 'a' }) { } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number +>1 : number >y : string +>'a' : string do { }while({ x: 1, y: 'a' }) >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number +>1 : number >y : string +>'a' : string if (() => 43) { } >() => 43 : () => number +>43 : number while (() => 43) { } >() => 43 : () => number +>43 : number do { }while(() => 43) >() => 43 : () => number +>43 : number if (new C()) { } >new C() : C @@ -208,6 +255,7 @@ do { }while(new D()) // references var a = true; >a : boolean +>true : boolean if (a) { } >a : boolean @@ -220,6 +268,7 @@ do { }while(a) var b = null; >b : any +>null : null if (b) { } >b : any @@ -245,6 +294,7 @@ do { }while(c) var d = 0.0; >d : number +>0.0 : number if (d) { } >d : number @@ -257,6 +307,7 @@ do { }while(d) var e = 'a string'; >e : string +>'a string' : string if (e) { } >e : string @@ -269,6 +320,7 @@ do { }while(e) var f = ''; >f : string +>'' : string if (f) { } >f : string @@ -281,6 +333,7 @@ do { }while(f) var g = /[a-z]/ >g : RegExp +>/[a-z]/ : RegExp if (g) { } >g : RegExp @@ -307,6 +360,8 @@ do { }while(h) var i = [1, 2]; >i : number[] >[1, 2] : number[] +>1 : number +>2 : number if (i) { } >i : number[] @@ -334,7 +389,9 @@ var k = { x: 1, y: 'a' }; >k : { x: number; y: string; } >{ x: 1, y: 'a' } : { x: number; y: string; } >x : number +>1 : number >y : string +>'a' : string if (k) { } >k : { x: number; y: string; } @@ -349,6 +406,7 @@ function fn(x?: string): I { return null; } >fn : (x?: string) => I >x : string >I : I +>null : null if (fn()) { } >fn() : I diff --git a/tests/baselines/reference/illegalGenericWrapping1.symbols b/tests/baselines/reference/illegalGenericWrapping1.symbols new file mode 100644 index 00000000000..f4ab78ceb69 --- /dev/null +++ b/tests/baselines/reference/illegalGenericWrapping1.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/illegalGenericWrapping1.ts === +interface Sequence { +>Sequence : Symbol(Sequence, Decl(illegalGenericWrapping1.ts, 0, 0)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) + + each(iterator: (value: T) => void ): void; +>each : Symbol(each, Decl(illegalGenericWrapping1.ts, 0, 23)) +>iterator : Symbol(iterator, Decl(illegalGenericWrapping1.ts, 1, 9)) +>value : Symbol(value, Decl(illegalGenericWrapping1.ts, 1, 20)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) + + map(iterator: (value: T) => U): Sequence; +>map : Symbol(map, Decl(illegalGenericWrapping1.ts, 1, 46)) +>U : Symbol(U, Decl(illegalGenericWrapping1.ts, 2, 8)) +>iterator : Symbol(iterator, Decl(illegalGenericWrapping1.ts, 2, 11)) +>value : Symbol(value, Decl(illegalGenericWrapping1.ts, 2, 22)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) +>U : Symbol(U, Decl(illegalGenericWrapping1.ts, 2, 8)) +>Sequence : Symbol(Sequence, Decl(illegalGenericWrapping1.ts, 0, 0)) +>U : Symbol(U, Decl(illegalGenericWrapping1.ts, 2, 8)) + + filter(iterator: (value: T) => boolean): Sequence; +>filter : Symbol(filter, Decl(illegalGenericWrapping1.ts, 2, 51)) +>iterator : Symbol(iterator, Decl(illegalGenericWrapping1.ts, 3, 11)) +>value : Symbol(value, Decl(illegalGenericWrapping1.ts, 3, 22)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) +>Sequence : Symbol(Sequence, Decl(illegalGenericWrapping1.ts, 0, 0)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) + + groupBy(keySelector: (value: T) => K): Sequence<{ key: K; items: Sequence; }>; +>groupBy : Symbol(groupBy, Decl(illegalGenericWrapping1.ts, 3, 57)) +>K : Symbol(K, Decl(illegalGenericWrapping1.ts, 4, 12)) +>keySelector : Symbol(keySelector, Decl(illegalGenericWrapping1.ts, 4, 15)) +>value : Symbol(value, Decl(illegalGenericWrapping1.ts, 4, 29)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) +>K : Symbol(K, Decl(illegalGenericWrapping1.ts, 4, 12)) +>Sequence : Symbol(Sequence, Decl(illegalGenericWrapping1.ts, 0, 0)) +>key : Symbol(key, Decl(illegalGenericWrapping1.ts, 4, 56)) +>K : Symbol(K, Decl(illegalGenericWrapping1.ts, 4, 12)) +>items : Symbol(items, Decl(illegalGenericWrapping1.ts, 4, 64)) +>Sequence : Symbol(Sequence, Decl(illegalGenericWrapping1.ts, 0, 0)) +>T : Symbol(T, Decl(illegalGenericWrapping1.ts, 0, 19)) +} + diff --git a/tests/baselines/reference/implementArrayInterface.symbols b/tests/baselines/reference/implementArrayInterface.symbols new file mode 100644 index 00000000000..97d106157fe --- /dev/null +++ b/tests/baselines/reference/implementArrayInterface.symbols @@ -0,0 +1,217 @@ +=== tests/cases/compiler/implementArrayInterface.ts === +declare class MyArray implements Array { +>MyArray : Symbol(MyArray, Decl(implementArrayInterface.ts, 0, 0)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + toString(): string; +>toString : Symbol(toString, Decl(implementArrayInterface.ts, 0, 46)) + + toLocaleString(): string; +>toLocaleString : Symbol(toLocaleString, Decl(implementArrayInterface.ts, 1, 23)) + + concat(...items: U[]): T[]; +>concat : Symbol(concat, Decl(implementArrayInterface.ts, 2, 29), Decl(implementArrayInterface.ts, 3, 46)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 3, 11)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 3, 26)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 3, 11)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + concat(...items: T[]): T[]; +>concat : Symbol(concat, Decl(implementArrayInterface.ts, 2, 29), Decl(implementArrayInterface.ts, 3, 46)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 4, 11)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + join(separator?: string): string; +>join : Symbol(join, Decl(implementArrayInterface.ts, 4, 31)) +>separator : Symbol(separator, Decl(implementArrayInterface.ts, 5, 9)) + + pop(): T; +>pop : Symbol(pop, Decl(implementArrayInterface.ts, 5, 37)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + push(...items: T[]): number; +>push : Symbol(push, Decl(implementArrayInterface.ts, 6, 13)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 7, 9)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + reverse(): T[]; +>reverse : Symbol(reverse, Decl(implementArrayInterface.ts, 7, 32)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + shift(): T; +>shift : Symbol(shift, Decl(implementArrayInterface.ts, 8, 19)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + slice(start?: number, end?: number): T[]; +>slice : Symbol(slice, Decl(implementArrayInterface.ts, 9, 15)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 10, 10)) +>end : Symbol(end, Decl(implementArrayInterface.ts, 10, 25)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + sort(compareFn?: (a: T, b: T) => number): T[]; +>sort : Symbol(sort, Decl(implementArrayInterface.ts, 10, 45)) +>compareFn : Symbol(compareFn, Decl(implementArrayInterface.ts, 11, 9)) +>a : Symbol(a, Decl(implementArrayInterface.ts, 11, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>b : Symbol(b, Decl(implementArrayInterface.ts, 11, 27)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + splice(start: number): T[]; +>splice : Symbol(splice, Decl(implementArrayInterface.ts, 11, 50), Decl(implementArrayInterface.ts, 12, 31)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 12, 11)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + splice(start: number, deleteCount: number, ...items: T[]): T[]; +>splice : Symbol(splice, Decl(implementArrayInterface.ts, 11, 50), Decl(implementArrayInterface.ts, 12, 31)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 13, 11)) +>deleteCount : Symbol(deleteCount, Decl(implementArrayInterface.ts, 13, 25)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 13, 46)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + unshift(...items: T[]): number; +>unshift : Symbol(unshift, Decl(implementArrayInterface.ts, 13, 67)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 14, 12)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + indexOf(searchElement: T, fromIndex?: number): number; +>indexOf : Symbol(indexOf, Decl(implementArrayInterface.ts, 14, 35)) +>searchElement : Symbol(searchElement, Decl(implementArrayInterface.ts, 16, 12)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>fromIndex : Symbol(fromIndex, Decl(implementArrayInterface.ts, 16, 29)) + + lastIndexOf(searchElement: T, fromIndex?: number): number; +>lastIndexOf : Symbol(lastIndexOf, Decl(implementArrayInterface.ts, 16, 58)) +>searchElement : Symbol(searchElement, Decl(implementArrayInterface.ts, 17, 16)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>fromIndex : Symbol(fromIndex, Decl(implementArrayInterface.ts, 17, 33)) + + every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; +>every : Symbol(every, Decl(implementArrayInterface.ts, 17, 62)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 18, 10)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 18, 23)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 18, 32)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 18, 47)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 18, 71)) + + some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; +>some : Symbol(some, Decl(implementArrayInterface.ts, 18, 96)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 19, 9)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 19, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 19, 31)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 19, 46)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 19, 70)) + + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; +>forEach : Symbol(forEach, Decl(implementArrayInterface.ts, 19, 95)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 20, 12)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 20, 25)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 20, 34)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 20, 49)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 20, 70)) + + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; +>map : Symbol(map, Decl(implementArrayInterface.ts, 20, 92)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 21, 8)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 21, 11)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 21, 24)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 21, 33)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 21, 48)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 21, 8)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 21, 66)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 21, 8)) + + filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; +>filter : Symbol(filter, Decl(implementArrayInterface.ts, 21, 87)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 22, 11)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 22, 24)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 22, 33)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 22, 48)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 22, 72)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; +>reduce : Symbol(reduce, Decl(implementArrayInterface.ts, 22, 93), Decl(implementArrayInterface.ts, 23, 120)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 23, 11)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 23, 24)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 23, 41)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 23, 58)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 23, 80)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 23, 98)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; +>reduce : Symbol(reduce, Decl(implementArrayInterface.ts, 22, 93), Decl(implementArrayInterface.ts, 23, 120)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 24, 14)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 24, 27)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 24, 44)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 24, 61)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 24, 83)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 24, 101)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) + + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; +>reduceRight : Symbol(reduceRight, Decl(implementArrayInterface.ts, 24, 122), Decl(implementArrayInterface.ts, 25, 125)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 25, 16)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 25, 29)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 25, 46)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 25, 63)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 25, 85)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 25, 103)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; +>reduceRight : Symbol(reduceRight, Decl(implementArrayInterface.ts, 24, 122), Decl(implementArrayInterface.ts, 25, 125)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 26, 19)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 26, 32)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 26, 49)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 26, 66)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 26, 88)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 26, 106)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) + + length: number; +>length : Symbol(length, Decl(implementArrayInterface.ts, 26, 127)) + + [n: number]: T; +>n : Symbol(n, Decl(implementArrayInterface.ts, 30, 5)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +} + diff --git a/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.symbols b/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.symbols new file mode 100644 index 00000000000..bf53a92dcd3 --- /dev/null +++ b/tests/baselines/reference/implementInterfaceAnyMemberWithVoid.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/implementInterfaceAnyMemberWithVoid.ts === +interface I { +>I : Symbol(I, Decl(implementInterfaceAnyMemberWithVoid.ts, 0, 0)) + + foo(value: number); +>foo : Symbol(foo, Decl(implementInterfaceAnyMemberWithVoid.ts, 0, 13)) +>value : Symbol(value, Decl(implementInterfaceAnyMemberWithVoid.ts, 1, 8)) +} + +class Bug implements I { +>Bug : Symbol(Bug, Decl(implementInterfaceAnyMemberWithVoid.ts, 2, 1)) +>I : Symbol(I, Decl(implementInterfaceAnyMemberWithVoid.ts, 0, 0)) + + public foo(value: number) { +>foo : Symbol(foo, Decl(implementInterfaceAnyMemberWithVoid.ts, 4, 24)) +>value : Symbol(value, Decl(implementInterfaceAnyMemberWithVoid.ts, 5, 15)) + } +} + diff --git a/tests/baselines/reference/implicitAnyAnyReturningFunction.symbols b/tests/baselines/reference/implicitAnyAnyReturningFunction.symbols new file mode 100644 index 00000000000..73e91853255 --- /dev/null +++ b/tests/baselines/reference/implicitAnyAnyReturningFunction.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/implicitAnyAnyReturningFunction.ts === +function A() { +>A : Symbol(A, Decl(implicitAnyAnyReturningFunction.ts, 0, 0)) + + return ""; +} + +function B() { +>B : Symbol(B, Decl(implicitAnyAnyReturningFunction.ts, 2, 1)) + + var someLocal: any = {}; +>someLocal : Symbol(someLocal, Decl(implicitAnyAnyReturningFunction.ts, 5, 7)) + + return someLocal; +>someLocal : Symbol(someLocal, Decl(implicitAnyAnyReturningFunction.ts, 5, 7)) +} + +class C { +>C : Symbol(C, Decl(implicitAnyAnyReturningFunction.ts, 7, 1)) + + public A() { +>A : Symbol(A, Decl(implicitAnyAnyReturningFunction.ts, 9, 9)) + + return ""; + } + + public B() { +>B : Symbol(B, Decl(implicitAnyAnyReturningFunction.ts, 12, 5)) + + var someLocal: any = {}; +>someLocal : Symbol(someLocal, Decl(implicitAnyAnyReturningFunction.ts, 15, 11)) + + return someLocal; +>someLocal : Symbol(someLocal, Decl(implicitAnyAnyReturningFunction.ts, 15, 11)) + } +} + diff --git a/tests/baselines/reference/implicitAnyAnyReturningFunction.types b/tests/baselines/reference/implicitAnyAnyReturningFunction.types index 1f0b81c724f..66f9cf49cb0 100644 --- a/tests/baselines/reference/implicitAnyAnyReturningFunction.types +++ b/tests/baselines/reference/implicitAnyAnyReturningFunction.types @@ -4,6 +4,7 @@ function A() { return ""; >"" : any +>"" : string } function B() { @@ -25,6 +26,7 @@ class C { return ""; >"" : any +>"" : string } public B() { diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.symbols b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.symbols new file mode 100644 index 00000000000..09d3a4a9430 --- /dev/null +++ b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType2.ts === +// generates function fn1(): number; +function fn1() { +>fn1 : Symbol(fn1, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 0, 0)) + + var x: number; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 2, 7)) + + return x; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 2, 7)) +} +// generates function fn2(): any; +function fn2(): any { +>fn2 : Symbol(fn2, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 4, 1)) + + var x: any; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 7, 7)) + + return x; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 7, 7)) +} +// generates function fn3(); +function fn3() { +>fn3 : Symbol(fn3, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 9, 1)) + + var x: any; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 12, 7)) + + return x; +>x : Symbol(x, Decl(implicitAnyDeclareFunctionWithoutFormalType2.ts, 12, 7)) +} + diff --git a/tests/baselines/reference/implicitAnyGenerics.symbols b/tests/baselines/reference/implicitAnyGenerics.symbols new file mode 100644 index 00000000000..865f48fdd59 --- /dev/null +++ b/tests/baselines/reference/implicitAnyGenerics.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/implicitAnyGenerics.ts === + +class C { +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 1, 8)) + + x: T; +>x : Symbol(x, Decl(implicitAnyGenerics.ts, 1, 12)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 1, 8)) +} + +var c = new C(); +>c : Symbol(c, Decl(implicitAnyGenerics.ts, 5, 3)) +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) + +var c2 = new C(); +>c2 : Symbol(c2, Decl(implicitAnyGenerics.ts, 6, 3)) +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) + +var c3 = new C(); +>c3 : Symbol(c3, Decl(implicitAnyGenerics.ts, 7, 3)) +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) + +var c4: C = new C(); +>c4 : Symbol(c4, Decl(implicitAnyGenerics.ts, 8, 3)) +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) +>C : Symbol(C, Decl(implicitAnyGenerics.ts, 0, 0)) + +class D { +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 10, 8)) + + constructor(x: T) { } +>x : Symbol(x, Decl(implicitAnyGenerics.ts, 11, 16)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 10, 8)) +} + +var d = new D(null); +>d : Symbol(d, Decl(implicitAnyGenerics.ts, 14, 3)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) + +var d2 = new D(1); +>d2 : Symbol(d2, Decl(implicitAnyGenerics.ts, 15, 3)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) + +var d3 = new D(1); +>d3 : Symbol(d3, Decl(implicitAnyGenerics.ts, 16, 3)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) + +var d4 = new D(1); +>d4 : Symbol(d4, Decl(implicitAnyGenerics.ts, 17, 3)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) + +var d5: D = new D(null); +>d5 : Symbol(d5, Decl(implicitAnyGenerics.ts, 18, 3)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) +>D : Symbol(D, Decl(implicitAnyGenerics.ts, 8, 25)) + +function foo(): T { return null; }; +>foo : Symbol(foo, Decl(implicitAnyGenerics.ts, 18, 29)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 20, 13)) +>T : Symbol(T, Decl(implicitAnyGenerics.ts, 20, 13)) + +foo() +>foo : Symbol(foo, Decl(implicitAnyGenerics.ts, 18, 29)) + +foo(); +>foo : Symbol(foo, Decl(implicitAnyGenerics.ts, 18, 29)) + + + diff --git a/tests/baselines/reference/implicitAnyGenerics.types b/tests/baselines/reference/implicitAnyGenerics.types index 91a231e3f12..e335c958fe9 100644 --- a/tests/baselines/reference/implicitAnyGenerics.types +++ b/tests/baselines/reference/implicitAnyGenerics.types @@ -43,33 +43,39 @@ var d = new D(null); >d : D >new D(null) : D >D : typeof D +>null : null var d2 = new D(1); >d2 : D >new D(1) : D >D : typeof D +>1 : number var d3 = new D(1); >d3 : D >new D(1) : D >D : typeof D +>1 : number var d4 = new D(1); >d4 : D >new D(1) : D >D : typeof D >1 : any +>1 : number var d5: D = new D(null); >d5 : D >D : D >new D(null) : D >D : typeof D +>null : null function foo(): T { return null; }; >foo : () => T >T : T >T : T +>null : null foo() >foo() : {} diff --git a/tests/baselines/reference/implicitAnyInCatch.symbols b/tests/baselines/reference/implicitAnyInCatch.symbols new file mode 100644 index 00000000000..e576593da82 --- /dev/null +++ b/tests/baselines/reference/implicitAnyInCatch.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/implicitAnyInCatch.ts === +// this should not be an error +try { } catch (error) { +>error : Symbol(error, Decl(implicitAnyInCatch.ts, 1, 15)) + + if (error.number === -2147024809) { } +>error : Symbol(error, Decl(implicitAnyInCatch.ts, 1, 15)) +} +for (var key in this) { } +>key : Symbol(key, Decl(implicitAnyInCatch.ts, 4, 8)) + +class C { +>C : Symbol(C, Decl(implicitAnyInCatch.ts, 4, 25)) + + public temp() { +>temp : Symbol(temp, Decl(implicitAnyInCatch.ts, 6, 9)) + + for (var x in this) { +>x : Symbol(x, Decl(implicitAnyInCatch.ts, 8, 16)) +>this : Symbol(C, Decl(implicitAnyInCatch.ts, 4, 25)) + } + } +} + + diff --git a/tests/baselines/reference/implicitAnyInCatch.types b/tests/baselines/reference/implicitAnyInCatch.types index b5a5821eacc..b0fbd4e7f12 100644 --- a/tests/baselines/reference/implicitAnyInCatch.types +++ b/tests/baselines/reference/implicitAnyInCatch.types @@ -9,6 +9,7 @@ try { } catch (error) { >error : any >number : any >-2147024809 : number +>2147024809 : number } for (var key in this) { } >key : any diff --git a/tests/baselines/reference/importAliasIdentifiers.symbols b/tests/baselines/reference/importAliasIdentifiers.symbols new file mode 100644 index 00000000000..3b2ba0ea46a --- /dev/null +++ b/tests/baselines/reference/importAliasIdentifiers.symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/internalModules/importDeclarations/importAliasIdentifiers.ts === +module moduleA { +>moduleA : Symbol(moduleA, Decl(importAliasIdentifiers.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 0, 16)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 2, 20)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 2, 37)) + } +} + +import alias = moduleA; +>alias : Symbol(alias, Decl(importAliasIdentifiers.ts, 4, 1)) +>moduleA : Symbol(moduleA, Decl(importAliasIdentifiers.ts, 0, 0)) + +var p: alias.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>alias : Symbol(alias, Decl(importAliasIdentifiers.ts, 4, 1)) +>Point : Symbol(alias.Point, Decl(importAliasIdentifiers.ts, 0, 16)) + +var p: moduleA.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>moduleA : Symbol(moduleA, Decl(importAliasIdentifiers.ts, 0, 0)) +>Point : Symbol(alias.Point, Decl(importAliasIdentifiers.ts, 0, 16)) + +var p: { x: number; y: number; }; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 10, 8)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 10, 19)) + +class clodule { +>clodule : Symbol(clodule, Decl(importAliasIdentifiers.ts, 10, 33), Decl(importAliasIdentifiers.ts, 14, 1)) + + name: string; +>name : Symbol(name, Decl(importAliasIdentifiers.ts, 12, 15)) +} + +module clodule { +>clodule : Symbol(clodule, Decl(importAliasIdentifiers.ts, 10, 33), Decl(importAliasIdentifiers.ts, 14, 1)) + + export interface Point { +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 16, 16)) + + x: number; y: number; +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 17, 28)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 18, 18)) + } + var Point: Point = { x: 0, y: 0 }; +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 16, 16), Decl(importAliasIdentifiers.ts, 20, 7)) +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 16, 16)) +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 20, 24)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 20, 30)) +} + +import clolias = clodule; +>clolias : Symbol(clolias, Decl(importAliasIdentifiers.ts, 21, 1)) +>clodule : Symbol(clodule, Decl(importAliasIdentifiers.ts, 10, 33), Decl(importAliasIdentifiers.ts, 14, 1)) + +var p: clolias.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>clolias : Symbol(clolias, Decl(importAliasIdentifiers.ts, 21, 1)) +>Point : Symbol(clolias.Point, Decl(importAliasIdentifiers.ts, 16, 16)) + +var p: clodule.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>clodule : Symbol(clodule, Decl(importAliasIdentifiers.ts, 10, 33), Decl(importAliasIdentifiers.ts, 14, 1)) +>Point : Symbol(clolias.Point, Decl(importAliasIdentifiers.ts, 16, 16)) + +var p: { x: number; y: number; }; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 27, 8)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 27, 19)) + + +function fundule() { +>fundule : Symbol(fundule, Decl(importAliasIdentifiers.ts, 27, 33), Decl(importAliasIdentifiers.ts, 32, 1)) + + return { x: 0, y: 0 }; +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 31, 12)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 31, 18)) +} + +module fundule { +>fundule : Symbol(fundule, Decl(importAliasIdentifiers.ts, 27, 33), Decl(importAliasIdentifiers.ts, 32, 1)) + + export interface Point { +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 34, 16)) + + x: number; y: number; +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 35, 28)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 36, 18)) + } + var Point: Point = { x: 0, y: 0 }; +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 34, 16), Decl(importAliasIdentifiers.ts, 38, 7)) +>Point : Symbol(Point, Decl(importAliasIdentifiers.ts, 34, 16)) +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 38, 24)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 38, 30)) +} + +import funlias = fundule; +>funlias : Symbol(funlias, Decl(importAliasIdentifiers.ts, 39, 1)) +>fundule : Symbol(fundule, Decl(importAliasIdentifiers.ts, 27, 33), Decl(importAliasIdentifiers.ts, 32, 1)) + +var p: funlias.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>funlias : Symbol(funlias, Decl(importAliasIdentifiers.ts, 39, 1)) +>Point : Symbol(funlias.Point, Decl(importAliasIdentifiers.ts, 34, 16)) + +var p: fundule.Point; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>fundule : Symbol(fundule, Decl(importAliasIdentifiers.ts, 27, 33), Decl(importAliasIdentifiers.ts, 32, 1)) +>Point : Symbol(funlias.Point, Decl(importAliasIdentifiers.ts, 34, 16)) + +var p: { x: number; y: number; }; +>p : Symbol(p, Decl(importAliasIdentifiers.ts, 8, 3), Decl(importAliasIdentifiers.ts, 9, 3), Decl(importAliasIdentifiers.ts, 10, 3), Decl(importAliasIdentifiers.ts, 25, 3), Decl(importAliasIdentifiers.ts, 26, 3), Decl(importAliasIdentifiers.ts, 27, 3), Decl(importAliasIdentifiers.ts, 43, 3), Decl(importAliasIdentifiers.ts, 44, 3), Decl(importAliasIdentifiers.ts, 45, 3)) +>x : Symbol(x, Decl(importAliasIdentifiers.ts, 45, 8)) +>y : Symbol(y, Decl(importAliasIdentifiers.ts, 45, 19)) + diff --git a/tests/baselines/reference/importAliasIdentifiers.types b/tests/baselines/reference/importAliasIdentifiers.types index 7401c3e7518..6746a5b3af7 100644 --- a/tests/baselines/reference/importAliasIdentifiers.types +++ b/tests/baselines/reference/importAliasIdentifiers.types @@ -17,12 +17,12 @@ import alias = moduleA; var p: alias.Point; >p : alias.Point ->alias : unknown +>alias : any >Point : alias.Point var p: moduleA.Point; >p : alias.Point ->moduleA : unknown +>moduleA : any >Point : alias.Point var p: { x: number; y: number; }; @@ -52,7 +52,9 @@ module clodule { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } import clolias = clodule; @@ -61,12 +63,12 @@ import clolias = clodule; var p: clolias.Point; >p : alias.Point ->clolias : unknown +>clolias : any >Point : clolias.Point var p: clodule.Point; >p : alias.Point ->clodule : unknown +>clodule : any >Point : clolias.Point var p: { x: number; y: number; }; @@ -81,7 +83,9 @@ function fundule() { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } module fundule { @@ -99,7 +103,9 @@ module fundule { >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } import funlias = fundule; @@ -108,12 +114,12 @@ import funlias = fundule; var p: funlias.Point; >p : alias.Point ->funlias : unknown +>funlias : any >Point : funlias.Point var p: fundule.Point; >p : alias.Point ->fundule : unknown +>fundule : any >Point : funlias.Point var p: { x: number; y: number; }; diff --git a/tests/baselines/reference/importAliasWithDottedName.symbols b/tests/baselines/reference/importAliasWithDottedName.symbols new file mode 100644 index 00000000000..886bfdf2fce --- /dev/null +++ b/tests/baselines/reference/importAliasWithDottedName.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/importAliasWithDottedName.ts === +module M { +>M : Symbol(M, Decl(importAliasWithDottedName.ts, 0, 0)) + + export var x = 1; +>x : Symbol(x, Decl(importAliasWithDottedName.ts, 1, 14)) + + export module N { +>N : Symbol(N, Decl(importAliasWithDottedName.ts, 1, 21)) + + export var y = 2; +>y : Symbol(y, Decl(importAliasWithDottedName.ts, 3, 18)) + } +} + +module A { +>A : Symbol(A, Decl(importAliasWithDottedName.ts, 5, 1)) + + import N = M.N; +>N : Symbol(N, Decl(importAliasWithDottedName.ts, 7, 10)) +>M : Symbol(M, Decl(importAliasWithDottedName.ts, 0, 0)) +>N : Symbol(N, Decl(importAliasWithDottedName.ts, 1, 21)) + + var r = N.y; +>r : Symbol(r, Decl(importAliasWithDottedName.ts, 9, 7)) +>N.y : Symbol(N.y, Decl(importAliasWithDottedName.ts, 3, 18)) +>N : Symbol(N, Decl(importAliasWithDottedName.ts, 7, 10)) +>y : Symbol(N.y, Decl(importAliasWithDottedName.ts, 3, 18)) + + var r2 = M.N.y; +>r2 : Symbol(r2, Decl(importAliasWithDottedName.ts, 10, 7)) +>M.N.y : Symbol(N.y, Decl(importAliasWithDottedName.ts, 3, 18)) +>M.N : Symbol(N, Decl(importAliasWithDottedName.ts, 1, 21)) +>M : Symbol(M, Decl(importAliasWithDottedName.ts, 0, 0)) +>N : Symbol(N, Decl(importAliasWithDottedName.ts, 1, 21)) +>y : Symbol(N.y, Decl(importAliasWithDottedName.ts, 3, 18)) +} diff --git a/tests/baselines/reference/importAliasWithDottedName.types b/tests/baselines/reference/importAliasWithDottedName.types index ab316fade5c..24ec5d1b0bb 100644 --- a/tests/baselines/reference/importAliasWithDottedName.types +++ b/tests/baselines/reference/importAliasWithDottedName.types @@ -4,12 +4,14 @@ module M { export var x = 1; >x : number +>1 : number export module N { >N : typeof N export var y = 2; >y : number +>2 : number } } diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict2.symbols b/tests/baselines/reference/importAndVariableDeclarationConflict2.symbols new file mode 100644 index 00000000000..570bb5e2b98 --- /dev/null +++ b/tests/baselines/reference/importAndVariableDeclarationConflict2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/importAndVariableDeclarationConflict2.ts === +module m { +>m : Symbol(m, Decl(importAndVariableDeclarationConflict2.ts, 0, 0)) + + export var m = ''; +>m : Symbol(m, Decl(importAndVariableDeclarationConflict2.ts, 1, 12)) +} + +import x = m.m; +>x : Symbol(x, Decl(importAndVariableDeclarationConflict2.ts, 2, 1)) +>m : Symbol(m, Decl(importAndVariableDeclarationConflict2.ts, 0, 0)) +>m : Symbol(x, Decl(importAndVariableDeclarationConflict2.ts, 1, 12)) + +class C { +>C : Symbol(C, Decl(importAndVariableDeclarationConflict2.ts, 4, 15)) + + public foo() { +>foo : Symbol(foo, Decl(importAndVariableDeclarationConflict2.ts, 6, 9)) + + var x = ''; +>x : Symbol(x, Decl(importAndVariableDeclarationConflict2.ts, 8, 7)) + } +} diff --git a/tests/baselines/reference/importAndVariableDeclarationConflict2.types b/tests/baselines/reference/importAndVariableDeclarationConflict2.types index eb4f354a4dc..eafc7be6deb 100644 --- a/tests/baselines/reference/importAndVariableDeclarationConflict2.types +++ b/tests/baselines/reference/importAndVariableDeclarationConflict2.types @@ -4,6 +4,7 @@ module m { export var m = ''; >m : string +>'' : string } import x = m.m; @@ -19,5 +20,6 @@ class C { var x = ''; >x : string +>'' : string } } diff --git a/tests/baselines/reference/importDecl.symbols b/tests/baselines/reference/importDecl.symbols new file mode 100644 index 00000000000..2341101b672 --- /dev/null +++ b/tests/baselines/reference/importDecl.symbols @@ -0,0 +1,220 @@ +=== tests/cases/compiler/importDecl_1.ts === +/// +/// +/// +/// +/// +import m4 = require("importDecl_require"); // Emit used +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) + +export var x4 = m4.x; +>x4 : Symbol(x4, Decl(importDecl_1.ts, 6, 10)) +>m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) + +export var d4 = m4.d; +>d4 : Symbol(d4, Decl(importDecl_1.ts, 7, 10)) +>m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) + +export var f4 = m4.foo(); +>f4 : Symbol(f4, Decl(importDecl_1.ts, 8, 10)) +>m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) + +export module m1 { +>m1 : Symbol(m1, Decl(importDecl_1.ts, 8, 25)) + + export var x2 = m4.x; +>x2 : Symbol(x2, Decl(importDecl_1.ts, 11, 14)) +>m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) + + export var d2 = m4.d; +>d2 : Symbol(d2, Decl(importDecl_1.ts, 12, 14)) +>m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) + + export var f2 = m4.foo(); +>f2 : Symbol(f2, Decl(importDecl_1.ts, 13, 14)) +>m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) + + var x3 = m4.x; +>x3 : Symbol(x3, Decl(importDecl_1.ts, 15, 7)) +>m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) + + var d3 = m4.d; +>d3 : Symbol(d3, Decl(importDecl_1.ts, 16, 7)) +>m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) + + var f3 = m4.foo(); +>f3 : Symbol(f3, Decl(importDecl_1.ts, 17, 7)) +>m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) +>m4 : Symbol(m4, Decl(importDecl_1.ts, 0, 0)) +>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) +} + +//Emit global only usage +import glo_m4 = require("importDecl_require1"); +>glo_m4 : Symbol(glo_m4, Decl(importDecl_1.ts, 18, 1)) + +export var useGlo_m4_d4 = glo_m4.d; +>useGlo_m4_d4 : Symbol(useGlo_m4_d4, Decl(importDecl_1.ts, 22, 10)) +>glo_m4.d : Symbol(glo_m4.d, Decl(importDecl_require1.ts, 0, 0)) +>glo_m4 : Symbol(glo_m4, Decl(importDecl_1.ts, 18, 1)) +>d : Symbol(glo_m4.d, Decl(importDecl_require1.ts, 0, 0)) + +export var useGlo_m4_f4 = glo_m4.foo(); +>useGlo_m4_f4 : Symbol(useGlo_m4_f4, Decl(importDecl_1.ts, 23, 10)) +>glo_m4.foo : Symbol(glo_m4.foo, Decl(importDecl_require1.ts, 3, 9)) +>glo_m4 : Symbol(glo_m4, Decl(importDecl_1.ts, 18, 1)) +>foo : Symbol(glo_m4.foo, Decl(importDecl_require1.ts, 3, 9)) + +//Emit even when used just in function type +import fncOnly_m4 = require("importDecl_require2"); +>fncOnly_m4 : Symbol(fncOnly_m4, Decl(importDecl_1.ts, 23, 39)) + +export var useFncOnly_m4_f4 = fncOnly_m4.foo(); +>useFncOnly_m4_f4 : Symbol(useFncOnly_m4_f4, Decl(importDecl_1.ts, 27, 10)) +>fncOnly_m4.foo : Symbol(fncOnly_m4.foo, Decl(importDecl_require2.ts, 3, 16)) +>fncOnly_m4 : Symbol(fncOnly_m4, Decl(importDecl_1.ts, 23, 39)) +>foo : Symbol(fncOnly_m4.foo, Decl(importDecl_require2.ts, 3, 16)) + +// only used privately no need to emit +import private_m4 = require("importDecl_require3"); +>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47)) + +export module usePrivate_m4_m1 { +>usePrivate_m4_m1 : Symbol(usePrivate_m4_m1, Decl(importDecl_1.ts, 30, 51)) + + var x3 = private_m4.x; +>x3 : Symbol(x3, Decl(importDecl_1.ts, 32, 7)) +>private_m4.x : Symbol(private_m4.x, Decl(importDecl_require3.ts, 3, 10)) +>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47)) +>x : Symbol(private_m4.x, Decl(importDecl_require3.ts, 3, 10)) + + var d3 = private_m4.d; +>d3 : Symbol(d3, Decl(importDecl_1.ts, 33, 7)) +>private_m4.d : Symbol(private_m4.d, Decl(importDecl_require3.ts, 0, 0)) +>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47)) +>d : Symbol(private_m4.d, Decl(importDecl_require3.ts, 0, 0)) + + var f3 = private_m4.foo(); +>f3 : Symbol(f3, Decl(importDecl_1.ts, 34, 7)) +>private_m4.foo : Symbol(private_m4.foo, Decl(importDecl_require3.ts, 3, 16)) +>private_m4 : Symbol(private_m4, Decl(importDecl_1.ts, 27, 47)) +>foo : Symbol(private_m4.foo, Decl(importDecl_require3.ts, 3, 16)) +} + +// Do not emit unused import +import m5 = require("importDecl_require4"); +>m5 : Symbol(m5, Decl(importDecl_1.ts, 35, 1)) + +export var d = m5.foo2(); +>d : Symbol(d, Decl(importDecl_1.ts, 39, 10)) +>m5.foo2 : Symbol(m5.foo2, Decl(importDecl_require4.ts, 0, 42)) +>m5 : Symbol(m5, Decl(importDecl_1.ts, 35, 1)) +>foo2 : Symbol(m5.foo2, Decl(importDecl_require4.ts, 0, 42)) + +// Do not emit multiple used import statements +import multiImport_m4 = require("importDecl_require"); // Emit used +>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25)) + +export var useMultiImport_m4_x4 = multiImport_m4.x; +>useMultiImport_m4_x4 : Symbol(useMultiImport_m4_x4, Decl(importDecl_1.ts, 43, 10)) +>multiImport_m4.x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) +>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25)) +>x : Symbol(m4.x, Decl(importDecl_require.ts, 3, 10)) + +export var useMultiImport_m4_d4 = multiImport_m4.d; +>useMultiImport_m4_d4 : Symbol(useMultiImport_m4_d4, Decl(importDecl_1.ts, 44, 10)) +>multiImport_m4.d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) +>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25)) +>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) + +export var useMultiImport_m4_f4 = multiImport_m4.foo(); +>useMultiImport_m4_f4 : Symbol(useMultiImport_m4_f4, Decl(importDecl_1.ts, 45, 10)) +>multiImport_m4.foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) +>multiImport_m4 : Symbol(multiImport_m4, Decl(importDecl_1.ts, 39, 25)) +>foo : Symbol(m4.foo, Decl(importDecl_require.ts, 3, 16)) + +=== tests/cases/compiler/importDecl_require.ts === +export class d { +>d : Symbol(d, Decl(importDecl_require.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(importDecl_require.ts, 0, 16)) +} +export var x: d; +>x : Symbol(x, Decl(importDecl_require.ts, 3, 10)) +>d : Symbol(d, Decl(importDecl_require.ts, 0, 0)) + +export function foo(): d { return null; } +>foo : Symbol(foo, Decl(importDecl_require.ts, 3, 16)) +>d : Symbol(d, Decl(importDecl_require.ts, 0, 0)) + +=== tests/cases/compiler/importDecl_require1.ts === +export class d { +>d : Symbol(d, Decl(importDecl_require1.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(importDecl_require1.ts, 0, 16)) +} +var x: d; +>x : Symbol(x, Decl(importDecl_require1.ts, 3, 3)) +>d : Symbol(d, Decl(importDecl_require1.ts, 0, 0)) + +export function foo(): d { return null; } +>foo : Symbol(foo, Decl(importDecl_require1.ts, 3, 9)) +>d : Symbol(d, Decl(importDecl_require1.ts, 0, 0)) + +=== tests/cases/compiler/importDecl_require2.ts === +export class d { +>d : Symbol(d, Decl(importDecl_require2.ts, 0, 0)) + + baz: string; +>baz : Symbol(baz, Decl(importDecl_require2.ts, 0, 16)) +} +export var x: d; +>x : Symbol(x, Decl(importDecl_require2.ts, 3, 10)) +>d : Symbol(d, Decl(importDecl_require2.ts, 0, 0)) + +export function foo(): d { return null; } +>foo : Symbol(foo, Decl(importDecl_require2.ts, 3, 16)) +>d : Symbol(d, Decl(importDecl_require2.ts, 0, 0)) + +=== tests/cases/compiler/importDecl_require3.ts === +export class d { +>d : Symbol(d, Decl(importDecl_require3.ts, 0, 0)) + + bing: string; +>bing : Symbol(bing, Decl(importDecl_require3.ts, 0, 16)) +} +export var x: d; +>x : Symbol(x, Decl(importDecl_require3.ts, 3, 10)) +>d : Symbol(d, Decl(importDecl_require3.ts, 0, 0)) + +export function foo(): d { return null; } +>foo : Symbol(foo, Decl(importDecl_require3.ts, 3, 16)) +>d : Symbol(d, Decl(importDecl_require3.ts, 0, 0)) + +=== tests/cases/compiler/importDecl_require4.ts === +import m4 = require("importDecl_require"); +>m4 : Symbol(m4, Decl(importDecl_require4.ts, 0, 0)) + +export function foo2(): m4.d { return null; } +>foo2 : Symbol(foo2, Decl(importDecl_require4.ts, 0, 42)) +>m4 : Symbol(m4, Decl(importDecl_require4.ts, 0, 0)) +>d : Symbol(m4.d, Decl(importDecl_require.ts, 0, 0)) + diff --git a/tests/baselines/reference/importDecl.types b/tests/baselines/reference/importDecl.types index 973729ae050..58a56281bae 100644 --- a/tests/baselines/reference/importDecl.types +++ b/tests/baselines/reference/importDecl.types @@ -171,6 +171,7 @@ export var x: d; export function foo(): d { return null; } >foo : () => d >d : d +>null : null === tests/cases/compiler/importDecl_require1.ts === export class d { @@ -186,6 +187,7 @@ var x: d; export function foo(): d { return null; } >foo : () => d >d : d +>null : null === tests/cases/compiler/importDecl_require2.ts === export class d { @@ -201,6 +203,7 @@ export var x: d; export function foo(): d { return null; } >foo : () => d >d : d +>null : null === tests/cases/compiler/importDecl_require3.ts === export class d { @@ -216,6 +219,7 @@ export var x: d; export function foo(): d { return null; } >foo : () => d >d : d +>null : null === tests/cases/compiler/importDecl_require4.ts === import m4 = require("importDecl_require"); @@ -223,6 +227,7 @@ import m4 = require("importDecl_require"); export function foo2(): m4.d { return null; } >foo2 : () => m4.d ->m4 : unknown +>m4 : any >d : m4.d +>null : null diff --git a/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.symbols b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.symbols new file mode 100644 index 00000000000..892cbf7464e --- /dev/null +++ b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/importDeclWithExportModifierInAmbientContext.ts === +declare module "m" { + module x { +>x : Symbol(x, Decl(importDeclWithExportModifierInAmbientContext.ts, 0, 20)) + + interface c { +>c : Symbol(c, Decl(importDeclWithExportModifierInAmbientContext.ts, 1, 14)) + } + } + export import a = x.c; +>a : Symbol(a, Decl(importDeclWithExportModifierInAmbientContext.ts, 4, 5)) +>x : Symbol(x, Decl(importDeclWithExportModifierInAmbientContext.ts, 0, 20)) +>c : Symbol(a, Decl(importDeclWithExportModifierInAmbientContext.ts, 1, 14)) + + var b: a; +>b : Symbol(b, Decl(importDeclWithExportModifierInAmbientContext.ts, 6, 7)) +>a : Symbol(a, Decl(importDeclWithExportModifierInAmbientContext.ts, 4, 5)) +} + diff --git a/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.types b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.types index 6649b33bfe0..617c133aeee 100644 --- a/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.types +++ b/tests/baselines/reference/importDeclWithExportModifierInAmbientContext.types @@ -1,15 +1,15 @@ === tests/cases/compiler/importDeclWithExportModifierInAmbientContext.ts === declare module "m" { module x { ->x : unknown +>x : any interface c { >c : c } } export import a = x.c; ->a : unknown ->x : unknown +>a : any +>x : any >c : a var b: a; diff --git a/tests/baselines/reference/importDeclarationUsedAsTypeQuery.symbols b/tests/baselines/reference/importDeclarationUsedAsTypeQuery.symbols new file mode 100644 index 00000000000..2664691972f --- /dev/null +++ b/tests/baselines/reference/importDeclarationUsedAsTypeQuery.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/importDeclarationUsedAsTypeQuery_1.ts === +/// +import a = require('importDeclarationUsedAsTypeQuery_require'); +>a : Symbol(a, Decl(importDeclarationUsedAsTypeQuery_1.ts, 0, 0)) + +export var x: typeof a; +>x : Symbol(x, Decl(importDeclarationUsedAsTypeQuery_1.ts, 2, 10)) +>a : Symbol(a, Decl(importDeclarationUsedAsTypeQuery_1.ts, 0, 0)) + +=== tests/cases/compiler/importDeclarationUsedAsTypeQuery_require.ts === +export class B { +>B : Symbol(B, Decl(importDeclarationUsedAsTypeQuery_require.ts, 0, 0)) + + id: number; +>id : Symbol(id, Decl(importDeclarationUsedAsTypeQuery_require.ts, 0, 16)) +} + diff --git a/tests/baselines/reference/importImportOnlyModule.symbols b/tests/baselines/reference/importImportOnlyModule.symbols new file mode 100644 index 00000000000..902f1b45a68 --- /dev/null +++ b/tests/baselines/reference/importImportOnlyModule.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/externalModules/foo_2.ts === +import foo = require("./foo_1"); +>foo : Symbol(foo, Decl(foo_2.ts, 0, 0)) + +var x = foo; // Cause a runtime dependency +>x : Symbol(x, Decl(foo_2.ts, 1, 3)) +>foo : Symbol(foo, Decl(foo_2.ts, 0, 0)) + +=== 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)) +} + +=== tests/cases/conformance/externalModules/foo_1.ts === +import c1 = require('./foo_0'); // Makes this an external module +>c1 : Symbol(c1, Decl(foo_1.ts, 0, 0)) + +var answer = 42; // No exports +>answer : Symbol(answer, Decl(foo_1.ts, 1, 3)) + diff --git a/tests/baselines/reference/importImportOnlyModule.types b/tests/baselines/reference/importImportOnlyModule.types index 741d1b24859..c1275bed511 100644 --- a/tests/baselines/reference/importImportOnlyModule.types +++ b/tests/baselines/reference/importImportOnlyModule.types @@ -12,9 +12,11 @@ export class C1 { m1 = 42; >m1 : number +>42 : number static s1 = true; >s1 : boolean +>true : boolean } === tests/cases/conformance/externalModules/foo_1.ts === @@ -23,4 +25,5 @@ import c1 = require('./foo_0'); // Makes this an external module var answer = 42; // No exports >answer : number +>42 : number diff --git a/tests/baselines/reference/importInTypePosition.symbols b/tests/baselines/reference/importInTypePosition.symbols new file mode 100644 index 00000000000..08f55093c50 --- /dev/null +++ b/tests/baselines/reference/importInTypePosition.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/importInTypePosition.ts === +module A { +>A : Symbol(A, Decl(importInTypePosition.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(importInTypePosition.ts, 0, 10)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(importInTypePosition.ts, 2, 20)) +>y : Symbol(y, Decl(importInTypePosition.ts, 2, 37)) + } + export var Origin = new Point(0, 0); +>Origin : Symbol(Origin, Decl(importInTypePosition.ts, 4, 14)) +>Point : Symbol(Point, Decl(importInTypePosition.ts, 0, 10)) +} + +// no code gen expected +module B { +>B : Symbol(B, Decl(importInTypePosition.ts, 5, 1)) + + import a = A; //Error generates 'var = ;' +>a : Symbol(a, Decl(importInTypePosition.ts, 8, 10)) +>A : Symbol(a, Decl(importInTypePosition.ts, 0, 0)) +} +// no code gen expected +module C { +>C : Symbol(C, Decl(importInTypePosition.ts, 11, 1)) + + import a = A; //Error generates 'var = ;' +>a : Symbol(a, Decl(importInTypePosition.ts, 13, 10)) +>A : Symbol(a, Decl(importInTypePosition.ts, 0, 0)) + + var m: typeof a; +>m : Symbol(m, Decl(importInTypePosition.ts, 16, 7)) +>a : Symbol(a, Decl(importInTypePosition.ts, 13, 10)) + + var p: a.Point; +>p : Symbol(p, Decl(importInTypePosition.ts, 17, 7), Decl(importInTypePosition.ts, 18, 7)) +>a : Symbol(a, Decl(importInTypePosition.ts, 13, 10)) +>Point : Symbol(a.Point, Decl(importInTypePosition.ts, 0, 10)) + + var p = { x: 0, y: 0 }; +>p : Symbol(p, Decl(importInTypePosition.ts, 17, 7), Decl(importInTypePosition.ts, 18, 7)) +>x : Symbol(x, Decl(importInTypePosition.ts, 18, 13)) +>y : Symbol(y, Decl(importInTypePosition.ts, 18, 19)) +} + diff --git a/tests/baselines/reference/importInTypePosition.types b/tests/baselines/reference/importInTypePosition.types index 163ae1d3a62..7360416e4b3 100644 --- a/tests/baselines/reference/importInTypePosition.types +++ b/tests/baselines/reference/importInTypePosition.types @@ -13,11 +13,13 @@ module A { >Origin : Point >new Point(0, 0) : Point >Point : typeof Point +>0 : number +>0 : number } // no code gen expected module B { ->B : unknown +>B : any import a = A; //Error generates 'var = ;' >a : typeof a @@ -37,13 +39,15 @@ module C { var p: a.Point; >p : a.Point ->a : unknown +>a : any >Point : a.Point var p = { x: 0, y: 0 }; >p : a.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } diff --git a/tests/baselines/reference/importOnAliasedIdentifiers.symbols b/tests/baselines/reference/importOnAliasedIdentifiers.symbols new file mode 100644 index 00000000000..7717799d4db --- /dev/null +++ b/tests/baselines/reference/importOnAliasedIdentifiers.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/importOnAliasedIdentifiers.ts === +module A { +>A : Symbol(A, Decl(importOnAliasedIdentifiers.ts, 0, 0)) + + export interface X { s: string } +>X : Symbol(X, Decl(importOnAliasedIdentifiers.ts, 0, 10), Decl(importOnAliasedIdentifiers.ts, 2, 14)) +>s : Symbol(s, Decl(importOnAliasedIdentifiers.ts, 1, 24)) + + export var X: X; +>X : Symbol(X, Decl(importOnAliasedIdentifiers.ts, 0, 10), Decl(importOnAliasedIdentifiers.ts, 2, 14)) +>X : Symbol(X, Decl(importOnAliasedIdentifiers.ts, 0, 10), Decl(importOnAliasedIdentifiers.ts, 2, 14)) +} +module B { +>B : Symbol(B, Decl(importOnAliasedIdentifiers.ts, 3, 1)) + + interface A { n: number } +>A : Symbol(A, Decl(importOnAliasedIdentifiers.ts, 4, 10)) +>n : Symbol(n, Decl(importOnAliasedIdentifiers.ts, 5, 17)) + + import Y = A; // Alias only for module A +>Y : Symbol(Y, Decl(importOnAliasedIdentifiers.ts, 5, 29)) +>A : Symbol(Y, Decl(importOnAliasedIdentifiers.ts, 0, 0)) + + import Z = A.X; // Alias for both type and member A.X +>Z : Symbol(Z, Decl(importOnAliasedIdentifiers.ts, 6, 17)) +>A : Symbol(Y, Decl(importOnAliasedIdentifiers.ts, 0, 0)) +>X : Symbol(Y.X, Decl(importOnAliasedIdentifiers.ts, 0, 10), Decl(importOnAliasedIdentifiers.ts, 2, 14)) + + var v: Z = Z; +>v : Symbol(v, Decl(importOnAliasedIdentifiers.ts, 8, 7)) +>Z : Symbol(Z, Decl(importOnAliasedIdentifiers.ts, 6, 17)) +>Z : Symbol(Z, Decl(importOnAliasedIdentifiers.ts, 6, 17)) +} diff --git a/tests/baselines/reference/importShadowsGlobalName.symbols b/tests/baselines/reference/importShadowsGlobalName.symbols new file mode 100644 index 00000000000..f308572737b --- /dev/null +++ b/tests/baselines/reference/importShadowsGlobalName.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/Bar.ts === +import Error = require('Foo'); +>Error : Symbol(Error, Decl(Bar.ts, 0, 0)) + +class Bar extends Error {} +>Bar : Symbol(Bar, Decl(Bar.ts, 0, 30)) +>Error : Symbol(Error, Decl(Bar.ts, 0, 0)) + +export = Bar; +>Bar : Symbol(Bar, Decl(Bar.ts, 0, 30)) + +=== tests/cases/compiler/Foo.ts === + +class Foo {} +>Foo : Symbol(Foo, Decl(Foo.ts, 0, 0)) + +export = Foo; +>Foo : Symbol(Foo, Decl(Foo.ts, 0, 0)) + diff --git a/tests/baselines/reference/importStatements.symbols b/tests/baselines/reference/importStatements.symbols new file mode 100644 index 00000000000..b160dcf2888 --- /dev/null +++ b/tests/baselines/reference/importStatements.symbols @@ -0,0 +1,88 @@ +=== tests/cases/conformance/internalModules/codeGeneration/importStatements.ts === +module A { +>A : Symbol(A, Decl(importStatements.ts, 0, 0)) + + export class Point { +>Point : Symbol(Point, Decl(importStatements.ts, 0, 10)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(importStatements.ts, 2, 20)) +>y : Symbol(y, Decl(importStatements.ts, 2, 37)) + } + + export var Origin = new Point(0, 0); +>Origin : Symbol(Origin, Decl(importStatements.ts, 5, 14)) +>Point : Symbol(Point, Decl(importStatements.ts, 0, 10)) +} + +// no code gen expected +module B { +>B : Symbol(B, Decl(importStatements.ts, 6, 1)) + + import a = A; //Error generates 'var = ;' +>a : Symbol(a, Decl(importStatements.ts, 9, 10)) +>A : Symbol(a, Decl(importStatements.ts, 0, 0)) +} + +// no code gen expected +module C { +>C : Symbol(C, Decl(importStatements.ts, 11, 1)) + + import a = A; //Error generates 'var = ;' +>a : Symbol(a, Decl(importStatements.ts, 14, 10)) +>A : Symbol(a, Decl(importStatements.ts, 0, 0)) + + var m: typeof a; +>m : Symbol(m, Decl(importStatements.ts, 16, 7)) +>a : Symbol(a, Decl(importStatements.ts, 14, 10)) + + var p: a.Point; +>p : Symbol(p, Decl(importStatements.ts, 17, 7), Decl(importStatements.ts, 18, 7)) +>a : Symbol(a, Decl(importStatements.ts, 14, 10)) +>Point : Symbol(a.Point, Decl(importStatements.ts, 0, 10)) + + var p = {x:0, y:0 }; +>p : Symbol(p, Decl(importStatements.ts, 17, 7), Decl(importStatements.ts, 18, 7)) +>x : Symbol(x, Decl(importStatements.ts, 18, 13)) +>y : Symbol(y, Decl(importStatements.ts, 18, 17)) +} + +// code gen expected +module D { +>D : Symbol(D, Decl(importStatements.ts, 19, 1)) + + import a = A; +>a : Symbol(a, Decl(importStatements.ts, 22, 10)) +>A : Symbol(a, Decl(importStatements.ts, 0, 0)) + + var p = new a.Point(1, 1); +>p : Symbol(p, Decl(importStatements.ts, 25, 7)) +>a.Point : Symbol(a.Point, Decl(importStatements.ts, 0, 10)) +>a : Symbol(a, Decl(importStatements.ts, 22, 10)) +>Point : Symbol(a.Point, Decl(importStatements.ts, 0, 10)) +} + +module E { +>E : Symbol(E, Decl(importStatements.ts, 26, 1)) + + import a = A; +>a : Symbol(a, Decl(importStatements.ts, 28, 10)) +>A : Symbol(a, Decl(importStatements.ts, 0, 0)) + + export function xDist(x: a.Point) { +>xDist : Symbol(xDist, Decl(importStatements.ts, 29, 17)) +>x : Symbol(x, Decl(importStatements.ts, 30, 26)) +>a : Symbol(a, Decl(importStatements.ts, 28, 10)) +>Point : Symbol(a.Point, Decl(importStatements.ts, 0, 10)) + + return (a.Origin.x - x.x); +>a.Origin.x : Symbol(a.Point.x, Decl(importStatements.ts, 2, 20)) +>a.Origin : Symbol(a.Origin, Decl(importStatements.ts, 5, 14)) +>a : Symbol(a, Decl(importStatements.ts, 28, 10)) +>Origin : Symbol(a.Origin, Decl(importStatements.ts, 5, 14)) +>x : Symbol(a.Point.x, Decl(importStatements.ts, 2, 20)) +>x.x : Symbol(a.Point.x, Decl(importStatements.ts, 2, 20)) +>x : Symbol(x, Decl(importStatements.ts, 30, 26)) +>x : Symbol(a.Point.x, Decl(importStatements.ts, 2, 20)) + } +} diff --git a/tests/baselines/reference/importStatements.types b/tests/baselines/reference/importStatements.types index 5980a142f34..ecf4453b360 100644 --- a/tests/baselines/reference/importStatements.types +++ b/tests/baselines/reference/importStatements.types @@ -14,11 +14,13 @@ module A { >Origin : Point >new Point(0, 0) : Point >Point : typeof Point +>0 : number +>0 : number } // no code gen expected module B { ->B : unknown +>B : any import a = A; //Error generates 'var = ;' >a : typeof a @@ -39,14 +41,16 @@ module C { var p: a.Point; >p : a.Point ->a : unknown +>a : any >Point : a.Point var p = {x:0, y:0 }; >p : a.Point >{x:0, y:0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } // code gen expected @@ -63,6 +67,8 @@ module D { >a.Point : typeof a.Point >a : typeof a >Point : typeof a.Point +>1 : number +>1 : number } module E { @@ -75,7 +81,7 @@ module E { export function xDist(x: a.Point) { >xDist : (x: a.Point) => number >x : a.Point ->a : unknown +>a : any >Point : a.Point return (a.Origin.x - x.x); diff --git a/tests/baselines/reference/importUsedInExtendsList1.symbols b/tests/baselines/reference/importUsedInExtendsList1.symbols new file mode 100644 index 00000000000..1b3ac99ee9d --- /dev/null +++ b/tests/baselines/reference/importUsedInExtendsList1.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/importUsedInExtendsList1_1.ts === +/// +import foo = require('importUsedInExtendsList1_require'); +>foo : Symbol(foo, Decl(importUsedInExtendsList1_1.ts, 0, 0)) + +class Sub extends foo.Super { } +>Sub : Symbol(Sub, Decl(importUsedInExtendsList1_1.ts, 1, 57)) +>foo.Super : Symbol(foo.Super, Decl(importUsedInExtendsList1_require.ts, 0, 0)) +>foo : Symbol(foo, Decl(importUsedInExtendsList1_1.ts, 0, 0)) +>Super : Symbol(foo.Super, Decl(importUsedInExtendsList1_require.ts, 0, 0)) + +var s: Sub; +>s : Symbol(s, Decl(importUsedInExtendsList1_1.ts, 3, 3)) +>Sub : Symbol(Sub, Decl(importUsedInExtendsList1_1.ts, 1, 57)) + +var r: string = s.foo; +>r : Symbol(r, Decl(importUsedInExtendsList1_1.ts, 4, 3)) +>s.foo : Symbol(foo.Super.foo, Decl(importUsedInExtendsList1_require.ts, 0, 20)) +>s : Symbol(s, Decl(importUsedInExtendsList1_1.ts, 3, 3)) +>foo : Symbol(foo.Super.foo, Decl(importUsedInExtendsList1_require.ts, 0, 20)) + +=== tests/cases/compiler/importUsedInExtendsList1_require.ts === +export class Super { foo: string; } +>Super : Symbol(Super, Decl(importUsedInExtendsList1_require.ts, 0, 0)) +>foo : Symbol(foo, Decl(importUsedInExtendsList1_require.ts, 0, 20)) + diff --git a/tests/baselines/reference/importUsedInExtendsList1.types b/tests/baselines/reference/importUsedInExtendsList1.types index 623b14e36aa..74737c4db96 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.types +++ b/tests/baselines/reference/importUsedInExtendsList1.types @@ -5,6 +5,7 @@ import foo = require('importUsedInExtendsList1_require'); class Sub extends foo.Super { } >Sub : Sub +>foo.Super : any >foo : typeof foo >Super : foo.Super diff --git a/tests/baselines/reference/import_reference-exported-alias.symbols b/tests/baselines/reference/import_reference-exported-alias.symbols new file mode 100644 index 00000000000..424bb4bc8b4 --- /dev/null +++ b/tests/baselines/reference/import_reference-exported-alias.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/file2.ts === +import appJs = require("file1"); +>appJs : Symbol(appJs, Decl(file2.ts, 0, 0)) + +import Services = appJs.Services; +>Services : Symbol(Services, Decl(file2.ts, 0, 32)) +>appJs : Symbol(appJs, Decl(file1.ts, 0, 0)) +>Services : Symbol(appJs.Services, Decl(file1.ts, 0, 12)) + +import UserServices = Services.UserServices; +>UserServices : Symbol(UserServices, Decl(file2.ts, 1, 33)) +>Services : Symbol(appJs.Services, Decl(file1.ts, 0, 12)) +>UserServices : Symbol(Services.UserServices, Decl(file1.ts, 1, 28)) + +var x = new UserServices().getUserName(); +>x : Symbol(x, Decl(file2.ts, 3, 3)) +>new UserServices().getUserName : Symbol(Services.UserServices.getUserName, Decl(file1.ts, 2, 35)) +>UserServices : Symbol(UserServices, Decl(file2.ts, 1, 33)) +>getUserName : Symbol(Services.UserServices.getUserName, Decl(file1.ts, 2, 35)) + +=== tests/cases/compiler/file1.ts === +module App { +>App : Symbol(App, Decl(file1.ts, 0, 0)) + + export module Services { +>Services : Symbol(Services, Decl(file1.ts, 0, 12)) + + export class UserServices { +>UserServices : Symbol(UserServices, Decl(file1.ts, 1, 28)) + + public getUserName(): string { +>getUserName : Symbol(getUserName, Decl(file1.ts, 2, 35)) + + return "Bill Gates"; + } + } + } +} + +import Mod = App; +>Mod : Symbol(Mod, Decl(file1.ts, 8, 1)) +>App : Symbol(App, Decl(file1.ts, 0, 0)) + +export = Mod; +>Mod : Symbol(Mod, Decl(file1.ts, 8, 1)) + diff --git a/tests/baselines/reference/import_reference-exported-alias.types b/tests/baselines/reference/import_reference-exported-alias.types index b935fb16cf2..3f9c34f62dc 100644 --- a/tests/baselines/reference/import_reference-exported-alias.types +++ b/tests/baselines/reference/import_reference-exported-alias.types @@ -34,6 +34,7 @@ module App { >getUserName : () => string return "Bill Gates"; +>"Bill Gates" : string } } } diff --git a/tests/baselines/reference/import_reference-to-type-alias.symbols b/tests/baselines/reference/import_reference-to-type-alias.symbols new file mode 100644 index 00000000000..2fef0714a3a --- /dev/null +++ b/tests/baselines/reference/import_reference-to-type-alias.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/file2.ts === +import appJs = require("file1"); +>appJs : Symbol(appJs, Decl(file2.ts, 0, 0)) + +import Services = appJs.App.Services; +>Services : Symbol(Services, Decl(file2.ts, 0, 32)) +>appJs : Symbol(appJs, Decl(file1.ts, 0, 0)) +>App : Symbol(appJs.App, Decl(file1.ts, 0, 0)) +>Services : Symbol(Services, Decl(file1.ts, 0, 19)) + +var x = new Services.UserServices().getUserName(); +>x : Symbol(x, Decl(file2.ts, 2, 3)) +>new Services.UserServices().getUserName : Symbol(Services.UserServices.getUserName, Decl(file1.ts, 2, 35)) +>Services.UserServices : Symbol(Services.UserServices, Decl(file1.ts, 1, 28)) +>Services : Symbol(Services, Decl(file2.ts, 0, 32)) +>UserServices : Symbol(Services.UserServices, Decl(file1.ts, 1, 28)) +>getUserName : Symbol(Services.UserServices.getUserName, Decl(file1.ts, 2, 35)) + +=== tests/cases/compiler/file1.ts === +export module App { +>App : Symbol(App, Decl(file1.ts, 0, 0)) + + export module Services { +>Services : Symbol(Services, Decl(file1.ts, 0, 19)) + + export class UserServices { +>UserServices : Symbol(UserServices, Decl(file1.ts, 1, 28)) + + public getUserName(): string { +>getUserName : Symbol(getUserName, Decl(file1.ts, 2, 35)) + + return "Bill Gates"; + } + } + } +} + diff --git a/tests/baselines/reference/import_reference-to-type-alias.types b/tests/baselines/reference/import_reference-to-type-alias.types index e1da40b5bb4..53c7dabcd5f 100644 --- a/tests/baselines/reference/import_reference-to-type-alias.types +++ b/tests/baselines/reference/import_reference-to-type-alias.types @@ -32,6 +32,7 @@ export module App { >getUserName : () => string return "Bill Gates"; +>"Bill Gates" : string } } } diff --git a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.symbols b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.symbols new file mode 100644 index 00000000000..bfc29cd8032 --- /dev/null +++ b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/a.ts === +/// +import ITest = require('ITest'); +>ITest : Symbol(ITest, Decl(a.ts, 0, 0)) + +var testData: ITest[]; +>testData : Symbol(testData, Decl(a.ts, 2, 3)) +>ITest : Symbol(ITest, Decl(a.ts, 0, 0)) + +var p = testData[0].name; +>p : Symbol(p, Decl(a.ts, 3, 3)) +>testData[0].name : Symbol(ITest.name, Decl(b.ts, 1, 20)) +>testData : Symbol(testData, Decl(a.ts, 2, 3)) +>name : Symbol(ITest.name, Decl(b.ts, 1, 20)) + +=== tests/cases/compiler/b.ts === +declare module "ITest" { + interface Name { +>Name : Symbol(Name, Decl(b.ts, 0, 24)) + + name: string; +>name : Symbol(name, Decl(b.ts, 1, 20)) + } + export = Name; +>Name : Symbol(Name, Decl(b.ts, 0, 24)) +} + diff --git a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types index 0dfe8ca336b..2fda99dc064 100644 --- a/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types +++ b/tests/baselines/reference/import_unneeded-require-when-referenecing-aliased-type-throug-array.types @@ -1,7 +1,7 @@ === tests/cases/compiler/a.ts === /// import ITest = require('ITest'); ->ITest : unknown +>ITest : any var testData: ITest[]; >testData : ITest[] @@ -12,6 +12,7 @@ var p = testData[0].name; >testData[0].name : string >testData[0] : ITest >testData : ITest[] +>0 : number >name : string === tests/cases/compiler/b.ts === diff --git a/tests/baselines/reference/import_var-referencing-an-imported-module-alias.symbols b/tests/baselines/reference/import_var-referencing-an-imported-module-alias.symbols new file mode 100644 index 00000000000..0cc6d0aa9a1 --- /dev/null +++ b/tests/baselines/reference/import_var-referencing-an-imported-module-alias.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/consumer.ts === + +import host = require("host"); +>host : Symbol(host, Decl(consumer.ts, 0, 0)) + +var hostVar = host; +>hostVar : Symbol(hostVar, Decl(consumer.ts, 2, 3)) +>host : Symbol(host, Decl(consumer.ts, 0, 0)) + +var v = new hostVar.Host(); +>v : Symbol(v, Decl(consumer.ts, 3, 3)) +>hostVar.Host : Symbol(host.Host, Decl(host.ts, 0, 0)) +>hostVar : Symbol(hostVar, Decl(consumer.ts, 2, 3)) +>Host : Symbol(host.Host, Decl(host.ts, 0, 0)) + +=== tests/cases/compiler/host.ts === +export class Host { } +>Host : Symbol(Host, Decl(host.ts, 0, 0)) + diff --git a/tests/baselines/reference/importedAliasesInTypePositions.symbols b/tests/baselines/reference/importedAliasesInTypePositions.symbols new file mode 100644 index 00000000000..50a6b582655 --- /dev/null +++ b/tests/baselines/reference/importedAliasesInTypePositions.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/file2.ts === +import RT_ALIAS = require("file1"); +>RT_ALIAS : Symbol(RT_ALIAS, Decl(file2.ts, 0, 0)) + +import ReferredTo = RT_ALIAS.elaborate.nested.mod.name.ReferredTo; +>ReferredTo : Symbol(ReferredTo, Decl(file2.ts, 0, 35)) +>RT_ALIAS : Symbol(RT_ALIAS, Decl(file1.ts, 0, 0)) +>elaborate : Symbol(RT_ALIAS.elaborate, Decl(file1.ts, 0, 0)) +>nested : Symbol(RT_ALIAS.elaborate.nested, Decl(file1.ts, 0, 24)) +>mod : Symbol(RT_ALIAS.elaborate.nested.mod, Decl(file1.ts, 0, 31)) +>name : Symbol(RT_ALIAS.elaborate.nested.mod.name, Decl(file1.ts, 0, 35)) +>ReferredTo : Symbol(ReferredTo, Decl(file1.ts, 0, 41)) + +export module ImportingModule { +>ImportingModule : Symbol(ImportingModule, Decl(file2.ts, 1, 66)) + + class UsesReferredType { +>UsesReferredType : Symbol(UsesReferredType, Decl(file2.ts, 3, 31)) + + constructor(private referred: ReferredTo) { } +>referred : Symbol(referred, Decl(file2.ts, 5, 20)) +>ReferredTo : Symbol(ReferredTo, Decl(file2.ts, 0, 35)) + } +} +=== tests/cases/compiler/file1.ts === +export module elaborate.nested.mod.name { +>elaborate : Symbol(elaborate, Decl(file1.ts, 0, 0)) +>nested : Symbol(nested, Decl(file1.ts, 0, 24)) +>mod : Symbol(mod, Decl(file1.ts, 0, 31)) +>name : Symbol(name, Decl(file1.ts, 0, 35)) + + export class ReferredTo { +>ReferredTo : Symbol(ReferredTo, Decl(file1.ts, 0, 41)) + + doSomething(): void { +>doSomething : Symbol(doSomething, Decl(file1.ts, 1, 29)) + } + } +} + diff --git a/tests/baselines/reference/importedModuleClassNameClash.symbols b/tests/baselines/reference/importedModuleClassNameClash.symbols new file mode 100644 index 00000000000..f394c48dde4 --- /dev/null +++ b/tests/baselines/reference/importedModuleClassNameClash.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/importedModuleClassNameClash.ts === +import foo = m1; +>foo : Symbol(foo, Decl(importedModuleClassNameClash.ts, 0, 0), Decl(importedModuleClassNameClash.ts, 2, 20)) +>m1 : Symbol(foo, Decl(importedModuleClassNameClash.ts, 0, 16)) + +export module m1 { } +>m1 : Symbol(foo, Decl(importedModuleClassNameClash.ts, 0, 16)) + +class foo { } +>foo : Symbol(foo, Decl(importedModuleClassNameClash.ts, 0, 0), Decl(importedModuleClassNameClash.ts, 2, 20)) + diff --git a/tests/baselines/reference/importedModuleClassNameClash.types b/tests/baselines/reference/importedModuleClassNameClash.types index 28cdee34167..6720403e127 100644 --- a/tests/baselines/reference/importedModuleClassNameClash.types +++ b/tests/baselines/reference/importedModuleClassNameClash.types @@ -1,10 +1,10 @@ === tests/cases/compiler/importedModuleClassNameClash.ts === import foo = m1; >foo : typeof foo ->m1 : unknown +>m1 : any export module m1 { } ->m1 : unknown +>m1 : any class foo { } >foo : foo diff --git a/tests/baselines/reference/inOperatorWithFunction.symbols b/tests/baselines/reference/inOperatorWithFunction.symbols new file mode 100644 index 00000000000..1e915ba107d --- /dev/null +++ b/tests/baselines/reference/inOperatorWithFunction.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/inOperatorWithFunction.ts === +var fn = function (val: boolean) { return val; } +>fn : Symbol(fn, Decl(inOperatorWithFunction.ts, 0, 3)) +>val : Symbol(val, Decl(inOperatorWithFunction.ts, 0, 19)) +>val : Symbol(val, Decl(inOperatorWithFunction.ts, 0, 19)) + +fn("a" in { "a": true }); +>fn : Symbol(fn, Decl(inOperatorWithFunction.ts, 0, 3)) + diff --git a/tests/baselines/reference/inOperatorWithFunction.types b/tests/baselines/reference/inOperatorWithFunction.types index 9de7663011d..e85a86632c7 100644 --- a/tests/baselines/reference/inOperatorWithFunction.types +++ b/tests/baselines/reference/inOperatorWithFunction.types @@ -9,5 +9,7 @@ fn("a" in { "a": true }); >fn("a" in { "a": true }) : boolean >fn : (val: boolean) => boolean >"a" in { "a": true } : boolean +>"a" : string >{ "a": true } : { "a": boolean; } +>true : boolean diff --git a/tests/baselines/reference/inOperatorWithGeneric.symbols b/tests/baselines/reference/inOperatorWithGeneric.symbols new file mode 100644 index 00000000000..7a84d7dce6b --- /dev/null +++ b/tests/baselines/reference/inOperatorWithGeneric.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/inOperatorWithGeneric.ts === +class C { +>C : Symbol(C, Decl(inOperatorWithGeneric.ts, 0, 0)) +>T : Symbol(T, Decl(inOperatorWithGeneric.ts, 0, 8)) + + foo(x:T) { +>foo : Symbol(foo, Decl(inOperatorWithGeneric.ts, 0, 12)) +>x : Symbol(x, Decl(inOperatorWithGeneric.ts, 1, 8)) +>T : Symbol(T, Decl(inOperatorWithGeneric.ts, 0, 8)) + + for (var p in x) { +>p : Symbol(p, Decl(inOperatorWithGeneric.ts, 2, 16)) +>x : Symbol(x, Decl(inOperatorWithGeneric.ts, 1, 8)) + } + } +} diff --git a/tests/baselines/reference/inOperatorWithValidOperands.symbols b/tests/baselines/reference/inOperatorWithValidOperands.symbols new file mode 100644 index 00000000000..07e0bd4f6de --- /dev/null +++ b/tests/baselines/reference/inOperatorWithValidOperands.symbols @@ -0,0 +1,93 @@ +=== tests/cases/conformance/expressions/binaryOperators/inOperator/inOperatorWithValidOperands.ts === +var x: any; +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +// valid left operands +// the left operand is required to be of type Any, the String primitive type, or the Number primitive type +var a1: string; +>a1 : Symbol(a1, Decl(inOperatorWithValidOperands.ts, 4, 3)) + +var a2: number; +>a2 : Symbol(a2, Decl(inOperatorWithValidOperands.ts, 5, 3)) + +var ra1 = x in x; +>ra1 : Symbol(ra1, Decl(inOperatorWithValidOperands.ts, 7, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +var ra2 = a1 in x; +>ra2 : Symbol(ra2, Decl(inOperatorWithValidOperands.ts, 8, 3)) +>a1 : Symbol(a1, Decl(inOperatorWithValidOperands.ts, 4, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +var ra3 = a2 in x; +>ra3 : Symbol(ra3, Decl(inOperatorWithValidOperands.ts, 9, 3)) +>a2 : Symbol(a2, Decl(inOperatorWithValidOperands.ts, 5, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +var ra4 = '' in x; +>ra4 : Symbol(ra4, Decl(inOperatorWithValidOperands.ts, 10, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +var ra5 = 0 in x; +>ra5 : Symbol(ra5, Decl(inOperatorWithValidOperands.ts, 11, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +// valid right operands +// the right operand is required to be of type Any, an object type, or a type parameter type +var b1: {}; +>b1 : Symbol(b1, Decl(inOperatorWithValidOperands.ts, 15, 3)) + +var rb1 = x in b1; +>rb1 : Symbol(rb1, Decl(inOperatorWithValidOperands.ts, 17, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) +>b1 : Symbol(b1, Decl(inOperatorWithValidOperands.ts, 15, 3)) + +var rb2 = x in {}; +>rb2 : Symbol(rb2, Decl(inOperatorWithValidOperands.ts, 18, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) + +function foo(t: T) { +>foo : Symbol(foo, Decl(inOperatorWithValidOperands.ts, 18, 18)) +>T : Symbol(T, Decl(inOperatorWithValidOperands.ts, 20, 13)) +>t : Symbol(t, Decl(inOperatorWithValidOperands.ts, 20, 16)) +>T : Symbol(T, Decl(inOperatorWithValidOperands.ts, 20, 13)) + + var rb3 = x in t; +>rb3 : Symbol(rb3, Decl(inOperatorWithValidOperands.ts, 21, 7)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) +>t : Symbol(t, Decl(inOperatorWithValidOperands.ts, 20, 16)) +} + +interface X { x: number } +>X : Symbol(X, Decl(inOperatorWithValidOperands.ts, 22, 1)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 24, 13)) + +interface Y { y: number } +>Y : Symbol(Y, Decl(inOperatorWithValidOperands.ts, 24, 25)) +>y : Symbol(y, Decl(inOperatorWithValidOperands.ts, 25, 13)) + +var c1: X | Y; +>c1 : Symbol(c1, Decl(inOperatorWithValidOperands.ts, 27, 3)) +>X : Symbol(X, Decl(inOperatorWithValidOperands.ts, 22, 1)) +>Y : Symbol(Y, Decl(inOperatorWithValidOperands.ts, 24, 25)) + +var c2: X; +>c2 : Symbol(c2, Decl(inOperatorWithValidOperands.ts, 28, 3)) +>X : Symbol(X, Decl(inOperatorWithValidOperands.ts, 22, 1)) + +var c3: Y; +>c3 : Symbol(c3, Decl(inOperatorWithValidOperands.ts, 29, 3)) +>Y : Symbol(Y, Decl(inOperatorWithValidOperands.ts, 24, 25)) + +var rc1 = x in c1; +>rc1 : Symbol(rc1, Decl(inOperatorWithValidOperands.ts, 31, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) +>c1 : Symbol(c1, Decl(inOperatorWithValidOperands.ts, 27, 3)) + +var rc2 = x in (c2 || c3); +>rc2 : Symbol(rc2, Decl(inOperatorWithValidOperands.ts, 32, 3)) +>x : Symbol(x, Decl(inOperatorWithValidOperands.ts, 0, 3)) +>c2 : Symbol(c2, Decl(inOperatorWithValidOperands.ts, 28, 3)) +>c3 : Symbol(c3, Decl(inOperatorWithValidOperands.ts, 29, 3)) + diff --git a/tests/baselines/reference/inOperatorWithValidOperands.types b/tests/baselines/reference/inOperatorWithValidOperands.types index 27ba22055bf..0cca583e683 100644 --- a/tests/baselines/reference/inOperatorWithValidOperands.types +++ b/tests/baselines/reference/inOperatorWithValidOperands.types @@ -31,11 +31,13 @@ var ra3 = a2 in x; var ra4 = '' in x; >ra4 : boolean >'' in x : boolean +>'' : string >x : any var ra5 = 0 in x; >ra5 : boolean >0 in x : boolean +>0 : number >x : any // valid right operands diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.symbols b/tests/baselines/reference/incrementOperatorWithAnyOtherType.symbols new file mode 100644 index 00000000000..d0af700ea8e --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.symbols @@ -0,0 +1,154 @@ +=== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherType.ts === +// ++ operator on any type + +var ANY: any; +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) + +var ANY1; +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ANY2: any[] = ["", ""]; +>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherType.ts, 4, 3)) + +var obj = {x:1,y:null}; +>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(incrementOperatorWithAnyOtherType.ts, 5, 11)) +>y : Symbol(y, Decl(incrementOperatorWithAnyOtherType.ts, 5, 15)) + +class A { +>A : Symbol(A, Decl(incrementOperatorWithAnyOtherType.ts, 5, 23)) + + public a: any; +>a : Symbol(a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) +} +module M { +>M : Symbol(M, Decl(incrementOperatorWithAnyOtherType.ts, 8, 1)) + + export var n: any; +>n : Symbol(n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) +} +var objA = new A(); +>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherType.ts, 12, 3)) +>A : Symbol(A, Decl(incrementOperatorWithAnyOtherType.ts, 5, 23)) + +// any type var +var ResultIsNumber1 = ++ANY; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(incrementOperatorWithAnyOtherType.ts, 15, 3)) +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) + +var ResultIsNumber2 = ++ANY1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(incrementOperatorWithAnyOtherType.ts, 16, 3)) +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ResultIsNumber3 = ANY1++; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(incrementOperatorWithAnyOtherType.ts, 18, 3)) +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +var ResultIsNumber4 = ANY1++; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(incrementOperatorWithAnyOtherType.ts, 19, 3)) +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +// expressions +var ResultIsNumber5 = ++ANY2[0]; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(incrementOperatorWithAnyOtherType.ts, 22, 3)) +>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber6 = ++obj.x; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(incrementOperatorWithAnyOtherType.ts, 23, 3)) +>obj.x : Symbol(x, Decl(incrementOperatorWithAnyOtherType.ts, 5, 11)) +>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(incrementOperatorWithAnyOtherType.ts, 5, 11)) + +var ResultIsNumber7 = ++obj.y; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(incrementOperatorWithAnyOtherType.ts, 24, 3)) +>obj.y : Symbol(y, Decl(incrementOperatorWithAnyOtherType.ts, 5, 15)) +>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherType.ts, 5, 3)) +>y : Symbol(y, Decl(incrementOperatorWithAnyOtherType.ts, 5, 15)) + +var ResultIsNumber8 = ++objA.a; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(incrementOperatorWithAnyOtherType.ts, 25, 3)) +>objA.a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) + +var ResultIsNumber = ++M.n; +>ResultIsNumber : Symbol(ResultIsNumber, Decl(incrementOperatorWithAnyOtherType.ts, 26, 3)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(incrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) + +var ResultIsNumber9 = ANY2[0]++; +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(incrementOperatorWithAnyOtherType.ts, 28, 3)) +>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber10 = obj.x++; +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(incrementOperatorWithAnyOtherType.ts, 29, 3)) +>obj.x : Symbol(x, Decl(incrementOperatorWithAnyOtherType.ts, 5, 11)) +>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherType.ts, 5, 3)) +>x : Symbol(x, Decl(incrementOperatorWithAnyOtherType.ts, 5, 11)) + +var ResultIsNumber11 = obj.y++; +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(incrementOperatorWithAnyOtherType.ts, 30, 3)) +>obj.y : Symbol(y, Decl(incrementOperatorWithAnyOtherType.ts, 5, 15)) +>obj : Symbol(obj, Decl(incrementOperatorWithAnyOtherType.ts, 5, 3)) +>y : Symbol(y, Decl(incrementOperatorWithAnyOtherType.ts, 5, 15)) + +var ResultIsNumber12 = objA.a++; +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(incrementOperatorWithAnyOtherType.ts, 31, 3)) +>objA.a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) + +var ResultIsNumber13 = M.n++; +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(incrementOperatorWithAnyOtherType.ts, 32, 3)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(incrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) + +// miss assignment opertors +++ANY; +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) + +++ANY1; +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +++ANY2[0]; +>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherType.ts, 4, 3)) + +++ANY, ++ANY1; +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +++objA.a; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) + +++M.n; +>M.n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(incrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) + +ANY++; +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) + +ANY1++; +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +ANY2[0]++; +>ANY2 : Symbol(ANY2, Decl(incrementOperatorWithAnyOtherType.ts, 4, 3)) + +ANY++, ANY1++; +>ANY : Symbol(ANY, Decl(incrementOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(incrementOperatorWithAnyOtherType.ts, 3, 3)) + +objA.a++; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithAnyOtherType.ts, 12, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithAnyOtherType.ts, 6, 9)) + +M.n++; +>M.n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) +>M : Symbol(M, Decl(incrementOperatorWithAnyOtherType.ts, 8, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithAnyOtherType.ts, 10, 14)) + diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types index 930c87274d0..3643b646ace 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherType.types @@ -10,12 +10,16 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] +>"" : string +>"" : string var obj = {x:1,y:null}; >obj : { x: number; y: any; } >{x:1,y:null} : { x: number; y: null; } >x : number +>1 : number >y : null +>null : null class A { >A : A @@ -61,6 +65,7 @@ var ResultIsNumber5 = ++ANY2[0]; >++ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number var ResultIsNumber6 = ++obj.x; >ResultIsNumber6 : number @@ -95,6 +100,7 @@ var ResultIsNumber9 = ANY2[0]++; >ANY2[0]++ : number >ANY2[0] : any >ANY2 : any[] +>0 : number var ResultIsNumber10 = obj.x++; >ResultIsNumber10 : number @@ -137,6 +143,7 @@ var ResultIsNumber13 = M.n++; >++ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number ++ANY, ++ANY1; >++ANY, ++ANY1 : number @@ -169,6 +176,7 @@ ANY2[0]++; >ANY2[0]++ : number >ANY2[0] : any >ANY2 : any[] +>0 : number ANY++, ANY1++; >ANY++, ANY1++ : number diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.symbols b/tests/baselines/reference/incrementOperatorWithNumberType.symbols new file mode 100644 index 00000000000..3523e15135c --- /dev/null +++ b/tests/baselines/reference/incrementOperatorWithNumberType.symbols @@ -0,0 +1,112 @@ +=== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithNumberType.ts === +// ++ operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(incrementOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(incrementOperatorWithNumberType.ts, 2, 3)) + +class A { +>A : Symbol(A, Decl(incrementOperatorWithNumberType.ts, 2, 31)) + + public a: number; +>a : Symbol(a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +} +module M { +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) + + export var n: number; +>n : Symbol(n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>A : Symbol(A, Decl(incrementOperatorWithNumberType.ts, 2, 31)) + +// number type var +var ResultIsNumber1 = ++NUMBER; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(incrementOperatorWithNumberType.ts, 14, 3)) +>NUMBER : Symbol(NUMBER, Decl(incrementOperatorWithNumberType.ts, 1, 3)) + +var ResultIsNumber2 = NUMBER++; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(incrementOperatorWithNumberType.ts, 16, 3)) +>NUMBER : Symbol(NUMBER, Decl(incrementOperatorWithNumberType.ts, 1, 3)) + +// expressions +var ResultIsNumber3 = ++objA.a; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(incrementOperatorWithNumberType.ts, 19, 3)) +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) + +var ResultIsNumber4 = ++M.n; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(incrementOperatorWithNumberType.ts, 20, 3)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + +var ResultIsNumber5 = objA.a++; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(incrementOperatorWithNumberType.ts, 22, 3)) +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) + +var ResultIsNumber6 = M.n++; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(incrementOperatorWithNumberType.ts, 23, 3)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + +var ResultIsNumber7 = NUMBER1[0]++; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(incrementOperatorWithNumberType.ts, 24, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(incrementOperatorWithNumberType.ts, 2, 3)) + +// miss assignment operators +++NUMBER; +>NUMBER : Symbol(NUMBER, Decl(incrementOperatorWithNumberType.ts, 1, 3)) + +++NUMBER1[0]; +>NUMBER1 : Symbol(NUMBER1, Decl(incrementOperatorWithNumberType.ts, 2, 3)) + +++objA.a; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) + +++M.n; +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + +++objA.a, M.n; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + +NUMBER++; +>NUMBER : Symbol(NUMBER, Decl(incrementOperatorWithNumberType.ts, 1, 3)) + +NUMBER1[0]++; +>NUMBER1 : Symbol(NUMBER1, Decl(incrementOperatorWithNumberType.ts, 2, 3)) + +objA.a++; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) + +M.n++; +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + +objA.a++, M.n++; +>objA.a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>objA : Symbol(objA, Decl(incrementOperatorWithNumberType.ts, 11, 3)) +>a : Symbol(A.a, Decl(incrementOperatorWithNumberType.ts, 4, 9)) +>M.n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) +>M : Symbol(M, Decl(incrementOperatorWithNumberType.ts, 6, 1)) +>n : Symbol(M.n, Decl(incrementOperatorWithNumberType.ts, 8, 14)) + diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.types b/tests/baselines/reference/incrementOperatorWithNumberType.types index ad6ea172ae3..21211a3848c 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberType.types +++ b/tests/baselines/reference/incrementOperatorWithNumberType.types @@ -6,6 +6,8 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number class A { >A : A @@ -70,6 +72,7 @@ var ResultIsNumber7 = NUMBER1[0]++; >NUMBER1[0]++ : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number // miss assignment operators ++NUMBER; @@ -80,6 +83,7 @@ var ResultIsNumber7 = NUMBER1[0]++; >++NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number ++objA.a; >++objA.a : number @@ -111,6 +115,7 @@ NUMBER1[0]++; >NUMBER1[0]++ : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number objA.a++; >objA.a++ : number diff --git a/tests/baselines/reference/indexClassByNumber.symbols b/tests/baselines/reference/indexClassByNumber.symbols new file mode 100644 index 00000000000..068ec9484e3 --- /dev/null +++ b/tests/baselines/reference/indexClassByNumber.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/indexClassByNumber.ts === +// Shouldn't be able to index a class instance by a number (unless it has declared a number index signature) + +class foo { } +>foo : Symbol(foo, Decl(indexClassByNumber.ts, 0, 0)) + +var f = new foo(); +>f : Symbol(f, Decl(indexClassByNumber.ts, 4, 3)) +>foo : Symbol(foo, Decl(indexClassByNumber.ts, 0, 0)) + +f[0] = 4; // Shouldn't be allowed +>f : Symbol(f, Decl(indexClassByNumber.ts, 4, 3)) + diff --git a/tests/baselines/reference/indexClassByNumber.types b/tests/baselines/reference/indexClassByNumber.types index c58771d3256..b1fb79f256a 100644 --- a/tests/baselines/reference/indexClassByNumber.types +++ b/tests/baselines/reference/indexClassByNumber.types @@ -13,4 +13,6 @@ f[0] = 4; // Shouldn't be allowed >f[0] = 4 : number >f[0] : any >f : foo +>0 : number +>4 : number diff --git a/tests/baselines/reference/indexIntoEnum.symbols b/tests/baselines/reference/indexIntoEnum.symbols new file mode 100644 index 00000000000..9b6a4a7427a --- /dev/null +++ b/tests/baselines/reference/indexIntoEnum.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/indexIntoEnum.ts === +module M { +>M : Symbol(M, Decl(indexIntoEnum.ts, 0, 0)) + + enum E { } +>E : Symbol(E, Decl(indexIntoEnum.ts, 0, 10)) + + var x = E[0]; +>x : Symbol(x, Decl(indexIntoEnum.ts, 4, 7)) +>E : Symbol(E, Decl(indexIntoEnum.ts, 0, 10)) +} diff --git a/tests/baselines/reference/indexIntoEnum.types b/tests/baselines/reference/indexIntoEnum.types index 39849566409..3c0d91cd240 100644 --- a/tests/baselines/reference/indexIntoEnum.types +++ b/tests/baselines/reference/indexIntoEnum.types @@ -9,4 +9,5 @@ module M { >x : string >E[0] : string >E : typeof E +>0 : number } diff --git a/tests/baselines/reference/indexSignatureWithoutTypeAnnotation1..symbols b/tests/baselines/reference/indexSignatureWithoutTypeAnnotation1..symbols new file mode 100644 index 00000000000..7ab1bd72cd7 --- /dev/null +++ b/tests/baselines/reference/indexSignatureWithoutTypeAnnotation1..symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/indexSignatureWithoutTypeAnnotation1..ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.symbols b/tests/baselines/reference/indexSignaturesInferentialTyping.symbols new file mode 100644 index 00000000000..a34aa7a5cd1 --- /dev/null +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/indexSignaturesInferentialTyping.ts === +function foo(items: { [index: number]: T }): T { return undefined; } +>foo : Symbol(foo, Decl(indexSignaturesInferentialTyping.ts, 0, 0)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 0, 13)) +>items : Symbol(items, Decl(indexSignaturesInferentialTyping.ts, 0, 16)) +>index : Symbol(index, Decl(indexSignaturesInferentialTyping.ts, 0, 26)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 0, 13)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 0, 13)) +>undefined : Symbol(undefined) + +function bar(items: { [index: string]: T }): T { return undefined; } +>bar : Symbol(bar, Decl(indexSignaturesInferentialTyping.ts, 0, 71)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 1, 13)) +>items : Symbol(items, Decl(indexSignaturesInferentialTyping.ts, 1, 16)) +>index : Symbol(index, Decl(indexSignaturesInferentialTyping.ts, 1, 26)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 1, 13)) +>T : Symbol(T, Decl(indexSignaturesInferentialTyping.ts, 1, 13)) +>undefined : Symbol(undefined) + +var x1 = foo({ 0: 0, 1: 1 }); // type should be number +>x1 : Symbol(x1, Decl(indexSignaturesInferentialTyping.ts, 3, 3)) +>foo : Symbol(foo, Decl(indexSignaturesInferentialTyping.ts, 0, 0)) + +var x2 = foo({ zero: 0, one: 1 }); +>x2 : Symbol(x2, Decl(indexSignaturesInferentialTyping.ts, 4, 3)) +>foo : Symbol(foo, Decl(indexSignaturesInferentialTyping.ts, 0, 0)) +>zero : Symbol(zero, Decl(indexSignaturesInferentialTyping.ts, 4, 14)) +>one : Symbol(one, Decl(indexSignaturesInferentialTyping.ts, 4, 23)) + +var x3 = bar({ 0: 0, 1: 1 }); +>x3 : Symbol(x3, Decl(indexSignaturesInferentialTyping.ts, 5, 3)) +>bar : Symbol(bar, Decl(indexSignaturesInferentialTyping.ts, 0, 71)) + +var x4 = bar({ zero: 0, one: 1 }); // type should be number +>x4 : Symbol(x4, Decl(indexSignaturesInferentialTyping.ts, 6, 3)) +>bar : Symbol(bar, Decl(indexSignaturesInferentialTyping.ts, 0, 71)) +>zero : Symbol(zero, Decl(indexSignaturesInferentialTyping.ts, 6, 14)) +>one : Symbol(one, Decl(indexSignaturesInferentialTyping.ts, 6, 23)) + diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.types b/tests/baselines/reference/indexSignaturesInferentialTyping.types index 9ea5a390498..328dbc18e4f 100644 --- a/tests/baselines/reference/indexSignaturesInferentialTyping.types +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.types @@ -22,6 +22,8 @@ var x1 = foo({ 0: 0, 1: 1 }); // type should be number >foo({ 0: 0, 1: 1 }) : number >foo : (items: { [index: number]: T; }) => T >{ 0: 0, 1: 1 } : { [x: number]: number; 0: number; 1: number; } +>0 : number +>1 : number var x2 = foo({ zero: 0, one: 1 }); >x2 : any @@ -29,13 +31,17 @@ var x2 = foo({ zero: 0, one: 1 }); >foo : (items: { [index: number]: T; }) => T >{ zero: 0, one: 1 } : { [x: number]: undefined; zero: number; one: number; } >zero : number +>0 : number >one : number +>1 : number var x3 = bar({ 0: 0, 1: 1 }); >x3 : number >bar({ 0: 0, 1: 1 }) : number >bar : (items: { [index: string]: T; }) => T >{ 0: 0, 1: 1 } : { [x: string]: number; 0: number; 1: number; } +>0 : number +>1 : number var x4 = bar({ zero: 0, one: 1 }); // type should be number >x4 : number @@ -43,5 +49,7 @@ var x4 = bar({ zero: 0, one: 1 }); // type should be number >bar : (items: { [index: string]: T; }) => T >{ zero: 0, one: 1 } : { [x: string]: number; zero: number; one: number; } >zero : number +>0 : number >one : number +>1 : number diff --git a/tests/baselines/reference/indexer.symbols b/tests/baselines/reference/indexer.symbols new file mode 100644 index 00000000000..409bd8092d6 --- /dev/null +++ b/tests/baselines/reference/indexer.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/indexer.ts === +interface JQueryElement { +>JQueryElement : Symbol(JQueryElement, Decl(indexer.ts, 0, 0)) + + id:string; +>id : Symbol(id, Decl(indexer.ts, 0, 25)) +} + +interface JQuery { +>JQuery : Symbol(JQuery, Decl(indexer.ts, 2, 1)) + + [n:number]:JQueryElement; +>n : Symbol(n, Decl(indexer.ts, 5, 5)) +>JQueryElement : Symbol(JQueryElement, Decl(indexer.ts, 0, 0)) +} + +var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; +>jq : Symbol(jq, Decl(indexer.ts, 8, 3)) +>JQuery : Symbol(JQuery, Decl(indexer.ts, 2, 1)) +>id : Symbol(id, Decl(indexer.ts, 8, 20)) +>id : Symbol(id, Decl(indexer.ts, 8, 37)) + +jq[0].id; +>jq[0].id : Symbol(JQueryElement.id, Decl(indexer.ts, 0, 25)) +>jq : Symbol(jq, Decl(indexer.ts, 8, 3)) +>id : Symbol(JQueryElement.id, Decl(indexer.ts, 0, 25)) + diff --git a/tests/baselines/reference/indexer.types b/tests/baselines/reference/indexer.types index 9987fdde0b1..a0142bb9383 100644 --- a/tests/baselines/reference/indexer.types +++ b/tests/baselines/reference/indexer.types @@ -20,12 +20,15 @@ var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >{ 0: { id : "a" }, 1: { id : "b" } } : { [x: number]: { id: string; }; 0: { id: string; }; 1: { id: string; }; } >{ id : "a" } : { id: string; } >id : string +>"a" : string >{ id : "b" } : { id: string; } >id : string +>"b" : string jq[0].id; >jq[0].id : string >jq[0] : JQueryElement >jq : JQuery +>0 : number >id : string diff --git a/tests/baselines/reference/indexer2.symbols b/tests/baselines/reference/indexer2.symbols new file mode 100644 index 00000000000..c23debb925c --- /dev/null +++ b/tests/baselines/reference/indexer2.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/indexer2.ts === +interface IHeapObjectProperty {} +>IHeapObjectProperty : Symbol(IHeapObjectProperty, Decl(indexer2.ts, 0, 0)) + +interface IDirectChildrenMap { +>IDirectChildrenMap : Symbol(IDirectChildrenMap, Decl(indexer2.ts, 0, 32)) + + hasOwnProperty(objectId: number) : boolean; +>hasOwnProperty : Symbol(hasOwnProperty, Decl(indexer2.ts, 1, 30)) +>objectId : Symbol(objectId, Decl(indexer2.ts, 2, 23)) + + [objectId: number] : IHeapObjectProperty[]; +>objectId : Symbol(objectId, Decl(indexer2.ts, 3, 9)) +>IHeapObjectProperty : Symbol(IHeapObjectProperty, Decl(indexer2.ts, 0, 0)) +} +var directChildrenMap = {}; +>directChildrenMap : Symbol(directChildrenMap, Decl(indexer2.ts, 5, 3)) +>IDirectChildrenMap : Symbol(IDirectChildrenMap, Decl(indexer2.ts, 0, 32)) + diff --git a/tests/baselines/reference/indexer3.symbols b/tests/baselines/reference/indexer3.symbols new file mode 100644 index 00000000000..1de91806faa --- /dev/null +++ b/tests/baselines/reference/indexer3.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/indexer3.ts === +var dateMap: { [x: string]: Date; } = {} +>dateMap : Symbol(dateMap, Decl(indexer3.ts, 0, 3)) +>x : Symbol(x, Decl(indexer3.ts, 0, 16)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r: Date = dateMap["hello"] // result type includes indexer using BCT +>r : Symbol(r, Decl(indexer3.ts, 1, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>dateMap : Symbol(dateMap, Decl(indexer3.ts, 0, 3)) + diff --git a/tests/baselines/reference/indexer3.types b/tests/baselines/reference/indexer3.types index 7f660ab6aa9..8f0582f782a 100644 --- a/tests/baselines/reference/indexer3.types +++ b/tests/baselines/reference/indexer3.types @@ -10,4 +10,5 @@ var r: Date = dateMap["hello"] // result type includes indexer using BCT >Date : Date >dateMap["hello"] : Date >dateMap : { [x: string]: Date; } +>"hello" : string diff --git a/tests/baselines/reference/indexerA.symbols b/tests/baselines/reference/indexerA.symbols new file mode 100644 index 00000000000..d549c3359d9 --- /dev/null +++ b/tests/baselines/reference/indexerA.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/indexerA.ts === +class JQueryElement { +>JQueryElement : Symbol(JQueryElement, Decl(indexerA.ts, 0, 0)) + + id:string; +>id : Symbol(id, Decl(indexerA.ts, 0, 21)) +} + +class JQuery { +>JQuery : Symbol(JQuery, Decl(indexerA.ts, 2, 1)) + + [n:number]:JQueryElement +>n : Symbol(n, Decl(indexerA.ts, 5, 5)) +>JQueryElement : Symbol(JQueryElement, Decl(indexerA.ts, 0, 0)) +} + +var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; +>jq : Symbol(jq, Decl(indexerA.ts, 8, 3)) +>JQuery : Symbol(JQuery, Decl(indexerA.ts, 2, 1)) +>id : Symbol(id, Decl(indexerA.ts, 8, 20)) +>id : Symbol(id, Decl(indexerA.ts, 8, 37)) + +jq[0].id; +>jq[0].id : Symbol(JQueryElement.id, Decl(indexerA.ts, 0, 21)) +>jq : Symbol(jq, Decl(indexerA.ts, 8, 3)) +>id : Symbol(JQueryElement.id, Decl(indexerA.ts, 0, 21)) + diff --git a/tests/baselines/reference/indexerA.types b/tests/baselines/reference/indexerA.types index 39f7372c839..c6ff81b3a26 100644 --- a/tests/baselines/reference/indexerA.types +++ b/tests/baselines/reference/indexerA.types @@ -20,12 +20,15 @@ var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >{ 0: { id : "a" }, 1: { id : "b" } } : { [x: number]: { id: string; }; 0: { id: string; }; 1: { id: string; }; } >{ id : "a" } : { id: string; } >id : string +>"a" : string >{ id : "b" } : { id: string; } >id : string +>"b" : string jq[0].id; >jq[0].id : string >jq[0] : JQueryElement >jq : JQuery +>0 : number >id : string diff --git a/tests/baselines/reference/indexerReturningTypeParameter1.symbols b/tests/baselines/reference/indexerReturningTypeParameter1.symbols new file mode 100644 index 00000000000..0bb1e305c80 --- /dev/null +++ b/tests/baselines/reference/indexerReturningTypeParameter1.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/indexerReturningTypeParameter1.ts === +interface f { +>f : Symbol(f, Decl(indexerReturningTypeParameter1.ts, 0, 0)) + + groupBy(): { [key: string]: T[]; }; +>groupBy : Symbol(groupBy, Decl(indexerReturningTypeParameter1.ts, 0, 13)) +>T : Symbol(T, Decl(indexerReturningTypeParameter1.ts, 1, 12)) +>key : Symbol(key, Decl(indexerReturningTypeParameter1.ts, 1, 21)) +>T : Symbol(T, Decl(indexerReturningTypeParameter1.ts, 1, 12)) +} +var a: f; +>a : Symbol(a, Decl(indexerReturningTypeParameter1.ts, 3, 3)) +>f : Symbol(f, Decl(indexerReturningTypeParameter1.ts, 0, 0)) + +var r = a.groupBy(); +>r : Symbol(r, Decl(indexerReturningTypeParameter1.ts, 4, 3)) +>a.groupBy : Symbol(f.groupBy, Decl(indexerReturningTypeParameter1.ts, 0, 13)) +>a : Symbol(a, Decl(indexerReturningTypeParameter1.ts, 3, 3)) +>groupBy : Symbol(f.groupBy, Decl(indexerReturningTypeParameter1.ts, 0, 13)) + +class c { +>c : Symbol(c, Decl(indexerReturningTypeParameter1.ts, 4, 20)) + + groupBy(): { [key: string]: T[]; } { +>groupBy : Symbol(groupBy, Decl(indexerReturningTypeParameter1.ts, 6, 9)) +>T : Symbol(T, Decl(indexerReturningTypeParameter1.ts, 7, 12)) +>key : Symbol(key, Decl(indexerReturningTypeParameter1.ts, 7, 21)) +>T : Symbol(T, Decl(indexerReturningTypeParameter1.ts, 7, 12)) + + return null; + } +} +var a2: c; +>a2 : Symbol(a2, Decl(indexerReturningTypeParameter1.ts, 11, 3)) +>c : Symbol(c, Decl(indexerReturningTypeParameter1.ts, 4, 20)) + +var r2 = a2.groupBy(); +>r2 : Symbol(r2, Decl(indexerReturningTypeParameter1.ts, 12, 3)) +>a2.groupBy : Symbol(c.groupBy, Decl(indexerReturningTypeParameter1.ts, 6, 9)) +>a2 : Symbol(a2, Decl(indexerReturningTypeParameter1.ts, 11, 3)) +>groupBy : Symbol(c.groupBy, Decl(indexerReturningTypeParameter1.ts, 6, 9)) + diff --git a/tests/baselines/reference/indexerReturningTypeParameter1.types b/tests/baselines/reference/indexerReturningTypeParameter1.types index a0a70f95331..83028bef93f 100644 --- a/tests/baselines/reference/indexerReturningTypeParameter1.types +++ b/tests/baselines/reference/indexerReturningTypeParameter1.types @@ -29,6 +29,7 @@ class c { >T : T return null; +>null : null } } var a2: c; diff --git a/tests/baselines/reference/indexerWithTuple.symbols b/tests/baselines/reference/indexerWithTuple.symbols new file mode 100644 index 00000000000..1ce5afbefac --- /dev/null +++ b/tests/baselines/reference/indexerWithTuple.symbols @@ -0,0 +1,131 @@ +=== tests/cases/conformance/types/tuple/indexerWithTuple.ts === +var strNumTuple: [string, number] = ["foo", 10]; +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) + +var numTupleTuple: [number, [string, number]] = [10, ["bar", 20]]; +>numTupleTuple : Symbol(numTupleTuple, Decl(indexerWithTuple.ts, 1, 3)) + +var unionTuple1: [number, string| number] = [10, "foo"]; +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) + +var unionTuple2: [boolean, string| number] = [true, "foo"]; +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) + +// no error +var idx0 = 0; +>idx0 : Symbol(idx0, Decl(indexerWithTuple.ts, 6, 3)) + +var idx1 = 1; +>idx1 : Symbol(idx1, Decl(indexerWithTuple.ts, 7, 3)) + +var ele10 = strNumTuple[0]; // string +>ele10 : Symbol(ele10, Decl(indexerWithTuple.ts, 8, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>0 : Symbol(0) + +var ele11 = strNumTuple[1]; // number +>ele11 : Symbol(ele11, Decl(indexerWithTuple.ts, 9, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>1 : Symbol(1) + +var ele12 = strNumTuple[2]; // string | number +>ele12 : Symbol(ele12, Decl(indexerWithTuple.ts, 10, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) + +var ele13 = strNumTuple[idx0]; // string | number +>ele13 : Symbol(ele13, Decl(indexerWithTuple.ts, 11, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>idx0 : Symbol(idx0, Decl(indexerWithTuple.ts, 6, 3)) + +var ele14 = strNumTuple[idx1]; // string | number +>ele14 : Symbol(ele14, Decl(indexerWithTuple.ts, 12, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>idx1 : Symbol(idx1, Decl(indexerWithTuple.ts, 7, 3)) + +var ele15 = strNumTuple["0"]; // string +>ele15 : Symbol(ele15, Decl(indexerWithTuple.ts, 13, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>"0" : Symbol(0) + +var ele16 = strNumTuple["1"]; // number +>ele16 : Symbol(ele16, Decl(indexerWithTuple.ts, 14, 3)) +>strNumTuple : Symbol(strNumTuple, Decl(indexerWithTuple.ts, 0, 3)) +>"1" : Symbol(1) + +var strNumTuple1 = numTupleTuple[1]; //[string, number]; +>strNumTuple1 : Symbol(strNumTuple1, Decl(indexerWithTuple.ts, 15, 3)) +>numTupleTuple : Symbol(numTupleTuple, Decl(indexerWithTuple.ts, 1, 3)) +>1 : Symbol(1) + +var ele17 = numTupleTuple[2]; // number | [string, number] +>ele17 : Symbol(ele17, Decl(indexerWithTuple.ts, 16, 3)) +>numTupleTuple : Symbol(numTupleTuple, Decl(indexerWithTuple.ts, 1, 3)) + +var eleUnion10 = unionTuple1[0]; // number +>eleUnion10 : Symbol(eleUnion10, Decl(indexerWithTuple.ts, 17, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>0 : Symbol(0) + +var eleUnion11 = unionTuple1[1]; // string | number +>eleUnion11 : Symbol(eleUnion11, Decl(indexerWithTuple.ts, 18, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>1 : Symbol(1) + +var eleUnion12 = unionTuple1[2]; // string | number +>eleUnion12 : Symbol(eleUnion12, Decl(indexerWithTuple.ts, 19, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) + +var eleUnion13 = unionTuple1[idx0]; // string | number +>eleUnion13 : Symbol(eleUnion13, Decl(indexerWithTuple.ts, 20, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>idx0 : Symbol(idx0, Decl(indexerWithTuple.ts, 6, 3)) + +var eleUnion14 = unionTuple1[idx1]; // string | number +>eleUnion14 : Symbol(eleUnion14, Decl(indexerWithTuple.ts, 21, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>idx1 : Symbol(idx1, Decl(indexerWithTuple.ts, 7, 3)) + +var eleUnion15 = unionTuple1["0"]; // number +>eleUnion15 : Symbol(eleUnion15, Decl(indexerWithTuple.ts, 22, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>"0" : Symbol(0) + +var eleUnion16 = unionTuple1["1"]; // string | number +>eleUnion16 : Symbol(eleUnion16, Decl(indexerWithTuple.ts, 23, 3)) +>unionTuple1 : Symbol(unionTuple1, Decl(indexerWithTuple.ts, 2, 3)) +>"1" : Symbol(1) + +var eleUnion20 = unionTuple2[0]; // boolean +>eleUnion20 : Symbol(eleUnion20, Decl(indexerWithTuple.ts, 25, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>0 : Symbol(0) + +var eleUnion21 = unionTuple2[1]; // string | number +>eleUnion21 : Symbol(eleUnion21, Decl(indexerWithTuple.ts, 26, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>1 : Symbol(1) + +var eleUnion22 = unionTuple2[2]; // string | number | boolean +>eleUnion22 : Symbol(eleUnion22, Decl(indexerWithTuple.ts, 27, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) + +var eleUnion23 = unionTuple2[idx0]; // string | number | boolean +>eleUnion23 : Symbol(eleUnion23, Decl(indexerWithTuple.ts, 28, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>idx0 : Symbol(idx0, Decl(indexerWithTuple.ts, 6, 3)) + +var eleUnion24 = unionTuple2[idx1]; // string | number | boolean +>eleUnion24 : Symbol(eleUnion24, Decl(indexerWithTuple.ts, 29, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>idx1 : Symbol(idx1, Decl(indexerWithTuple.ts, 7, 3)) + +var eleUnion25 = unionTuple2["0"]; // boolean +>eleUnion25 : Symbol(eleUnion25, Decl(indexerWithTuple.ts, 30, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>"0" : Symbol(0) + +var eleUnion26 = unionTuple2["1"]; // string | number +>eleUnion26 : Symbol(eleUnion26, Decl(indexerWithTuple.ts, 31, 3)) +>unionTuple2 : Symbol(unionTuple2, Decl(indexerWithTuple.ts, 3, 3)) +>"1" : Symbol(1) + diff --git a/tests/baselines/reference/indexerWithTuple.types b/tests/baselines/reference/indexerWithTuple.types index 75b89ca6088..4faae2cda29 100644 --- a/tests/baselines/reference/indexerWithTuple.types +++ b/tests/baselines/reference/indexerWithTuple.types @@ -2,41 +2,55 @@ var strNumTuple: [string, number] = ["foo", 10]; >strNumTuple : [string, number] >["foo", 10] : [string, number] +>"foo" : string +>10 : number var numTupleTuple: [number, [string, number]] = [10, ["bar", 20]]; >numTupleTuple : [number, [string, number]] >[10, ["bar", 20]] : [number, [string, number]] +>10 : number >["bar", 20] : [string, number] +>"bar" : string +>20 : number var unionTuple1: [number, string| number] = [10, "foo"]; >unionTuple1 : [number, string | number] >[10, "foo"] : [number, string] +>10 : number +>"foo" : string var unionTuple2: [boolean, string| number] = [true, "foo"]; >unionTuple2 : [boolean, string | number] >[true, "foo"] : [boolean, string] +>true : boolean +>"foo" : string // no error var idx0 = 0; >idx0 : number +>0 : number var idx1 = 1; >idx1 : number +>1 : number var ele10 = strNumTuple[0]; // string >ele10 : string >strNumTuple[0] : string >strNumTuple : [string, number] +>0 : number var ele11 = strNumTuple[1]; // number >ele11 : number >strNumTuple[1] : number >strNumTuple : [string, number] +>1 : number var ele12 = strNumTuple[2]; // string | number >ele12 : string | number >strNumTuple[2] : string | number >strNumTuple : [string, number] +>2 : number var ele13 = strNumTuple[idx0]; // string | number >ele13 : string | number @@ -54,36 +68,43 @@ var ele15 = strNumTuple["0"]; // string >ele15 : string >strNumTuple["0"] : string >strNumTuple : [string, number] +>"0" : string var ele16 = strNumTuple["1"]; // number >ele16 : number >strNumTuple["1"] : number >strNumTuple : [string, number] +>"1" : string var strNumTuple1 = numTupleTuple[1]; //[string, number]; >strNumTuple1 : [string, number] >numTupleTuple[1] : [string, number] >numTupleTuple : [number, [string, number]] +>1 : number var ele17 = numTupleTuple[2]; // number | [string, number] >ele17 : number | [string, number] >numTupleTuple[2] : number | [string, number] >numTupleTuple : [number, [string, number]] +>2 : number var eleUnion10 = unionTuple1[0]; // number >eleUnion10 : number >unionTuple1[0] : number >unionTuple1 : [number, string | number] +>0 : number var eleUnion11 = unionTuple1[1]; // string | number >eleUnion11 : string | number >unionTuple1[1] : string | number >unionTuple1 : [number, string | number] +>1 : number var eleUnion12 = unionTuple1[2]; // string | number >eleUnion12 : string | number >unionTuple1[2] : string | number >unionTuple1 : [number, string | number] +>2 : number var eleUnion13 = unionTuple1[idx0]; // string | number >eleUnion13 : string | number @@ -101,26 +122,31 @@ var eleUnion15 = unionTuple1["0"]; // number >eleUnion15 : number >unionTuple1["0"] : number >unionTuple1 : [number, string | number] +>"0" : string var eleUnion16 = unionTuple1["1"]; // string | number >eleUnion16 : string | number >unionTuple1["1"] : string | number >unionTuple1 : [number, string | number] +>"1" : string var eleUnion20 = unionTuple2[0]; // boolean >eleUnion20 : boolean >unionTuple2[0] : boolean >unionTuple2 : [boolean, string | number] +>0 : number var eleUnion21 = unionTuple2[1]; // string | number >eleUnion21 : string | number >unionTuple2[1] : string | number >unionTuple2 : [boolean, string | number] +>1 : number var eleUnion22 = unionTuple2[2]; // string | number | boolean >eleUnion22 : string | number | boolean >unionTuple2[2] : string | number | boolean >unionTuple2 : [boolean, string | number] +>2 : number var eleUnion23 = unionTuple2[idx0]; // string | number | boolean >eleUnion23 : string | number | boolean @@ -138,9 +164,11 @@ var eleUnion25 = unionTuple2["0"]; // boolean >eleUnion25 : boolean >unionTuple2["0"] : boolean >unionTuple2 : [boolean, string | number] +>"0" : string var eleUnion26 = unionTuple2["1"]; // string | number >eleUnion26 : string | number >unionTuple2["1"] : string | number >unionTuple2 : [boolean, string | number] +>"1" : string diff --git a/tests/baselines/reference/indexersInClassType.symbols b/tests/baselines/reference/indexersInClassType.symbols new file mode 100644 index 00000000000..e459888cc0d --- /dev/null +++ b/tests/baselines/reference/indexersInClassType.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/classes/members/classTypes/indexersInClassType.ts === +class C { +>C : Symbol(C, Decl(indexersInClassType.ts, 0, 0)) + + [x: number]: Date; +>x : Symbol(x, Decl(indexersInClassType.ts, 1, 5)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + [x: string]: Object; +>x : Symbol(x, Decl(indexersInClassType.ts, 2, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + 1: Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + 'a': {} + + fn() { +>fn : Symbol(fn, Decl(indexersInClassType.ts, 4, 11)) + + return this; +>this : Symbol(C, Decl(indexersInClassType.ts, 0, 0)) + } +} + +var c = new C(); +>c : Symbol(c, Decl(indexersInClassType.ts, 11, 3)) +>C : Symbol(C, Decl(indexersInClassType.ts, 0, 0)) + +var r = c.fn(); +>r : Symbol(r, Decl(indexersInClassType.ts, 12, 3)) +>c.fn : Symbol(C.fn, Decl(indexersInClassType.ts, 4, 11)) +>c : Symbol(c, Decl(indexersInClassType.ts, 11, 3)) +>fn : Symbol(C.fn, Decl(indexersInClassType.ts, 4, 11)) + +var r2 = r[1]; +>r2 : Symbol(r2, Decl(indexersInClassType.ts, 13, 3)) +>r : Symbol(r, Decl(indexersInClassType.ts, 12, 3)) +>1 : Symbol(C.1, Decl(indexersInClassType.ts, 2, 24)) + +var r3 = r.a +>r3 : Symbol(r3, Decl(indexersInClassType.ts, 14, 3)) +>r.a : Symbol(C.'a', Decl(indexersInClassType.ts, 3, 12)) +>r : Symbol(r, Decl(indexersInClassType.ts, 12, 3)) +>a : Symbol(C.'a', Decl(indexersInClassType.ts, 3, 12)) + + diff --git a/tests/baselines/reference/indexersInClassType.types b/tests/baselines/reference/indexersInClassType.types index afc21b9ce8a..8e06bdfbfd3 100644 --- a/tests/baselines/reference/indexersInClassType.types +++ b/tests/baselines/reference/indexersInClassType.types @@ -39,6 +39,7 @@ var r2 = r[1]; >r2 : Date >r[1] : Date >r : C +>1 : number var r3 = r.a >r3 : {} diff --git a/tests/baselines/reference/inferSecondaryParameter.symbols b/tests/baselines/reference/inferSecondaryParameter.symbols new file mode 100644 index 00000000000..c2527ed14b3 --- /dev/null +++ b/tests/baselines/reference/inferSecondaryParameter.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/inferSecondaryParameter.ts === +// type inference on 'bug' should give 'any' + +interface Ib { m(test: string, fn: Function); } +>Ib : Symbol(Ib, Decl(inferSecondaryParameter.ts, 0, 0)) +>m : Symbol(m, Decl(inferSecondaryParameter.ts, 2, 14)) +>test : Symbol(test, Decl(inferSecondaryParameter.ts, 2, 17)) +>fn : Symbol(fn, Decl(inferSecondaryParameter.ts, 2, 30)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var b: Ib = { m: function (test: string, fn: Function) { } }; +>b : Symbol(b, Decl(inferSecondaryParameter.ts, 4, 3)) +>Ib : Symbol(Ib, Decl(inferSecondaryParameter.ts, 0, 0)) +>m : Symbol(m, Decl(inferSecondaryParameter.ts, 4, 13)) +>test : Symbol(test, Decl(inferSecondaryParameter.ts, 4, 27)) +>fn : Symbol(fn, Decl(inferSecondaryParameter.ts, 4, 40)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +b.m("test", function (bug) { +>b.m : Symbol(Ib.m, Decl(inferSecondaryParameter.ts, 2, 14)) +>b : Symbol(b, Decl(inferSecondaryParameter.ts, 4, 3)) +>m : Symbol(Ib.m, Decl(inferSecondaryParameter.ts, 2, 14)) +>bug : Symbol(bug, Decl(inferSecondaryParameter.ts, 6, 22)) + + var a: number = bug; +>a : Symbol(a, Decl(inferSecondaryParameter.ts, 7, 7)) +>bug : Symbol(bug, Decl(inferSecondaryParameter.ts, 6, 22)) + +}); diff --git a/tests/baselines/reference/inferSecondaryParameter.types b/tests/baselines/reference/inferSecondaryParameter.types index e416cface90..34dbb14ea66 100644 --- a/tests/baselines/reference/inferSecondaryParameter.types +++ b/tests/baselines/reference/inferSecondaryParameter.types @@ -23,6 +23,7 @@ b.m("test", function (bug) { >b.m : (test: string, fn: Function) => any >b : Ib >m : (test: string, fn: Function) => any +>"test" : string >function (bug) { var a: number = bug;} : (bug: any) => void >bug : any diff --git a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.symbols b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.symbols new file mode 100644 index 00000000000..22ab5fa4118 --- /dev/null +++ b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/inferTypeArgumentsInSignatureWithRestParameters.ts === +function f(array: T[], ...args) { } +>f : Symbol(f, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 0)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 11)) +>array : Symbol(array, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 14)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 11)) +>args : Symbol(args, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 25)) + +function g(array: number[], ...args) { } +>g : Symbol(g, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 38)) +>array : Symbol(array, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 1, 11)) +>args : Symbol(args, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 1, 27)) + +function h(nonarray: T, ...args) { } +>h : Symbol(h, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 1, 40)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 11)) +>nonarray : Symbol(nonarray, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 14)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 11)) +>args : Symbol(args, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 26)) + +function i(array: T[], opt?: any[]) { } +>i : Symbol(i, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 39)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 3, 11)) +>array : Symbol(array, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 3, 14)) +>T : Symbol(T, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 3, 11)) +>opt : Symbol(opt, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 3, 25)) + +var a = [1, 2, 3, 4, 5]; +>a : Symbol(a, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 4, 3)) + +f(a); // OK +>f : Symbol(f, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 0)) +>a : Symbol(a, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 4, 3)) + +g(a); // OK +>g : Symbol(g, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 0, 38)) +>a : Symbol(a, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 4, 3)) + +h(a); // OK +>h : Symbol(h, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 1, 40)) +>a : Symbol(a, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 4, 3)) + +i(a); // OK +>i : Symbol(i, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 2, 39)) +>a : Symbol(a, Decl(inferTypeArgumentsInSignatureWithRestParameters.ts, 4, 3)) + diff --git a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types index 5bf41c64b24..f4d94388f42 100644 --- a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types +++ b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types @@ -28,6 +28,11 @@ function i(array: T[], opt?: any[]) { } var a = [1, 2, 3, 4, 5]; >a : number[] >[1, 2, 3, 4, 5] : number[] +>1 : number +>2 : number +>3 : number +>4 : number +>5 : number f(a); // OK >f(a) : void diff --git a/tests/baselines/reference/inferenceFromParameterlessLambda.symbols b/tests/baselines/reference/inferenceFromParameterlessLambda.symbols new file mode 100644 index 00000000000..6170a4d1149 --- /dev/null +++ b/tests/baselines/reference/inferenceFromParameterlessLambda.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/inferenceFromParameterlessLambda.ts === +function foo(o: Take, i: Make) { } +>foo : Symbol(foo, Decl(inferenceFromParameterlessLambda.ts, 0, 0)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 0, 13)) +>o : Symbol(o, Decl(inferenceFromParameterlessLambda.ts, 0, 16)) +>Take : Symbol(Take, Decl(inferenceFromParameterlessLambda.ts, 3, 1)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 0, 13)) +>i : Symbol(i, Decl(inferenceFromParameterlessLambda.ts, 0, 27)) +>Make : Symbol(Make, Decl(inferenceFromParameterlessLambda.ts, 0, 43)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 0, 13)) + +interface Make { +>Make : Symbol(Make, Decl(inferenceFromParameterlessLambda.ts, 0, 43)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 1, 15)) + + (): T; +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 1, 15)) +} +interface Take { +>Take : Symbol(Take, Decl(inferenceFromParameterlessLambda.ts, 3, 1)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 4, 15)) + + (n: T): void; +>n : Symbol(n, Decl(inferenceFromParameterlessLambda.ts, 5, 5)) +>T : Symbol(T, Decl(inferenceFromParameterlessLambda.ts, 4, 15)) +} +// Infer string from second argument because it isn't context sensitive +foo(n => n.length, () => 'hi'); +>foo : Symbol(foo, Decl(inferenceFromParameterlessLambda.ts, 0, 0)) +>n : Symbol(n, Decl(inferenceFromParameterlessLambda.ts, 8, 4)) +>n.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>n : Symbol(n, Decl(inferenceFromParameterlessLambda.ts, 8, 4)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + diff --git a/tests/baselines/reference/inferenceFromParameterlessLambda.types b/tests/baselines/reference/inferenceFromParameterlessLambda.types index 8dbb8c5967c..57747d881f6 100644 --- a/tests/baselines/reference/inferenceFromParameterlessLambda.types +++ b/tests/baselines/reference/inferenceFromParameterlessLambda.types @@ -34,4 +34,5 @@ foo(n => n.length, () => 'hi'); >n : string >length : number >() => 'hi' : () => string +>'hi' : string diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType.symbols b/tests/baselines/reference/inferentialTypingWithFunctionType.symbols new file mode 100644 index 00000000000..6b5eac3e5b7 --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionType.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/inferentialTypingWithFunctionType.ts === +declare function map(x: T, f: (s: T) => U): U; +>map : Symbol(map, Decl(inferentialTypingWithFunctionType.ts, 0, 0)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionType.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionType.ts, 0, 23)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionType.ts, 0, 27)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionType.ts, 0, 21)) +>f : Symbol(f, Decl(inferentialTypingWithFunctionType.ts, 0, 32)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionType.ts, 0, 37)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionType.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionType.ts, 0, 23)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionType.ts, 0, 23)) + +declare function identity(y: V): V; +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionType.ts, 0, 52)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionType.ts, 1, 26)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionType.ts, 1, 29)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionType.ts, 1, 26)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionType.ts, 1, 26)) + +var s = map("", identity); +>s : Symbol(s, Decl(inferentialTypingWithFunctionType.ts, 3, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionType.ts, 0, 0)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionType.ts, 0, 52)) + diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType.types b/tests/baselines/reference/inferentialTypingWithFunctionType.types index 9f1986c49ea..460156c91ea 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType.types @@ -22,5 +22,6 @@ var s = map("", identity); >s : string >map("", identity) : string >map : (x: T, f: (s: T) => U) => U +>"" : string >identity : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.symbols b/tests/baselines/reference/inferentialTypingWithFunctionType2.symbols new file mode 100644 index 00000000000..5fcc91d816e --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/inferentialTypingWithFunctionType2.ts === +function identity(a: A): A { +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionType2.ts, 0, 0)) +>A : Symbol(A, Decl(inferentialTypingWithFunctionType2.ts, 0, 18)) +>a : Symbol(a, Decl(inferentialTypingWithFunctionType2.ts, 0, 21)) +>A : Symbol(A, Decl(inferentialTypingWithFunctionType2.ts, 0, 18)) +>A : Symbol(A, Decl(inferentialTypingWithFunctionType2.ts, 0, 18)) + + return a; +>a : Symbol(a, Decl(inferentialTypingWithFunctionType2.ts, 0, 21)) +} +var x = [1, 2, 3].map(identity)[0]; +>x : Symbol(x, Decl(inferentialTypingWithFunctionType2.ts, 3, 3)) +>[1, 2, 3].map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionType2.ts, 0, 0)) + diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.types b/tests/baselines/reference/inferentialTypingWithFunctionType2.types index a97bf2ab36c..6dc4cda3b68 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType2.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.types @@ -15,6 +15,10 @@ var x = [1, 2, 3].map(identity)[0]; >[1, 2, 3].map(identity) : number[] >[1, 2, 3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number >map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >identity : (a: A) => A +>0 : number diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.symbols b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.symbols new file mode 100644 index 00000000000..ae72021b31b --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/inferentialTypingWithFunctionTypeNested.ts === +declare function map(x: T, f: () => { x: (s: T) => U }): U; +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 0)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 23)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 27)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 21)) +>f : Symbol(f, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 32)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 43)) +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 48)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 23)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 23)) + +declare function identity(y: V): V; +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 65)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeNested.ts, 1, 26)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeNested.ts, 1, 29)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeNested.ts, 1, 26)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeNested.ts, 1, 26)) + +var s = map("", () => { return { x: identity }; }); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeNested.ts, 3, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 0)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeNested.ts, 3, 32)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeNested.ts, 0, 65)) + diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types index c411dd00514..a83379b4c73 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types @@ -23,6 +23,7 @@ var s = map("", () => { return { x: identity }; }); >s : string >map("", () => { return { x: identity }; }) : string >map : (x: T, f: () => { x: (s: T) => U; }) => U +>"" : string >() => { return { x: identity }; } : () => { x: (y: string) => string; } >{ x: identity } : { x: (y: V) => V; } >x : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols new file mode 100644 index 00000000000..a9571bc8a38 --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols @@ -0,0 +1,94 @@ +=== tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts === +declare function map(array: T, func: (x: T) => U): U; +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23)) +>array : Symbol(array, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 27)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21)) +>func : Symbol(func, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 36)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 44)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23)) + +declare function identity(y: V): V; +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 29)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26)) +>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26)) + +var s: string; +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) + +// dotted name +var dottedIdentity = { x: identity }; +>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + +s = map("", dottedIdentity.x); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>dottedIdentity.x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) +>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) + +// index expression +s = map("", dottedIdentity['x']); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3)) +>'x' : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22)) + +// function call +s = map("", (() => identity)()); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + +// construct +interface IdentityConstructor { +>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 12, 32)) + + new (): typeof identity; +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +} +var ic: IdentityConstructor; +>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 18, 3)) +>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 12, 32)) + +s = map("", new ic()); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 18, 3)) + +// assignment +var t; +>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 22, 3)) + +s = map("", t = identity); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 22, 3)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + +// type assertion +s = map("", identity); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + +// parenthesized expression +s = map("", (identity)); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + +// comma +s = map("", ("", identity)); +>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3)) +>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0)) +>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59)) + diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types index 115da50176f..5a4decef4dc 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types @@ -33,6 +33,7 @@ s = map("", dottedIdentity.x); >s : string >map("", dottedIdentity.x) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >dottedIdentity.x : (y: V) => V >dottedIdentity : { x: (y: V) => V; } >x : (y: V) => V @@ -43,8 +44,10 @@ s = map("", dottedIdentity['x']); >s : string >map("", dottedIdentity['x']) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >dottedIdentity['x'] : (y: V) => V >dottedIdentity : { x: (y: V) => V; } +>'x' : string // function call s = map("", (() => identity)()); @@ -52,6 +55,7 @@ s = map("", (() => identity)()); >s : string >map("", (() => identity)()) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >(() => identity)() : (y: V) => V >(() => identity) : () => (y: V) => V >() => identity : () => (y: V) => V @@ -73,6 +77,7 @@ s = map("", new ic()); >s : string >map("", new ic()) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >new ic() : (y: V) => V >ic : IdentityConstructor @@ -85,6 +90,7 @@ s = map("", t = identity); >s : string >map("", t = identity) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >t = identity : (y: V) => V >t : any >identity : (y: V) => V @@ -95,6 +101,7 @@ s = map("", identity); >s : string >map("", identity) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >identity : (y: V) => V >identity : (y: V) => V >identity : (y: V) => V @@ -105,6 +112,7 @@ s = map("", (identity)); >s : string >map("", (identity)) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >(identity) : (y: V) => V >identity : (y: V) => V @@ -114,7 +122,9 @@ s = map("", ("", identity)); >s : string >map("", ("", identity)) : string >map : (array: T, func: (x: T) => U) => U +>"" : string >("", identity) : (y: V) => V >"", identity : (y: V) => V +>"" : string >identity : (y: V) => V diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.symbols b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.symbols new file mode 100644 index 00000000000..144d3426f7a --- /dev/null +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/inferentialTypingWithFunctionTypeZip.ts === +var pair: (x: T) => (y: S) => { x: T; y: S; } +>pair : Symbol(pair, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 3)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 11)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 13)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 17)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 11)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 27)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 13)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 37)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 11)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 43)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 13)) + +var zipWith: (a: T[], b: S[], f: (x: T) => (y: S) => U) => U[]; +>zipWith : Symbol(zipWith, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 3)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 14)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 16)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 19)) +>a : Symbol(a, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 23)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 14)) +>b : Symbol(b, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 30)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 16)) +>f : Symbol(f, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 38)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 43)) +>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 14)) +>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 53)) +>S : Symbol(S, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 16)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 19)) +>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 19)) + +var result = zipWith([1, 2], ['a', 'b'], pair); +>result : Symbol(result, Decl(inferentialTypingWithFunctionTypeZip.ts, 2, 3)) +>zipWith : Symbol(zipWith, Decl(inferentialTypingWithFunctionTypeZip.ts, 1, 3)) +>pair : Symbol(pair, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 3)) + +var i = result[0].x; // number +>i : Symbol(i, Decl(inferentialTypingWithFunctionTypeZip.ts, 3, 3)) +>result[0].x : Symbol(x, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 37)) +>result : Symbol(result, Decl(inferentialTypingWithFunctionTypeZip.ts, 2, 3)) +>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeZip.ts, 0, 37)) + diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types index 53a9dff0b48..cc9d8790bd4 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types @@ -34,7 +34,11 @@ var result = zipWith([1, 2], ['a', 'b'], pair); >zipWith([1, 2], ['a', 'b'], pair) : { x: number; y: {}; }[] >zipWith : (a: T[], b: S[], f: (x: T) => (y: S) => U) => U[] >[1, 2] : number[] +>1 : number +>2 : number >['a', 'b'] : string[] +>'a' : string +>'b' : string >pair : (x: T) => (y: S) => { x: T; y: S; } var i = result[0].x; // number @@ -42,5 +46,6 @@ var i = result[0].x; // number >result[0].x : number >result[0] : { x: number; y: {}; } >result : { x: number; y: {}; }[] +>0 : number >x : number diff --git a/tests/baselines/reference/inferentiallyTypingAnEmptyArray.symbols b/tests/baselines/reference/inferentiallyTypingAnEmptyArray.symbols new file mode 100644 index 00000000000..b53f21579da --- /dev/null +++ b/tests/baselines/reference/inferentiallyTypingAnEmptyArray.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/inferentiallyTypingAnEmptyArray.ts === +// April 2014, Section 4.6: +// In the absence of a contextual type, the type of an array literal is C[], where C is the +// Undefined type(section 3.2.6) if the array literal is empty, or the best common type of +// the element expressions if the array literal is not empty. +// When an array literal is contextually typed(section 4.19) by an object type containing a +// numeric index signature of type T, each element expression is contextually typed by T and +// the type of the array literal is the best common type of T and the types of the element +// expressions. +// +// While the spec does not say it, an inferential type causes an empty array literal to have +// the undefined[] type. In other words, the first clause from the excerpt above applies even +// though there is a "contextual type" present. This is the intention, even though the spec +// seems to imply the contrary. +// Therefore, the following access to bar should not cause an error because we infer +// the undefined[] type. +declare function foo(arr: T[]): T; +>foo : Symbol(foo, Decl(inferentiallyTypingAnEmptyArray.ts, 0, 0)) +>T : Symbol(T, Decl(inferentiallyTypingAnEmptyArray.ts, 15, 21)) +>arr : Symbol(arr, Decl(inferentiallyTypingAnEmptyArray.ts, 15, 24)) +>T : Symbol(T, Decl(inferentiallyTypingAnEmptyArray.ts, 15, 21)) +>T : Symbol(T, Decl(inferentiallyTypingAnEmptyArray.ts, 15, 21)) + +foo([]).bar; +>foo : Symbol(foo, Decl(inferentiallyTypingAnEmptyArray.ts, 0, 0)) + diff --git a/tests/baselines/reference/infiniteExpandingTypeThroughInheritanceInstantiation.symbols b/tests/baselines/reference/infiniteExpandingTypeThroughInheritanceInstantiation.symbols new file mode 100644 index 00000000000..2640ec367dc --- /dev/null +++ b/tests/baselines/reference/infiniteExpandingTypeThroughInheritanceInstantiation.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/infiniteExpandingTypeThroughInheritanceInstantiation.ts === +interface A +>A : Symbol(A, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 12)) +{ + x: A> +>x : Symbol(x, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 1, 1)) +>A : Symbol(A, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 0)) +>B : Symbol(B, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 3, 1)) +>T : Symbol(T, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 12)) +} + +interface B extends A // error +>B : Symbol(B, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 3, 1)) +>T : Symbol(T, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 5, 12)) +>A : Symbol(A, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 5, 12)) +{ + x: B> +>x : Symbol(x, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 6, 1)) +>B : Symbol(B, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 3, 1)) +>A : Symbol(A, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpandingTypeThroughInheritanceInstantiation.ts, 5, 12)) +} + diff --git a/tests/baselines/reference/infiniteExpansionThroughTypeInference.symbols b/tests/baselines/reference/infiniteExpansionThroughTypeInference.symbols new file mode 100644 index 00000000000..ba90d5c74a8 --- /dev/null +++ b/tests/baselines/reference/infiniteExpansionThroughTypeInference.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughTypeInference.ts === +interface G { +>G : Symbol(G, Decl(infiniteExpansionThroughTypeInference.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpansionThroughTypeInference.ts, 0, 12)) + + x: G> // infinitely expanding type reference +>x : Symbol(x, Decl(infiniteExpansionThroughTypeInference.ts, 0, 16)) +>G : Symbol(G, Decl(infiniteExpansionThroughTypeInference.ts, 0, 0)) +>G : Symbol(G, Decl(infiniteExpansionThroughTypeInference.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpansionThroughTypeInference.ts, 0, 12)) + + y: T +>y : Symbol(y, Decl(infiniteExpansionThroughTypeInference.ts, 1, 14)) +>T : Symbol(T, Decl(infiniteExpansionThroughTypeInference.ts, 0, 12)) +} + +function ff(g: G): void { +>ff : Symbol(ff, Decl(infiniteExpansionThroughTypeInference.ts, 3, 1)) +>T : Symbol(T, Decl(infiniteExpansionThroughTypeInference.ts, 5, 12)) +>g : Symbol(g, Decl(infiniteExpansionThroughTypeInference.ts, 5, 15)) +>G : Symbol(G, Decl(infiniteExpansionThroughTypeInference.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpansionThroughTypeInference.ts, 5, 12)) + + ff(g) // when infering T here we need to make sure to not descend into the structure of G infinitely +>ff : Symbol(ff, Decl(infiniteExpansionThroughTypeInference.ts, 3, 1)) +>g : Symbol(g, Decl(infiniteExpansionThroughTypeInference.ts, 5, 15)) +} + + diff --git a/tests/baselines/reference/infinitelyExpandingBaseTypes1.symbols b/tests/baselines/reference/infinitelyExpandingBaseTypes1.symbols new file mode 100644 index 00000000000..dc3456602bb --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingBaseTypes1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/infinitelyExpandingBaseTypes1.ts === +interface A +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 0, 12)) +{ + x : A> +>x : Symbol(x, Decl(infinitelyExpandingBaseTypes1.ts, 1, 1)) +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes1.ts, 0, 0)) +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 0, 12)) +} + +interface B +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes1.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 5, 12)) +{ + x : B +>x : Symbol(x, Decl(infinitelyExpandingBaseTypes1.ts, 6, 1)) +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes1.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 5, 12)) +} + +interface C extends A, B { } +>C : Symbol(C, Decl(infinitelyExpandingBaseTypes1.ts, 8, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 10, 12)) +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 10, 12)) +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes1.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes1.ts, 10, 12)) + + + diff --git a/tests/baselines/reference/infinitelyExpandingBaseTypes2.symbols b/tests/baselines/reference/infinitelyExpandingBaseTypes2.symbols new file mode 100644 index 00000000000..8379ea16878 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingBaseTypes2.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/infinitelyExpandingBaseTypes2.ts === +interface A +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes2.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes2.ts, 0, 12)) +{ + x : A<()=>T> +>x : Symbol(x, Decl(infinitelyExpandingBaseTypes2.ts, 1, 1)) +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes2.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes2.ts, 0, 12)) +} + +interface B +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes2.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes2.ts, 5, 12)) +{ + x : B<()=>T> +>x : Symbol(x, Decl(infinitelyExpandingBaseTypes2.ts, 6, 1)) +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes2.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyExpandingBaseTypes2.ts, 5, 12)) +} + +var a: A +>a : Symbol(a, Decl(infinitelyExpandingBaseTypes2.ts, 10, 3)) +>A : Symbol(A, Decl(infinitelyExpandingBaseTypes2.ts, 0, 0)) + +var b: B = a +>b : Symbol(b, Decl(infinitelyExpandingBaseTypes2.ts, 11, 3)) +>B : Symbol(B, Decl(infinitelyExpandingBaseTypes2.ts, 3, 1)) +>a : Symbol(a, Decl(infinitelyExpandingBaseTypes2.ts, 10, 3)) + diff --git a/tests/baselines/reference/infinitelyExpandingTypeAssignability.symbols b/tests/baselines/reference/infinitelyExpandingTypeAssignability.symbols new file mode 100644 index 00000000000..1907ff33cf6 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypeAssignability.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/infinitelyExpandingTypeAssignability.ts === +interface A { +>A : Symbol(A, Decl(infinitelyExpandingTypeAssignability.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 0, 12)) + + x : T +>x : Symbol(x, Decl(infinitelyExpandingTypeAssignability.ts, 0, 16)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 0, 12)) +} + +interface B extends A>>> { } +>B : Symbol(B, Decl(infinitelyExpandingTypeAssignability.ts, 2, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 4, 12)) +>A : Symbol(A, Decl(infinitelyExpandingTypeAssignability.ts, 0, 0)) +>B : Symbol(B, Decl(infinitelyExpandingTypeAssignability.ts, 2, 1)) +>B : Symbol(B, Decl(infinitelyExpandingTypeAssignability.ts, 2, 1)) +>B : Symbol(B, Decl(infinitelyExpandingTypeAssignability.ts, 2, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 4, 12)) + +interface C extends A>>> { } +>C : Symbol(C, Decl(infinitelyExpandingTypeAssignability.ts, 4, 40)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 6, 12)) +>A : Symbol(A, Decl(infinitelyExpandingTypeAssignability.ts, 0, 0)) +>C : Symbol(C, Decl(infinitelyExpandingTypeAssignability.ts, 4, 40)) +>C : Symbol(C, Decl(infinitelyExpandingTypeAssignability.ts, 4, 40)) +>C : Symbol(C, Decl(infinitelyExpandingTypeAssignability.ts, 4, 40)) +>T : Symbol(T, Decl(infinitelyExpandingTypeAssignability.ts, 6, 12)) + +var x : B +>x : Symbol(x, Decl(infinitelyExpandingTypeAssignability.ts, 8, 3)) +>B : Symbol(B, Decl(infinitelyExpandingTypeAssignability.ts, 2, 1)) + +var y : C = x +>y : Symbol(y, Decl(infinitelyExpandingTypeAssignability.ts, 9, 3)) +>C : Symbol(C, Decl(infinitelyExpandingTypeAssignability.ts, 4, 40)) +>x : Symbol(x, Decl(infinitelyExpandingTypeAssignability.ts, 8, 3)) + diff --git a/tests/baselines/reference/infinitelyExpandingTypes3.symbols b/tests/baselines/reference/infinitelyExpandingTypes3.symbols new file mode 100644 index 00000000000..fbc14afc80f --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes3.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/infinitelyExpandingTypes3.ts === +interface List { +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes3.ts, 0, 15)) + + data: T; +>data : Symbol(data, Decl(infinitelyExpandingTypes3.ts, 0, 19)) +>T : Symbol(T, Decl(infinitelyExpandingTypes3.ts, 0, 15)) + + next: List; // will be recursive reference when OwnerList is expanded +>next : Symbol(next, Decl(infinitelyExpandingTypes3.ts, 1, 12)) +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes3.ts, 0, 15)) + + owner: OwnerList; +>owner : Symbol(owner, Decl(infinitelyExpandingTypes3.ts, 2, 18)) +>OwnerList : Symbol(OwnerList, Decl(infinitelyExpandingTypes3.ts, 4, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypes3.ts, 0, 15)) +} + +interface OwnerList extends List> { +>OwnerList : Symbol(OwnerList, Decl(infinitelyExpandingTypes3.ts, 4, 1)) +>U : Symbol(U, Decl(infinitelyExpandingTypes3.ts, 6, 20)) +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>U : Symbol(U, Decl(infinitelyExpandingTypes3.ts, 6, 20)) + + name: string; +>name : Symbol(name, Decl(infinitelyExpandingTypes3.ts, 6, 46)) +} + +interface OwnerList2 extends List> { +>OwnerList2 : Symbol(OwnerList2, Decl(infinitelyExpandingTypes3.ts, 8, 1)) +>U : Symbol(U, Decl(infinitelyExpandingTypes3.ts, 10, 21)) +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>List : Symbol(List, Decl(infinitelyExpandingTypes3.ts, 0, 0)) +>U : Symbol(U, Decl(infinitelyExpandingTypes3.ts, 10, 21)) + + name: string; +>name : Symbol(name, Decl(infinitelyExpandingTypes3.ts, 10, 47)) +} + +var o1: OwnerList; +>o1 : Symbol(o1, Decl(infinitelyExpandingTypes3.ts, 14, 3)) +>OwnerList : Symbol(OwnerList, Decl(infinitelyExpandingTypes3.ts, 4, 1)) + +var o2: OwnerList2; +>o2 : Symbol(o2, Decl(infinitelyExpandingTypes3.ts, 15, 3)) +>OwnerList2 : Symbol(OwnerList2, Decl(infinitelyExpandingTypes3.ts, 8, 1)) + +o1 = o2; // should not error +>o1 : Symbol(o1, Decl(infinitelyExpandingTypes3.ts, 14, 3)) +>o2 : Symbol(o2, Decl(infinitelyExpandingTypes3.ts, 15, 3)) + diff --git a/tests/baselines/reference/infinitelyExpandingTypes4.symbols b/tests/baselines/reference/infinitelyExpandingTypes4.symbols new file mode 100644 index 00000000000..af0aee01216 --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes4.symbols @@ -0,0 +1,73 @@ +=== tests/cases/compiler/infinitelyExpandingTypes4.ts === +interface Query { +>Query : Symbol(Query, Decl(infinitelyExpandingTypes4.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 0, 16)) + + // ... + groupBy(keySelector: (item: T) => K): Query>; +>groupBy : Symbol(groupBy, Decl(infinitelyExpandingTypes4.ts, 0, 20)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 2, 12)) +>keySelector : Symbol(keySelector, Decl(infinitelyExpandingTypes4.ts, 2, 15)) +>item : Symbol(item, Decl(infinitelyExpandingTypes4.ts, 2, 29)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 0, 16)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 2, 12)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes4.ts, 0, 0)) +>Grouping : Symbol(Grouping, Decl(infinitelyExpandingTypes4.ts, 10, 1)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 2, 12)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 0, 16)) + + // ... +} + +interface QueryEnumerator { +>QueryEnumerator : Symbol(QueryEnumerator, Decl(infinitelyExpandingTypes4.ts, 4, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 6, 26)) + + // ... + groupBy(keySelector: (item: T) => K): QueryEnumerator>; +>groupBy : Symbol(groupBy, Decl(infinitelyExpandingTypes4.ts, 6, 30)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 8, 12)) +>keySelector : Symbol(keySelector, Decl(infinitelyExpandingTypes4.ts, 8, 15)) +>item : Symbol(item, Decl(infinitelyExpandingTypes4.ts, 8, 29)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 6, 26)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 8, 12)) +>QueryEnumerator : Symbol(QueryEnumerator, Decl(infinitelyExpandingTypes4.ts, 4, 1)) +>Grouping : Symbol(Grouping, Decl(infinitelyExpandingTypes4.ts, 10, 1)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 8, 12)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 6, 26)) + + // ... +} + +interface Grouping extends Query { +>Grouping : Symbol(Grouping, Decl(infinitelyExpandingTypes4.ts, 10, 1)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 12, 19)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 12, 21)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes4.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes4.ts, 12, 21)) + + key(): K; +>key : Symbol(key, Decl(infinitelyExpandingTypes4.ts, 12, 43)) +>K : Symbol(K, Decl(infinitelyExpandingTypes4.ts, 12, 19)) +} + +var q1: Query; +>q1 : Symbol(q1, Decl(infinitelyExpandingTypes4.ts, 16, 3)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes4.ts, 0, 0)) + +var q2: QueryEnumerator; +>q2 : Symbol(q2, Decl(infinitelyExpandingTypes4.ts, 17, 3)) +>QueryEnumerator : Symbol(QueryEnumerator, Decl(infinitelyExpandingTypes4.ts, 4, 1)) + +var q3: Query; +>q3 : Symbol(q3, Decl(infinitelyExpandingTypes4.ts, 18, 3)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes4.ts, 0, 0)) + +q1 = q2; // should error +>q1 : Symbol(q1, Decl(infinitelyExpandingTypes4.ts, 16, 3)) +>q2 : Symbol(q2, Decl(infinitelyExpandingTypes4.ts, 17, 3)) + +q1 = q3; // should not error +>q1 : Symbol(q1, Decl(infinitelyExpandingTypes4.ts, 16, 3)) +>q3 : Symbol(q3, Decl(infinitelyExpandingTypes4.ts, 18, 3)) + diff --git a/tests/baselines/reference/infinitelyExpandingTypes5.symbols b/tests/baselines/reference/infinitelyExpandingTypes5.symbols new file mode 100644 index 00000000000..d67d605559e --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypes5.symbols @@ -0,0 +1,49 @@ +=== tests/cases/compiler/infinitelyExpandingTypes5.ts === +interface Query { +>Query : Symbol(Query, Decl(infinitelyExpandingTypes5.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 0, 16)) + + foo(x: T): Query; +>foo : Symbol(foo, Decl(infinitelyExpandingTypes5.ts, 0, 20)) +>x : Symbol(x, Decl(infinitelyExpandingTypes5.ts, 1, 8)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 0, 16)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes5.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 0, 16)) +} + +interface Enumerator { +>Enumerator : Symbol(Enumerator, Decl(infinitelyExpandingTypes5.ts, 2, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 4, 21)) + + (action: (item: T, index: number) => boolean): boolean; +>action : Symbol(action, Decl(infinitelyExpandingTypes5.ts, 5, 5)) +>item : Symbol(item, Decl(infinitelyExpandingTypes5.ts, 5, 14)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 4, 21)) +>index : Symbol(index, Decl(infinitelyExpandingTypes5.ts, 5, 22)) +} + +function from(array: T[]): Query; +>from : Symbol(from, Decl(infinitelyExpandingTypes5.ts, 6, 1), Decl(infinitelyExpandingTypes5.ts, 8, 39), Decl(infinitelyExpandingTypes5.ts, 9, 54)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 8, 14)) +>array : Symbol(array, Decl(infinitelyExpandingTypes5.ts, 8, 17)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 8, 14)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes5.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 8, 14)) + +function from(enumerator: Enumerator): Query; +>from : Symbol(from, Decl(infinitelyExpandingTypes5.ts, 6, 1), Decl(infinitelyExpandingTypes5.ts, 8, 39), Decl(infinitelyExpandingTypes5.ts, 9, 54)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 9, 14)) +>enumerator : Symbol(enumerator, Decl(infinitelyExpandingTypes5.ts, 9, 17)) +>Enumerator : Symbol(Enumerator, Decl(infinitelyExpandingTypes5.ts, 2, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 9, 14)) +>Query : Symbol(Query, Decl(infinitelyExpandingTypes5.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 9, 14)) + +function from(arg: any): any { +>from : Symbol(from, Decl(infinitelyExpandingTypes5.ts, 6, 1), Decl(infinitelyExpandingTypes5.ts, 8, 39), Decl(infinitelyExpandingTypes5.ts, 9, 54)) +>arg : Symbol(arg, Decl(infinitelyExpandingTypes5.ts, 10, 14)) + + return undefined; +>undefined : Symbol(undefined) +} + diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.symbols b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.symbols new file mode 100644 index 00000000000..dfa5d6e03ed --- /dev/null +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.symbols @@ -0,0 +1,55 @@ +=== tests/cases/compiler/infinitelyExpandingTypesNonGenericBase.ts === +class Functionality { +>Functionality : Symbol(Functionality, Decl(infinitelyExpandingTypesNonGenericBase.ts, 0, 0)) +>V : Symbol(V, Decl(infinitelyExpandingTypesNonGenericBase.ts, 0, 20)) + + property: Options; +>property : Symbol(property, Decl(infinitelyExpandingTypesNonGenericBase.ts, 0, 24)) +>Options : Symbol(Options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 13, 1)) +>V : Symbol(V, Decl(infinitelyExpandingTypesNonGenericBase.ts, 0, 20)) +} + +class Base { +>Base : Symbol(Base, Decl(infinitelyExpandingTypesNonGenericBase.ts, 2, 1)) +} + +class A extends Base { +>A : Symbol(A, Decl(infinitelyExpandingTypesNonGenericBase.ts, 5, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 7, 8)) +>Base : Symbol(Base, Decl(infinitelyExpandingTypesNonGenericBase.ts, 2, 1)) + + options: Options[]>; +>options : Symbol(options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 7, 25)) +>Options : Symbol(Options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 13, 1)) +>Functionality : Symbol(Functionality, Decl(infinitelyExpandingTypesNonGenericBase.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 7, 8)) +} + +interface OptionsBase { +>OptionsBase : Symbol(OptionsBase, Decl(infinitelyExpandingTypesNonGenericBase.ts, 9, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 11, 22)) + + Options: Options; +>Options : Symbol(Options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 11, 26)) +>Options : Symbol(Options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 13, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 11, 22)) +} + +interface Options extends OptionsBase { +>Options : Symbol(Options, Decl(infinitelyExpandingTypesNonGenericBase.ts, 13, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 15, 18)) +>OptionsBase : Symbol(OptionsBase, Decl(infinitelyExpandingTypesNonGenericBase.ts, 9, 1)) +>T : Symbol(T, Decl(infinitelyExpandingTypesNonGenericBase.ts, 15, 18)) +} + + +function o(type: new () => Base) { +>o : Symbol(o, Decl(infinitelyExpandingTypesNonGenericBase.ts, 16, 1)) +>type : Symbol(type, Decl(infinitelyExpandingTypesNonGenericBase.ts, 19, 11)) +>Base : Symbol(Base, Decl(infinitelyExpandingTypesNonGenericBase.ts, 2, 1)) +} + +o(A); +>o : Symbol(o, Decl(infinitelyExpandingTypesNonGenericBase.ts, 16, 1)) +>A : Symbol(A, Decl(infinitelyExpandingTypesNonGenericBase.ts, 5, 1)) + diff --git a/tests/baselines/reference/infinitelyGenerativeInheritance1.symbols b/tests/baselines/reference/infinitelyGenerativeInheritance1.symbols new file mode 100644 index 00000000000..54ecd9c965b --- /dev/null +++ b/tests/baselines/reference/infinitelyGenerativeInheritance1.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/infinitelyGenerativeInheritance1.ts === +interface Stack { +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 0, 16)) + + pop(): T +>pop : Symbol(pop, Decl(infinitelyGenerativeInheritance1.ts, 0, 20)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 0, 16)) + + zip(a: Stack): Stack<{ x: T; y: S }> +>zip : Symbol(zip, Decl(infinitelyGenerativeInheritance1.ts, 1, 14)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 2, 10)) +>a : Symbol(a, Decl(infinitelyGenerativeInheritance1.ts, 2, 13)) +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 2, 10)) +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>x : Symbol(x, Decl(infinitelyGenerativeInheritance1.ts, 2, 34)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 0, 16)) +>y : Symbol(y, Decl(infinitelyGenerativeInheritance1.ts, 2, 40)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 2, 10)) +} + +interface MyStack extends Stack { +>MyStack : Symbol(MyStack, Decl(infinitelyGenerativeInheritance1.ts, 3, 1)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 5, 18)) +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 5, 18)) + + zip(a: Stack): Stack<{ x: T; y: S }> +>zip : Symbol(zip, Decl(infinitelyGenerativeInheritance1.ts, 5, 39)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 6, 10)) +>a : Symbol(a, Decl(infinitelyGenerativeInheritance1.ts, 6, 13)) +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 6, 10)) +>Stack : Symbol(Stack, Decl(infinitelyGenerativeInheritance1.ts, 0, 0)) +>x : Symbol(x, Decl(infinitelyGenerativeInheritance1.ts, 6, 34)) +>T : Symbol(T, Decl(infinitelyGenerativeInheritance1.ts, 5, 18)) +>y : Symbol(y, Decl(infinitelyGenerativeInheritance1.ts, 6, 40)) +>S : Symbol(S, Decl(infinitelyGenerativeInheritance1.ts, 6, 10)) +} + diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.symbols b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.symbols new file mode 100644 index 00000000000..55655889ca4 --- /dev/null +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/inheritSameNamePrivatePropertiesFromSameOrigin.ts === +class B { +>B : Symbol(B, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 0, 0)) + + private x: number; +>x : Symbol(x, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 0, 9)) +} +class C extends B { } +>C : Symbol(C, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 2, 1)) +>B : Symbol(B, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 0, 0)) + +class C2 extends B { } +>C2 : Symbol(C2, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 3, 21)) +>B : Symbol(B, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 0, 0)) + +interface A extends C, C2 { // ok +>A : Symbol(A, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 5, 22)) +>C : Symbol(C, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 2, 1)) +>C2 : Symbol(C2, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 3, 21)) + + y: string; +>y : Symbol(y, Decl(inheritSameNamePrivatePropertiesFromSameOrigin.ts, 7, 27)) +} diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.symbols b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.symbols new file mode 100644 index 00000000000..4c496fcc240 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/inheritanceMemberFuncOverridingMethod.ts === +class a { +>a : Symbol(a, Decl(inheritanceMemberFuncOverridingMethod.ts, 0, 0)) + + x() { +>x : Symbol(x, Decl(inheritanceMemberFuncOverridingMethod.ts, 0, 9)) + + return "10"; + } +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceMemberFuncOverridingMethod.ts, 4, 1)) +>a : Symbol(a, Decl(inheritanceMemberFuncOverridingMethod.ts, 0, 0)) + + x() { +>x : Symbol(x, Decl(inheritanceMemberFuncOverridingMethod.ts, 6, 19)) + + return "20"; + } +} diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types index e30d307e943..3f170d1a6ec 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.types @@ -6,6 +6,7 @@ class a { >x : () => string return "10"; +>"10" : string } } @@ -17,5 +18,6 @@ class b extends a { >x : () => string return "20"; +>"20" : string } } diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.symbols b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.symbols new file mode 100644 index 00000000000..bf755882165 --- /dev/null +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/inheritanceMemberPropertyOverridingProperty.ts === +class a { +>a : Symbol(a, Decl(inheritanceMemberPropertyOverridingProperty.ts, 0, 0)) + + x: () => string; +>x : Symbol(x, Decl(inheritanceMemberPropertyOverridingProperty.ts, 0, 9)) +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceMemberPropertyOverridingProperty.ts, 2, 1)) +>a : Symbol(a, Decl(inheritanceMemberPropertyOverridingProperty.ts, 0, 0)) + + x: () => string; +>x : Symbol(x, Decl(inheritanceMemberPropertyOverridingProperty.ts, 4, 19)) +} diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.symbols b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.symbols new file mode 100644 index 00000000000..9c65c2e3655 --- /dev/null +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/inheritanceOfGenericConstructorMethod1.ts === +class A { } +>A : Symbol(A, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 0)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 8)) + +class B extends A {} +>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod1.ts, 1, 8)) +>A : Symbol(A, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 0)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod1.ts, 1, 8)) + +var a = new A(); +>a : Symbol(a, Decl(inheritanceOfGenericConstructorMethod1.ts, 2, 3)) +>A : Symbol(A, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var b1 = new B(); // no error +>b1 : Symbol(b1, Decl(inheritanceOfGenericConstructorMethod1.ts, 3, 3)) +>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) + +var b2: B = new B(); // no error +>b2 : Symbol(b2, Decl(inheritanceOfGenericConstructorMethod1.ts, 4, 3)) +>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var b3 = new B(); // error, could not select overload for 'new' expression +>b3 : Symbol(b3, Decl(inheritanceOfGenericConstructorMethod1.ts, 5, 3)) +>B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.symbols b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.symbols new file mode 100644 index 00000000000..8fe59ed1927 --- /dev/null +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/inheritanceOfGenericConstructorMethod2.ts === +module M { +>M : Symbol(M, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 0)) + + export class C1 { } +>C1 : Symbol(C1, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 10)) + + export class C2 { } +>C2 : Symbol(C2, Decl(inheritanceOfGenericConstructorMethod2.ts, 1, 22)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod2.ts, 2, 19)) +} +module N { +>N : Symbol(N, Decl(inheritanceOfGenericConstructorMethod2.ts, 3, 1)) + + export class D1 extends M.C1 { } +>D1 : Symbol(D1, Decl(inheritanceOfGenericConstructorMethod2.ts, 4, 10)) +>M.C1 : Symbol(M.C1, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 10)) +>M : Symbol(M, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 0)) +>C1 : Symbol(M.C1, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 10)) + + export class D2 extends M.C2 { } +>D2 : Symbol(D2, Decl(inheritanceOfGenericConstructorMethod2.ts, 5, 35)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod2.ts, 6, 19)) +>M.C2 : Symbol(M.C2, Decl(inheritanceOfGenericConstructorMethod2.ts, 1, 22)) +>M : Symbol(M, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 0)) +>C2 : Symbol(M.C2, Decl(inheritanceOfGenericConstructorMethod2.ts, 1, 22)) +>T : Symbol(T, Decl(inheritanceOfGenericConstructorMethod2.ts, 6, 19)) +} + +var c = new M.C2(); // no error +>c : Symbol(c, Decl(inheritanceOfGenericConstructorMethod2.ts, 9, 3)) +>M.C2 : Symbol(M.C2, Decl(inheritanceOfGenericConstructorMethod2.ts, 1, 22)) +>M : Symbol(M, Decl(inheritanceOfGenericConstructorMethod2.ts, 0, 0)) +>C2 : Symbol(M.C2, Decl(inheritanceOfGenericConstructorMethod2.ts, 1, 22)) + +var n = new N.D1(); // no error +>n : Symbol(n, Decl(inheritanceOfGenericConstructorMethod2.ts, 10, 3)) +>N.D1 : Symbol(N.D1, Decl(inheritanceOfGenericConstructorMethod2.ts, 4, 10)) +>N : Symbol(N, Decl(inheritanceOfGenericConstructorMethod2.ts, 3, 1)) +>D1 : Symbol(N.D1, Decl(inheritanceOfGenericConstructorMethod2.ts, 4, 10)) + +var n2 = new N.D2(); // error +>n2 : Symbol(n2, Decl(inheritanceOfGenericConstructorMethod2.ts, 11, 3)) +>N.D2 : Symbol(N.D2, Decl(inheritanceOfGenericConstructorMethod2.ts, 5, 35)) +>N : Symbol(N, Decl(inheritanceOfGenericConstructorMethod2.ts, 3, 1)) +>D2 : Symbol(N.D2, Decl(inheritanceOfGenericConstructorMethod2.ts, 5, 35)) + +var n3 = new N.D2(); // no error, D2 +>n3 : Symbol(n3, Decl(inheritanceOfGenericConstructorMethod2.ts, 12, 3)) +>N.D2 : Symbol(N.D2, Decl(inheritanceOfGenericConstructorMethod2.ts, 5, 35)) +>N : Symbol(N, Decl(inheritanceOfGenericConstructorMethod2.ts, 3, 1)) +>D2 : Symbol(N.D2, Decl(inheritanceOfGenericConstructorMethod2.ts, 5, 35)) + diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types index 69b2ebb608d..119b6a19046 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.types @@ -14,12 +14,14 @@ module N { export class D1 extends M.C1 { } >D1 : D1 +>M.C1 : any >M : typeof M >C1 : M.C1 export class D2 extends M.C2 { } >D2 : D2 >T : T +>M.C2 : any >M : typeof M >C2 : M.C2 >T : T diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.symbols b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.symbols new file mode 100644 index 00000000000..55e595e89be --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/inheritanceStaticFuncOverridingMethod.ts === +class a { +>a : Symbol(a, Decl(inheritanceStaticFuncOverridingMethod.ts, 0, 0)) + + static x() { +>x : Symbol(a.x, Decl(inheritanceStaticFuncOverridingMethod.ts, 0, 9)) + + return "10"; + } +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceStaticFuncOverridingMethod.ts, 4, 1)) +>a : Symbol(a, Decl(inheritanceStaticFuncOverridingMethod.ts, 0, 0)) + + static x() { +>x : Symbol(b.x, Decl(inheritanceStaticFuncOverridingMethod.ts, 6, 19)) + + return "20"; + } +} diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types index ec7b3f5bbf9..22fa0a6660f 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types @@ -6,6 +6,7 @@ class a { >x : () => string return "10"; +>"10" : string } } @@ -17,5 +18,6 @@ class b extends a { >x : () => string return "20"; +>"20" : string } } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.symbols b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.symbols new file mode 100644 index 00000000000..50a8db2e792 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/inheritanceStaticFuncOverridingPropertyOfFuncType.ts === +class a { +>a : Symbol(a, Decl(inheritanceStaticFuncOverridingPropertyOfFuncType.ts, 0, 0)) + + static x: () => string; +>x : Symbol(a.x, Decl(inheritanceStaticFuncOverridingPropertyOfFuncType.ts, 0, 9)) +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceStaticFuncOverridingPropertyOfFuncType.ts, 2, 1)) +>a : Symbol(a, Decl(inheritanceStaticFuncOverridingPropertyOfFuncType.ts, 0, 0)) + + static x() { +>x : Symbol(b.x, Decl(inheritanceStaticFuncOverridingPropertyOfFuncType.ts, 4, 19)) + + return "20"; + } +} diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types index 842f9ffddf9..a7df20382ec 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types @@ -14,5 +14,6 @@ class b extends a { >x : () => string return "20"; +>"20" : string } } diff --git a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.symbols b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.symbols new file mode 100644 index 00000000000..bf2f3d3aa15 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/inheritanceStaticFunctionOverridingInstanceProperty.ts === +class a { +>a : Symbol(a, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 0, 0)) + + x: string; +>x : Symbol(x, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 0, 9)) +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 2, 1)) +>a : Symbol(a, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 0, 0)) + + static x() { +>x : Symbol(b.x, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 4, 19)) + + return new b().x; +>new b().x : Symbol(a.x, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 0, 9)) +>b : Symbol(b, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 2, 1)) +>x : Symbol(a.x, Decl(inheritanceStaticFunctionOverridingInstanceProperty.ts, 0, 9)) + } +} diff --git a/tests/baselines/reference/inheritanceStaticMembersCompatible.symbols b/tests/baselines/reference/inheritanceStaticMembersCompatible.symbols new file mode 100644 index 00000000000..da502ae6428 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticMembersCompatible.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/inheritanceStaticMembersCompatible.ts === +class a { +>a : Symbol(a, Decl(inheritanceStaticMembersCompatible.ts, 0, 0)) + + static x: a; +>x : Symbol(a.x, Decl(inheritanceStaticMembersCompatible.ts, 0, 9)) +>a : Symbol(a, Decl(inheritanceStaticMembersCompatible.ts, 0, 0)) +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceStaticMembersCompatible.ts, 2, 1)) +>a : Symbol(a, Decl(inheritanceStaticMembersCompatible.ts, 0, 0)) + + static x: b; +>x : Symbol(b.x, Decl(inheritanceStaticMembersCompatible.ts, 4, 19)) +>b : Symbol(b, Decl(inheritanceStaticMembersCompatible.ts, 2, 1)) +} diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.symbols b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.symbols new file mode 100644 index 00000000000..a084b245815 --- /dev/null +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/inheritanceStaticPropertyOverridingProperty.ts === +class a { +>a : Symbol(a, Decl(inheritanceStaticPropertyOverridingProperty.ts, 0, 0)) + + static x: () => string; +>x : Symbol(a.x, Decl(inheritanceStaticPropertyOverridingProperty.ts, 0, 9)) +} + +class b extends a { +>b : Symbol(b, Decl(inheritanceStaticPropertyOverridingProperty.ts, 2, 1)) +>a : Symbol(a, Decl(inheritanceStaticPropertyOverridingProperty.ts, 0, 0)) + + static x: () => string; +>x : Symbol(b.x, Decl(inheritanceStaticPropertyOverridingProperty.ts, 4, 19)) +} diff --git a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.symbols b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.symbols new file mode 100644 index 00000000000..a76a4aad7fa --- /dev/null +++ b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/inheritedFunctionAssignmentCompatibility.ts === +interface IResultCallback extends Function { } +>IResultCallback : Symbol(IResultCallback, Decl(inheritedFunctionAssignmentCompatibility.ts, 0, 0)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +function fn(cb: IResultCallback) { } +>fn : Symbol(fn, Decl(inheritedFunctionAssignmentCompatibility.ts, 0, 46)) +>cb : Symbol(cb, Decl(inheritedFunctionAssignmentCompatibility.ts, 2, 12)) +>IResultCallback : Symbol(IResultCallback, Decl(inheritedFunctionAssignmentCompatibility.ts, 0, 0)) + +fn((a, b) => true); +>fn : Symbol(fn, Decl(inheritedFunctionAssignmentCompatibility.ts, 0, 46)) +>a : Symbol(a, Decl(inheritedFunctionAssignmentCompatibility.ts, 4, 4)) +>b : Symbol(b, Decl(inheritedFunctionAssignmentCompatibility.ts, 4, 6)) + +fn(function (a, b) { return true; }) +>fn : Symbol(fn, Decl(inheritedFunctionAssignmentCompatibility.ts, 0, 46)) +>a : Symbol(a, Decl(inheritedFunctionAssignmentCompatibility.ts, 5, 13)) +>b : Symbol(b, Decl(inheritedFunctionAssignmentCompatibility.ts, 5, 15)) + + diff --git a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types index c24c0545c3e..b13fde1189a 100644 --- a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types +++ b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types @@ -14,6 +14,7 @@ fn((a, b) => true); >(a, b) => true : (a: any, b: any) => boolean >a : any >b : any +>true : boolean fn(function (a, b) { return true; }) >fn(function (a, b) { return true; }) : void @@ -21,5 +22,6 @@ fn(function (a, b) { return true; }) >function (a, b) { return true; } : (a: any, b: any) => boolean >a : any >b : any +>true : boolean diff --git a/tests/baselines/reference/inheritedGenericCallSignature.symbols b/tests/baselines/reference/inheritedGenericCallSignature.symbols new file mode 100644 index 00000000000..49170401165 --- /dev/null +++ b/tests/baselines/reference/inheritedGenericCallSignature.symbols @@ -0,0 +1,50 @@ +=== tests/cases/compiler/inheritedGenericCallSignature.ts === + +interface I1 { +>I1 : Symbol(I1, Decl(inheritedGenericCallSignature.ts, 0, 0)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 1, 13)) + + (a: T): T; +>a : Symbol(a, Decl(inheritedGenericCallSignature.ts, 3, 5)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 1, 13)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 1, 13)) + +} + + +interface Object {} +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11), Decl(inheritedGenericCallSignature.ts, 5, 1)) + + + +interface I2 extends I1 { +>I2 : Symbol(I2, Decl(inheritedGenericCallSignature.ts, 8, 19)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 12, 13)) +>I1 : Symbol(I1, Decl(inheritedGenericCallSignature.ts, 0, 0)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 12, 13)) + + b: T; +>b : Symbol(b, Decl(inheritedGenericCallSignature.ts, 12, 33)) +>T : Symbol(T, Decl(inheritedGenericCallSignature.ts, 12, 13)) + +} + + + +var x: I2; +>x : Symbol(x, Decl(inheritedGenericCallSignature.ts, 20, 3)) +>I2 : Symbol(I2, Decl(inheritedGenericCallSignature.ts, 8, 19)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + + +var y = x(undefined); +>y : Symbol(y, Decl(inheritedGenericCallSignature.ts, 24, 3)) +>x : Symbol(x, Decl(inheritedGenericCallSignature.ts, 20, 3)) +>undefined : Symbol(undefined) + +y.length; // should not error +>y.length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) +>y : Symbol(y, Decl(inheritedGenericCallSignature.ts, 24, 3)) +>length : Symbol(Array.length, Decl(lib.d.ts, 1007, 20)) + diff --git a/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases2.symbols b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases2.symbols new file mode 100644 index 00000000000..2cc31a14f7f --- /dev/null +++ b/tests/baselines/reference/inheritedMembersAndIndexSignaturesFromDifferentBases2.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/inheritedMembersAndIndexSignaturesFromDifferentBases2.ts === +interface A { +>A : Symbol(A, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 0, 0)) +>T : Symbol(T, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 0, 12)) + + [n: number]: T; +>n : Symbol(n, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 1, 5)) +>T : Symbol(T, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 0, 12)) +} + +interface B { +>B : Symbol(B, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 2, 1)) + + foo: number; +>foo : Symbol(foo, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 4, 13)) +} + +interface C extends B, A { } // Should succeed +>C : Symbol(C, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 6, 1)) +>B : Symbol(B, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 2, 1)) +>A : Symbol(A, Decl(inheritedMembersAndIndexSignaturesFromDifferentBases2.ts, 0, 0)) + diff --git a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.symbols b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.symbols new file mode 100644 index 00000000000..1b1c6b21beb --- /dev/null +++ b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.symbols @@ -0,0 +1,124 @@ +=== tests/cases/compiler/inheritedOverloadedSpecializedSignatures.ts === +interface A { +>A : Symbol(A, Decl(inheritedOverloadedSpecializedSignatures.ts, 0, 0), Decl(inheritedOverloadedSpecializedSignatures.ts, 10, 19), Decl(inheritedOverloadedSpecializedSignatures.ts, 19, 1)) + + (key:string):void; +>key : Symbol(key, Decl(inheritedOverloadedSpecializedSignatures.ts, 1, 3)) +} + +interface B extends A { +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) +>A : Symbol(A, Decl(inheritedOverloadedSpecializedSignatures.ts, 0, 0), Decl(inheritedOverloadedSpecializedSignatures.ts, 10, 19), Decl(inheritedOverloadedSpecializedSignatures.ts, 19, 1)) + + (key:'foo'):string; +>key : Symbol(key, Decl(inheritedOverloadedSpecializedSignatures.ts, 5, 3)) +} + +var b:B; +>b : Symbol(b, Decl(inheritedOverloadedSpecializedSignatures.ts, 8, 3)) +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) + +// Should not error +b('foo').charAt(0); +>b('foo').charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>b : Symbol(b, Decl(inheritedOverloadedSpecializedSignatures.ts, 8, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +interface A { +>A : Symbol(A, Decl(inheritedOverloadedSpecializedSignatures.ts, 0, 0), Decl(inheritedOverloadedSpecializedSignatures.ts, 10, 19), Decl(inheritedOverloadedSpecializedSignatures.ts, 19, 1)) + + (x: 'A1'): string; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 13, 5)) + + (x: string): void; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 14, 5)) +} + +interface B extends A { +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) +>A : Symbol(A, Decl(inheritedOverloadedSpecializedSignatures.ts, 0, 0), Decl(inheritedOverloadedSpecializedSignatures.ts, 10, 19), Decl(inheritedOverloadedSpecializedSignatures.ts, 19, 1)) + + (x: 'B1'): number; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 18, 5)) +} + +interface A { +>A : Symbol(A, Decl(inheritedOverloadedSpecializedSignatures.ts, 0, 0), Decl(inheritedOverloadedSpecializedSignatures.ts, 10, 19), Decl(inheritedOverloadedSpecializedSignatures.ts, 19, 1)) + + (x: 'A2'): boolean; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 22, 5)) +} + +interface B { +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) + + (x: 'B2'): string[]; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 26, 5)) +} + +interface C1 extends B { +>C1 : Symbol(C1, Decl(inheritedOverloadedSpecializedSignatures.ts, 27, 1)) +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) + + (x: 'C1'): number[]; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 30, 2)) +} + +interface C2 extends B { +>C2 : Symbol(C2, Decl(inheritedOverloadedSpecializedSignatures.ts, 31, 1)) +>B : Symbol(B, Decl(inheritedOverloadedSpecializedSignatures.ts, 2, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 15, 1), Decl(inheritedOverloadedSpecializedSignatures.ts, 23, 1)) + + (x: 'C2'): boolean[]; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 34, 2)) +} + +interface C extends C1, C2 { +>C : Symbol(C, Decl(inheritedOverloadedSpecializedSignatures.ts, 35, 1)) +>C1 : Symbol(C1, Decl(inheritedOverloadedSpecializedSignatures.ts, 27, 1)) +>C2 : Symbol(C2, Decl(inheritedOverloadedSpecializedSignatures.ts, 31, 1)) + + (x: 'C'): string; +>x : Symbol(x, Decl(inheritedOverloadedSpecializedSignatures.ts, 38, 2)) +} + +var c: C; +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) +>C : Symbol(C, Decl(inheritedOverloadedSpecializedSignatures.ts, 35, 1)) + +// none of these lines should error +var x1: string[] = c('B2'); +>x1 : Symbol(x1, Decl(inheritedOverloadedSpecializedSignatures.ts, 43, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x2: number = c('B1'); +>x2 : Symbol(x2, Decl(inheritedOverloadedSpecializedSignatures.ts, 44, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x3: boolean = c('A2'); +>x3 : Symbol(x3, Decl(inheritedOverloadedSpecializedSignatures.ts, 45, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x4: string = c('A1'); +>x4 : Symbol(x4, Decl(inheritedOverloadedSpecializedSignatures.ts, 46, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x5: void = c('A0'); +>x5 : Symbol(x5, Decl(inheritedOverloadedSpecializedSignatures.ts, 47, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x6: number[] = c('C1'); +>x6 : Symbol(x6, Decl(inheritedOverloadedSpecializedSignatures.ts, 48, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x7: boolean[] = c('C2'); +>x7 : Symbol(x7, Decl(inheritedOverloadedSpecializedSignatures.ts, 49, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x8: string = c('C'); +>x8 : Symbol(x8, Decl(inheritedOverloadedSpecializedSignatures.ts, 50, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + +var x9: void = c('generic'); +>x9 : Symbol(x9, Decl(inheritedOverloadedSpecializedSignatures.ts, 51, 3)) +>c : Symbol(c, Decl(inheritedOverloadedSpecializedSignatures.ts, 41, 3)) + diff --git a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types index dcbab74b681..dc8b9b465d8 100644 --- a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types +++ b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types @@ -24,7 +24,9 @@ b('foo').charAt(0); >b('foo').charAt : (pos: number) => string >b('foo') : string >b : B +>'foo' : string >charAt : (pos: number) => string +>0 : number interface A { >A : A @@ -92,44 +94,53 @@ var x1: string[] = c('B2'); >x1 : string[] >c('B2') : string[] >c : C +>'B2' : string var x2: number = c('B1'); >x2 : number >c('B1') : number >c : C +>'B1' : string var x3: boolean = c('A2'); >x3 : boolean >c('A2') : boolean >c : C +>'A2' : string var x4: string = c('A1'); >x4 : string >c('A1') : string >c : C +>'A1' : string var x5: void = c('A0'); >x5 : void >c('A0') : void >c : C +>'A0' : string var x6: number[] = c('C1'); >x6 : number[] >c('C1') : number[] >c : C +>'C1' : string var x7: boolean[] = c('C2'); >x7 : boolean[] >c('C2') : boolean[] >c : C +>'C2' : string var x8: string = c('C'); >x8 : string >c('C') : string >c : C +>'C' : string var x9: void = c('generic'); >x9 : void >c('generic') : void >c : C +>'generic' : string diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.js b/tests/baselines/reference/initializePropertiesWithRenamedLet.js index d4f985bea56..d53fed8c0f7 100644 --- a/tests/baselines/reference/initializePropertiesWithRenamedLet.js +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.js @@ -25,8 +25,8 @@ if (true) { } var x, y, z; if (true) { - var x_1 = ({ x: 0 }).x; - var y_1 = ({ y: 0 }).y; + var x_1 = { x: 0 }.x; + var y_1 = { y: 0 }.y; var z_1; (_a = { z: 0 }, z_1 = _a.z, _a); (_b = { z: 0 }, z_1 = _b.z, _b); diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.symbols b/tests/baselines/reference/initializePropertiesWithRenamedLet.symbols new file mode 100644 index 00000000000..203508ddf98 --- /dev/null +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/initializePropertiesWithRenamedLet.ts === + +var x0; +>x0 : Symbol(x0, Decl(initializePropertiesWithRenamedLet.ts, 1, 3)) + +if (true) { + let x0; +>x0 : Symbol(x0, Decl(initializePropertiesWithRenamedLet.ts, 3, 7)) + + var obj1 = { x0: x0 }; +>obj1 : Symbol(obj1, Decl(initializePropertiesWithRenamedLet.ts, 4, 7)) +>x0 : Symbol(x0, Decl(initializePropertiesWithRenamedLet.ts, 4, 16)) +>x0 : Symbol(x0, Decl(initializePropertiesWithRenamedLet.ts, 3, 7)) + + var obj2 = { x0 }; +>obj2 : Symbol(obj2, Decl(initializePropertiesWithRenamedLet.ts, 5, 7)) +>x0 : Symbol(x0, Decl(initializePropertiesWithRenamedLet.ts, 5, 16)) +} + +var x, y, z; +>x : Symbol(x, Decl(initializePropertiesWithRenamedLet.ts, 8, 3)) +>y : Symbol(y, Decl(initializePropertiesWithRenamedLet.ts, 8, 6)) +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 8, 9)) + +if (true) { + let { x: x } = { x: 0 }; +>x : Symbol(x, Decl(initializePropertiesWithRenamedLet.ts, 10, 9)) +>x : Symbol(x, Decl(initializePropertiesWithRenamedLet.ts, 10, 20)) + + let { y } = { y: 0 }; +>y : Symbol(y, Decl(initializePropertiesWithRenamedLet.ts, 11, 9)) +>y : Symbol(y, Decl(initializePropertiesWithRenamedLet.ts, 11, 17)) + + let z; +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 12, 7)) + + ({ z: z } = { z: 0 }); +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 13, 6)) +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 12, 7)) +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 13, 17)) + + ({ z } = { z: 0 }); +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 14, 6)) +>z : Symbol(z, Decl(initializePropertiesWithRenamedLet.ts, 14, 14)) +} diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.types b/tests/baselines/reference/initializePropertiesWithRenamedLet.types index 77f16756fdb..3c6938cd643 100644 --- a/tests/baselines/reference/initializePropertiesWithRenamedLet.types +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.types @@ -4,6 +4,8 @@ var x0; >x0 : any if (true) { +>true : boolean + let x0; >x0 : any @@ -25,16 +27,20 @@ var x, y, z; >z : any if (true) { +>true : boolean + let { x: x } = { x: 0 }; ->x : unknown +>x : any >x : number >{ x: 0 } : { x: number; } >x : number +>0 : number let { y } = { y: 0 }; >y : number >{ y: 0 } : { y: number; } >y : number +>0 : number let z; >z : any @@ -47,6 +53,7 @@ if (true) { >z : any >{ z: 0 } : { z: number; } >z : number +>0 : number ({ z } = { z: 0 }); >({ z } = { z: 0 }) : { z: number; } @@ -55,4 +62,5 @@ if (true) { >z : any >{ z: 0 } : { z: number; } >z : number +>0 : number } diff --git a/tests/baselines/reference/initializersWidened.symbols b/tests/baselines/reference/initializersWidened.symbols new file mode 100644 index 00000000000..625c066a058 --- /dev/null +++ b/tests/baselines/reference/initializersWidened.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/types/typeRelationships/widenedTypes/initializersWidened.ts === +// these are widened to any at the point of assignment + +var x = null; +>x : Symbol(x, Decl(initializersWidened.ts, 2, 3)) + +var y = undefined; +>y : Symbol(y, Decl(initializersWidened.ts, 3, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/initializersWidened.types b/tests/baselines/reference/initializersWidened.types index f09d43115c5..15705589246 100644 --- a/tests/baselines/reference/initializersWidened.types +++ b/tests/baselines/reference/initializersWidened.types @@ -3,6 +3,7 @@ var x = null; >x : any +>null : null var y = undefined; >y : any diff --git a/tests/baselines/reference/innerAliases2.symbols b/tests/baselines/reference/innerAliases2.symbols new file mode 100644 index 00000000000..541fc03ffbd --- /dev/null +++ b/tests/baselines/reference/innerAliases2.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/innerAliases2.ts === +module _provider { +>_provider : Symbol(_provider, Decl(innerAliases2.ts, 0, 0)) + + export class UsefulClass { +>UsefulClass : Symbol(UsefulClass, Decl(innerAliases2.ts, 0, 18)) + + public foo() { +>foo : Symbol(foo, Decl(innerAliases2.ts, 1, 42)) + } + } +} + +module consumer { +>consumer : Symbol(consumer, Decl(innerAliases2.ts, 5, 1)) + + import provider = _provider; +>provider : Symbol(provider, Decl(innerAliases2.ts, 7, 17)) +>_provider : Symbol(provider, Decl(innerAliases2.ts, 0, 0)) + + var g:provider.UsefulClass= null; +>g : Symbol(g, Decl(innerAliases2.ts, 10, 19)) +>provider : Symbol(provider, Decl(innerAliases2.ts, 7, 17)) +>UsefulClass : Symbol(provider.UsefulClass, Decl(innerAliases2.ts, 0, 18)) + + function use():provider.UsefulClass { +>use : Symbol(use, Decl(innerAliases2.ts, 10, 49)) +>provider : Symbol(provider, Decl(innerAliases2.ts, 7, 17)) +>UsefulClass : Symbol(provider.UsefulClass, Decl(innerAliases2.ts, 0, 18)) + + var p2:provider.UsefulClass= new provider.UsefulClass(); +>p2 : Symbol(p2, Decl(innerAliases2.ts, 13, 35)) +>provider : Symbol(provider, Decl(innerAliases2.ts, 7, 17)) +>UsefulClass : Symbol(provider.UsefulClass, Decl(innerAliases2.ts, 0, 18)) +>provider.UsefulClass : Symbol(provider.UsefulClass, Decl(innerAliases2.ts, 0, 18)) +>provider : Symbol(provider, Decl(innerAliases2.ts, 7, 17)) +>UsefulClass : Symbol(provider.UsefulClass, Decl(innerAliases2.ts, 0, 18)) + + return p2; +>p2 : Symbol(p2, Decl(innerAliases2.ts, 13, 35)) + } +} + + diff --git a/tests/baselines/reference/innerAliases2.types b/tests/baselines/reference/innerAliases2.types index ee8c18f93b4..127497e3869 100644 --- a/tests/baselines/reference/innerAliases2.types +++ b/tests/baselines/reference/innerAliases2.types @@ -20,17 +20,18 @@ module consumer { var g:provider.UsefulClass= null; >g : provider.UsefulClass ->provider : unknown +>provider : any >UsefulClass : provider.UsefulClass +>null : null function use():provider.UsefulClass { >use : () => provider.UsefulClass ->provider : unknown +>provider : any >UsefulClass : provider.UsefulClass var p2:provider.UsefulClass= new provider.UsefulClass(); >p2 : provider.UsefulClass ->provider : unknown +>provider : any >UsefulClass : provider.UsefulClass >new provider.UsefulClass() : provider.UsefulClass >provider.UsefulClass : typeof provider.UsefulClass diff --git a/tests/baselines/reference/innerBoundLambdaEmit.symbols b/tests/baselines/reference/innerBoundLambdaEmit.symbols new file mode 100644 index 00000000000..689aa7d075b --- /dev/null +++ b/tests/baselines/reference/innerBoundLambdaEmit.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/innerBoundLambdaEmit.ts === +module M { +>M : Symbol(M, Decl(innerBoundLambdaEmit.ts, 0, 0)) + + export class Foo { +>Foo : Symbol(Foo, Decl(innerBoundLambdaEmit.ts, 0, 10)) + } + var bar = () => { }; +>bar : Symbol(bar, Decl(innerBoundLambdaEmit.ts, 3, 7)) +} +interface Array { +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(innerBoundLambdaEmit.ts, 4, 1)) +>T : Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(innerBoundLambdaEmit.ts, 5, 16)) + + toFoo(): M.Foo +>toFoo : Symbol(toFoo, Decl(innerBoundLambdaEmit.ts, 5, 20)) +>M : Symbol(M, Decl(innerBoundLambdaEmit.ts, 0, 0)) +>Foo : Symbol(M.Foo, Decl(innerBoundLambdaEmit.ts, 0, 10)) +} + diff --git a/tests/baselines/reference/innerBoundLambdaEmit.types b/tests/baselines/reference/innerBoundLambdaEmit.types index d68e6e81cb6..d4cc16ede16 100644 --- a/tests/baselines/reference/innerBoundLambdaEmit.types +++ b/tests/baselines/reference/innerBoundLambdaEmit.types @@ -15,7 +15,7 @@ interface Array { toFoo(): M.Foo >toFoo : () => M.Foo ->M : unknown +>M : any >Foo : M.Foo } diff --git a/tests/baselines/reference/innerExtern.symbols b/tests/baselines/reference/innerExtern.symbols new file mode 100644 index 00000000000..142af91a46f --- /dev/null +++ b/tests/baselines/reference/innerExtern.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/innerExtern.ts === +module A { +>A : Symbol(A, Decl(innerExtern.ts, 0, 0)) + + export declare module BB { +>BB : Symbol(BB, Decl(innerExtern.ts, 0, 10)) + + export var Elephant; +>Elephant : Symbol(Elephant, Decl(innerExtern.ts, 2, 18)) + } + export module B { +>B : Symbol(B, Decl(innerExtern.ts, 3, 5)) + + export class C { +>C : Symbol(C, Decl(innerExtern.ts, 4, 21)) + + x = BB.Elephant.X; +>x : Symbol(x, Decl(innerExtern.ts, 5, 24)) +>BB.Elephant : Symbol(BB.Elephant, Decl(innerExtern.ts, 2, 18)) +>BB : Symbol(BB, Decl(innerExtern.ts, 0, 10)) +>Elephant : Symbol(BB.Elephant, Decl(innerExtern.ts, 2, 18)) + } + } +} + + + diff --git a/tests/baselines/reference/innerFunc.symbols b/tests/baselines/reference/innerFunc.symbols new file mode 100644 index 00000000000..459e1268f5f --- /dev/null +++ b/tests/baselines/reference/innerFunc.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/innerFunc.ts === +function salt() { +>salt : Symbol(salt, Decl(innerFunc.ts, 0, 0)) + + function pepper() { return 5;} +>pepper : Symbol(pepper, Decl(innerFunc.ts, 0, 17)) + + return pepper(); +>pepper : Symbol(pepper, Decl(innerFunc.ts, 0, 17)) +} + +module M { +>M : Symbol(M, Decl(innerFunc.ts, 3, 1)) + + export function tungsten() { +>tungsten : Symbol(tungsten, Decl(innerFunc.ts, 5, 10)) + + function oxygen() { return 6; }; +>oxygen : Symbol(oxygen, Decl(innerFunc.ts, 6, 32)) + + return oxygen(); +>oxygen : Symbol(oxygen, Decl(innerFunc.ts, 6, 32)) + } +} + diff --git a/tests/baselines/reference/innerFunc.types b/tests/baselines/reference/innerFunc.types index 8ca9e9d0a0b..48d98ae42e1 100644 --- a/tests/baselines/reference/innerFunc.types +++ b/tests/baselines/reference/innerFunc.types @@ -4,6 +4,7 @@ function salt() { function pepper() { return 5;} >pepper : () => number +>5 : number return pepper(); >pepper() : number @@ -18,6 +19,7 @@ module M { function oxygen() { return 6; }; >oxygen : () => number +>6 : number return oxygen(); >oxygen() : number diff --git a/tests/baselines/reference/innerOverloads.symbols b/tests/baselines/reference/innerOverloads.symbols new file mode 100644 index 00000000000..d87a60b26e8 --- /dev/null +++ b/tests/baselines/reference/innerOverloads.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/innerOverloads.ts === + +function outer() { +>outer : Symbol(outer, Decl(innerOverloads.ts, 0, 0)) + + function inner(x:number); // should work +>inner : Symbol(inner, Decl(innerOverloads.ts, 1, 18), Decl(innerOverloads.ts, 2, 29), Decl(innerOverloads.ts, 3, 29)) +>x : Symbol(x, Decl(innerOverloads.ts, 2, 19)) + + function inner(x:string); +>inner : Symbol(inner, Decl(innerOverloads.ts, 1, 18), Decl(innerOverloads.ts, 2, 29), Decl(innerOverloads.ts, 3, 29)) +>x : Symbol(x, Decl(innerOverloads.ts, 3, 19)) + + function inner(a:any) { return a; } +>inner : Symbol(inner, Decl(innerOverloads.ts, 1, 18), Decl(innerOverloads.ts, 2, 29), Decl(innerOverloads.ts, 3, 29)) +>a : Symbol(a, Decl(innerOverloads.ts, 4, 19)) +>a : Symbol(a, Decl(innerOverloads.ts, 4, 19)) + + return inner(0); +>inner : Symbol(inner, Decl(innerOverloads.ts, 1, 18), Decl(innerOverloads.ts, 2, 29), Decl(innerOverloads.ts, 3, 29)) +} + +var x = outer(); // should work +>x : Symbol(x, Decl(innerOverloads.ts, 9, 3)) +>outer : Symbol(outer, Decl(innerOverloads.ts, 0, 0)) + + diff --git a/tests/baselines/reference/innerOverloads.types b/tests/baselines/reference/innerOverloads.types index 7168f6161f3..68af57b3bea 100644 --- a/tests/baselines/reference/innerOverloads.types +++ b/tests/baselines/reference/innerOverloads.types @@ -19,6 +19,7 @@ function outer() { return inner(0); >inner(0) : any >inner : { (x: number): any; (x: string): any; } +>0 : number } var x = outer(); // should work diff --git a/tests/baselines/reference/innerTypeArgumentInference.symbols b/tests/baselines/reference/innerTypeArgumentInference.symbols new file mode 100644 index 00000000000..441ce4986ef --- /dev/null +++ b/tests/baselines/reference/innerTypeArgumentInference.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/innerTypeArgumentInference.ts === +interface Generator { (): T; } +>Generator : Symbol(Generator, Decl(innerTypeArgumentInference.ts, 0, 0)) +>T : Symbol(T, Decl(innerTypeArgumentInference.ts, 0, 20)) +>T : Symbol(T, Decl(innerTypeArgumentInference.ts, 0, 20)) + +function Generate(func: Generator): U { +>Generate : Symbol(Generate, Decl(innerTypeArgumentInference.ts, 0, 33)) +>U : Symbol(U, Decl(innerTypeArgumentInference.ts, 1, 18)) +>func : Symbol(func, Decl(innerTypeArgumentInference.ts, 1, 21)) +>Generator : Symbol(Generator, Decl(innerTypeArgumentInference.ts, 0, 0)) +>U : Symbol(U, Decl(innerTypeArgumentInference.ts, 1, 18)) +>U : Symbol(U, Decl(innerTypeArgumentInference.ts, 1, 18)) + + return Generate(func); +>Generate : Symbol(Generate, Decl(innerTypeArgumentInference.ts, 0, 33)) +>func : Symbol(func, Decl(innerTypeArgumentInference.ts, 1, 21)) +} diff --git a/tests/baselines/reference/innerTypeParameterShadowingOuterOne.symbols b/tests/baselines/reference/innerTypeParameterShadowingOuterOne.symbols new file mode 100644 index 00000000000..b890c6c9ecf --- /dev/null +++ b/tests/baselines/reference/innerTypeParameterShadowingOuterOne.symbols @@ -0,0 +1,73 @@ +=== tests/cases/conformance/types/typeParameters/typeParameterLists/innerTypeParameterShadowingOuterOne.ts === +// inner type parameters shadow outer ones of the same name +// no errors expected + +function f() { +>f : Symbol(f, Decl(innerTypeParameterShadowingOuterOne.ts, 0, 0)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 3, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + function g() { +>g : Symbol(g, Decl(innerTypeParameterShadowingOuterOne.ts, 3, 30)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 4, 15)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + var x: T; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 5, 11)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 4, 15)) + + x.toFixed(); +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 5, 11)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + } + var x: T; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 8, 7)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 3, 11)) + + x.getDate(); +>x.getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 8, 7)) +>getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +} + +function f2() { +>f2 : Symbol(f2, Decl(innerTypeParameterShadowingOuterOne.ts, 10, 1)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 27)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + function g() { +>g : Symbol(g, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 47)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 13, 15)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne.ts, 13, 32)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + var x: U; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 14, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne.ts, 13, 32)) + + x.toFixed(); +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 14, 11)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + } + var x: U; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 17, 7)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 27)) + + x.getDate(); +>x.getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne.ts, 17, 7)) +>getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +} +//function f2() { +// function g() { +// var x: U; +// x.toFixed(); +// } +// var x: U; +// x.getDate(); +//} diff --git a/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.symbols b/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.symbols new file mode 100644 index 00000000000..13afcb3e123 --- /dev/null +++ b/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.symbols @@ -0,0 +1,86 @@ +=== tests/cases/conformance/types/typeParameters/typeParameterLists/innerTypeParameterShadowingOuterOne2.ts === +// inner type parameters shadow outer ones of the same name +// no errors expected + +class C { +>C : Symbol(C, Decl(innerTypeParameterShadowingOuterOne2.ts, 0, 0)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 3, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + g() { +>g : Symbol(g, Decl(innerTypeParameterShadowingOuterOne2.ts, 3, 25)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 4, 6)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + var x: T; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 5, 11)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 4, 6)) + + x.toFixed(); +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 5, 11)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + } + + h() { +>h : Symbol(h, Decl(innerTypeParameterShadowingOuterOne2.ts, 7, 5)) + + var x: T; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 10, 11)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 3, 8)) + + x.getDate(); +>x.getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 10, 11)) +>getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) + } +} + +class C2 { +>C2 : Symbol(C2, Decl(innerTypeParameterShadowingOuterOne2.ts, 13, 1)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 9)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 24)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + g() { +>g : Symbol(g, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 42)) +>T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 16, 6)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne2.ts, 16, 23)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + var x: U; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 17, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne2.ts, 16, 23)) + + x.toFixed(); +>x.toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 17, 11)) +>toFixed : Symbol(Number.toFixed, Decl(lib.d.ts, 463, 37)) + } + + h() { +>h : Symbol(h, Decl(innerTypeParameterShadowingOuterOne2.ts, 19, 5)) + + var x: U; +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 22, 11)) +>U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 24)) + + x.getDate(); +>x.getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +>x : Symbol(x, Decl(innerTypeParameterShadowingOuterOne2.ts, 22, 11)) +>getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) + } +} +//class C2 { +// g() { +// var x: U; +// x.toFixed(); +// } + +// h() { +// var x: U; +// x.getDate(); +// } +//} diff --git a/tests/baselines/reference/instanceAndStaticDeclarations1.symbols b/tests/baselines/reference/instanceAndStaticDeclarations1.symbols new file mode 100644 index 00000000000..518d899eabf --- /dev/null +++ b/tests/baselines/reference/instanceAndStaticDeclarations1.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/instanceAndStaticDeclarations1.ts === +// from spec + +class Point { +>Point : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) + + constructor(public x: number, public y: number) { } +>x : Symbol(x, Decl(instanceAndStaticDeclarations1.ts, 3, 16)) +>y : Symbol(y, Decl(instanceAndStaticDeclarations1.ts, 3, 33)) + + public distance(p: Point) { +>distance : Symbol(distance, Decl(instanceAndStaticDeclarations1.ts, 3, 55)) +>p : Symbol(p, Decl(instanceAndStaticDeclarations1.ts, 4, 20)) +>Point : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) + + var dx = this.x - p.x; +>dx : Symbol(dx, Decl(instanceAndStaticDeclarations1.ts, 5, 11)) +>this.x : Symbol(x, Decl(instanceAndStaticDeclarations1.ts, 3, 16)) +>this : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) +>x : Symbol(x, Decl(instanceAndStaticDeclarations1.ts, 3, 16)) +>p.x : Symbol(x, Decl(instanceAndStaticDeclarations1.ts, 3, 16)) +>p : Symbol(p, Decl(instanceAndStaticDeclarations1.ts, 4, 20)) +>x : Symbol(x, Decl(instanceAndStaticDeclarations1.ts, 3, 16)) + + var dy = this.y - p.y; +>dy : Symbol(dy, Decl(instanceAndStaticDeclarations1.ts, 6, 11)) +>this.y : Symbol(y, Decl(instanceAndStaticDeclarations1.ts, 3, 33)) +>this : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) +>y : Symbol(y, Decl(instanceAndStaticDeclarations1.ts, 3, 33)) +>p.y : Symbol(y, Decl(instanceAndStaticDeclarations1.ts, 3, 33)) +>p : Symbol(p, Decl(instanceAndStaticDeclarations1.ts, 4, 20)) +>y : Symbol(y, Decl(instanceAndStaticDeclarations1.ts, 3, 33)) + + return Math.sqrt(dx * dx + dy * dy); +>Math.sqrt : Symbol(Math.sqrt, Decl(lib.d.ts, 620, 27)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>sqrt : Symbol(Math.sqrt, Decl(lib.d.ts, 620, 27)) +>dx : Symbol(dx, Decl(instanceAndStaticDeclarations1.ts, 5, 11)) +>dx : Symbol(dx, Decl(instanceAndStaticDeclarations1.ts, 5, 11)) +>dy : Symbol(dy, Decl(instanceAndStaticDeclarations1.ts, 6, 11)) +>dy : Symbol(dy, Decl(instanceAndStaticDeclarations1.ts, 6, 11)) + } + static origin = new Point(0, 0); +>origin : Symbol(Point.origin, Decl(instanceAndStaticDeclarations1.ts, 8, 5)) +>Point : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) + + static distance(p1: Point, p2: Point) { return p1.distance(p2); } +>distance : Symbol(Point.distance, Decl(instanceAndStaticDeclarations1.ts, 9, 36)) +>p1 : Symbol(p1, Decl(instanceAndStaticDeclarations1.ts, 10, 20)) +>Point : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) +>p2 : Symbol(p2, Decl(instanceAndStaticDeclarations1.ts, 10, 30)) +>Point : Symbol(Point, Decl(instanceAndStaticDeclarations1.ts, 0, 0)) +>p1.distance : Symbol(distance, Decl(instanceAndStaticDeclarations1.ts, 3, 55)) +>p1 : Symbol(p1, Decl(instanceAndStaticDeclarations1.ts, 10, 20)) +>distance : Symbol(distance, Decl(instanceAndStaticDeclarations1.ts, 3, 55)) +>p2 : Symbol(p2, Decl(instanceAndStaticDeclarations1.ts, 10, 30)) +} diff --git a/tests/baselines/reference/instanceAndStaticDeclarations1.types b/tests/baselines/reference/instanceAndStaticDeclarations1.types index c80cf78e37a..9d6ba692735 100644 --- a/tests/baselines/reference/instanceAndStaticDeclarations1.types +++ b/tests/baselines/reference/instanceAndStaticDeclarations1.types @@ -50,6 +50,8 @@ class Point { >origin : Point >new Point(0, 0) : Point >Point : typeof Point +>0 : number +>0 : number static distance(p1: Point, p2: Point) { return p1.distance(p2); } >distance : (p1: Point, p2: Point) => number diff --git a/tests/baselines/reference/instanceMemberInitialization.symbols b/tests/baselines/reference/instanceMemberInitialization.symbols new file mode 100644 index 00000000000..adc192208ca --- /dev/null +++ b/tests/baselines/reference/instanceMemberInitialization.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/classes/propertyMemberDeclarations/instanceMemberInitialization.ts === +class C { +>C : Symbol(C, Decl(instanceMemberInitialization.ts, 0, 0)) + + x = 1; +>x : Symbol(x, Decl(instanceMemberInitialization.ts, 0, 9)) +} + +var c = new C(); +>c : Symbol(c, Decl(instanceMemberInitialization.ts, 4, 3)) +>C : Symbol(C, Decl(instanceMemberInitialization.ts, 0, 0)) + +c.x = 3; +>c.x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) +>c : Symbol(c, Decl(instanceMemberInitialization.ts, 4, 3)) +>x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) + +var c2 = new C(); +>c2 : Symbol(c2, Decl(instanceMemberInitialization.ts, 6, 3)) +>C : Symbol(C, Decl(instanceMemberInitialization.ts, 0, 0)) + +var r = c.x === c2.x; +>r : Symbol(r, Decl(instanceMemberInitialization.ts, 7, 3)) +>c.x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) +>c : Symbol(c, Decl(instanceMemberInitialization.ts, 4, 3)) +>x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) +>c2.x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) +>c2 : Symbol(c2, Decl(instanceMemberInitialization.ts, 6, 3)) +>x : Symbol(C.x, Decl(instanceMemberInitialization.ts, 0, 9)) + diff --git a/tests/baselines/reference/instanceMemberInitialization.types b/tests/baselines/reference/instanceMemberInitialization.types index 5e9d7df3706..4d65c62aa49 100644 --- a/tests/baselines/reference/instanceMemberInitialization.types +++ b/tests/baselines/reference/instanceMemberInitialization.types @@ -4,6 +4,7 @@ class C { x = 1; >x : number +>1 : number } var c = new C(); @@ -16,6 +17,7 @@ c.x = 3; >c.x : number >c : C >x : number +>3 : number var c2 = new C(); >c2 : C diff --git a/tests/baselines/reference/instanceOfInExternalModules.symbols b/tests/baselines/reference/instanceOfInExternalModules.symbols new file mode 100644 index 00000000000..45d158fc62e --- /dev/null +++ b/tests/baselines/reference/instanceOfInExternalModules.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/instanceOfInExternalModules_1.ts === +/// +import Bar = require("instanceOfInExternalModules_require"); +>Bar : Symbol(Bar, Decl(instanceOfInExternalModules_1.ts, 0, 0)) + +function IsFoo(value: any): boolean { +>IsFoo : Symbol(IsFoo, Decl(instanceOfInExternalModules_1.ts, 1, 60)) +>value : Symbol(value, Decl(instanceOfInExternalModules_1.ts, 2, 15)) + + return value instanceof Bar.Foo; +>value : Symbol(value, Decl(instanceOfInExternalModules_1.ts, 2, 15)) +>Bar.Foo : Symbol(Bar.Foo, Decl(instanceOfInExternalModules_require.ts, 0, 0)) +>Bar : Symbol(Bar, Decl(instanceOfInExternalModules_1.ts, 0, 0)) +>Foo : Symbol(Bar.Foo, Decl(instanceOfInExternalModules_require.ts, 0, 0)) +} + +=== tests/cases/compiler/instanceOfInExternalModules_require.ts === +export class Foo { foo: string; } +>Foo : Symbol(Foo, Decl(instanceOfInExternalModules_require.ts, 0, 0)) +>foo : Symbol(foo, Decl(instanceOfInExternalModules_require.ts, 0, 18)) + diff --git a/tests/baselines/reference/instanceSubtypeCheck1.symbols b/tests/baselines/reference/instanceSubtypeCheck1.symbols new file mode 100644 index 00000000000..c7f4bb4152d --- /dev/null +++ b/tests/baselines/reference/instanceSubtypeCheck1.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/instanceSubtypeCheck1.ts === +interface A +>A : Symbol(A, Decl(instanceSubtypeCheck1.ts, 0, 0)) +>T : Symbol(T, Decl(instanceSubtypeCheck1.ts, 0, 12)) +{ + x: A> +>x : Symbol(x, Decl(instanceSubtypeCheck1.ts, 1, 1)) +>A : Symbol(A, Decl(instanceSubtypeCheck1.ts, 0, 0)) +>B : Symbol(B, Decl(instanceSubtypeCheck1.ts, 3, 1)) +>T : Symbol(T, Decl(instanceSubtypeCheck1.ts, 0, 12)) +} + +interface B extends A +>B : Symbol(B, Decl(instanceSubtypeCheck1.ts, 3, 1)) +>T : Symbol(T, Decl(instanceSubtypeCheck1.ts, 5, 12)) +>A : Symbol(A, Decl(instanceSubtypeCheck1.ts, 0, 0)) +>T : Symbol(T, Decl(instanceSubtypeCheck1.ts, 5, 12)) +{ + x: B> +>x : Symbol(x, Decl(instanceSubtypeCheck1.ts, 6, 1)) +>B : Symbol(B, Decl(instanceSubtypeCheck1.ts, 3, 1)) +>A : Symbol(A, Decl(instanceSubtypeCheck1.ts, 0, 0)) +>T : Symbol(T, Decl(instanceSubtypeCheck1.ts, 5, 12)) +} diff --git a/tests/baselines/reference/instanceofOperatorWithAny.symbols b/tests/baselines/reference/instanceofOperatorWithAny.symbols new file mode 100644 index 00000000000..71e08c948e3 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithAny.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithAny.ts === +var a: any; +>a : Symbol(a, Decl(instanceofOperatorWithAny.ts, 0, 3)) + +var r: boolean = a instanceof a; +>r : Symbol(r, Decl(instanceofOperatorWithAny.ts, 2, 3)) +>a : Symbol(a, Decl(instanceofOperatorWithAny.ts, 0, 3)) +>a : Symbol(a, Decl(instanceofOperatorWithAny.ts, 0, 3)) + diff --git a/tests/baselines/reference/instanceofOperatorWithLHSIsObject.symbols b/tests/baselines/reference/instanceofOperatorWithLHSIsObject.symbols new file mode 100644 index 00000000000..44859d83f72 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithLHSIsObject.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithLHSIsObject.ts === +class C { } +>C : Symbol(C, Decl(instanceofOperatorWithLHSIsObject.ts, 0, 0)) + +var x1: any; +>x1 : Symbol(x1, Decl(instanceofOperatorWithLHSIsObject.ts, 2, 3)) + +var x2: Function; +>x2 : Symbol(x2, Decl(instanceofOperatorWithLHSIsObject.ts, 3, 3)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var a: {}; +>a : Symbol(a, Decl(instanceofOperatorWithLHSIsObject.ts, 5, 3)) + +var b: Object; +>b : Symbol(b, Decl(instanceofOperatorWithLHSIsObject.ts, 6, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var c: C; +>c : Symbol(c, Decl(instanceofOperatorWithLHSIsObject.ts, 7, 3)) +>C : Symbol(C, Decl(instanceofOperatorWithLHSIsObject.ts, 0, 0)) + +var d: string | C; +>d : Symbol(d, Decl(instanceofOperatorWithLHSIsObject.ts, 8, 3)) +>C : Symbol(C, Decl(instanceofOperatorWithLHSIsObject.ts, 0, 0)) + +var r1 = a instanceof x1; +>r1 : Symbol(r1, Decl(instanceofOperatorWithLHSIsObject.ts, 10, 3)) +>a : Symbol(a, Decl(instanceofOperatorWithLHSIsObject.ts, 5, 3)) +>x1 : Symbol(x1, Decl(instanceofOperatorWithLHSIsObject.ts, 2, 3)) + +var r2 = b instanceof x2; +>r2 : Symbol(r2, Decl(instanceofOperatorWithLHSIsObject.ts, 11, 3)) +>b : Symbol(b, Decl(instanceofOperatorWithLHSIsObject.ts, 6, 3)) +>x2 : Symbol(x2, Decl(instanceofOperatorWithLHSIsObject.ts, 3, 3)) + +var r3 = c instanceof x1; +>r3 : Symbol(r3, Decl(instanceofOperatorWithLHSIsObject.ts, 12, 3)) +>c : Symbol(c, Decl(instanceofOperatorWithLHSIsObject.ts, 7, 3)) +>x1 : Symbol(x1, Decl(instanceofOperatorWithLHSIsObject.ts, 2, 3)) + +var r4 = d instanceof x1; +>r4 : Symbol(r4, Decl(instanceofOperatorWithLHSIsObject.ts, 13, 3)) +>d : Symbol(d, Decl(instanceofOperatorWithLHSIsObject.ts, 8, 3)) +>x1 : Symbol(x1, Decl(instanceofOperatorWithLHSIsObject.ts, 2, 3)) + diff --git a/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.symbols b/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.symbols new file mode 100644 index 00000000000..a46802ac144 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithLHSIsTypeParameter.ts === +function foo(t: T) { +>foo : Symbol(foo, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 0, 13)) +>t : Symbol(t, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 0, 16)) +>T : Symbol(T, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 0, 13)) + + var x: any; +>x : Symbol(x, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 1, 7)) + + var r = t instanceof x; +>r : Symbol(r, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 2, 7)) +>t : Symbol(t, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 0, 16)) +>x : Symbol(x, Decl(instanceofOperatorWithLHSIsTypeParameter.ts, 1, 7)) +} diff --git a/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.symbols b/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.symbols new file mode 100644 index 00000000000..e15f4b7ea45 --- /dev/null +++ b/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.symbols @@ -0,0 +1,51 @@ +=== tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithRHSIsSubtypeOfFunction.ts === +interface I extends Function { } +>I : Symbol(I, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 0, 0)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var x: any; +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) + +var f1: Function; +>f1 : Symbol(f1, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 3, 3)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var f2: I; +>f2 : Symbol(f2, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 4, 3)) +>I : Symbol(I, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 0, 0)) + +var f3: { (): void }; +>f3 : Symbol(f3, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 5, 3)) + +var f4: { new (): number }; +>f4 : Symbol(f4, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 6, 3)) + +var r1 = x instanceof f1; +>r1 : Symbol(r1, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 8, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) +>f1 : Symbol(f1, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 3, 3)) + +var r2 = x instanceof f2; +>r2 : Symbol(r2, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 9, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) +>f2 : Symbol(f2, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 4, 3)) + +var r3 = x instanceof f3; +>r3 : Symbol(r3, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 10, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) +>f3 : Symbol(f3, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 5, 3)) + +var r4 = x instanceof f4; +>r4 : Symbol(r4, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 11, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) +>f4 : Symbol(f4, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 6, 3)) + +var r5 = x instanceof null; +>r5 : Symbol(r5, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 12, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) + +var r6 = x instanceof undefined; +>r6 : Symbol(r6, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 13, 3)) +>x : Symbol(x, Decl(instanceofOperatorWithRHSIsSubtypeOfFunction.ts, 2, 3)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.types b/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.types index 2bcf91bb1ab..256f26f8fc9 100644 --- a/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.types +++ b/tests/baselines/reference/instanceofOperatorWithRHSIsSubtypeOfFunction.types @@ -48,6 +48,7 @@ var r5 = x instanceof null; >r5 : boolean >x instanceof null : boolean >x : any +>null : null var r6 = x instanceof undefined; >r6 : boolean diff --git a/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.symbols b/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.symbols new file mode 100644 index 00000000000..b20387d9b80 --- /dev/null +++ b/tests/baselines/reference/instantiateGenericClassWithZeroTypeArguments.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/instantiateGenericClassWithZeroTypeArguments.ts === +// no errors expected when instantiating a generic type with no type arguments provided + +class C { +>C : Symbol(C, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 0, 0)) +>T : Symbol(T, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 2, 8)) + + x: T; +>x : Symbol(x, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 2, 12)) +>T : Symbol(T, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 2, 8)) +} + +var c = new C(); +>c : Symbol(c, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 6, 3)) +>C : Symbol(C, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 0, 0)) + +class D { +>D : Symbol(D, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 6, 16)) +>T : Symbol(T, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 8, 8)) +>U : Symbol(U, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 8, 10)) + + x: T +>x : Symbol(x, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 8, 15)) +>T : Symbol(T, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 8, 8)) + + y: U +>y : Symbol(y, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 9, 8)) +>U : Symbol(U, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 8, 10)) +} + +var d = new D(); +>d : Symbol(d, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 13, 3)) +>D : Symbol(D, Decl(instantiateGenericClassWithZeroTypeArguments.ts, 6, 16)) + diff --git a/tests/baselines/reference/instantiatedModule.symbols b/tests/baselines/reference/instantiatedModule.symbols new file mode 100644 index 00000000000..42e0edcd221 --- /dev/null +++ b/tests/baselines/reference/instantiatedModule.symbols @@ -0,0 +1,195 @@ +=== tests/cases/conformance/internalModules/moduleDeclarations/instantiatedModule.ts === +// adding the var makes this an instantiated module + +module M { +>M : Symbol(M, Decl(instantiatedModule.ts, 0, 0)) + + export interface Point { x: number; y: number } +>Point : Symbol(Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) +>x : Symbol(x, Decl(instantiatedModule.ts, 3, 28)) +>y : Symbol(y, Decl(instantiatedModule.ts, 3, 39)) + + export var Point = 1; +>Point : Symbol(Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) +} + +// primary expression +var m: typeof M; +>m : Symbol(m, Decl(instantiatedModule.ts, 8, 3), Decl(instantiatedModule.ts, 9, 3)) +>M : Symbol(M, Decl(instantiatedModule.ts, 0, 0)) + +var m = M; +>m : Symbol(m, Decl(instantiatedModule.ts, 8, 3), Decl(instantiatedModule.ts, 9, 3)) +>M : Symbol(M, Decl(instantiatedModule.ts, 0, 0)) + +var a1: number; +>a1 : Symbol(a1, Decl(instantiatedModule.ts, 11, 3), Decl(instantiatedModule.ts, 12, 3), Decl(instantiatedModule.ts, 13, 3)) + +var a1 = M.Point; +>a1 : Symbol(a1, Decl(instantiatedModule.ts, 11, 3), Decl(instantiatedModule.ts, 12, 3), Decl(instantiatedModule.ts, 13, 3)) +>M.Point : Symbol(M.Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) +>M : Symbol(M, Decl(instantiatedModule.ts, 0, 0)) +>Point : Symbol(M.Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) + +var a1 = m.Point; +>a1 : Symbol(a1, Decl(instantiatedModule.ts, 11, 3), Decl(instantiatedModule.ts, 12, 3), Decl(instantiatedModule.ts, 13, 3)) +>m.Point : Symbol(M.Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) +>m : Symbol(m, Decl(instantiatedModule.ts, 8, 3), Decl(instantiatedModule.ts, 9, 3)) +>Point : Symbol(M.Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) + +var p1: { x: number; y: number; } +>p1 : Symbol(p1, Decl(instantiatedModule.ts, 15, 3), Decl(instantiatedModule.ts, 16, 3)) +>x : Symbol(x, Decl(instantiatedModule.ts, 15, 9)) +>y : Symbol(y, Decl(instantiatedModule.ts, 15, 20)) + +var p1: M.Point; +>p1 : Symbol(p1, Decl(instantiatedModule.ts, 15, 3), Decl(instantiatedModule.ts, 16, 3)) +>M : Symbol(M, Decl(instantiatedModule.ts, 0, 0)) +>Point : Symbol(M.Point, Decl(instantiatedModule.ts, 2, 10), Decl(instantiatedModule.ts, 4, 14)) + +// making the point a class instead of an interface +// makes this an instantiated mmodule +module M2 { +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) + + export class Point { +>Point : Symbol(Point, Decl(instantiatedModule.ts, 20, 11)) + + x: number; +>x : Symbol(x, Decl(instantiatedModule.ts, 21, 24)) + + y: number; +>y : Symbol(y, Decl(instantiatedModule.ts, 22, 18)) + + static Origin(): Point { +>Origin : Symbol(Point.Origin, Decl(instantiatedModule.ts, 23, 18)) +>Point : Symbol(Point, Decl(instantiatedModule.ts, 20, 11)) + + return { x: 0, y: 0 }; +>x : Symbol(x, Decl(instantiatedModule.ts, 25, 20)) +>y : Symbol(y, Decl(instantiatedModule.ts, 25, 26)) + } + } +} + +var m2: typeof M2; +>m2 : Symbol(m2, Decl(instantiatedModule.ts, 30, 3), Decl(instantiatedModule.ts, 31, 3)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) + +var m2 = M2; +>m2 : Symbol(m2, Decl(instantiatedModule.ts, 30, 3), Decl(instantiatedModule.ts, 31, 3)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) + +// static side of the class +var a2: typeof M2.Point; +>a2 : Symbol(a2, Decl(instantiatedModule.ts, 34, 3), Decl(instantiatedModule.ts, 35, 3), Decl(instantiatedModule.ts, 36, 3)) +>M2.Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +var a2 = m2.Point; +>a2 : Symbol(a2, Decl(instantiatedModule.ts, 34, 3), Decl(instantiatedModule.ts, 35, 3), Decl(instantiatedModule.ts, 36, 3)) +>m2.Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>m2 : Symbol(m2, Decl(instantiatedModule.ts, 30, 3), Decl(instantiatedModule.ts, 31, 3)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +var a2 = M2.Point; +>a2 : Symbol(a2, Decl(instantiatedModule.ts, 34, 3), Decl(instantiatedModule.ts, 35, 3), Decl(instantiatedModule.ts, 36, 3)) +>M2.Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +var o: M2.Point = a2.Origin(); +>o : Symbol(o, Decl(instantiatedModule.ts, 37, 3)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>a2.Origin : Symbol(M2.Point.Origin, Decl(instantiatedModule.ts, 23, 18)) +>a2 : Symbol(a2, Decl(instantiatedModule.ts, 34, 3), Decl(instantiatedModule.ts, 35, 3), Decl(instantiatedModule.ts, 36, 3)) +>Origin : Symbol(M2.Point.Origin, Decl(instantiatedModule.ts, 23, 18)) + +var p2: { x: number; y: number } +>p2 : Symbol(p2, Decl(instantiatedModule.ts, 39, 3), Decl(instantiatedModule.ts, 40, 3), Decl(instantiatedModule.ts, 41, 3), Decl(instantiatedModule.ts, 42, 3)) +>x : Symbol(x, Decl(instantiatedModule.ts, 39, 9)) +>y : Symbol(y, Decl(instantiatedModule.ts, 39, 20)) + +var p2: M2.Point; +>p2 : Symbol(p2, Decl(instantiatedModule.ts, 39, 3), Decl(instantiatedModule.ts, 40, 3), Decl(instantiatedModule.ts, 41, 3), Decl(instantiatedModule.ts, 42, 3)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +var p2 = new m2.Point(); +>p2 : Symbol(p2, Decl(instantiatedModule.ts, 39, 3), Decl(instantiatedModule.ts, 40, 3), Decl(instantiatedModule.ts, 41, 3), Decl(instantiatedModule.ts, 42, 3)) +>m2.Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>m2 : Symbol(m2, Decl(instantiatedModule.ts, 30, 3), Decl(instantiatedModule.ts, 31, 3)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +var p2 = new M2.Point(); +>p2 : Symbol(p2, Decl(instantiatedModule.ts, 39, 3), Decl(instantiatedModule.ts, 40, 3), Decl(instantiatedModule.ts, 41, 3), Decl(instantiatedModule.ts, 42, 3)) +>M2.Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) +>M2 : Symbol(M2, Decl(instantiatedModule.ts, 16, 16)) +>Point : Symbol(M2.Point, Decl(instantiatedModule.ts, 20, 11)) + +module M3 { +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) + + export enum Color { Blue, Red } +>Color : Symbol(Color, Decl(instantiatedModule.ts, 44, 11)) +>Blue : Symbol(Color.Blue, Decl(instantiatedModule.ts, 45, 23)) +>Red : Symbol(Color.Red, Decl(instantiatedModule.ts, 45, 29)) +} + +var m3: typeof M3; +>m3 : Symbol(m3, Decl(instantiatedModule.ts, 48, 3), Decl(instantiatedModule.ts, 49, 3)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) + +var m3 = M3; +>m3 : Symbol(m3, Decl(instantiatedModule.ts, 48, 3), Decl(instantiatedModule.ts, 49, 3)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) + +var a3: typeof M3.Color; +>a3 : Symbol(a3, Decl(instantiatedModule.ts, 51, 3), Decl(instantiatedModule.ts, 52, 3), Decl(instantiatedModule.ts, 53, 3)) +>M3.Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) + +var a3 = m3.Color; +>a3 : Symbol(a3, Decl(instantiatedModule.ts, 51, 3), Decl(instantiatedModule.ts, 52, 3), Decl(instantiatedModule.ts, 53, 3)) +>m3.Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>m3 : Symbol(m3, Decl(instantiatedModule.ts, 48, 3), Decl(instantiatedModule.ts, 49, 3)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) + +var a3 = M3.Color; +>a3 : Symbol(a3, Decl(instantiatedModule.ts, 51, 3), Decl(instantiatedModule.ts, 52, 3), Decl(instantiatedModule.ts, 53, 3)) +>M3.Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) + +var blue: M3.Color = a3.Blue; +>blue : Symbol(blue, Decl(instantiatedModule.ts, 54, 3)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>a3.Blue : Symbol(M3.Color.Blue, Decl(instantiatedModule.ts, 45, 23)) +>a3 : Symbol(a3, Decl(instantiatedModule.ts, 51, 3), Decl(instantiatedModule.ts, 52, 3), Decl(instantiatedModule.ts, 53, 3)) +>Blue : Symbol(M3.Color.Blue, Decl(instantiatedModule.ts, 45, 23)) + +var p3: M3.Color; +>p3 : Symbol(p3, Decl(instantiatedModule.ts, 56, 3), Decl(instantiatedModule.ts, 57, 3), Decl(instantiatedModule.ts, 58, 3)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) + +var p3 = M3.Color.Red; +>p3 : Symbol(p3, Decl(instantiatedModule.ts, 56, 3), Decl(instantiatedModule.ts, 57, 3), Decl(instantiatedModule.ts, 58, 3)) +>M3.Color.Red : Symbol(M3.Color.Red, Decl(instantiatedModule.ts, 45, 29)) +>M3.Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>M3 : Symbol(M3, Decl(instantiatedModule.ts, 42, 24)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>Red : Symbol(M3.Color.Red, Decl(instantiatedModule.ts, 45, 29)) + +var p3 = m3.Color.Blue; +>p3 : Symbol(p3, Decl(instantiatedModule.ts, 56, 3), Decl(instantiatedModule.ts, 57, 3), Decl(instantiatedModule.ts, 58, 3)) +>m3.Color.Blue : Symbol(M3.Color.Blue, Decl(instantiatedModule.ts, 45, 23)) +>m3.Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>m3 : Symbol(m3, Decl(instantiatedModule.ts, 48, 3), Decl(instantiatedModule.ts, 49, 3)) +>Color : Symbol(M3.Color, Decl(instantiatedModule.ts, 44, 11)) +>Blue : Symbol(M3.Color.Blue, Decl(instantiatedModule.ts, 45, 23)) + diff --git a/tests/baselines/reference/instantiatedModule.types b/tests/baselines/reference/instantiatedModule.types index b3f4dc0d5a1..e9933eea804 100644 --- a/tests/baselines/reference/instantiatedModule.types +++ b/tests/baselines/reference/instantiatedModule.types @@ -11,6 +11,7 @@ module M { export var Point = 1; >Point : number +>1 : number } // primary expression @@ -44,7 +45,7 @@ var p1: { x: number; y: number; } var p1: M.Point; >p1 : { x: number; y: number; } ->M : unknown +>M : any >Point : M.Point // making the point a class instead of an interface @@ -68,7 +69,9 @@ module M2 { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } } } @@ -84,6 +87,7 @@ var m2 = M2; // static side of the class var a2: typeof M2.Point; >a2 : typeof M2.Point +>M2.Point : typeof M2.Point >M2 : typeof M2 >Point : typeof M2.Point @@ -101,7 +105,7 @@ var a2 = M2.Point; var o: M2.Point = a2.Origin(); >o : M2.Point ->M2 : unknown +>M2 : any >Point : M2.Point >a2.Origin() : M2.Point >a2.Origin : () => M2.Point @@ -115,7 +119,7 @@ var p2: { x: number; y: number } var p2: M2.Point; >p2 : { x: number; y: number; } ->M2 : unknown +>M2 : any >Point : M2.Point var p2 = new m2.Point(); @@ -151,6 +155,7 @@ var m3 = M3; var a3: typeof M3.Color; >a3 : typeof M3.Color +>M3.Color : typeof M3.Color >M3 : typeof M3 >Color : typeof M3.Color @@ -168,7 +173,7 @@ var a3 = M3.Color; var blue: M3.Color = a3.Blue; >blue : M3.Color ->M3 : unknown +>M3 : any >Color : M3.Color >a3.Blue : M3.Color >a3 : typeof M3.Color @@ -176,7 +181,7 @@ var blue: M3.Color = a3.Blue; var p3: M3.Color; >p3 : M3.Color ->M3 : unknown +>M3 : any >Color : M3.Color var p3 = M3.Color.Red; diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.symbols b/tests/baselines/reference/instantiatedReturnTypeContravariance.symbols new file mode 100644 index 00000000000..f64ebfdce21 --- /dev/null +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/instantiatedReturnTypeContravariance.ts === +interface B { +>B : Symbol(B, Decl(instantiatedReturnTypeContravariance.ts, 0, 0)) +>T : Symbol(T, Decl(instantiatedReturnTypeContravariance.ts, 0, 12)) + +name: string; +>name : Symbol(name, Decl(instantiatedReturnTypeContravariance.ts, 0, 16)) + +x(): T; +>x : Symbol(x, Decl(instantiatedReturnTypeContravariance.ts, 2, 13)) +>T : Symbol(T, Decl(instantiatedReturnTypeContravariance.ts, 0, 12)) + +} + +class c { +>c : Symbol(c, Decl(instantiatedReturnTypeContravariance.ts, 6, 1)) + +foo(): B { +>foo : Symbol(foo, Decl(instantiatedReturnTypeContravariance.ts, 8, 9)) +>B : Symbol(B, Decl(instantiatedReturnTypeContravariance.ts, 0, 0)) + +return null; + +} + +} + +class d extends c { +>d : Symbol(d, Decl(instantiatedReturnTypeContravariance.ts, 16, 1)) +>c : Symbol(c, Decl(instantiatedReturnTypeContravariance.ts, 6, 1)) + +foo(): B { +>foo : Symbol(foo, Decl(instantiatedReturnTypeContravariance.ts, 18, 19)) +>B : Symbol(B, Decl(instantiatedReturnTypeContravariance.ts, 0, 0)) + +return null; + +} + +} + + + diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.types b/tests/baselines/reference/instantiatedReturnTypeContravariance.types index 8b7cb7b609e..1de1b8b7151 100644 --- a/tests/baselines/reference/instantiatedReturnTypeContravariance.types +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.types @@ -20,6 +20,7 @@ foo(): B { >B : B return null; +>null : null } @@ -34,6 +35,7 @@ foo(): B { >B : B return null; +>null : null } diff --git a/tests/baselines/reference/interMixingModulesInterfaces0.symbols b/tests/baselines/reference/interMixingModulesInterfaces0.symbols new file mode 100644 index 00000000000..6b482053b2e --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces0.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/interMixingModulesInterfaces0.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces0.ts, 0, 0)) + + export module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) + + export function createB(): B { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces0.ts, 2, 21)) +>B : Symbol(B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) + + return null; + } + } + + export interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces0.ts, 8, 24)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces0.ts, 9, 21)) + } +} + +var x: A.B = A.B.createB(); +>x : Symbol(x, Decl(interMixingModulesInterfaces0.ts, 14, 3)) +>A : Symbol(A, Decl(interMixingModulesInterfaces0.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) +>A.B.createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces0.ts, 2, 21)) +>A.B : Symbol(A.B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) +>A : Symbol(A, Decl(interMixingModulesInterfaces0.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces0.ts, 0, 10), Decl(interMixingModulesInterfaces0.ts, 6, 5)) +>createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces0.ts, 2, 21)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces0.types b/tests/baselines/reference/interMixingModulesInterfaces0.types index 977b02e15e8..bc78303ba74 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces0.types +++ b/tests/baselines/reference/interMixingModulesInterfaces0.types @@ -10,6 +10,7 @@ module A { >B : B return null; +>null : null } } @@ -26,7 +27,7 @@ module A { var x: A.B = A.B.createB(); >x : A.B ->A : unknown +>A : any >B : A.B >A.B.createB() : A.B >A.B.createB : () => A.B diff --git a/tests/baselines/reference/interMixingModulesInterfaces1.symbols b/tests/baselines/reference/interMixingModulesInterfaces1.symbols new file mode 100644 index 00000000000..39162cf5a42 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces1.symbols @@ -0,0 +1,36 @@ +=== tests/cases/compiler/interMixingModulesInterfaces1.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces1.ts, 0, 0)) + + export interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces1.ts, 2, 24)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces1.ts, 3, 21)) + } + + export module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) + + export function createB(): B { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces1.ts, 7, 21)) +>B : Symbol(B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) + + return null; + } + } +} + +var x: A.B = A.B.createB(); +>x : Symbol(x, Decl(interMixingModulesInterfaces1.ts, 14, 3)) +>A : Symbol(A, Decl(interMixingModulesInterfaces1.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) +>A.B.createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces1.ts, 7, 21)) +>A.B : Symbol(A.B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) +>A : Symbol(A, Decl(interMixingModulesInterfaces1.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces1.ts, 0, 10), Decl(interMixingModulesInterfaces1.ts, 5, 5)) +>createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces1.ts, 7, 21)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces1.types b/tests/baselines/reference/interMixingModulesInterfaces1.types index c94cc80e5bf..37401e3a788 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces1.types +++ b/tests/baselines/reference/interMixingModulesInterfaces1.types @@ -20,13 +20,14 @@ module A { >B : B return null; +>null : null } } } var x: A.B = A.B.createB(); >x : A.B ->A : unknown +>A : any >B : A.B >A.B.createB() : A.B >A.B.createB : () => A.B diff --git a/tests/baselines/reference/interMixingModulesInterfaces2.symbols b/tests/baselines/reference/interMixingModulesInterfaces2.symbols new file mode 100644 index 00000000000..0362909047a --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces2.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/interMixingModulesInterfaces2.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces2.ts, 0, 0)) + + export interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces2.ts, 0, 10)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces2.ts, 2, 24)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces2.ts, 3, 21)) + } + + module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces2.ts, 0, 10), Decl(interMixingModulesInterfaces2.ts, 5, 5)) + + export function createB(): B { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces2.ts, 7, 14)) +>B : Symbol(B, Decl(interMixingModulesInterfaces2.ts, 0, 10)) + + return null; + } + } +} + +var x: A.B = null; +>x : Symbol(x, Decl(interMixingModulesInterfaces2.ts, 14, 3)) +>A : Symbol(A, Decl(interMixingModulesInterfaces2.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces2.ts, 0, 10)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces2.types b/tests/baselines/reference/interMixingModulesInterfaces2.types index ff21c25358b..6780a34dc7e 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces2.types +++ b/tests/baselines/reference/interMixingModulesInterfaces2.types @@ -20,12 +20,14 @@ module A { >B : B return null; +>null : null } } } var x: A.B = null; >x : A.B ->A : unknown +>A : any >B : A.B +>null : null diff --git a/tests/baselines/reference/interMixingModulesInterfaces3.symbols b/tests/baselines/reference/interMixingModulesInterfaces3.symbols new file mode 100644 index 00000000000..482cc883930 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces3.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/interMixingModulesInterfaces3.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces3.ts, 0, 0)) + + module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces3.ts, 0, 10), Decl(interMixingModulesInterfaces3.ts, 6, 5)) + + export function createB(): B { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces3.ts, 2, 14)) +>B : Symbol(B, Decl(interMixingModulesInterfaces3.ts, 6, 5)) + + return null; + } + } + + export interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces3.ts, 6, 5)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces3.ts, 8, 24)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces3.ts, 9, 21)) + } +} + +var x: A.B = null; +>x : Symbol(x, Decl(interMixingModulesInterfaces3.ts, 14, 3)) +>A : Symbol(A, Decl(interMixingModulesInterfaces3.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces3.ts, 6, 5)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces3.types b/tests/baselines/reference/interMixingModulesInterfaces3.types index 123d609c365..416ac215227 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces3.types +++ b/tests/baselines/reference/interMixingModulesInterfaces3.types @@ -10,6 +10,7 @@ module A { >B : B return null; +>null : null } } @@ -26,6 +27,7 @@ module A { var x: A.B = null; >x : A.B ->A : unknown +>A : any >B : A.B +>null : null diff --git a/tests/baselines/reference/interMixingModulesInterfaces4.symbols b/tests/baselines/reference/interMixingModulesInterfaces4.symbols new file mode 100644 index 00000000000..498b34c721f --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces4.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/interMixingModulesInterfaces4.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces4.ts, 0, 0)) + + export module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces4.ts, 0, 10)) + + export function createB(): number { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces4.ts, 2, 21)) + + return null; + } + } + + interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces4.ts, 0, 10), Decl(interMixingModulesInterfaces4.ts, 6, 5)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces4.ts, 8, 17)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces4.ts, 9, 21)) + } +} + +var x : number = A.B.createB(); +>x : Symbol(x, Decl(interMixingModulesInterfaces4.ts, 14, 3)) +>A.B.createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces4.ts, 2, 21)) +>A.B : Symbol(A.B, Decl(interMixingModulesInterfaces4.ts, 0, 10)) +>A : Symbol(A, Decl(interMixingModulesInterfaces4.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces4.ts, 0, 10)) +>createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces4.ts, 2, 21)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces4.types b/tests/baselines/reference/interMixingModulesInterfaces4.types index e4e9bf385ac..456f7fc2202 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces4.types +++ b/tests/baselines/reference/interMixingModulesInterfaces4.types @@ -9,6 +9,7 @@ module A { >createB : () => number return null; +>null : null } } diff --git a/tests/baselines/reference/interMixingModulesInterfaces5.symbols b/tests/baselines/reference/interMixingModulesInterfaces5.symbols new file mode 100644 index 00000000000..7f45a62c858 --- /dev/null +++ b/tests/baselines/reference/interMixingModulesInterfaces5.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/interMixingModulesInterfaces5.ts === +module A { +>A : Symbol(A, Decl(interMixingModulesInterfaces5.ts, 0, 0)) + + interface B { +>B : Symbol(B, Decl(interMixingModulesInterfaces5.ts, 0, 10), Decl(interMixingModulesInterfaces5.ts, 5, 5)) + + name: string; +>name : Symbol(name, Decl(interMixingModulesInterfaces5.ts, 2, 17)) + + value: number; +>value : Symbol(value, Decl(interMixingModulesInterfaces5.ts, 3, 21)) + } + + export module B { +>B : Symbol(B, Decl(interMixingModulesInterfaces5.ts, 5, 5)) + + export function createB(): number { +>createB : Symbol(createB, Decl(interMixingModulesInterfaces5.ts, 7, 21)) + + return null; + } + } +} + +var x: number = A.B.createB(); +>x : Symbol(x, Decl(interMixingModulesInterfaces5.ts, 14, 3)) +>A.B.createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces5.ts, 7, 21)) +>A.B : Symbol(A.B, Decl(interMixingModulesInterfaces5.ts, 5, 5)) +>A : Symbol(A, Decl(interMixingModulesInterfaces5.ts, 0, 0)) +>B : Symbol(A.B, Decl(interMixingModulesInterfaces5.ts, 5, 5)) +>createB : Symbol(A.B.createB, Decl(interMixingModulesInterfaces5.ts, 7, 21)) + diff --git a/tests/baselines/reference/interMixingModulesInterfaces5.types b/tests/baselines/reference/interMixingModulesInterfaces5.types index 199b37b16eb..977ecc39668 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces5.types +++ b/tests/baselines/reference/interMixingModulesInterfaces5.types @@ -19,6 +19,7 @@ module A { >createB : () => number return null; +>null : null } } } diff --git a/tests/baselines/reference/interface0.symbols b/tests/baselines/reference/interface0.symbols new file mode 100644 index 00000000000..25e12370916 --- /dev/null +++ b/tests/baselines/reference/interface0.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/interface0.ts === +interface Generic { +>Generic : Symbol(Generic, Decl(interface0.ts, 0, 0)) +>T : Symbol(T, Decl(interface0.ts, 0, 18)) + + x: T; +>x : Symbol(x, Decl(interface0.ts, 0, 22)) +>T : Symbol(T, Decl(interface0.ts, 0, 18)) +} + +var y: Generic = { x: 3 }; +>y : Symbol(y, Decl(interface0.ts, 4, 3)) +>Generic : Symbol(Generic, Decl(interface0.ts, 0, 0)) +>x : Symbol(x, Decl(interface0.ts, 4, 26)) + diff --git a/tests/baselines/reference/interface0.types b/tests/baselines/reference/interface0.types index ecbd2d212ed..8fd04eea83c 100644 --- a/tests/baselines/reference/interface0.types +++ b/tests/baselines/reference/interface0.types @@ -13,4 +13,5 @@ var y: Generic = { x: 3 }; >Generic : Generic >{ x: 3 } : { x: number; } >x : number +>3 : number diff --git a/tests/baselines/reference/interfaceContextualType.symbols b/tests/baselines/reference/interfaceContextualType.symbols new file mode 100644 index 00000000000..34831880431 --- /dev/null +++ b/tests/baselines/reference/interfaceContextualType.symbols @@ -0,0 +1,55 @@ +=== tests/cases/compiler/interfaceContextualType.ts === +export interface IOptions { +>IOptions : Symbol(IOptions, Decl(interfaceContextualType.ts, 0, 0)) + + italic?: boolean; +>italic : Symbol(italic, Decl(interfaceContextualType.ts, 0, 27)) + + bold?: boolean; +>bold : Symbol(bold, Decl(interfaceContextualType.ts, 1, 21)) +} +export interface IMap { +>IMap : Symbol(IMap, Decl(interfaceContextualType.ts, 3, 1)) + + [s: string]: IOptions; +>s : Symbol(s, Decl(interfaceContextualType.ts, 5, 5)) +>IOptions : Symbol(IOptions, Decl(interfaceContextualType.ts, 0, 0)) +} + +class Bug { +>Bug : Symbol(Bug, Decl(interfaceContextualType.ts, 6, 1)) + + public values: IMap; +>values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) +>IMap : Symbol(IMap, Decl(interfaceContextualType.ts, 3, 1)) + + ok() { +>ok : Symbol(ok, Decl(interfaceContextualType.ts, 9, 24)) + + this.values = {}; +>this.values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) +>this : Symbol(Bug, Decl(interfaceContextualType.ts, 6, 1)) +>values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) + + this.values['comments'] = { italic: true }; +>this.values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) +>this : Symbol(Bug, Decl(interfaceContextualType.ts, 6, 1)) +>values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) +>italic : Symbol(italic, Decl(interfaceContextualType.ts, 12, 35)) + } + shouldBeOK() { +>shouldBeOK : Symbol(shouldBeOK, Decl(interfaceContextualType.ts, 13, 5)) + + this.values = { +>this.values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) +>this : Symbol(Bug, Decl(interfaceContextualType.ts, 6, 1)) +>values : Symbol(values, Decl(interfaceContextualType.ts, 8, 11)) + + comments: { italic: true } +>comments : Symbol(comments, Decl(interfaceContextualType.ts, 15, 23)) +>italic : Symbol(italic, Decl(interfaceContextualType.ts, 16, 23)) + + }; + } +} + diff --git a/tests/baselines/reference/interfaceContextualType.types b/tests/baselines/reference/interfaceContextualType.types index 3078ecfdfa4..4b932a71538 100644 --- a/tests/baselines/reference/interfaceContextualType.types +++ b/tests/baselines/reference/interfaceContextualType.types @@ -39,8 +39,10 @@ class Bug { >this.values : IMap >this : Bug >values : IMap +>'comments' : string >{ italic: true } : { italic: boolean; } >italic : boolean +>true : boolean } shouldBeOK() { >shouldBeOK : () => void @@ -56,6 +58,7 @@ class Bug { >comments : { italic: boolean; } >{ italic: true } : { italic: boolean; } >italic : boolean +>true : boolean }; } diff --git a/tests/baselines/reference/interfaceDeclaration5.symbols b/tests/baselines/reference/interfaceDeclaration5.symbols new file mode 100644 index 00000000000..3478a56693a --- /dev/null +++ b/tests/baselines/reference/interfaceDeclaration5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/interfaceDeclaration5.ts === +export interface I1 { item:string; } +>I1 : Symbol(I1, Decl(interfaceDeclaration5.ts, 0, 0)) +>item : Symbol(item, Decl(interfaceDeclaration5.ts, 0, 21)) + +export class C1 { } +>C1 : Symbol(C1, Decl(interfaceDeclaration5.ts, 0, 36)) + diff --git a/tests/baselines/reference/interfaceExtendsClass1.symbols b/tests/baselines/reference/interfaceExtendsClass1.symbols new file mode 100644 index 00000000000..6caa2013a25 --- /dev/null +++ b/tests/baselines/reference/interfaceExtendsClass1.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/interfaceExtendsClass1.ts === +class Control { +>Control : Symbol(Control, Decl(interfaceExtendsClass1.ts, 0, 0)) + + private state: any; +>state : Symbol(state, Decl(interfaceExtendsClass1.ts, 0, 15)) +} +interface SelectableControl extends Control { +>SelectableControl : Symbol(SelectableControl, Decl(interfaceExtendsClass1.ts, 2, 1)) +>Control : Symbol(Control, Decl(interfaceExtendsClass1.ts, 0, 0)) + + select(): void; +>select : Symbol(select, Decl(interfaceExtendsClass1.ts, 3, 45)) +} +class Button extends Control { +>Button : Symbol(Button, Decl(interfaceExtendsClass1.ts, 5, 1)) +>Control : Symbol(Control, Decl(interfaceExtendsClass1.ts, 0, 0)) + + select() { } +>select : Symbol(select, Decl(interfaceExtendsClass1.ts, 6, 30)) +} +class TextBox extends Control { +>TextBox : Symbol(TextBox, Decl(interfaceExtendsClass1.ts, 8, 1)) +>Control : Symbol(Control, Decl(interfaceExtendsClass1.ts, 0, 0)) + + select() { } +>select : Symbol(select, Decl(interfaceExtendsClass1.ts, 9, 31)) +} +class Image extends Control { +>Image : Symbol(Image, Decl(interfaceExtendsClass1.ts, 11, 1)) +>Control : Symbol(Control, Decl(interfaceExtendsClass1.ts, 0, 0)) +} +class Location { +>Location : Symbol(Location, Decl(interfaceExtendsClass1.ts, 13, 1)) + + select() { } +>select : Symbol(select, Decl(interfaceExtendsClass1.ts, 14, 16)) +} + diff --git a/tests/baselines/reference/interfaceInReopenedModule.symbols b/tests/baselines/reference/interfaceInReopenedModule.symbols new file mode 100644 index 00000000000..3cde824b451 --- /dev/null +++ b/tests/baselines/reference/interfaceInReopenedModule.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/interfaceInReopenedModule.ts === +module m { +>m : Symbol(m, Decl(interfaceInReopenedModule.ts, 0, 0), Decl(interfaceInReopenedModule.ts, 1, 1)) +} + +// In second instance of same module, exported interface is not visible +module m { +>m : Symbol(m, Decl(interfaceInReopenedModule.ts, 0, 0), Decl(interfaceInReopenedModule.ts, 1, 1)) + + interface f {} +>f : Symbol(f, Decl(interfaceInReopenedModule.ts, 4, 10)) + + export class n { +>n : Symbol(n, Decl(interfaceInReopenedModule.ts, 5, 18)) + + private n: f; +>n : Symbol(n, Decl(interfaceInReopenedModule.ts, 6, 20)) +>f : Symbol(f, Decl(interfaceInReopenedModule.ts, 4, 10)) + } +} + diff --git a/tests/baselines/reference/interfaceInheritance2.symbols b/tests/baselines/reference/interfaceInheritance2.symbols new file mode 100644 index 00000000000..4e72717f6d8 --- /dev/null +++ b/tests/baselines/reference/interfaceInheritance2.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/interfaceInheritance2.ts === +interface I6 { +>I6 : Symbol(I6, Decl(interfaceInheritance2.ts, 0, 0)) + + ():void; +} + +interface I7 extends I6 { } +>I7 : Symbol(I7, Decl(interfaceInheritance2.ts, 2, 1)) +>I6 : Symbol(I6, Decl(interfaceInheritance2.ts, 0, 0)) + +var v1:I7; +>v1 : Symbol(v1, Decl(interfaceInheritance2.ts, 6, 3)) +>I7 : Symbol(I7, Decl(interfaceInheritance2.ts, 2, 1)) + +v1(); +>v1 : Symbol(v1, Decl(interfaceInheritance2.ts, 6, 3)) + diff --git a/tests/baselines/reference/interfaceOnly.symbols b/tests/baselines/reference/interfaceOnly.symbols new file mode 100644 index 00000000000..70473ff3139 --- /dev/null +++ b/tests/baselines/reference/interfaceOnly.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/interfaceOnly.ts === +interface foo { +>foo : Symbol(foo, Decl(interfaceOnly.ts, 0, 0)) + + foo(); +>foo : Symbol(foo, Decl(interfaceOnly.ts, 0, 15)) + + f2 (f: ()=> void); +>f2 : Symbol(f2, Decl(interfaceOnly.ts, 1, 10)) +>f : Symbol(f, Decl(interfaceOnly.ts, 2, 8)) +} diff --git a/tests/baselines/reference/interfacePropertiesWithSameName1.symbols b/tests/baselines/reference/interfacePropertiesWithSameName1.symbols new file mode 100644 index 00000000000..aa002fa4af2 --- /dev/null +++ b/tests/baselines/reference/interfacePropertiesWithSameName1.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/interfacePropertiesWithSameName1.ts === +interface Mover { +>Mover : Symbol(Mover, Decl(interfacePropertiesWithSameName1.ts, 0, 0)) + + move(): void; +>move : Symbol(move, Decl(interfacePropertiesWithSameName1.ts, 0, 17)) + + getStatus(): { speed: number; }; +>getStatus : Symbol(getStatus, Decl(interfacePropertiesWithSameName1.ts, 1, 17)) +>speed : Symbol(speed, Decl(interfacePropertiesWithSameName1.ts, 2, 18)) +} +interface Shaker { +>Shaker : Symbol(Shaker, Decl(interfacePropertiesWithSameName1.ts, 3, 1)) + + shake(): void; +>shake : Symbol(shake, Decl(interfacePropertiesWithSameName1.ts, 4, 18)) + + getStatus(): { frequency: number; }; +>getStatus : Symbol(getStatus, Decl(interfacePropertiesWithSameName1.ts, 5, 18)) +>frequency : Symbol(frequency, Decl(interfacePropertiesWithSameName1.ts, 6, 18)) +} + +interface MoverShaker extends Mover, Shaker { +>MoverShaker : Symbol(MoverShaker, Decl(interfacePropertiesWithSameName1.ts, 7, 1)) +>Mover : Symbol(Mover, Decl(interfacePropertiesWithSameName1.ts, 0, 0)) +>Shaker : Symbol(Shaker, Decl(interfacePropertiesWithSameName1.ts, 3, 1)) + + getStatus(): { speed: number; frequency: number; }; +>getStatus : Symbol(getStatus, Decl(interfacePropertiesWithSameName1.ts, 9, 45)) +>speed : Symbol(speed, Decl(interfacePropertiesWithSameName1.ts, 10, 18)) +>frequency : Symbol(frequency, Decl(interfacePropertiesWithSameName1.ts, 10, 33)) +} + diff --git a/tests/baselines/reference/interfaceSubtyping.symbols b/tests/baselines/reference/interfaceSubtyping.symbols new file mode 100644 index 00000000000..6f77110885f --- /dev/null +++ b/tests/baselines/reference/interfaceSubtyping.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/interfaceSubtyping.ts === +interface iface { +>iface : Symbol(iface, Decl(interfaceSubtyping.ts, 0, 0)) + + foo(): void; +>foo : Symbol(foo, Decl(interfaceSubtyping.ts, 0, 17)) +} +class Camera implements iface{ +>Camera : Symbol(Camera, Decl(interfaceSubtyping.ts, 2, 1)) +>iface : Symbol(iface, Decl(interfaceSubtyping.ts, 0, 0)) + + constructor (public str: string) { +>str : Symbol(str, Decl(interfaceSubtyping.ts, 4, 17)) + } + foo() { return "s"; } +>foo : Symbol(foo, Decl(interfaceSubtyping.ts, 5, 5)) +} + diff --git a/tests/baselines/reference/interfaceSubtyping.types b/tests/baselines/reference/interfaceSubtyping.types index d9b31a50df9..26a900a56b2 100644 --- a/tests/baselines/reference/interfaceSubtyping.types +++ b/tests/baselines/reference/interfaceSubtyping.types @@ -14,5 +14,6 @@ class Camera implements iface{ } foo() { return "s"; } >foo : () => string +>"s" : string } diff --git a/tests/baselines/reference/interfaceThatHidesBaseProperty.symbols b/tests/baselines/reference/interfaceThatHidesBaseProperty.symbols new file mode 100644 index 00000000000..2705aef2b27 --- /dev/null +++ b/tests/baselines/reference/interfaceThatHidesBaseProperty.symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatHidesBaseProperty.ts === +interface Base { +>Base : Symbol(Base, Decl(interfaceThatHidesBaseProperty.ts, 0, 0)) + + x: { a: number }; +>x : Symbol(x, Decl(interfaceThatHidesBaseProperty.ts, 0, 16)) +>a : Symbol(a, Decl(interfaceThatHidesBaseProperty.ts, 1, 8)) +} + +interface Derived extends Base { +>Derived : Symbol(Derived, Decl(interfaceThatHidesBaseProperty.ts, 2, 1)) +>Base : Symbol(Base, Decl(interfaceThatHidesBaseProperty.ts, 0, 0)) + + x: { +>x : Symbol(x, Decl(interfaceThatHidesBaseProperty.ts, 4, 32)) + + a: number; b: number; +>a : Symbol(a, Decl(interfaceThatHidesBaseProperty.ts, 5, 8)) +>b : Symbol(b, Decl(interfaceThatHidesBaseProperty.ts, 6, 18)) + + }; +} diff --git a/tests/baselines/reference/interfaceWithCallAndConstructSignature.symbols b/tests/baselines/reference/interfaceWithCallAndConstructSignature.symbols new file mode 100644 index 00000000000..d9811466659 --- /dev/null +++ b/tests/baselines/reference/interfaceWithCallAndConstructSignature.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithCallAndConstructSignature.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithCallAndConstructSignature.ts, 0, 0)) + + (): number; + new (): any; +} + +var f: Foo; +>f : Symbol(f, Decl(interfaceWithCallAndConstructSignature.ts, 5, 3)) +>Foo : Symbol(Foo, Decl(interfaceWithCallAndConstructSignature.ts, 0, 0)) + +var r = f(); +>r : Symbol(r, Decl(interfaceWithCallAndConstructSignature.ts, 6, 3)) +>f : Symbol(f, Decl(interfaceWithCallAndConstructSignature.ts, 5, 3)) + +var r2 = new f(); +>r2 : Symbol(r2, Decl(interfaceWithCallAndConstructSignature.ts, 7, 3)) +>f : Symbol(f, Decl(interfaceWithCallAndConstructSignature.ts, 5, 3)) + diff --git a/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature.symbols b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature.symbols new file mode 100644 index 00000000000..8557f8e61b9 --- /dev/null +++ b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithCallSignaturesThatHidesBaseSignature.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 0, 0)) + + (): { a: number }; +>a : Symbol(a, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 1, 9)) +} + +interface Derived extends Foo { +>Derived : Symbol(Derived, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 0, 0)) + + (): { a: number; b: number }; +>a : Symbol(a, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 5, 9)) +>b : Symbol(b, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 5, 20)) +} + +var d: Derived; +>d : Symbol(d, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 8, 3)) +>Derived : Symbol(Derived, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 2, 1)) + +var r = d(); +>r : Symbol(r, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 9, 3)) +>d : Symbol(d, Decl(interfaceWithCallSignaturesThatHidesBaseSignature.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature2.symbols b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature2.symbols new file mode 100644 index 00000000000..0636b2dbaff --- /dev/null +++ b/tests/baselines/reference/interfaceWithCallSignaturesThatHidesBaseSignature2.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithCallSignaturesThatHidesBaseSignature2.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 0, 0)) + + (): { a: number; b: number }; +>a : Symbol(a, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 1, 9)) +>b : Symbol(b, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 1, 20)) +} + +interface Derived extends Foo { // error +>Derived : Symbol(Derived, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 0, 0)) + + (): { a: number }; +>a : Symbol(a, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 5, 9)) +} + +var d: Derived; +>d : Symbol(d, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 8, 3)) +>Derived : Symbol(Derived, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 2, 1)) + +var r = d(); +>r : Symbol(r, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 9, 3)) +>d : Symbol(d, Decl(interfaceWithCallSignaturesThatHidesBaseSignature2.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithCommaSeparators.symbols b/tests/baselines/reference/interfaceWithCommaSeparators.symbols new file mode 100644 index 00000000000..e96a8852d56 --- /dev/null +++ b/tests/baselines/reference/interfaceWithCommaSeparators.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/interfaceWithCommaSeparators.ts === +var v: { bar(): void, baz } +>v : Symbol(v, Decl(interfaceWithCommaSeparators.ts, 0, 3)) +>bar : Symbol(bar, Decl(interfaceWithCommaSeparators.ts, 0, 8)) +>baz : Symbol(baz, Decl(interfaceWithCommaSeparators.ts, 0, 21)) + +interface Foo { bar(): void, baz } +>Foo : Symbol(Foo, Decl(interfaceWithCommaSeparators.ts, 0, 27)) +>bar : Symbol(bar, Decl(interfaceWithCommaSeparators.ts, 1, 15)) +>baz : Symbol(baz, Decl(interfaceWithCommaSeparators.ts, 1, 28)) + diff --git a/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature.symbols b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature.symbols new file mode 100644 index 00000000000..377d8053414 --- /dev/null +++ b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithConstructSignaturesThatHidesBaseSignature.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 0, 0)) + + new (): { a: number }; +>a : Symbol(a, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 1, 13)) +} + +interface Derived extends Foo { +>Derived : Symbol(Derived, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 0, 0)) + + new (): { a: number; b: number }; +>a : Symbol(a, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 5, 13)) +>b : Symbol(b, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 5, 24)) +} + +var d: Derived; +>d : Symbol(d, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 8, 3)) +>Derived : Symbol(Derived, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 2, 1)) + +var r = new d(); +>r : Symbol(r, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 9, 3)) +>d : Symbol(d, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature2.symbols b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature2.symbols new file mode 100644 index 00000000000..b15dcd632e7 --- /dev/null +++ b/tests/baselines/reference/interfaceWithConstructSignaturesThatHidesBaseSignature2.symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithConstructSignaturesThatHidesBaseSignature2.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 0, 0)) + + new (): { a: number; b: number }; +>a : Symbol(a, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 1, 13)) +>b : Symbol(b, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 1, 24)) +} + +interface Derived extends Foo { +>Derived : Symbol(Derived, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 0, 0)) + + new (): { a: number }; // constructors not checked for conformance like a call signature is +>a : Symbol(a, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 5, 13)) +} + +var d: Derived; +>d : Symbol(d, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 8, 3)) +>Derived : Symbol(Derived, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 2, 1)) + +var r = new d(); +>r : Symbol(r, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 9, 3)) +>d : Symbol(d, Decl(interfaceWithConstructSignaturesThatHidesBaseSignature2.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithOptionalProperty.symbols b/tests/baselines/reference/interfaceWithOptionalProperty.symbols new file mode 100644 index 00000000000..262b3f01ccc --- /dev/null +++ b/tests/baselines/reference/interfaceWithOptionalProperty.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/interfaceWithOptionalProperty.ts === + +interface I { +>I : Symbol(I, Decl(interfaceWithOptionalProperty.ts, 0, 0)) + + x?: number; +>x : Symbol(x, Decl(interfaceWithOptionalProperty.ts, 1, 13)) +} diff --git a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.symbols b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.symbols new file mode 100644 index 00000000000..28dcb55238b --- /dev/null +++ b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithOverloadedCallAndConstructSignatures.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 0, 0)) + + (): number; + (x: string): number; +>x : Symbol(x, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 2, 5)) + + new (): any; + new (x: string): Object; +>x : Symbol(x, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 5, 9)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +var f: Foo; +>f : Symbol(f, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 8, 3)) +>Foo : Symbol(Foo, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 0, 0)) + +var r1 = f(); +>r1 : Symbol(r1, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 9, 3)) +>f : Symbol(f, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 8, 3)) + +var r2 = f(''); +>r2 : Symbol(r2, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 10, 3)) +>f : Symbol(f, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 8, 3)) + +var r3 = new f(); +>r3 : Symbol(r3, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 11, 3)) +>f : Symbol(f, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 8, 3)) + +var r4 = new f(''); +>r4 : Symbol(r4, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 12, 3)) +>f : Symbol(f, Decl(interfaceWithOverloadedCallAndConstructSignatures.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types index 1172f10a3dd..1110992fd52 100644 --- a/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types +++ b/tests/baselines/reference/interfaceWithOverloadedCallAndConstructSignatures.types @@ -25,6 +25,7 @@ var r2 = f(''); >r2 : number >f('') : number >f : Foo +>'' : string var r3 = new f(); >r3 : any @@ -35,4 +36,5 @@ var r4 = new f(''); >r4 : Object >new f('') : Object >f : Foo +>'' : string diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.symbols b/tests/baselines/reference/interfaceWithPropertyOfEveryType.symbols new file mode 100644 index 00000000000..46c8e92261f --- /dev/null +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.symbols @@ -0,0 +1,139 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithPropertyOfEveryType.ts === +class C { foo: string; } +>C : Symbol(C, Decl(interfaceWithPropertyOfEveryType.ts, 0, 0)) +>foo : Symbol(foo, Decl(interfaceWithPropertyOfEveryType.ts, 0, 9)) + +function f1() { } +>f1 : Symbol(f1, Decl(interfaceWithPropertyOfEveryType.ts, 0, 24)) + +module M { +>M : Symbol(M, Decl(interfaceWithPropertyOfEveryType.ts, 1, 17)) + + export var y = 1; +>y : Symbol(y, Decl(interfaceWithPropertyOfEveryType.ts, 3, 14)) +} +enum E { A } +>E : Symbol(E, Decl(interfaceWithPropertyOfEveryType.ts, 4, 1)) +>A : Symbol(E.A, Decl(interfaceWithPropertyOfEveryType.ts, 5, 8)) + +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithPropertyOfEveryType.ts, 5, 12)) + + a: number; +>a : Symbol(a, Decl(interfaceWithPropertyOfEveryType.ts, 7, 15)) + + b: string; +>b : Symbol(b, Decl(interfaceWithPropertyOfEveryType.ts, 8, 14)) + + c: boolean; +>c : Symbol(c, Decl(interfaceWithPropertyOfEveryType.ts, 9, 14)) + + d: any; +>d : Symbol(d, Decl(interfaceWithPropertyOfEveryType.ts, 10, 15)) + + e: void; +>e : Symbol(e, Decl(interfaceWithPropertyOfEveryType.ts, 11, 11)) + + f: number[]; +>f : Symbol(f, Decl(interfaceWithPropertyOfEveryType.ts, 12, 12)) + + g: Object; +>g : Symbol(g, Decl(interfaceWithPropertyOfEveryType.ts, 13, 16)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + h: (x: number) => number; +>h : Symbol(h, Decl(interfaceWithPropertyOfEveryType.ts, 14, 14)) +>x : Symbol(x, Decl(interfaceWithPropertyOfEveryType.ts, 15, 8)) + + i: (x: T) => T; +>i : Symbol(i, Decl(interfaceWithPropertyOfEveryType.ts, 15, 29)) +>T : Symbol(T, Decl(interfaceWithPropertyOfEveryType.ts, 16, 8)) +>x : Symbol(x, Decl(interfaceWithPropertyOfEveryType.ts, 16, 11)) +>T : Symbol(T, Decl(interfaceWithPropertyOfEveryType.ts, 16, 8)) +>T : Symbol(T, Decl(interfaceWithPropertyOfEveryType.ts, 16, 8)) + + j: Foo; +>j : Symbol(j, Decl(interfaceWithPropertyOfEveryType.ts, 16, 22)) +>Foo : Symbol(Foo, Decl(interfaceWithPropertyOfEveryType.ts, 5, 12)) + + k: C; +>k : Symbol(k, Decl(interfaceWithPropertyOfEveryType.ts, 17, 11)) +>C : Symbol(C, Decl(interfaceWithPropertyOfEveryType.ts, 0, 0)) + + l: typeof f1; +>l : Symbol(l, Decl(interfaceWithPropertyOfEveryType.ts, 18, 9)) +>f1 : Symbol(f1, Decl(interfaceWithPropertyOfEveryType.ts, 0, 24)) + + m: typeof M; +>m : Symbol(m, Decl(interfaceWithPropertyOfEveryType.ts, 19, 17)) +>M : Symbol(M, Decl(interfaceWithPropertyOfEveryType.ts, 1, 17)) + + n: {}; +>n : Symbol(n, Decl(interfaceWithPropertyOfEveryType.ts, 20, 16)) + + o: E; +>o : Symbol(o, Decl(interfaceWithPropertyOfEveryType.ts, 21, 10)) +>E : Symbol(E, Decl(interfaceWithPropertyOfEveryType.ts, 4, 1)) +} + +var a: Foo = { +>a : Symbol(a, Decl(interfaceWithPropertyOfEveryType.ts, 25, 3)) +>Foo : Symbol(Foo, Decl(interfaceWithPropertyOfEveryType.ts, 5, 12)) + + a: 1, +>a : Symbol(a, Decl(interfaceWithPropertyOfEveryType.ts, 25, 14)) + + b: '', +>b : Symbol(b, Decl(interfaceWithPropertyOfEveryType.ts, 26, 9)) + + c: true, +>c : Symbol(c, Decl(interfaceWithPropertyOfEveryType.ts, 27, 10)) + + d: {}, +>d : Symbol(d, Decl(interfaceWithPropertyOfEveryType.ts, 28, 12)) + + e: null , +>e : Symbol(e, Decl(interfaceWithPropertyOfEveryType.ts, 29, 10)) + + f: [1], +>f : Symbol(f, Decl(interfaceWithPropertyOfEveryType.ts, 30, 13)) + + g: {}, +>g : Symbol(g, Decl(interfaceWithPropertyOfEveryType.ts, 31, 11)) + + h: (x: number) => 1, +>h : Symbol(h, Decl(interfaceWithPropertyOfEveryType.ts, 32, 10)) +>x : Symbol(x, Decl(interfaceWithPropertyOfEveryType.ts, 33, 8)) + + i: (x: T) => x, +>i : Symbol(i, Decl(interfaceWithPropertyOfEveryType.ts, 33, 24)) +>T : Symbol(T, Decl(interfaceWithPropertyOfEveryType.ts, 34, 8)) +>x : Symbol(x, Decl(interfaceWithPropertyOfEveryType.ts, 34, 11)) +>T : Symbol(T, Decl(interfaceWithPropertyOfEveryType.ts, 34, 8)) +>x : Symbol(x, Decl(interfaceWithPropertyOfEveryType.ts, 34, 11)) + + j: null, +>j : Symbol(j, Decl(interfaceWithPropertyOfEveryType.ts, 34, 22)) +>Foo : Symbol(Foo, Decl(interfaceWithPropertyOfEveryType.ts, 5, 12)) + + k: new C(), +>k : Symbol(k, Decl(interfaceWithPropertyOfEveryType.ts, 35, 17)) +>C : Symbol(C, Decl(interfaceWithPropertyOfEveryType.ts, 0, 0)) + + l: f1, +>l : Symbol(l, Decl(interfaceWithPropertyOfEveryType.ts, 36, 15)) +>f1 : Symbol(f1, Decl(interfaceWithPropertyOfEveryType.ts, 0, 24)) + + m: M, +>m : Symbol(m, Decl(interfaceWithPropertyOfEveryType.ts, 37, 10)) +>M : Symbol(M, Decl(interfaceWithPropertyOfEveryType.ts, 1, 17)) + + n: {}, +>n : Symbol(n, Decl(interfaceWithPropertyOfEveryType.ts, 38, 9)) + + o: E.A +>o : Symbol(o, Decl(interfaceWithPropertyOfEveryType.ts, 39, 10)) +>E.A : Symbol(E.A, Decl(interfaceWithPropertyOfEveryType.ts, 5, 8)) +>E : Symbol(E, Decl(interfaceWithPropertyOfEveryType.ts, 4, 1)) +>A : Symbol(E.A, Decl(interfaceWithPropertyOfEveryType.ts, 5, 8)) +} diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types index 21d4359b6fb..7428ee73aa1 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types @@ -11,6 +11,7 @@ module M { export var y = 1; >y : number +>1 : number } enum E { A } >E : E @@ -83,12 +84,15 @@ var a: Foo = { a: 1, >a : number +>1 : number b: '', >b : string +>'' : string c: true, >c : boolean +>true : boolean d: {}, >d : {} @@ -96,10 +100,12 @@ var a: Foo = { e: null , >e : null +>null : null f: [1], >f : number[] >[1] : number[] +>1 : number g: {}, >g : {} @@ -109,6 +115,7 @@ var a: Foo = { >h : (x: number) => number >(x: number) => 1 : (x: number) => number >x : number +>1 : number i: (x: T) => x, >i : (x: T) => T @@ -122,6 +129,7 @@ var a: Foo = { >j : Foo >null : Foo >Foo : Foo +>null : null k: new C(), >k : C diff --git a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.symbols b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.symbols new file mode 100644 index 00000000000..40ec7863a04 --- /dev/null +++ b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithSpecializedCallAndConstructSignatures.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 0, 0)) + + (x: 'a'): number; +>x : Symbol(x, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 1, 5)) + + (x: string): any; +>x : Symbol(x, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 2, 5)) + + new (x: 'a'): any; +>x : Symbol(x, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 4, 9)) + + new (x: string): Object; +>x : Symbol(x, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 5, 9)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +var f: Foo; +>f : Symbol(f, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 8, 3)) +>Foo : Symbol(Foo, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 0, 0)) + +var r = f('a'); +>r : Symbol(r, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 9, 3)) +>f : Symbol(f, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 8, 3)) + +var r2 = f('A'); +>r2 : Symbol(r2, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 10, 3)) +>f : Symbol(f, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 8, 3)) + +var r3 = new f('a'); +>r3 : Symbol(r3, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 11, 3)) +>f : Symbol(f, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 8, 3)) + +var r4 = new f('A'); +>r4 : Symbol(r4, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 12, 3)) +>f : Symbol(f, Decl(interfaceWithSpecializedCallAndConstructSignatures.ts, 8, 3)) + diff --git a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types index e9bc0cd2889..971b5e56907 100644 --- a/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types +++ b/tests/baselines/reference/interfaceWithSpecializedCallAndConstructSignatures.types @@ -24,19 +24,23 @@ var r = f('a'); >r : number >f('a') : number >f : Foo +>'a' : string var r2 = f('A'); >r2 : any >f('A') : any >f : Foo +>'A' : string var r3 = new f('a'); >r3 : any >new f('a') : any >f : Foo +>'a' : string var r4 = new f('A'); >r4 : Object >new f('A') : Object >f : Foo +>'A' : string diff --git a/tests/baselines/reference/interfacedecl.symbols b/tests/baselines/reference/interfacedecl.symbols new file mode 100644 index 00000000000..eb9cce5f1fd --- /dev/null +++ b/tests/baselines/reference/interfacedecl.symbols @@ -0,0 +1,94 @@ +=== tests/cases/compiler/interfacedecl.ts === +interface a0 { +>a0 : Symbol(a0, Decl(interfacedecl.ts, 0, 0)) + + (): string; + (a, b, c?: string): number; +>a : Symbol(a, Decl(interfacedecl.ts, 2, 5)) +>b : Symbol(b, Decl(interfacedecl.ts, 2, 7)) +>c : Symbol(c, Decl(interfacedecl.ts, 2, 10)) + + new (): string; + new (s: string); +>s : Symbol(s, Decl(interfacedecl.ts, 5, 9)) + + [n: number]: ()=>string; +>n : Symbol(n, Decl(interfacedecl.ts, 7, 5)) + + [s: string]: any; +>s : Symbol(s, Decl(interfacedecl.ts, 8, 5)) + + p1; +>p1 : Symbol(p1, Decl(interfacedecl.ts, 8, 21)) + + p2: string; +>p2 : Symbol(p2, Decl(interfacedecl.ts, 10, 7)) + + p3?; +>p3 : Symbol(p3, Decl(interfacedecl.ts, 11, 15)) + + p4?: number; +>p4 : Symbol(p4, Decl(interfacedecl.ts, 12, 8)) + + p5: (s: number) =>string; +>p5 : Symbol(p5, Decl(interfacedecl.ts, 13, 16)) +>s : Symbol(s, Decl(interfacedecl.ts, 14, 9)) + + f1(); +>f1 : Symbol(f1, Decl(interfacedecl.ts, 14, 29)) + + f2? (); +>f2 : Symbol(f2, Decl(interfacedecl.ts, 16, 9)) + + f3(a: string): number; +>f3 : Symbol(f3, Decl(interfacedecl.ts, 17, 11)) +>a : Symbol(a, Decl(interfacedecl.ts, 18, 7)) + + f4? (s: number): string; +>f4 : Symbol(f4, Decl(interfacedecl.ts, 18, 26)) +>s : Symbol(s, Decl(interfacedecl.ts, 19, 9)) +} + + +interface a1 { +>a1 : Symbol(a1, Decl(interfacedecl.ts, 20, 1)) + + [n: number]: number; +>n : Symbol(n, Decl(interfacedecl.ts, 24, 5)) +} + +interface a2 { +>a2 : Symbol(a2, Decl(interfacedecl.ts, 25, 1)) + + [s: string]: number; +>s : Symbol(s, Decl(interfacedecl.ts, 28, 5)) +} + +interface a { +>a : Symbol(a, Decl(interfacedecl.ts, 29, 1)) +} + +interface b extends a { +>b : Symbol(b, Decl(interfacedecl.ts, 32, 1)) +>a : Symbol(a, Decl(interfacedecl.ts, 29, 1)) +} + +interface c extends a, b { +>c : Symbol(c, Decl(interfacedecl.ts, 35, 1)) +>a : Symbol(a, Decl(interfacedecl.ts, 29, 1)) +>b : Symbol(b, Decl(interfacedecl.ts, 32, 1)) +} + +interface d extends a { +>d : Symbol(d, Decl(interfacedecl.ts, 38, 1)) +>a : Symbol(a, Decl(interfacedecl.ts, 29, 1)) +} + +class c1 implements a { +>c1 : Symbol(c1, Decl(interfacedecl.ts, 41, 1)) +>a : Symbol(a, Decl(interfacedecl.ts, 29, 1)) +} +var instance2 = new c1(); +>instance2 : Symbol(instance2, Decl(interfacedecl.ts, 45, 3)) +>c1 : Symbol(c1, Decl(interfacedecl.ts, 41, 1)) + diff --git a/tests/baselines/reference/internalAliasClass.symbols b/tests/baselines/reference/internalAliasClass.symbols new file mode 100644 index 00000000000..4695367cf6e --- /dev/null +++ b/tests/baselines/reference/internalAliasClass.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/internalAliasClass.ts === +module a { +>a : Symbol(a, Decl(internalAliasClass.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(internalAliasClass.ts, 0, 10)) + } +} + +module c { +>c : Symbol(c, Decl(internalAliasClass.ts, 3, 1)) + + import b = a.c; +>b : Symbol(b, Decl(internalAliasClass.ts, 5, 10)) +>a : Symbol(a, Decl(internalAliasClass.ts, 0, 0)) +>c : Symbol(b, Decl(internalAliasClass.ts, 0, 10)) + + export var x: b = new b(); +>x : Symbol(x, Decl(internalAliasClass.ts, 7, 14)) +>b : Symbol(b, Decl(internalAliasClass.ts, 5, 10)) +>b : Symbol(b, Decl(internalAliasClass.ts, 5, 10)) +} diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..f3a796cf66c --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/internalAliasClassInsideLocalModuleWithExport.ts === +export module x { +>x : Symbol(x, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 0, 17)) + + foo(a: number) { +>foo : Symbol(foo, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 1, 20)) +>a : Symbol(a, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 2, 12)) + + return a; +>a : Symbol(a, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 2, 12)) + } + } +} + +export module m2 { +>m2 : Symbol(m2, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 6, 1)) + + export module m3 { +>m3 : Symbol(m3, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 8, 18)) + + export import c = x.c; +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 9, 22)) +>x : Symbol(x, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 0, 0)) +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 0, 17)) + + export var cProp = new c(); +>cProp : Symbol(cProp, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 11, 18)) +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 9, 22)) + + var cReturnVal = cProp.foo(10); +>cReturnVal : Symbol(cReturnVal, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 12, 11)) +>cProp.foo : Symbol(c.foo, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 1, 20)) +>cProp : Symbol(cProp, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 11, 18)) +>foo : Symbol(c.foo, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 1, 20)) + } +} + +export var d = new m2.m3.c(); +>d : Symbol(d, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 16, 10)) +>m2.m3.c : Symbol(m2.m3.c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 9, 22)) +>m2.m3 : Symbol(m2.m3, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 8, 18)) +>m2 : Symbol(m2, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 6, 1)) +>m3 : Symbol(m2.m3, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 8, 18)) +>c : Symbol(m2.m3.c, Decl(internalAliasClassInsideLocalModuleWithExport.ts, 9, 22)) + diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types index 3f6f5845fda..58afd2071fe 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithExport.types @@ -37,6 +37,7 @@ export module m2 { >cProp.foo : (a: number) => number >cProp : c >foo : (a: number) => number +>10 : number } } diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..5c1d8b16afc --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/internalAliasClassInsideLocalModuleWithoutExport.ts === +export module x { +>x : Symbol(x, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 0, 17)) + + foo(a: number) { +>foo : Symbol(foo, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 1, 20)) +>a : Symbol(a, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 2, 12)) + + return a; +>a : Symbol(a, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 2, 12)) + } + } +} + +export module m2 { +>m2 : Symbol(m2, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 6, 1)) + + export module m3 { +>m3 : Symbol(m3, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 8, 18)) + + import c = x.c; +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 9, 22)) +>x : Symbol(x, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 0, 0)) +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 0, 17)) + + export var cProp = new c(); +>cProp : Symbol(cProp, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 11, 18)) +>c : Symbol(c, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 9, 22)) + + var cReturnVal = cProp.foo(10); +>cReturnVal : Symbol(cReturnVal, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 12, 11)) +>cProp.foo : Symbol(c.foo, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 1, 20)) +>cProp : Symbol(cProp, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 11, 18)) +>foo : Symbol(c.foo, Decl(internalAliasClassInsideLocalModuleWithoutExport.ts, 1, 20)) + } +} diff --git a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types index 4f916d5689c..43f612d3f44 100644 --- a/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasClassInsideLocalModuleWithoutExport.types @@ -37,5 +37,6 @@ export module m2 { >cProp.foo : (a: number) => number >cProp : c >foo : (a: number) => number +>10 : number } } diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..1b4d44307e3 --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/internalAliasClassInsideTopLevelModuleWithExport.ts === +export module x { +>x : Symbol(x, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 0, 17)) + + foo(a: number) { +>foo : Symbol(foo, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 1, 20)) +>a : Symbol(a, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 2, 12)) + + return a; +>a : Symbol(a, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 2, 12)) + } + } +} + +export import xc = x.c; +>xc : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 6, 1)) +>x : Symbol(x, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 0, 0)) +>c : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var cProp = new xc(); +>cProp : Symbol(cProp, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 9, 10)) +>xc : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 6, 1)) + +var cReturnVal = cProp.foo(10); +>cReturnVal : Symbol(cReturnVal, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 10, 3)) +>cProp.foo : Symbol(xc.foo, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 1, 20)) +>cProp : Symbol(cProp, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 9, 10)) +>foo : Symbol(xc.foo, Decl(internalAliasClassInsideTopLevelModuleWithExport.ts, 1, 20)) + diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types index 6a25f03c2e9..3d72c04aad6 100644 --- a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithExport.types @@ -31,4 +31,5 @@ var cReturnVal = cProp.foo(10); >cProp.foo : (a: number) => number >cProp : xc >foo : (a: number) => number +>10 : number diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..b4e720cec94 --- /dev/null +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.ts === +export module x { +>x : Symbol(x, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export class c { +>c : Symbol(c, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 0, 17)) + + foo(a: number) { +>foo : Symbol(foo, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 1, 20)) +>a : Symbol(a, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 2, 12)) + + return a; +>a : Symbol(a, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 2, 12)) + } + } +} + +import xc = x.c; +>xc : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>x : Symbol(x, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>c : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var cProp = new xc(); +>cProp : Symbol(cProp, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 9, 10)) +>xc : Symbol(xc, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 6, 1)) + +var cReturnVal = cProp.foo(10); +>cReturnVal : Symbol(cReturnVal, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 10, 3)) +>cProp.foo : Symbol(xc.foo, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 1, 20)) +>cProp : Symbol(cProp, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 9, 10)) +>foo : Symbol(xc.foo, Decl(internalAliasClassInsideTopLevelModuleWithoutExport.ts, 1, 20)) + diff --git a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types index 4e086f86054..f816fdce7af 100644 --- a/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasClassInsideTopLevelModuleWithoutExport.types @@ -31,4 +31,5 @@ var cReturnVal = cProp.foo(10); >cProp.foo : (a: number) => number >cProp : xc >foo : (a: number) => number +>10 : number diff --git a/tests/baselines/reference/internalAliasEnum.symbols b/tests/baselines/reference/internalAliasEnum.symbols new file mode 100644 index 00000000000..d08317ae9a7 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnum.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasEnum.ts === +module a { +>a : Symbol(a, Decl(internalAliasEnum.ts, 0, 0)) + + export enum weekend { +>weekend : Symbol(weekend, Decl(internalAliasEnum.ts, 0, 10)) + + Friday, +>Friday : Symbol(weekend.Friday, Decl(internalAliasEnum.ts, 1, 25)) + + Saturday, +>Saturday : Symbol(weekend.Saturday, Decl(internalAliasEnum.ts, 2, 15)) + + Sunday +>Sunday : Symbol(weekend.Sunday, Decl(internalAliasEnum.ts, 3, 17)) + } +} + +module c { +>c : Symbol(c, Decl(internalAliasEnum.ts, 6, 1)) + + import b = a.weekend; +>b : Symbol(b, Decl(internalAliasEnum.ts, 8, 10)) +>a : Symbol(a, Decl(internalAliasEnum.ts, 0, 0)) +>weekend : Symbol(b, Decl(internalAliasEnum.ts, 0, 10)) + + export var bVal: b = b.Sunday; +>bVal : Symbol(bVal, Decl(internalAliasEnum.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasEnum.ts, 8, 10)) +>b.Sunday : Symbol(b.Sunday, Decl(internalAliasEnum.ts, 3, 17)) +>b : Symbol(b, Decl(internalAliasEnum.ts, 8, 10)) +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnum.ts, 3, 17)) +} + diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..84b7cb44f48 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithExport.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasEnumInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 0, 0)) + + export enum weekend { +>weekend : Symbol(weekend, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 0, 17)) + + Friday, +>Friday : Symbol(weekend.Friday, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 1, 25)) + + Saturday, +>Saturday : Symbol(weekend.Saturday, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 2, 15)) + + Sunday +>Sunday : Symbol(weekend.Sunday, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 3, 17)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 6, 1)) + + export import b = a.weekend; +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 8, 17)) +>a : Symbol(a, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 0, 0)) +>weekend : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 0, 17)) + + export var bVal: b = b.Sunday; +>bVal : Symbol(bVal, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 8, 17)) +>b.Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 3, 17)) +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 8, 17)) +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideLocalModuleWithExport.ts, 3, 17)) +} + diff --git a/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..c9e77221b6c --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasEnumInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 0, 0)) + + export enum weekend { +>weekend : Symbol(weekend, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 0, 17)) + + Friday, +>Friday : Symbol(weekend.Friday, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 1, 25)) + + Saturday, +>Saturday : Symbol(weekend.Saturday, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 2, 15)) + + Sunday +>Sunday : Symbol(weekend.Sunday, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 3, 17)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 6, 1)) + + import b = a.weekend; +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 8, 17)) +>a : Symbol(a, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 0, 0)) +>weekend : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 0, 17)) + + export var bVal: b = b.Sunday; +>bVal : Symbol(bVal, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 8, 17)) +>b.Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 3, 17)) +>b : Symbol(b, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 8, 17)) +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideLocalModuleWithoutExport.ts, 3, 17)) +} + diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..404dceb8507 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/internalAliasEnumInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 0, 0)) + + export enum weekend { +>weekend : Symbol(weekend, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 0, 17)) + + Friday, +>Friday : Symbol(b.Friday, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 1, 25)) + + Saturday, +>Saturday : Symbol(b.Saturday, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 2, 15)) + + Sunday +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 3, 17)) + } +} + +export import b = a.weekend; +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 6, 1)) +>a : Symbol(a, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 0, 0)) +>weekend : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var bVal: b = b.Sunday; +>bVal : Symbol(bVal, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 9, 10)) +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 6, 1)) +>b.Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 3, 17)) +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 6, 1)) +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithExport.ts, 3, 17)) + diff --git a/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..ca69a0f3181 --- /dev/null +++ b/tests/baselines/reference/internalAliasEnumInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/internalAliasEnumInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export enum weekend { +>weekend : Symbol(weekend, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 0, 17)) + + Friday, +>Friday : Symbol(b.Friday, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 1, 25)) + + Saturday, +>Saturday : Symbol(b.Saturday, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 2, 15)) + + Sunday +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 3, 17)) + } +} + +import b = a.weekend; +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>a : Symbol(a, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>weekend : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var bVal: b = b.Sunday; +>bVal : Symbol(bVal, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 9, 10)) +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>b.Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 3, 17)) +>b : Symbol(b, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>Sunday : Symbol(b.Sunday, Decl(internalAliasEnumInsideTopLevelModuleWithoutExport.ts, 3, 17)) + diff --git a/tests/baselines/reference/internalAliasFunction.symbols b/tests/baselines/reference/internalAliasFunction.symbols new file mode 100644 index 00000000000..cae4be7d574 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunction.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/internalAliasFunction.ts === +module a { +>a : Symbol(a, Decl(internalAliasFunction.ts, 0, 0)) + + export function foo(x: number) { +>foo : Symbol(foo, Decl(internalAliasFunction.ts, 0, 10)) +>x : Symbol(x, Decl(internalAliasFunction.ts, 1, 24)) + + return x; +>x : Symbol(x, Decl(internalAliasFunction.ts, 1, 24)) + } +} + +module c { +>c : Symbol(c, Decl(internalAliasFunction.ts, 4, 1)) + + import b = a.foo; +>b : Symbol(b, Decl(internalAliasFunction.ts, 6, 10)) +>a : Symbol(a, Decl(internalAliasFunction.ts, 0, 0)) +>foo : Symbol(b, Decl(internalAliasFunction.ts, 0, 10)) + + export var bVal = b(10); +>bVal : Symbol(bVal, Decl(internalAliasFunction.ts, 8, 14)) +>b : Symbol(b, Decl(internalAliasFunction.ts, 6, 10)) + + export var bVal2 = b; +>bVal2 : Symbol(bVal2, Decl(internalAliasFunction.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasFunction.ts, 6, 10)) +} + diff --git a/tests/baselines/reference/internalAliasFunction.types b/tests/baselines/reference/internalAliasFunction.types index ed297ce1b4e..d67535c76f7 100644 --- a/tests/baselines/reference/internalAliasFunction.types +++ b/tests/baselines/reference/internalAliasFunction.types @@ -23,6 +23,7 @@ module c { >bVal : number >b(10) : number >b : (x: number) => number +>10 : number export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..82fa9b118e0 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/internalAliasFunctionInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 0, 0)) + + export function foo(x: number) { +>foo : Symbol(foo, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 0, 17)) +>x : Symbol(x, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 1, 24)) + + return x; +>x : Symbol(x, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 1, 24)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 4, 1)) + + export import b = a.foo; +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 6, 17)) +>a : Symbol(a, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 0, 0)) +>foo : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 0, 17)) + + export var bVal = b(10); +>bVal : Symbol(bVal, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 8, 14)) +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 6, 17)) + + export var bVal2 = b; +>bVal2 : Symbol(bVal2, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithExport.ts, 6, 17)) +} + diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types index b3140e7b09a..928d8530228 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types @@ -23,6 +23,7 @@ export module c { >bVal : number >b(10) : number >b : (x: number) => number +>10 : number export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..4fe034d91a6 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/internalAliasFunctionInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 0, 0)) + + export function foo(x: number) { +>foo : Symbol(foo, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 0, 17)) +>x : Symbol(x, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 1, 24)) + + return x; +>x : Symbol(x, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 1, 24)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 4, 1)) + + import b = a.foo; +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 6, 17)) +>a : Symbol(a, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 0, 0)) +>foo : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 0, 17)) + + var bVal = b(10); +>bVal : Symbol(bVal, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 8, 7)) +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 6, 17)) + + export var bVal2 = b; +>bVal2 : Symbol(bVal2, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasFunctionInsideLocalModuleWithoutExport.ts, 6, 17)) +} + diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types index c78b5040495..630be11c71e 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types @@ -23,6 +23,7 @@ export module c { >bVal : number >b(10) : number >b : (x: number) => number +>10 : number export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..9281660ddd5 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/internalAliasFunctionInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 0, 0)) + + export function foo(x: number) { +>foo : Symbol(foo, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 0, 17)) +>x : Symbol(x, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 1, 24)) + + return x; +>x : Symbol(x, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 1, 24)) + } +} + +export import b = a.foo; +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 4, 1)) +>a : Symbol(a, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 0, 0)) +>foo : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var bVal = b(10); +>bVal : Symbol(bVal, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 7, 10)) +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 4, 1)) + +export var bVal2 = b; +>bVal2 : Symbol(bVal2, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 8, 10)) +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithExport.ts, 4, 1)) + diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types index 365f0edeb27..c1e9f9af3d7 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types @@ -20,6 +20,7 @@ export var bVal = b(10); >bVal : number >b(10) : number >b : (x: number) => number +>10 : number export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..ff079a34920 --- /dev/null +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/internalAliasFunctionInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export function foo(x: number) { +>foo : Symbol(foo, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 0, 17)) +>x : Symbol(x, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 1, 24)) + + return x; +>x : Symbol(x, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 1, 24)) + } +} + +import b = a.foo; +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 4, 1)) +>a : Symbol(a, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>foo : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var bVal = b(10); +>bVal : Symbol(bVal, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 7, 10)) +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 4, 1)) + +export var bVal2 = b; +>bVal2 : Symbol(bVal2, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 8, 10)) +>b : Symbol(b, Decl(internalAliasFunctionInsideTopLevelModuleWithoutExport.ts, 4, 1)) + diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types index c2f06c66f76..bca35e33dec 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types @@ -20,6 +20,7 @@ export var bVal = b(10); >bVal : number >b(10) : number >b : (x: number) => number +>10 : number export var bVal2 = b; >bVal2 : (x: number) => number diff --git a/tests/baselines/reference/internalAliasInitializedModule.symbols b/tests/baselines/reference/internalAliasInitializedModule.symbols new file mode 100644 index 00000000000..0487879019e --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModule.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/internalAliasInitializedModule.ts === +module a { +>a : Symbol(a, Decl(internalAliasInitializedModule.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasInitializedModule.ts, 0, 10)) + + export class c { +>c : Symbol(c, Decl(internalAliasInitializedModule.ts, 1, 21)) + } + } +} + +module c { +>c : Symbol(c, Decl(internalAliasInitializedModule.ts, 5, 1)) + + import b = a.b; +>b : Symbol(b, Decl(internalAliasInitializedModule.ts, 7, 10)) +>a : Symbol(a, Decl(internalAliasInitializedModule.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasInitializedModule.ts, 0, 10)) + + export var x: b.c = new b.c(); +>x : Symbol(x, Decl(internalAliasInitializedModule.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasInitializedModule.ts, 7, 10)) +>c : Symbol(b.c, Decl(internalAliasInitializedModule.ts, 1, 21)) +>b.c : Symbol(b.c, Decl(internalAliasInitializedModule.ts, 1, 21)) +>b : Symbol(b, Decl(internalAliasInitializedModule.ts, 7, 10)) +>c : Symbol(b.c, Decl(internalAliasInitializedModule.ts, 1, 21)) +} diff --git a/tests/baselines/reference/internalAliasInitializedModule.types b/tests/baselines/reference/internalAliasInitializedModule.types index dacc2f148bd..0e7c9650182 100644 --- a/tests/baselines/reference/internalAliasInitializedModule.types +++ b/tests/baselines/reference/internalAliasInitializedModule.types @@ -21,7 +21,7 @@ module c { export var x: b.c = new b.c(); >x : b.c ->b : unknown +>b : any >c : b.c >new b.c() : b.c >b.c : typeof b.c diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..35b121410e4 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/internalAliasInitializedModuleInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 0, 17)) + + export class c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) + } + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 5, 1)) + + export import b = a.b; +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 7, 17)) +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 0, 17)) + + export var x: b.c = new b.c(); +>x : Symbol(x, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 7, 17)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) +>b.c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 7, 17)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) +} diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.types index 973003d2c49..302ac5ada43 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithExport.types @@ -21,7 +21,7 @@ export module c { export var x: b.c = new b.c(); >x : b.c ->b : unknown +>b : any >c : b.c >new b.c() : b.c >b.c : typeof b.c diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..539874f4534 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 0, 17)) + + export class c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) + } + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 5, 1)) + + import b = a.b; +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 7, 17)) +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 0, 17)) + + export var x: b.c = new b.c(); +>x : Symbol(x, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 9, 14)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 7, 17)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) +>b.c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 7, 17)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) +} diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.types index 540883209de..f5ea07fb744 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideLocalModuleWithoutExport.types @@ -21,7 +21,7 @@ export module c { export var x: b.c = new b.c(); >x : b.c ->b : unknown +>b : any >c : b.c >new b.c() : b.c >b.c : typeof b.c diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..78b6ee28589 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 0, 17)) + + export class c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) + } + } +} + +export import b = a.b; +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 5, 1)) +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var x: b.c = new b.c(); +>x : Symbol(x, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 8, 10)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 5, 1)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) +>b.c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 5, 1)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) + diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.types index aa9944787d6..f6ba838f3d7 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithExport.types @@ -18,7 +18,7 @@ export import b = a.b; export var x: b.c = new b.c(); >x : b.c ->b : unknown +>b : any >c : b.c >new b.c() : b.c >b.c : typeof b.c diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..ec49c87d617 --- /dev/null +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 17)) + + export class c { +>c : Symbol(c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) + } + } +} + +import b = a.b; +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 5, 1)) +>a : Symbol(a, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var x: b.c = new b.c(); +>x : Symbol(x, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 8, 10)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 5, 1)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) +>b.c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) +>b : Symbol(b, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 5, 1)) +>c : Symbol(b.c, Decl(internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) + diff --git a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.types index e17fcdba2a7..b15bb6dc8ec 100644 --- a/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.types @@ -18,7 +18,7 @@ import b = a.b; export var x: b.c = new b.c(); >x : b.c ->b : unknown +>b : any >c : b.c >new b.c() : b.c >b.c : typeof b.c diff --git a/tests/baselines/reference/internalAliasInterface.symbols b/tests/baselines/reference/internalAliasInterface.symbols new file mode 100644 index 00000000000..f4c3d493c6f --- /dev/null +++ b/tests/baselines/reference/internalAliasInterface.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/internalAliasInterface.ts === +module a { +>a : Symbol(a, Decl(internalAliasInterface.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(internalAliasInterface.ts, 0, 10)) + } +} + +module c { +>c : Symbol(c, Decl(internalAliasInterface.ts, 3, 1)) + + import b = a.I; +>b : Symbol(b, Decl(internalAliasInterface.ts, 5, 10)) +>a : Symbol(a, Decl(internalAliasInterface.ts, 0, 0)) +>I : Symbol(b, Decl(internalAliasInterface.ts, 0, 10)) + + export var x: b; +>x : Symbol(x, Decl(internalAliasInterface.ts, 7, 14)) +>b : Symbol(b, Decl(internalAliasInterface.ts, 5, 10)) +} + diff --git a/tests/baselines/reference/internalAliasInterface.types b/tests/baselines/reference/internalAliasInterface.types index 310c568104d..fdb60eee7ce 100644 --- a/tests/baselines/reference/internalAliasInterface.types +++ b/tests/baselines/reference/internalAliasInterface.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalAliasInterface.ts === module a { ->a : unknown +>a : any export interface I { >I : I @@ -11,8 +11,8 @@ module c { >c : typeof c import b = a.I; ->b : unknown ->a : unknown +>b : any +>a : any >I : b export var x: b; diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..d2455d82343 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 0, 17)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 3, 1)) + + export import b = a.I; +>b : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 5, 17)) +>a : Symbol(a, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 0, 0)) +>I : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 0, 17)) + + export var x: b; +>x : Symbol(x, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 7, 14)) +>b : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithExport.ts, 5, 17)) +} + diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.types index 9667fd125d5..84dae24aeb6 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithExport.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithExport.ts === export module a { ->a : unknown +>a : any export interface I { >I : I @@ -11,8 +11,8 @@ export module c { >c : typeof c export import b = a.I; ->b : unknown ->a : unknown +>b : any +>a : any >I : b export var x: b; diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..00aa21e52fa --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 0, 17)) + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 3, 1)) + + import b = a.I; +>b : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 5, 17)) +>a : Symbol(a, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 0, 0)) +>I : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 0, 17)) + + export var x: b; +>x : Symbol(x, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 7, 14)) +>b : Symbol(b, Decl(internalAliasInterfaceInsideLocalModuleWithoutExport.ts, 5, 17)) +} + diff --git a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.types index 2f9368bc6a9..f236f9b49a8 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasInterfaceInsideLocalModuleWithoutExport.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExport.ts === export module a { ->a : unknown +>a : any export interface I { >I : I @@ -11,8 +11,8 @@ export module c { >c : typeof c import b = a.I; ->b : unknown ->a : unknown +>b : any +>a : any >I : b export var x: b; diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..3947509fad3 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 0, 17)) + } +} + +export import b = a.I; +>b : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 3, 1)) +>a : Symbol(a, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 0, 0)) +>I : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var x: b; +>x : Symbol(x, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 6, 10)) +>b : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithExport.ts, 3, 1)) + diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.types index 9197d1e0215..365c526383c 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithExport.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.ts === export module a { ->a : unknown +>a : any export interface I { >I : I @@ -8,8 +8,8 @@ export module a { } export import b = a.I; ->b : unknown ->a : unknown +>b : any +>a : any >I : b export var x: b; diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..9561b861731 --- /dev/null +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export interface I { +>I : Symbol(I, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 0, 17)) + } +} + +import b = a.I; +>b : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 3, 1)) +>a : Symbol(a, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>I : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var x: b; +>x : Symbol(x, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 6, 10)) +>b : Symbol(b, Decl(internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts, 3, 1)) + diff --git a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.types index 58be03b6a3c..2a8ee86a7f7 100644 --- a/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasInterfaceInsideTopLevelModuleWithoutExport.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalAliasInterfaceInsideTopLevelModuleWithoutExport.ts === export module a { ->a : unknown +>a : any export interface I { >I : I @@ -8,8 +8,8 @@ export module a { } import b = a.I; ->b : unknown ->a : unknown +>b : any +>a : any >I : b export var x: b; diff --git a/tests/baselines/reference/internalAliasUninitializedModule.symbols b/tests/baselines/reference/internalAliasUninitializedModule.symbols new file mode 100644 index 00000000000..95af5c5699d --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModule.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasUninitializedModule.ts === +module a { +>a : Symbol(a, Decl(internalAliasUninitializedModule.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasUninitializedModule.ts, 0, 10)) + + export interface I { +>I : Symbol(I, Decl(internalAliasUninitializedModule.ts, 1, 21)) + + foo(); +>foo : Symbol(foo, Decl(internalAliasUninitializedModule.ts, 2, 28)) + } + } +} + +module c { +>c : Symbol(c, Decl(internalAliasUninitializedModule.ts, 6, 1)) + + import b = a.b; +>b : Symbol(b, Decl(internalAliasUninitializedModule.ts, 8, 10)) +>a : Symbol(a, Decl(internalAliasUninitializedModule.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasUninitializedModule.ts, 0, 10)) + + export var x: b.I; +>x : Symbol(x, Decl(internalAliasUninitializedModule.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasUninitializedModule.ts, 8, 10)) +>I : Symbol(b.I, Decl(internalAliasUninitializedModule.ts, 1, 21)) + + x.foo(); +>x.foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModule.ts, 2, 28)) +>x : Symbol(x, Decl(internalAliasUninitializedModule.ts, 10, 14)) +>foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModule.ts, 2, 28)) +} diff --git a/tests/baselines/reference/internalAliasUninitializedModule.types b/tests/baselines/reference/internalAliasUninitializedModule.types index 408a2467e03..6599fd0fda0 100644 --- a/tests/baselines/reference/internalAliasUninitializedModule.types +++ b/tests/baselines/reference/internalAliasUninitializedModule.types @@ -1,9 +1,9 @@ === tests/cases/compiler/internalAliasUninitializedModule.ts === module a { ->a : unknown +>a : any export module b { ->b : unknown +>b : any export interface I { >I : I @@ -18,13 +18,13 @@ module c { >c : typeof c import b = a.b; ->b : unknown ->a : unknown ->b : unknown +>b : any +>a : any +>b : any export var x: b.I; >x : b.I ->b : unknown +>b : any >I : b.I x.foo(); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..861859ce2ea --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 0, 17)) + + export interface I { +>I : Symbol(I, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) + + foo(); +>foo : Symbol(foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 2, 28)) + } + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 6, 1)) + + export import b = a.b; +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 8, 17)) +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 0, 17)) + + export var x: b.I; +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 8, 17)) +>I : Symbol(b.I, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 1, 21)) + + x.foo(); +>x.foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 2, 28)) +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 10, 14)) +>foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithExport.ts, 2, 28)) +} diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types index f7bbc68dac0..d54620658e6 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithExport.types @@ -1,9 +1,9 @@ === tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.ts === export module a { ->a : unknown +>a : any export module b { ->b : unknown +>b : any export interface I { >I : I @@ -18,13 +18,13 @@ export module c { >c : typeof c export import b = a.b; ->b : unknown ->a : unknown ->b : unknown +>b : any +>a : any +>b : any export var x: b.I; >x : b.I ->b : unknown +>b : any >I : b.I x.foo(); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..433426c9fd9 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 0, 17)) + + export interface I { +>I : Symbol(I, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) + + foo(); +>foo : Symbol(foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 2, 28)) + } + } +} + +export module c { +>c : Symbol(c, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 6, 1)) + + import b = a.b; +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 8, 17)) +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 0, 17)) + + export var x: b.I; +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 10, 14)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 8, 17)) +>I : Symbol(b.I, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 1, 21)) + + x.foo(); +>x.foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 2, 28)) +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 10, 14)) +>foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts, 2, 28)) +} diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types index cf9a85a712f..9bb409b22e1 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.types @@ -1,9 +1,9 @@ === tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.ts === export module a { ->a : unknown +>a : any export module b { ->b : unknown +>b : any export interface I { >I : I @@ -18,13 +18,13 @@ export module c { >c : typeof c import b = a.b; ->b : unknown ->a : unknown ->b : unknown +>b : any +>a : any +>b : any export var x: b.I; >x : b.I ->b : unknown +>b : any >I : b.I x.foo(); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..14428deac43 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 0, 17)) + + export interface I { +>I : Symbol(I, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) + + foo(); +>foo : Symbol(foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 2, 28)) + } + } +} + +export import b = a.b; +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 6, 1)) +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 0, 17)) + +export var x: b.I; +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 9, 10)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 6, 1)) +>I : Symbol(b.I, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 1, 21)) + +x.foo(); +>x.foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 2, 28)) +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 9, 10)) +>foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts, 2, 28)) + diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types index 015ec48fe6a..dbca81bf40b 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.types @@ -1,9 +1,9 @@ === tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithExport.ts === export module a { ->a : unknown +>a : any export module b { ->b : unknown +>b : any export interface I { >I : I @@ -15,13 +15,13 @@ export module a { } export import b = a.b; ->b : unknown ->a : unknown ->b : unknown +>b : any +>a : any +>b : any export var x: b.I; >x : b.I ->b : unknown +>b : any >I : b.I x.foo(); diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..cd17daeb023 --- /dev/null +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export module b { +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 17)) + + export interface I { +>I : Symbol(I, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) + + foo(); +>foo : Symbol(foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 2, 28)) + } + } +} + +import b = a.b; +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>a : Symbol(a, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 0, 17)) + +export var x: b.I; +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 9, 10)) +>b : Symbol(b, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 6, 1)) +>I : Symbol(b.I, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 1, 21)) + +x.foo(); +>x.foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 2, 28)) +>x : Symbol(x, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 9, 10)) +>foo : Symbol(b.I.foo, Decl(internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts, 2, 28)) + diff --git a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types index 71a2f535816..a2b07049295 100644 --- a/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.types @@ -1,9 +1,9 @@ === tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.ts === export module a { ->a : unknown +>a : any export module b { ->b : unknown +>b : any export interface I { >I : I @@ -15,13 +15,13 @@ export module a { } import b = a.b; ->b : unknown ->a : unknown ->b : unknown +>b : any +>a : any +>b : any export var x: b.I; >x : b.I ->b : unknown +>b : any >I : b.I x.foo(); diff --git a/tests/baselines/reference/internalAliasVar.symbols b/tests/baselines/reference/internalAliasVar.symbols new file mode 100644 index 00000000000..52b1d3233f5 --- /dev/null +++ b/tests/baselines/reference/internalAliasVar.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/internalAliasVar.ts === +module a { +>a : Symbol(a, Decl(internalAliasVar.ts, 0, 0)) + + export var x = 10; +>x : Symbol(x, Decl(internalAliasVar.ts, 1, 14)) +} + +module c { +>c : Symbol(c, Decl(internalAliasVar.ts, 2, 1)) + + import b = a.x; +>b : Symbol(b, Decl(internalAliasVar.ts, 4, 10)) +>a : Symbol(a, Decl(internalAliasVar.ts, 0, 0)) +>x : Symbol(b, Decl(internalAliasVar.ts, 1, 14)) + + export var bVal = b; +>bVal : Symbol(bVal, Decl(internalAliasVar.ts, 6, 14)) +>b : Symbol(b, Decl(internalAliasVar.ts, 4, 10)) +} + diff --git a/tests/baselines/reference/internalAliasVar.types b/tests/baselines/reference/internalAliasVar.types index d284b064d83..59da851b569 100644 --- a/tests/baselines/reference/internalAliasVar.types +++ b/tests/baselines/reference/internalAliasVar.types @@ -4,6 +4,7 @@ module a { export var x = 10; >x : number +>10 : number } module c { diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.symbols b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.symbols new file mode 100644 index 00000000000..099d257ec71 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/internalAliasVarInsideLocalModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 0, 0)) + + export var x = 10; +>x : Symbol(x, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 1, 14)) +} + +export module c { +>c : Symbol(c, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 2, 1)) + + export import b = a.x; +>b : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 4, 17)) +>a : Symbol(a, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 0, 0)) +>x : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 1, 14)) + + export var bVal = b; +>bVal : Symbol(bVal, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 6, 14)) +>b : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithExport.ts, 4, 17)) +} + diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types index b8d94c9ebbd..995c24bc382 100644 --- a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithExport.types @@ -4,6 +4,7 @@ export module a { export var x = 10; >x : number +>10 : number } export module c { diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.symbols new file mode 100644 index 00000000000..9a32adb4069 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/internalAliasVarInsideLocalModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 0, 0)) + + export var x = 10; +>x : Symbol(x, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 1, 14)) +} + +export module c { +>c : Symbol(c, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 2, 1)) + + import b = a.x; +>b : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 4, 17)) +>a : Symbol(a, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 0, 0)) +>x : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 1, 14)) + + export var bVal = b; +>bVal : Symbol(bVal, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 6, 14)) +>b : Symbol(b, Decl(internalAliasVarInsideLocalModuleWithoutExport.ts, 4, 17)) +} + diff --git a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types index c9e2897befb..5e322f8483c 100644 --- a/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasVarInsideLocalModuleWithoutExport.types @@ -4,6 +4,7 @@ export module a { export var x = 10; >x : number +>10 : number } export module c { diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.symbols b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.symbols new file mode 100644 index 00000000000..1fa0bf59d50 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/internalAliasVarInsideTopLevelModuleWithExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 0, 0)) + + export var x = 10; +>x : Symbol(x, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 1, 14)) +} + +export import b = a.x; +>b : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 2, 1)) +>a : Symbol(a, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 0, 0)) +>x : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 1, 14)) + +export var bVal = b; +>bVal : Symbol(bVal, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 5, 10)) +>b : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithExport.ts, 2, 1)) + + diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types index 22335c7d8c0..199de9cae51 100644 --- a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithExport.types @@ -4,6 +4,7 @@ export module a { export var x = 10; >x : number +>10 : number } export import b = a.x; diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.symbols b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.symbols new file mode 100644 index 00000000000..a1d9ab3cc45 --- /dev/null +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/internalAliasVarInsideTopLevelModuleWithoutExport.ts === +export module a { +>a : Symbol(a, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 0, 0)) + + export var x = 10; +>x : Symbol(x, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 1, 14)) +} + +import b = a.x; +>b : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 2, 1)) +>a : Symbol(a, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 0, 0)) +>x : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 1, 14)) + +export var bVal = b; +>bVal : Symbol(bVal, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 5, 10)) +>b : Symbol(b, Decl(internalAliasVarInsideTopLevelModuleWithoutExport.ts, 2, 1)) + + diff --git a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types index 1474735c62d..d7a7309ccb4 100644 --- a/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasVarInsideTopLevelModuleWithoutExport.types @@ -4,6 +4,7 @@ export module a { export var x = 10; >x : number +>10 : number } import b = a.x; diff --git a/tests/baselines/reference/internalAliasWithDottedNameEmit.symbols b/tests/baselines/reference/internalAliasWithDottedNameEmit.symbols new file mode 100644 index 00000000000..d4fe1ff9d58 --- /dev/null +++ b/tests/baselines/reference/internalAliasWithDottedNameEmit.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/internalAliasWithDottedNameEmit.ts === +module a.b.c { +>a : Symbol(a, Decl(internalAliasWithDottedNameEmit.ts, 0, 0), Decl(internalAliasWithDottedNameEmit.ts, 2, 1)) +>b : Symbol(b, Decl(internalAliasWithDottedNameEmit.ts, 0, 9)) +>c : Symbol(c, Decl(internalAliasWithDottedNameEmit.ts, 0, 11)) + + export var d; +>d : Symbol(d, Decl(internalAliasWithDottedNameEmit.ts, 1, 16)) +} +module a.e.f { +>a : Symbol(a, Decl(internalAliasWithDottedNameEmit.ts, 0, 0), Decl(internalAliasWithDottedNameEmit.ts, 2, 1)) +>e : Symbol(e, Decl(internalAliasWithDottedNameEmit.ts, 3, 9)) +>f : Symbol(f, Decl(internalAliasWithDottedNameEmit.ts, 3, 11)) + + import g = b.c; +>g : Symbol(g, Decl(internalAliasWithDottedNameEmit.ts, 3, 14)) +>b : Symbol(b, Decl(internalAliasWithDottedNameEmit.ts, 0, 9)) +>c : Symbol(g, Decl(internalAliasWithDottedNameEmit.ts, 0, 11)) +} + diff --git a/tests/baselines/reference/internalAliasWithDottedNameEmit.types b/tests/baselines/reference/internalAliasWithDottedNameEmit.types index 2b66ec9541b..60cae3c887a 100644 --- a/tests/baselines/reference/internalAliasWithDottedNameEmit.types +++ b/tests/baselines/reference/internalAliasWithDottedNameEmit.types @@ -9,8 +9,8 @@ module a.b.c { } module a.e.f { >a : typeof a ->e : unknown ->f : unknown +>e : any +>f : any import g = b.c; >g : typeof g diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols new file mode 100644 index 00000000000..e1098948fd6 --- /dev/null +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts === +class A { +>A : Symbol(A, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) + + aProp: string; +>aProp : Symbol(aProp, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 9)) +} +module A { +>A : Symbol(A, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) + + export interface X { s: string } +>X : Symbol(X, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 3, 10)) +>s : Symbol(s, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 4, 24)) + + export var a = 10; +>a : Symbol(a, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 5, 14)) +} + +module B { +>B : Symbol(B, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 6, 1)) + + import Y = A; +>Y : Symbol(Y, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 8, 10)) +>A : Symbol(Y, Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) +} + diff --git a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types index 3ec8770f17c..e0548f1f867 100644 --- a/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types @@ -14,10 +14,11 @@ module A { export var a = 10; >a : number +>10 : number } module B { ->B : unknown +>B : any import Y = A; >Y : typeof Y diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols new file mode 100644 index 00000000000..5852777fe1c --- /dev/null +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts === +class A { +>A : Symbol(A, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) + + aProp: string; +>aProp : Symbol(aProp, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 9)) +} +module A { +>A : Symbol(A, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) + + export interface X { s: string } +>X : Symbol(X, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 3, 10)) +>s : Symbol(s, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 4, 24)) +} + +module B { +>B : Symbol(B, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 5, 1)) + + import Y = A; +>Y : Symbol(Y, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 7, 10)) +>A : Symbol(Y, Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 0, 0), Decl(internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts, 2, 1)) +} + diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types index c07fc1c4955..8a6b8b1215f 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.types @@ -14,7 +14,7 @@ module A { } module B { ->B : unknown +>B : any import Y = A; >Y : typeof Y diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.symbols b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.symbols new file mode 100644 index 00000000000..06df9fbfa3f --- /dev/null +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts === +module A { +>A : Symbol(A, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 0, 0)) + + export interface X { s: string } +>X : Symbol(X, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 0, 10)) +>s : Symbol(s, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 1, 24)) +} + +module B { +>B : Symbol(B, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 2, 1)) + + var A = 1; +>A : Symbol(A, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 5, 7)) + + import Y = A; +>Y : Symbol(Y, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 5, 14)) +>A : Symbol(Y, Decl(internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts, 0, 0)) +} + diff --git a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types index 0bff332846a..1226ca3cbc4 100644 --- a/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types +++ b/tests/baselines/reference/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.types @@ -1,6 +1,6 @@ === tests/cases/compiler/internalImportUnInstantiatedModuleNotReferencingInstanceNoConflict.ts === module A { ->A : unknown +>A : any export interface X { s: string } >X : X @@ -12,9 +12,10 @@ module B { var A = 1; >A : number +>1 : number import Y = A; ->Y : unknown ->A : unknown +>Y : any +>A : any } diff --git a/tests/baselines/reference/invalidSplice.symbols b/tests/baselines/reference/invalidSplice.symbols new file mode 100644 index 00000000000..dc028776cb3 --- /dev/null +++ b/tests/baselines/reference/invalidSplice.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/invalidSplice.ts === +var arr = [].splice(0,3,4,5); +>arr : Symbol(arr, Decl(invalidSplice.ts, 0, 3)) +>[].splice : Symbol(Array.splice, Decl(lib.d.ts, 1060, 50), Decl(lib.d.ts, 1066, 31)) +>splice : Symbol(Array.splice, Decl(lib.d.ts, 1060, 50), Decl(lib.d.ts, 1066, 31)) + diff --git a/tests/baselines/reference/invalidSplice.types b/tests/baselines/reference/invalidSplice.types index ab4ad85d61f..1e3b42ff551 100644 --- a/tests/baselines/reference/invalidSplice.types +++ b/tests/baselines/reference/invalidSplice.types @@ -5,4 +5,8 @@ var arr = [].splice(0,3,4,5); >[].splice : { (start: number): any[]; (start: number, deleteCount: number, ...items: any[]): any[]; } >[] : undefined[] >splice : { (start: number): any[]; (start: number, deleteCount: number, ...items: any[]): any[]; } +>0 : number +>3 : number +>4 : number +>5 : number diff --git a/tests/baselines/reference/invalidSwitchBreakStatement.symbols b/tests/baselines/reference/invalidSwitchBreakStatement.symbols new file mode 100644 index 00000000000..a17a2a7dee2 --- /dev/null +++ b/tests/baselines/reference/invalidSwitchBreakStatement.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/statements/breakStatements/invalidSwitchBreakStatement.ts === +// break is not allowed in a switch statement +No type information for this code. +No type information for this code.switch (12) { +No type information for this code. case 5: +No type information for this code. break; +No type information for this code.} +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/invalidSwitchBreakStatement.types b/tests/baselines/reference/invalidSwitchBreakStatement.types index a17a2a7dee2..3544da72489 100644 --- a/tests/baselines/reference/invalidSwitchBreakStatement.types +++ b/tests/baselines/reference/invalidSwitchBreakStatement.types @@ -1,9 +1,12 @@ === tests/cases/conformance/statements/breakStatements/invalidSwitchBreakStatement.ts === // break is not allowed in a switch statement -No type information for this code. -No type information for this code.switch (12) { -No type information for this code. case 5: -No type information for this code. break; -No type information for this code.} -No type information for this code. -No type information for this code. \ No newline at end of file + +switch (12) { +>12 : number + + case 5: +>5 : number + + break; +} + diff --git a/tests/baselines/reference/invalidTypeNames.symbols b/tests/baselines/reference/invalidTypeNames.symbols new file mode 100644 index 00000000000..c91de26233f --- /dev/null +++ b/tests/baselines/reference/invalidTypeNames.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/invalidTypeNames.ts === +// Refer to calling code - a real illegal name is subbed in here +class illegal_name_here { +>illegal_name_here : Symbol(illegal_name_here, Decl(invalidTypeNames.ts, 0, 0)) +} + diff --git a/tests/baselines/reference/invalidUndefinedValues.symbols b/tests/baselines/reference/invalidUndefinedValues.symbols new file mode 100644 index 00000000000..5a9b81fde31 --- /dev/null +++ b/tests/baselines/reference/invalidUndefinedValues.symbols @@ -0,0 +1,92 @@ +=== tests/cases/conformance/types/primitives/undefined/invalidUndefinedValues.ts === +var x: typeof undefined; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>undefined : Symbol(undefined) + +x = 1; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) + +x = ''; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) + +x = true; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) + +var a: void; +>a : Symbol(a, Decl(invalidUndefinedValues.ts, 5, 3)) + +x = a; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>a : Symbol(a, Decl(invalidUndefinedValues.ts, 5, 3)) + +x = null; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) + +class C { foo: string } +>C : Symbol(C, Decl(invalidUndefinedValues.ts, 7, 9)) +>foo : Symbol(foo, Decl(invalidUndefinedValues.ts, 9, 9)) + +var b: C; +>b : Symbol(b, Decl(invalidUndefinedValues.ts, 10, 3)) +>C : Symbol(C, Decl(invalidUndefinedValues.ts, 7, 9)) + +x = C; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>C : Symbol(C, Decl(invalidUndefinedValues.ts, 7, 9)) + +x = b; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>b : Symbol(b, Decl(invalidUndefinedValues.ts, 10, 3)) + +interface I { foo: string } +>I : Symbol(I, Decl(invalidUndefinedValues.ts, 12, 6)) +>foo : Symbol(foo, Decl(invalidUndefinedValues.ts, 14, 13)) + +var c: I; +>c : Symbol(c, Decl(invalidUndefinedValues.ts, 15, 3)) +>I : Symbol(I, Decl(invalidUndefinedValues.ts, 12, 6)) + +x = c; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>c : Symbol(c, Decl(invalidUndefinedValues.ts, 15, 3)) + +module M { export var x = 1; } +>M : Symbol(M, Decl(invalidUndefinedValues.ts, 16, 6)) +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 18, 21)) + +x = M; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>M : Symbol(M, Decl(invalidUndefinedValues.ts, 16, 6)) + +x = { f() { } } +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>f : Symbol(f, Decl(invalidUndefinedValues.ts, 21, 5)) + +function f(a: T) { +>f : Symbol(f, Decl(invalidUndefinedValues.ts, 21, 15)) +>T : Symbol(T, Decl(invalidUndefinedValues.ts, 23, 11)) +>a : Symbol(a, Decl(invalidUndefinedValues.ts, 23, 14)) +>T : Symbol(T, Decl(invalidUndefinedValues.ts, 23, 11)) + + x = a; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>a : Symbol(a, Decl(invalidUndefinedValues.ts, 23, 14)) +} +x = f; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>f : Symbol(f, Decl(invalidUndefinedValues.ts, 21, 15)) + +enum E { A } +>E : Symbol(E, Decl(invalidUndefinedValues.ts, 26, 6)) +>A : Symbol(E.A, Decl(invalidUndefinedValues.ts, 28, 8)) + +x = E; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>E : Symbol(E, Decl(invalidUndefinedValues.ts, 26, 6)) + +x = E.A; +>x : Symbol(x, Decl(invalidUndefinedValues.ts, 0, 3)) +>E.A : Symbol(E.A, Decl(invalidUndefinedValues.ts, 28, 8)) +>E : Symbol(E, Decl(invalidUndefinedValues.ts, 26, 6)) +>A : Symbol(E.A, Decl(invalidUndefinedValues.ts, 28, 8)) + diff --git a/tests/baselines/reference/invalidUndefinedValues.types b/tests/baselines/reference/invalidUndefinedValues.types index 3f17deede37..b88c2021618 100644 --- a/tests/baselines/reference/invalidUndefinedValues.types +++ b/tests/baselines/reference/invalidUndefinedValues.types @@ -6,14 +6,17 @@ var x: typeof undefined; x = 1; >x = 1 : number >x : any +>1 : number x = ''; >x = '' : string >x : any +>'' : string x = true; >x = true : boolean >x : any +>true : boolean var a: void; >a : void @@ -26,6 +29,7 @@ x = a; x = null; >x = null : null >x : any +>null : null class C { foo: string } >C : C @@ -61,6 +65,7 @@ x = c; module M { export var x = 1; } >M : typeof M >x : number +>1 : number x = M; >x = M : typeof M diff --git a/tests/baselines/reference/ipromise2.symbols b/tests/baselines/reference/ipromise2.symbols new file mode 100644 index 00000000000..be936f4512a --- /dev/null +++ b/tests/baselines/reference/ipromise2.symbols @@ -0,0 +1,122 @@ +=== tests/cases/compiler/ipromise2.ts === +declare module Windows.Foundation { +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise2.ts, 0, 23)) + + export interface IPromise { +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) + + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise2.ts, 2, 13)) +>success : Symbol(success, Decl(ipromise2.ts, 2, 16)) +>value : Symbol(value, Decl(ipromise2.ts, 2, 27)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 2, 13)) +>error : Symbol(error, Decl(ipromise2.ts, 2, 52)) +>error : Symbol(error, Decl(ipromise2.ts, 2, 62)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 2, 13)) +>progress : Symbol(progress, Decl(ipromise2.ts, 2, 89)) +>progress : Symbol(progress, Decl(ipromise2.ts, 2, 102)) +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise2.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 2, 13)) + + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise2.ts, 3, 13)) +>success : Symbol(success, Decl(ipromise2.ts, 3, 16)) +>value : Symbol(value, Decl(ipromise2.ts, 3, 27)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 3, 13)) +>error : Symbol(error, Decl(ipromise2.ts, 3, 52)) +>error : Symbol(error, Decl(ipromise2.ts, 3, 62)) +>U : Symbol(U, Decl(ipromise2.ts, 3, 13)) +>progress : Symbol(progress, Decl(ipromise2.ts, 3, 79)) +>progress : Symbol(progress, Decl(ipromise2.ts, 3, 92)) +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise2.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 3, 13)) + + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise2.ts, 4, 13)) +>success : Symbol(success, Decl(ipromise2.ts, 4, 16)) +>value : Symbol(value, Decl(ipromise2.ts, 4, 27)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) +>U : Symbol(U, Decl(ipromise2.ts, 4, 13)) +>error : Symbol(error, Decl(ipromise2.ts, 4, 42)) +>error : Symbol(error, Decl(ipromise2.ts, 4, 52)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 4, 13)) +>progress : Symbol(progress, Decl(ipromise2.ts, 4, 79)) +>progress : Symbol(progress, Decl(ipromise2.ts, 4, 92)) +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise2.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 4, 13)) + + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise2.ts, 5, 13)) +>success : Symbol(success, Decl(ipromise2.ts, 5, 16)) +>value : Symbol(value, Decl(ipromise2.ts, 5, 27)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) +>U : Symbol(U, Decl(ipromise2.ts, 5, 13)) +>error : Symbol(error, Decl(ipromise2.ts, 5, 42)) +>error : Symbol(error, Decl(ipromise2.ts, 5, 52)) +>U : Symbol(U, Decl(ipromise2.ts, 5, 13)) +>progress : Symbol(progress, Decl(ipromise2.ts, 5, 69)) +>progress : Symbol(progress, Decl(ipromise2.ts, 5, 82)) +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise2.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise2.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise2.ts, 5, 13)) + + done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; +>done : Symbol(done, Decl(ipromise2.ts, 5, 139)) +>U : Symbol(U, Decl(ipromise2.ts, 6, 13)) +>success : Symbol(success, Decl(ipromise2.ts, 6, 16)) +>value : Symbol(value, Decl(ipromise2.ts, 6, 27)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) +>error : Symbol(error, Decl(ipromise2.ts, 6, 44)) +>error : Symbol(error, Decl(ipromise2.ts, 6, 54)) +>progress : Symbol(progress, Decl(ipromise2.ts, 6, 73)) +>progress : Symbol(progress, Decl(ipromise2.ts, 6, 86)) + + value: T; +>value : Symbol(value, Decl(ipromise2.ts, 6, 117)) +>T : Symbol(T, Decl(ipromise2.ts, 1, 30)) + } +} + +var p: Windows.Foundation.IPromise; +>p : Symbol(p, Decl(ipromise2.ts, 11, 3)) +>Windows : Symbol(Windows, Decl(ipromise2.ts, 0, 0)) +>Foundation : Symbol(Windows.Foundation, Decl(ipromise2.ts, 0, 23)) +>IPromise : Symbol(Windows.Foundation.IPromise, Decl(ipromise2.ts, 0, 35)) + +var p2 = p.then(function (s) { +>p2 : Symbol(p2, Decl(ipromise2.ts, 13, 3)) +>p.then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>p : Symbol(p, Decl(ipromise2.ts, 11, 3)) +>then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise2.ts, 1, 34), Decl(ipromise2.ts, 2, 159), Decl(ipromise2.ts, 3, 149), Decl(ipromise2.ts, 4, 149)) +>s : Symbol(s, Decl(ipromise2.ts, 13, 26)) + + return 34; +} ); + + +var x: number = p2.value; +>x : Symbol(x, Decl(ipromise2.ts, 18, 3)) +>p2.value : Symbol(Windows.Foundation.IPromise.value, Decl(ipromise2.ts, 6, 117)) +>p2 : Symbol(p2, Decl(ipromise2.ts, 13, 3)) +>value : Symbol(Windows.Foundation.IPromise.value, Decl(ipromise2.ts, 6, 117)) + + diff --git a/tests/baselines/reference/ipromise2.types b/tests/baselines/reference/ipromise2.types index 72c7b44f146..b52c3460dd4 100644 --- a/tests/baselines/reference/ipromise2.types +++ b/tests/baselines/reference/ipromise2.types @@ -1,7 +1,7 @@ === tests/cases/compiler/ipromise2.ts === declare module Windows.Foundation { ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any export interface IPromise { >IPromise : IPromise @@ -21,8 +21,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -39,8 +39,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -57,8 +57,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -74,8 +74,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -98,8 +98,8 @@ declare module Windows.Foundation { var p: Windows.Foundation.IPromise; >p : Windows.Foundation.IPromise ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : Windows.Foundation.IPromise var p2 = p.then(function (s) { @@ -112,6 +112,8 @@ var p2 = p.then(function (s) { >s : string return 34; +>34 : number + } ); diff --git a/tests/baselines/reference/ipromise3.symbols b/tests/baselines/reference/ipromise3.symbols new file mode 100644 index 00000000000..3605a94fc88 --- /dev/null +++ b/tests/baselines/reference/ipromise3.symbols @@ -0,0 +1,97 @@ +=== tests/cases/compiler/ipromise3.ts === +interface IPromise3 { +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) + + then(success?: (value: T) => IPromise3, error?: (error: any) => IPromise3, progress?: (progress: any) => void ): IPromise3; +>then : Symbol(then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>U : Symbol(U, Decl(ipromise3.ts, 1, 9)) +>success : Symbol(success, Decl(ipromise3.ts, 1, 12)) +>value : Symbol(value, Decl(ipromise3.ts, 1, 23)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 1, 9)) +>error : Symbol(error, Decl(ipromise3.ts, 1, 49)) +>error : Symbol(error, Decl(ipromise3.ts, 1, 59)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 1, 9)) +>progress : Symbol(progress, Decl(ipromise3.ts, 1, 87)) +>progress : Symbol(progress, Decl(ipromise3.ts, 1, 100)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 1, 9)) + + then(success?: (value: T) => IPromise3, error?: (error: any) => U, progress?: (progress: any) => void ): IPromise3; +>then : Symbol(then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>U : Symbol(U, Decl(ipromise3.ts, 2, 9)) +>success : Symbol(success, Decl(ipromise3.ts, 2, 12)) +>value : Symbol(value, Decl(ipromise3.ts, 2, 23)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 2, 9)) +>error : Symbol(error, Decl(ipromise3.ts, 2, 49)) +>error : Symbol(error, Decl(ipromise3.ts, 2, 59)) +>U : Symbol(U, Decl(ipromise3.ts, 2, 9)) +>progress : Symbol(progress, Decl(ipromise3.ts, 2, 76)) +>progress : Symbol(progress, Decl(ipromise3.ts, 2, 89)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 2, 9)) + + then(success?: (value: T) => U, error?: (error: any) => IPromise3, progress?: (progress: any) => void ): IPromise3; +>then : Symbol(then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>U : Symbol(U, Decl(ipromise3.ts, 3, 9)) +>success : Symbol(success, Decl(ipromise3.ts, 3, 12)) +>value : Symbol(value, Decl(ipromise3.ts, 3, 23)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) +>U : Symbol(U, Decl(ipromise3.ts, 3, 9)) +>error : Symbol(error, Decl(ipromise3.ts, 3, 38)) +>error : Symbol(error, Decl(ipromise3.ts, 3, 48)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 3, 9)) +>progress : Symbol(progress, Decl(ipromise3.ts, 3, 76)) +>progress : Symbol(progress, Decl(ipromise3.ts, 3, 89)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 3, 9)) + + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): IPromise3; +>then : Symbol(then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>U : Symbol(U, Decl(ipromise3.ts, 4, 9)) +>success : Symbol(success, Decl(ipromise3.ts, 4, 12)) +>value : Symbol(value, Decl(ipromise3.ts, 4, 23)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) +>U : Symbol(U, Decl(ipromise3.ts, 4, 9)) +>error : Symbol(error, Decl(ipromise3.ts, 4, 38)) +>error : Symbol(error, Decl(ipromise3.ts, 4, 48)) +>U : Symbol(U, Decl(ipromise3.ts, 4, 9)) +>progress : Symbol(progress, Decl(ipromise3.ts, 4, 65)) +>progress : Symbol(progress, Decl(ipromise3.ts, 4, 78)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>U : Symbol(U, Decl(ipromise3.ts, 4, 9)) + + done? (success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; +>done : Symbol(done, Decl(ipromise3.ts, 4, 117)) +>U : Symbol(U, Decl(ipromise3.ts, 5, 11)) +>success : Symbol(success, Decl(ipromise3.ts, 5, 14)) +>value : Symbol(value, Decl(ipromise3.ts, 5, 25)) +>T : Symbol(T, Decl(ipromise3.ts, 0, 20)) +>error : Symbol(error, Decl(ipromise3.ts, 5, 42)) +>error : Symbol(error, Decl(ipromise3.ts, 5, 52)) +>progress : Symbol(progress, Decl(ipromise3.ts, 5, 71)) +>progress : Symbol(progress, Decl(ipromise3.ts, 5, 84)) +} +var p1: IPromise3; +>p1 : Symbol(p1, Decl(ipromise3.ts, 7, 3)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) + +var p2: IPromise3 = p1.then(function (x) { +>p2 : Symbol(p2, Decl(ipromise3.ts, 8, 3)) +>IPromise3 : Symbol(IPromise3, Decl(ipromise3.ts, 0, 0)) +>p1.then : Symbol(IPromise3.then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>p1 : Symbol(p1, Decl(ipromise3.ts, 7, 3)) +>then : Symbol(IPromise3.then, Decl(ipromise3.ts, 0, 24), Decl(ipromise3.ts, 1, 139), Decl(ipromise3.ts, 2, 128), Decl(ipromise3.ts, 3, 128)) +>x : Symbol(x, Decl(ipromise3.ts, 8, 46)) + + return x; +>x : Symbol(x, Decl(ipromise3.ts, 8, 46)) + +}); + diff --git a/tests/baselines/reference/ipromise4.symbols b/tests/baselines/reference/ipromise4.symbols new file mode 100644 index 00000000000..65ae5f90cfe --- /dev/null +++ b/tests/baselines/reference/ipromise4.symbols @@ -0,0 +1,117 @@ +=== tests/cases/compiler/ipromise4.ts === +declare module Windows.Foundation { +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise4.ts, 0, 23)) + + export interface IPromise { +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) + + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise4.ts, 2, 13)) +>success : Symbol(success, Decl(ipromise4.ts, 2, 16)) +>value : Symbol(value, Decl(ipromise4.ts, 2, 27)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 2, 13)) +>error : Symbol(error, Decl(ipromise4.ts, 2, 52)) +>error : Symbol(error, Decl(ipromise4.ts, 2, 62)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 2, 13)) +>progress : Symbol(progress, Decl(ipromise4.ts, 2, 89)) +>progress : Symbol(progress, Decl(ipromise4.ts, 2, 102)) +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise4.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 2, 13)) + + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise4.ts, 3, 13)) +>success : Symbol(success, Decl(ipromise4.ts, 3, 16)) +>value : Symbol(value, Decl(ipromise4.ts, 3, 27)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 3, 13)) +>error : Symbol(error, Decl(ipromise4.ts, 3, 52)) +>error : Symbol(error, Decl(ipromise4.ts, 3, 62)) +>U : Symbol(U, Decl(ipromise4.ts, 3, 13)) +>progress : Symbol(progress, Decl(ipromise4.ts, 3, 79)) +>progress : Symbol(progress, Decl(ipromise4.ts, 3, 92)) +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise4.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 3, 13)) + + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise4.ts, 4, 13)) +>success : Symbol(success, Decl(ipromise4.ts, 4, 16)) +>value : Symbol(value, Decl(ipromise4.ts, 4, 27)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) +>U : Symbol(U, Decl(ipromise4.ts, 4, 13)) +>error : Symbol(error, Decl(ipromise4.ts, 4, 42)) +>error : Symbol(error, Decl(ipromise4.ts, 4, 52)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 4, 13)) +>progress : Symbol(progress, Decl(ipromise4.ts, 4, 79)) +>progress : Symbol(progress, Decl(ipromise4.ts, 4, 92)) +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise4.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 4, 13)) + + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; +>then : Symbol(then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>U : Symbol(U, Decl(ipromise4.ts, 5, 13)) +>success : Symbol(success, Decl(ipromise4.ts, 5, 16)) +>value : Symbol(value, Decl(ipromise4.ts, 5, 27)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) +>U : Symbol(U, Decl(ipromise4.ts, 5, 13)) +>error : Symbol(error, Decl(ipromise4.ts, 5, 42)) +>error : Symbol(error, Decl(ipromise4.ts, 5, 52)) +>U : Symbol(U, Decl(ipromise4.ts, 5, 13)) +>progress : Symbol(progress, Decl(ipromise4.ts, 5, 69)) +>progress : Symbol(progress, Decl(ipromise4.ts, 5, 82)) +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Foundation, Decl(ipromise4.ts, 0, 23)) +>IPromise : Symbol(IPromise, Decl(ipromise4.ts, 0, 35)) +>U : Symbol(U, Decl(ipromise4.ts, 5, 13)) + + done? (success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; +>done : Symbol(done, Decl(ipromise4.ts, 5, 139)) +>U : Symbol(U, Decl(ipromise4.ts, 6, 15)) +>success : Symbol(success, Decl(ipromise4.ts, 6, 18)) +>value : Symbol(value, Decl(ipromise4.ts, 6, 29)) +>T : Symbol(T, Decl(ipromise4.ts, 1, 30)) +>error : Symbol(error, Decl(ipromise4.ts, 6, 46)) +>error : Symbol(error, Decl(ipromise4.ts, 6, 56)) +>progress : Symbol(progress, Decl(ipromise4.ts, 6, 75)) +>progress : Symbol(progress, Decl(ipromise4.ts, 6, 88)) + } +} + +var p: Windows.Foundation.IPromise = null; +>p : Symbol(p, Decl(ipromise4.ts, 10, 3)) +>Windows : Symbol(Windows, Decl(ipromise4.ts, 0, 0)) +>Foundation : Symbol(Windows.Foundation, Decl(ipromise4.ts, 0, 23)) +>IPromise : Symbol(Windows.Foundation.IPromise, Decl(ipromise4.ts, 0, 35)) + +p.then(function (x) { } ); // should not error +>p.then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>p : Symbol(p, Decl(ipromise4.ts, 10, 3)) +>then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>x : Symbol(x, Decl(ipromise4.ts, 12, 17)) + +p.then(function (x) { return "hello"; } ).then(function (x) { return x } ); // should not error +>p.then(function (x) { return "hello"; } ).then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>p.then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>p : Symbol(p, Decl(ipromise4.ts, 10, 3)) +>then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>x : Symbol(x, Decl(ipromise4.ts, 13, 17)) +>then : Symbol(Windows.Foundation.IPromise.then, Decl(ipromise4.ts, 1, 34), Decl(ipromise4.ts, 2, 159), Decl(ipromise4.ts, 3, 149), Decl(ipromise4.ts, 4, 149)) +>x : Symbol(x, Decl(ipromise4.ts, 13, 57)) +>x : Symbol(x, Decl(ipromise4.ts, 13, 57)) + + diff --git a/tests/baselines/reference/ipromise4.types b/tests/baselines/reference/ipromise4.types index 0ae6c35f1fd..b12c47c7ed5 100644 --- a/tests/baselines/reference/ipromise4.types +++ b/tests/baselines/reference/ipromise4.types @@ -1,7 +1,7 @@ === tests/cases/compiler/ipromise4.ts === declare module Windows.Foundation { ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any export interface IPromise { >IPromise : IPromise @@ -21,8 +21,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -39,8 +39,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -57,8 +57,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -74,8 +74,8 @@ declare module Windows.Foundation { >U : U >progress : (progress: any) => void >progress : any ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : IPromise >U : U @@ -94,9 +94,10 @@ declare module Windows.Foundation { var p: Windows.Foundation.IPromise = null; >p : Windows.Foundation.IPromise ->Windows : unknown ->Foundation : unknown +>Windows : any +>Foundation : any >IPromise : Windows.Foundation.IPromise +>null : null p.then(function (x) { } ); // should not error >p.then(function (x) { } ) : Windows.Foundation.IPromise @@ -115,6 +116,7 @@ p.then(function (x) { return "hello"; } ).then(function (x) { return x } ); // s >then : { (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >function (x) { return "hello"; } : (x: number) => string >x : number +>"hello" : string >then : { (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; } >function (x) { return x } : (x: string) => string >x : string diff --git a/tests/baselines/reference/isDeclarationVisibleNodeKinds.symbols b/tests/baselines/reference/isDeclarationVisibleNodeKinds.symbols new file mode 100644 index 00000000000..659a1330616 --- /dev/null +++ b/tests/baselines/reference/isDeclarationVisibleNodeKinds.symbols @@ -0,0 +1,168 @@ +=== tests/cases/compiler/isDeclarationVisibleNodeKinds.ts === + +// Function types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator1(schema: any): (data: T) => T { +>createValidator1 : Symbol(createValidator1, Decl(isDeclarationVisibleNodeKinds.ts, 2, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 3, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 3, 52)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 3, 55)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 3, 52)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 3, 52)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// Constructor types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator2(schema: any): new (data: T) => T { +>createValidator2 : Symbol(createValidator2, Decl(isDeclarationVisibleNodeKinds.ts, 9, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 10, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 10, 56)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 10, 59)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 10, 56)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 10, 56)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// union types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator3(schema: any): number | { new (data: T): T; } { +>createValidator3 : Symbol(createValidator3, Decl(isDeclarationVisibleNodeKinds.ts, 16, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 17, 38)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 17, 68)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 17, 71)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 17, 68)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 17, 68)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// Array types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator4(schema: any): { new (data: T): T; }[] { +>createValidator4 : Symbol(createValidator4, Decl(isDeclarationVisibleNodeKinds.ts, 23, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 24, 38)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 24, 59)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 24, 62)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 24, 59)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 24, 59)) + + return undefined; +>undefined : Symbol(undefined) + } +} + + +// TypeLiterals +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator5(schema: any): { new (data: T): T } { +>createValidator5 : Symbol(createValidator5, Decl(isDeclarationVisibleNodeKinds.ts, 31, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 32, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 32, 58)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 32, 61)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 32, 58)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 32, 58)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// Tuple types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator6(schema: any): [ new (data: T) => T, number] { +>createValidator6 : Symbol(createValidator6, Decl(isDeclarationVisibleNodeKinds.ts, 38, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 39, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 39, 58)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 39, 61)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 39, 58)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 39, 58)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// Paren Types +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator7(schema: any): (new (data: T)=>T )[] { +>createValidator7 : Symbol(createValidator7, Decl(isDeclarationVisibleNodeKinds.ts, 45, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 46, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 46, 57)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 46, 60)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 46, 57)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 46, 57)) + + return undefined; +>undefined : Symbol(undefined) + } +} + +// Type reference +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export function createValidator8(schema: any): Array<{ (data: T) : T}> { +>createValidator8 : Symbol(createValidator8, Decl(isDeclarationVisibleNodeKinds.ts, 52, 15)) +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 53, 37)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 53, 60)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 53, 63)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 53, 60)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 53, 60)) + + return undefined; +>undefined : Symbol(undefined) + } +} + + +module schema { +>schema : Symbol(schema, Decl(isDeclarationVisibleNodeKinds.ts, 0, 0), Decl(isDeclarationVisibleNodeKinds.ts, 6, 1), Decl(isDeclarationVisibleNodeKinds.ts, 13, 1), Decl(isDeclarationVisibleNodeKinds.ts, 20, 1), Decl(isDeclarationVisibleNodeKinds.ts, 27, 1), Decl(isDeclarationVisibleNodeKinds.ts, 35, 1), Decl(isDeclarationVisibleNodeKinds.ts, 42, 1), Decl(isDeclarationVisibleNodeKinds.ts, 49, 1), Decl(isDeclarationVisibleNodeKinds.ts, 56, 1)) + + export class T { +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 59, 15)) + + get createValidator9(): (data: T) => T { +>createValidator9 : Symbol(createValidator9, Decl(isDeclarationVisibleNodeKinds.ts, 60, 20)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 61, 33)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 61, 36)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 61, 33)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 61, 33)) + + return undefined; +>undefined : Symbol(undefined) + } + + set createValidator10(v: (data: T) => T) { +>createValidator10 : Symbol(createValidator10, Decl(isDeclarationVisibleNodeKinds.ts, 63, 9)) +>v : Symbol(v, Decl(isDeclarationVisibleNodeKinds.ts, 65, 30)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 65, 34)) +>data : Symbol(data, Decl(isDeclarationVisibleNodeKinds.ts, 65, 37)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 65, 34)) +>T : Symbol(T, Decl(isDeclarationVisibleNodeKinds.ts, 65, 34)) + } + } +} diff --git a/tests/baselines/reference/isLiteral1.symbols b/tests/baselines/reference/isLiteral1.symbols new file mode 100644 index 00000000000..62163aabfbb --- /dev/null +++ b/tests/baselines/reference/isLiteral1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/isLiteral1.ts === +var x: number = 02343; +>x : Symbol(x, Decl(isLiteral1.ts, 0, 3)) + diff --git a/tests/baselines/reference/isLiteral1.types b/tests/baselines/reference/isLiteral1.types index f26eab098b4..7ef84568f86 100644 --- a/tests/baselines/reference/isLiteral1.types +++ b/tests/baselines/reference/isLiteral1.types @@ -1,4 +1,5 @@ === tests/cases/compiler/isLiteral1.ts === var x: number = 02343; >x : number +>02343 : number diff --git a/tests/baselines/reference/isLiteral2.symbols b/tests/baselines/reference/isLiteral2.symbols new file mode 100644 index 00000000000..e1f25bf00a2 --- /dev/null +++ b/tests/baselines/reference/isLiteral2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/isLiteral2.ts === +var x: number = 02343 +>x : Symbol(x, Decl(isLiteral2.ts, 0, 3)) + diff --git a/tests/baselines/reference/isLiteral2.types b/tests/baselines/reference/isLiteral2.types index 32c1b29f13e..ab62993fab6 100644 --- a/tests/baselines/reference/isLiteral2.types +++ b/tests/baselines/reference/isLiteral2.types @@ -1,4 +1,5 @@ === tests/cases/compiler/isLiteral2.ts === var x: number = 02343 >x : number +>02343 : number diff --git a/tests/baselines/reference/iterableArrayPattern1.symbols b/tests/baselines/reference/iterableArrayPattern1.symbols new file mode 100644 index 00000000000..ae0acb823a0 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts === +var [a, b] = new SymbolIterator; +>a : Symbol(a, Decl(iterableArrayPattern1.ts, 0, 5)) +>b : Symbol(b, Decl(iterableArrayPattern1.ts, 0, 7)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 32)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 32)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern1.ts, 1, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iterableArrayPattern1.ts, 3, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern1.ts, 4, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 32)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern1.types b/tests/baselines/reference/iterableArrayPattern1.types index 8be8521c684..2cfd2354f31 100644 --- a/tests/baselines/reference/iterableArrayPattern1.types +++ b/tests/baselines/reference/iterableArrayPattern1.types @@ -21,6 +21,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern11.symbols b/tests/baselines/reference/iterableArrayPattern11.symbols new file mode 100644 index 00000000000..38a9b18e2d1 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern11.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts === +function fun([a, b] = new FooIterator) { } +>fun : Symbol(fun, Decl(iterableArrayPattern11.ts, 0, 0)) +>a : Symbol(a, Decl(iterableArrayPattern11.ts, 0, 14)) +>b : Symbol(b, Decl(iterableArrayPattern11.ts, 0, 16)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27)) + +fun(new FooIterator); +>fun : Symbol(fun, Decl(iterableArrayPattern11.ts, 0, 0)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern11.ts, 1, 21)) +>x : Symbol(x, Decl(iterableArrayPattern11.ts, 2, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern11.ts, 2, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern11.ts, 1, 21)) +>y : Symbol(y, Decl(iterableArrayPattern11.ts, 3, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern11.ts, 4, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern11.ts, 6, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern11.ts, 2, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern11.ts, 7, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern11.types b/tests/baselines/reference/iterableArrayPattern11.types index 2b6f1d67336..3118e748d6f 100644 --- a/tests/baselines/reference/iterableArrayPattern11.types +++ b/tests/baselines/reference/iterableArrayPattern11.types @@ -37,6 +37,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern12.symbols b/tests/baselines/reference/iterableArrayPattern12.symbols new file mode 100644 index 00000000000..118bea4d0b4 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern12.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts === +function fun([a, ...b] = new FooIterator) { } +>fun : Symbol(fun, Decl(iterableArrayPattern12.ts, 0, 0)) +>a : Symbol(a, Decl(iterableArrayPattern12.ts, 0, 14)) +>b : Symbol(b, Decl(iterableArrayPattern12.ts, 0, 16)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27)) + +fun(new FooIterator); +>fun : Symbol(fun, Decl(iterableArrayPattern12.ts, 0, 0)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern12.ts, 1, 21)) +>x : Symbol(x, Decl(iterableArrayPattern12.ts, 2, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern12.ts, 2, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern12.ts, 1, 21)) +>y : Symbol(y, Decl(iterableArrayPattern12.ts, 3, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern12.ts, 4, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern12.ts, 6, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern12.ts, 2, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern12.ts, 7, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern12.types b/tests/baselines/reference/iterableArrayPattern12.types index a415539b91c..b32c2ff7dc8 100644 --- a/tests/baselines/reference/iterableArrayPattern12.types +++ b/tests/baselines/reference/iterableArrayPattern12.types @@ -37,6 +37,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern13.symbols b/tests/baselines/reference/iterableArrayPattern13.symbols new file mode 100644 index 00000000000..832d8ecf69c --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern13.symbols @@ -0,0 +1,45 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts === +function fun([a, ...b]) { } +>fun : Symbol(fun, Decl(iterableArrayPattern13.ts, 0, 0)) +>a : Symbol(a, Decl(iterableArrayPattern13.ts, 0, 14)) +>b : Symbol(b, Decl(iterableArrayPattern13.ts, 0, 16)) + +fun(new FooIterator); +>fun : Symbol(fun, Decl(iterableArrayPattern13.ts, 0, 0)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 3, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern13.ts, 1, 21)) +>x : Symbol(x, Decl(iterableArrayPattern13.ts, 2, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern13.ts, 2, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern13.ts, 1, 21)) +>y : Symbol(y, Decl(iterableArrayPattern13.ts, 3, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 3, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern13.ts, 4, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern13.ts, 6, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern13.ts, 2, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern13.ts, 7, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 3, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern13.types b/tests/baselines/reference/iterableArrayPattern13.types index dbfbf9a1ebc..556a871f5a8 100644 --- a/tests/baselines/reference/iterableArrayPattern13.types +++ b/tests/baselines/reference/iterableArrayPattern13.types @@ -35,6 +35,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern14.errors.txt b/tests/baselines/reference/iterableArrayPattern14.errors.txt new file mode 100644 index 00000000000..a14ddc45022 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern14.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts (1 errors) ==== + function fun(...[a, ...b]) { } + ~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. + fun(new FooIterator); + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern14.types b/tests/baselines/reference/iterableArrayPattern14.types deleted file mode 100644 index 3f73f2973d1..00000000000 --- a/tests/baselines/reference/iterableArrayPattern14.types +++ /dev/null @@ -1,50 +0,0 @@ -=== tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts === -function fun(...[a, ...b]) { } ->fun : (...[a, ...b]: any[]) => void ->a : any ->b : any[] - -fun(new FooIterator); ->fun(new FooIterator) : void ->fun : (...[a, ...b]: any[]) => void ->new FooIterator : FooIterator ->FooIterator : typeof FooIterator - -class Bar { x } ->Bar : Bar ->x : any - -class Foo extends Bar { y } ->Foo : Foo ->Bar : Bar ->y : any - -class FooIterator { ->FooIterator : FooIterator - - next() { ->next : () => { value: Foo; done: boolean; } - - return { ->{ value: new Foo, done: false } : { value: Foo; done: boolean; } - - value: new Foo, ->value : Foo ->new Foo : Foo ->Foo : typeof Foo - - done: false ->done : boolean - - }; - } - - [Symbol.iterator]() { ->Symbol.iterator : symbol ->Symbol : SymbolConstructor ->iterator : symbol - - return this; ->this : FooIterator - } -} diff --git a/tests/baselines/reference/iterableArrayPattern15.errors.txt b/tests/baselines/reference/iterableArrayPattern15.errors.txt new file mode 100644 index 00000000000..bb2d1eb096d --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern15.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts (1 errors) ==== + function fun(...[a, b]: Bar[]) { } + ~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. + fun(...new FooIterator); + class Bar { x } + class Foo extends Bar { y } + class FooIterator { + next() { + return { + value: new Foo, + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern15.types b/tests/baselines/reference/iterableArrayPattern15.types deleted file mode 100644 index de548a91c26..00000000000 --- a/tests/baselines/reference/iterableArrayPattern15.types +++ /dev/null @@ -1,52 +0,0 @@ -=== tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts === -function fun(...[a, b]: Bar[]) { } ->fun : (...[a, b]: Bar[]) => void ->a : Bar ->b : Bar ->Bar : Bar - -fun(...new FooIterator); ->fun(...new FooIterator) : void ->fun : (...[a, b]: Bar[]) => void ->...new FooIterator : Foo ->new FooIterator : FooIterator ->FooIterator : typeof FooIterator - -class Bar { x } ->Bar : Bar ->x : any - -class Foo extends Bar { y } ->Foo : Foo ->Bar : Bar ->y : any - -class FooIterator { ->FooIterator : FooIterator - - next() { ->next : () => { value: Foo; done: boolean; } - - return { ->{ value: new Foo, done: false } : { value: Foo; done: boolean; } - - value: new Foo, ->value : Foo ->new Foo : Foo ->Foo : typeof Foo - - done: false ->done : boolean - - }; - } - - [Symbol.iterator]() { ->Symbol.iterator : symbol ->Symbol : SymbolConstructor ->iterator : symbol - - return this; ->this : FooIterator - } -} diff --git a/tests/baselines/reference/iterableArrayPattern16.errors.txt b/tests/baselines/reference/iterableArrayPattern16.errors.txt index 42236140be7..e03d0a799da 100644 --- a/tests/baselines/reference/iterableArrayPattern16.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern16.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. Property '0' is missing in type 'FooIterator'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts (1 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts (2 errors) ==== function fun(...[a, b]: [Bar, Bar][]) { } + ~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. fun(...new FooIteratorIterator); ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. diff --git a/tests/baselines/reference/iterableArrayPattern17.errors.txt b/tests/baselines/reference/iterableArrayPattern17.errors.txt index 306b00ea990..3cc04fadd11 100644 --- a/tests/baselines/reference/iterableArrayPattern17.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern17.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'. Property 'x' is missing in type 'FooIterator'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts (1 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts (2 errors) ==== function fun(...[a, b]: Bar[]) { } + ~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. fun(new FooIterator); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'. diff --git a/tests/baselines/reference/iterableArrayPattern2.symbols b/tests/baselines/reference/iterableArrayPattern2.symbols new file mode 100644 index 00000000000..0f4e7682235 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern2.symbols @@ -0,0 +1,32 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts === +var [a, ...b] = new SymbolIterator; +>a : Symbol(a, Decl(iterableArrayPattern2.ts, 0, 5)) +>b : Symbol(b, Decl(iterableArrayPattern2.ts, 0, 7)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 35)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 35)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern2.ts, 1, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iterableArrayPattern2.ts, 3, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern2.ts, 4, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 35)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern2.types b/tests/baselines/reference/iterableArrayPattern2.types index 819516dfe05..bd58cb86b79 100644 --- a/tests/baselines/reference/iterableArrayPattern2.types +++ b/tests/baselines/reference/iterableArrayPattern2.types @@ -21,6 +21,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern20.errors.txt b/tests/baselines/reference/iterableArrayPattern20.errors.txt new file mode 100644 index 00000000000..4451a814bd5 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern20.errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts (1 errors) ==== + function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. + fun(...new FooArrayIterator); + class Bar { x } + class Foo extends Bar { y } + class FooArrayIterator { + next() { + return { + value: [new Foo], + done: false + }; + } + + [Symbol.iterator]() { + return this; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern20.types b/tests/baselines/reference/iterableArrayPattern20.types deleted file mode 100644 index 055dfa95859..00000000000 --- a/tests/baselines/reference/iterableArrayPattern20.types +++ /dev/null @@ -1,58 +0,0 @@ -=== tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts === -function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } ->fun : (...[[a = new Foo], b = [new Foo]]: Bar[][]) => void ->a : Bar ->new Foo : Foo ->Foo : typeof Foo ->b : Bar[] ->[new Foo] : Foo[] ->new Foo : Foo ->Foo : typeof Foo ->Bar : Bar - -fun(...new FooArrayIterator); ->fun(...new FooArrayIterator) : void ->fun : (...[[a = new Foo], b = [new Foo]]: Bar[][]) => void ->...new FooArrayIterator : Foo[] ->new FooArrayIterator : FooArrayIterator ->FooArrayIterator : typeof FooArrayIterator - -class Bar { x } ->Bar : Bar ->x : any - -class Foo extends Bar { y } ->Foo : Foo ->Bar : Bar ->y : any - -class FooArrayIterator { ->FooArrayIterator : FooArrayIterator - - next() { ->next : () => { value: Foo[]; done: boolean; } - - return { ->{ value: [new Foo], done: false } : { value: Foo[]; done: boolean; } - - value: [new Foo], ->value : Foo[] ->[new Foo] : Foo[] ->new Foo : Foo ->Foo : typeof Foo - - done: false ->done : boolean - - }; - } - - [Symbol.iterator]() { ->Symbol.iterator : symbol ->Symbol : SymbolConstructor ->iterator : symbol - - return this; ->this : FooArrayIterator - } -} diff --git a/tests/baselines/reference/iterableArrayPattern25.errors.txt b/tests/baselines/reference/iterableArrayPattern25.errors.txt index cc901523b55..07f46c0d49e 100644 --- a/tests/baselines/reference/iterableArrayPattern25.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern25.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts(1,30): error TS2370: A rest parameter must be of an array type. +tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. ==== tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2370: A rest parameter must be of an array type. + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern26.errors.txt b/tests/baselines/reference/iterableArrayPattern26.errors.txt index 9fb3e688039..a5eff0afb0d 100644 --- a/tests/baselines/reference/iterableArrayPattern26.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern26.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts(2,21): error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. Property '0' is missing in type 'Map'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts (1 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts (2 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. diff --git a/tests/baselines/reference/iterableArrayPattern27.errors.txt b/tests/baselines/reference/iterableArrayPattern27.errors.txt new file mode 100644 index 00000000000..99914ddc508 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern27.errors.txt @@ -0,0 +1,8 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. + + +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts (1 errors) ==== + function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. + takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern27.types b/tests/baselines/reference/iterableArrayPattern27.types deleted file mode 100644 index 72d13ee0e00..00000000000 --- a/tests/baselines/reference/iterableArrayPattern27.types +++ /dev/null @@ -1,18 +0,0 @@ -=== tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts === -function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } ->takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [string, number][]) => void ->k1 : string ->v1 : number ->k2 : string ->v2 : number - -takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); ->takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])) : void ->takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [string, number][]) => void ->...new Map([["", 0], ["hello", 1]]) : [string, number] ->new Map([["", 0], ["hello", 1]]) : Map ->Map : MapConstructor ->[["", 0], ["hello", 1]] : [string, number][] ->["", 0] : [string, number] ->["hello", 1] : [string, number] - diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index 0190dd939e8..986dfe1d9a2 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,28): error TS2453: The type argument for type parameter 'V' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'boolean'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (2 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); ~~~ !!! error TS2453: The type argument for type parameter 'V' cannot be inferred from the usage. Consider specifying the type arguments explicitly. diff --git a/tests/baselines/reference/iterableArrayPattern29.errors.txt b/tests/baselines/reference/iterableArrayPattern29.errors.txt index 632854ae952..b34d0317d57 100644 --- a/tests/baselines/reference/iterableArrayPattern29.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern29.errors.txt @@ -1,10 +1,13 @@ +tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts(2,21): error TS2345: Argument of type '[string, boolean]' is not assignable to parameter of type '[string, number]'. Types of property '1' are incompatible. Type 'boolean' is not assignable to type 'number'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts (1 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts (2 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '[string, boolean]' is not assignable to parameter of type '[string, number]'. diff --git a/tests/baselines/reference/iterableArrayPattern3.symbols b/tests/baselines/reference/iterableArrayPattern3.symbols new file mode 100644 index 00000000000..32907a90b20 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern3.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts === +var a: Bar, b: Bar; +>a : Symbol(a, Decl(iterableArrayPattern3.ts, 0, 3)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25)) +>b : Symbol(b, Decl(iterableArrayPattern3.ts, 0, 11)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25)) + +[a, b] = new FooIterator; +>a : Symbol(a, Decl(iterableArrayPattern3.ts, 0, 3)) +>b : Symbol(b, Decl(iterableArrayPattern3.ts, 0, 11)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 3, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25)) +>x : Symbol(x, Decl(iterableArrayPattern3.ts, 2, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern3.ts, 2, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25)) +>y : Symbol(y, Decl(iterableArrayPattern3.ts, 3, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 3, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern3.ts, 4, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern3.ts, 6, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern3.ts, 2, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern3.ts, 7, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 3, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern3.types b/tests/baselines/reference/iterableArrayPattern3.types index 291eed9723a..fed5c7f07d3 100644 --- a/tests/baselines/reference/iterableArrayPattern3.types +++ b/tests/baselines/reference/iterableArrayPattern3.types @@ -38,6 +38,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern30.symbols b/tests/baselines/reference/iterableArrayPattern30.symbols new file mode 100644 index 00000000000..d291c3b128b --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern30.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern30.ts === +const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) +>k1 : Symbol(k1, Decl(iterableArrayPattern30.ts, 0, 8)) +>v1 : Symbol(v1, Decl(iterableArrayPattern30.ts, 0, 11)) +>k2 : Symbol(k2, Decl(iterableArrayPattern30.ts, 0, 18)) +>v2 : Symbol(v2, Decl(iterableArrayPattern30.ts, 0, 21)) +>Map : Symbol(Map, Decl(lib.d.ts, 1837, 1), Decl(lib.d.ts, 1859, 11)) + diff --git a/tests/baselines/reference/iterableArrayPattern30.types b/tests/baselines/reference/iterableArrayPattern30.types index 998da11d651..d27db2e7544 100644 --- a/tests/baselines/reference/iterableArrayPattern30.types +++ b/tests/baselines/reference/iterableArrayPattern30.types @@ -8,5 +8,9 @@ const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) >Map : MapConstructor >[["", true], ["hello", true]] : [string, boolean][] >["", true] : [string, boolean] +>"" : string +>true : boolean >["hello", true] : [string, boolean] +>"hello" : string +>true : boolean diff --git a/tests/baselines/reference/iterableArrayPattern4.symbols b/tests/baselines/reference/iterableArrayPattern4.symbols new file mode 100644 index 00000000000..473262707b0 --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern4.symbols @@ -0,0 +1,47 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts === +var a: Bar, b: Bar[]; +>a : Symbol(a, Decl(iterableArrayPattern4.ts, 0, 3)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28)) +>b : Symbol(b, Decl(iterableArrayPattern4.ts, 0, 11)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28)) + +[a, ...b] = new FooIterator; +>a : Symbol(a, Decl(iterableArrayPattern4.ts, 0, 3)) +>b : Symbol(b, Decl(iterableArrayPattern4.ts, 0, 11)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 3, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28)) +>x : Symbol(x, Decl(iterableArrayPattern4.ts, 2, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern4.ts, 2, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28)) +>y : Symbol(y, Decl(iterableArrayPattern4.ts, 3, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 3, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern4.ts, 4, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern4.ts, 6, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern4.ts, 2, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern4.ts, 7, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 3, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern4.types b/tests/baselines/reference/iterableArrayPattern4.types index 531b2aa8275..8f05a454b53 100644 --- a/tests/baselines/reference/iterableArrayPattern4.types +++ b/tests/baselines/reference/iterableArrayPattern4.types @@ -39,6 +39,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableArrayPattern9.symbols b/tests/baselines/reference/iterableArrayPattern9.symbols new file mode 100644 index 00000000000..7e188f1c94e --- /dev/null +++ b/tests/baselines/reference/iterableArrayPattern9.symbols @@ -0,0 +1,42 @@ +=== tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts === +function fun([a, b] = new FooIterator) { } +>fun : Symbol(fun, Decl(iterableArrayPattern9.ts, 0, 0)) +>a : Symbol(a, Decl(iterableArrayPattern9.ts, 0, 14)) +>b : Symbol(b, Decl(iterableArrayPattern9.ts, 0, 16)) +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern9.ts, 2, 27)) + +class Bar { x } +>Bar : Symbol(Bar, Decl(iterableArrayPattern9.ts, 0, 42)) +>x : Symbol(x, Decl(iterableArrayPattern9.ts, 1, 11)) + +class Foo extends Bar { y } +>Foo : Symbol(Foo, Decl(iterableArrayPattern9.ts, 1, 15)) +>Bar : Symbol(Bar, Decl(iterableArrayPattern9.ts, 0, 42)) +>y : Symbol(y, Decl(iterableArrayPattern9.ts, 2, 23)) + +class FooIterator { +>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern9.ts, 2, 27)) + + next() { +>next : Symbol(next, Decl(iterableArrayPattern9.ts, 3, 19)) + + return { + value: new Foo, +>value : Symbol(value, Decl(iterableArrayPattern9.ts, 5, 16)) +>Foo : Symbol(Foo, Decl(iterableArrayPattern9.ts, 1, 15)) + + done: false +>done : Symbol(done, Decl(iterableArrayPattern9.ts, 6, 27)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(FooIterator, Decl(iterableArrayPattern9.ts, 2, 27)) + } +} diff --git a/tests/baselines/reference/iterableArrayPattern9.types b/tests/baselines/reference/iterableArrayPattern9.types index 67d4bab1a83..03cfa31b621 100644 --- a/tests/baselines/reference/iterableArrayPattern9.types +++ b/tests/baselines/reference/iterableArrayPattern9.types @@ -31,6 +31,7 @@ class FooIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iterableContextualTyping1.symbols b/tests/baselines/reference/iterableContextualTyping1.symbols new file mode 100644 index 00000000000..90b025ddbb0 --- /dev/null +++ b/tests/baselines/reference/iterableContextualTyping1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/expressions/contextualTyping/iterableContextualTyping1.ts === +var iter: Iterable<(x: string) => number> = [s => s.length]; +>iter : Symbol(iter, Decl(iterableContextualTyping1.ts, 0, 3)) +>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1633, 1)) +>x : Symbol(x, Decl(iterableContextualTyping1.ts, 0, 20)) +>s : Symbol(s, Decl(iterableContextualTyping1.ts, 0, 45)) +>s.length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) +>s : Symbol(s, Decl(iterableContextualTyping1.ts, 0, 45)) +>length : Symbol(String.length, Decl(lib.d.ts, 414, 19)) + diff --git a/tests/baselines/reference/iteratorSpreadInArray.symbols b/tests/baselines/reference/iteratorSpreadInArray.symbols new file mode 100644 index 00000000000..c535fe5426f --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray.ts === +var array = [...new SymbolIterator]; +>array : Symbol(array, Decl(iteratorSpreadInArray.ts, 0, 3)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray.ts, 0, 36)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray.ts, 0, 36)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray.ts, 2, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInArray.ts, 4, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray.ts, 5, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray.ts, 0, 36)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray.types b/tests/baselines/reference/iteratorSpreadInArray.types index 13b1a458eb9..2c4a1d207ef 100644 --- a/tests/baselines/reference/iteratorSpreadInArray.types +++ b/tests/baselines/reference/iteratorSpreadInArray.types @@ -22,6 +22,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray11.symbols b/tests/baselines/reference/iteratorSpreadInArray11.symbols new file mode 100644 index 00000000000..7df50594c22 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray11.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts === +var iter: Iterable; +>iter : Symbol(iter, Decl(iteratorSpreadInArray11.ts, 0, 3)) +>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1633, 1)) + +var array = [...iter]; +>array : Symbol(array, Decl(iteratorSpreadInArray11.ts, 1, 3)) +>iter : Symbol(iter, Decl(iteratorSpreadInArray11.ts, 0, 3)) + diff --git a/tests/baselines/reference/iteratorSpreadInArray2.symbols b/tests/baselines/reference/iteratorSpreadInArray2.symbols new file mode 100644 index 00000000000..48f2f853db8 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray2.symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts === +var array = [...new NumberIterator, ...new SymbolIterator]; +>array : Symbol(array, Decl(iteratorSpreadInArray2.ts, 0, 3)) +>NumberIterator : Symbol(NumberIterator, Decl(iteratorSpreadInArray2.ts, 13, 1)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray2.ts, 0, 59)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray2.ts, 0, 59)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray2.ts, 2, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInArray2.ts, 4, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray2.ts, 5, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray2.ts, 0, 59)) + } +} + +class NumberIterator { +>NumberIterator : Symbol(NumberIterator, Decl(iteratorSpreadInArray2.ts, 13, 1)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray2.ts, 15, 22)) + + return { + value: 0, +>value : Symbol(value, Decl(iteratorSpreadInArray2.ts, 17, 16)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray2.ts, 18, 21)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(NumberIterator, Decl(iteratorSpreadInArray2.ts, 13, 1)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray2.types b/tests/baselines/reference/iteratorSpreadInArray2.types index 3cb27445f57..a59c2cf6c67 100644 --- a/tests/baselines/reference/iteratorSpreadInArray2.types +++ b/tests/baselines/reference/iteratorSpreadInArray2.types @@ -25,6 +25,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } @@ -50,9 +51,11 @@ class NumberIterator { value: 0, >value : number +>0 : number done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray3.symbols b/tests/baselines/reference/iteratorSpreadInArray3.symbols new file mode 100644 index 00000000000..b55f8e415ff --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray3.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts === +var array = [...[0, 1], ...new SymbolIterator]; +>array : Symbol(array, Decl(iteratorSpreadInArray3.ts, 0, 3)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray3.ts, 0, 47)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray3.ts, 0, 47)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray3.ts, 2, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInArray3.ts, 4, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray3.ts, 5, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray3.ts, 0, 47)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray3.types b/tests/baselines/reference/iteratorSpreadInArray3.types index e5c25daabc7..0374f28b6b9 100644 --- a/tests/baselines/reference/iteratorSpreadInArray3.types +++ b/tests/baselines/reference/iteratorSpreadInArray3.types @@ -4,6 +4,8 @@ var array = [...[0, 1], ...new SymbolIterator]; >[...[0, 1], ...new SymbolIterator] : (number | symbol)[] >...[0, 1] : number >[0, 1] : number[] +>0 : number +>1 : number >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator @@ -24,6 +26,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray4.symbols b/tests/baselines/reference/iteratorSpreadInArray4.symbols new file mode 100644 index 00000000000..a1cba88d942 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray4.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray4.ts === +var array = [0, 1, ...new SymbolIterator]; +>array : Symbol(array, Decl(iteratorSpreadInArray4.ts, 0, 3)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray4.ts, 0, 42)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray4.ts, 0, 42)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray4.ts, 2, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInArray4.ts, 4, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray4.ts, 5, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray4.ts, 0, 42)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray4.types b/tests/baselines/reference/iteratorSpreadInArray4.types index 790fc9db1ba..d9a304421ba 100644 --- a/tests/baselines/reference/iteratorSpreadInArray4.types +++ b/tests/baselines/reference/iteratorSpreadInArray4.types @@ -2,6 +2,8 @@ var array = [0, 1, ...new SymbolIterator]; >array : (number | symbol)[] >[0, 1, ...new SymbolIterator] : (number | symbol)[] +>0 : number +>1 : number >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator >SymbolIterator : typeof SymbolIterator @@ -22,6 +24,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInArray7.symbols b/tests/baselines/reference/iteratorSpreadInArray7.symbols new file mode 100644 index 00000000000..c9b8bba1090 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInArray7.symbols @@ -0,0 +1,36 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts === +var array: symbol[]; +>array : Symbol(array, Decl(iteratorSpreadInArray7.ts, 0, 3)) + +array.concat([...new SymbolIterator]); +>array.concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>array : Symbol(array, Decl(iteratorSpreadInArray7.ts, 0, 3)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray7.ts, 1, 38)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray7.ts, 1, 38)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInArray7.ts, 3, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInArray7.ts, 5, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInArray7.ts, 6, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray7.ts, 1, 38)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInArray7.types b/tests/baselines/reference/iteratorSpreadInArray7.types index c58d01f098b..f207a56f3d5 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.types +++ b/tests/baselines/reference/iteratorSpreadInArray7.types @@ -28,6 +28,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall11.symbols b/tests/baselines/reference/iteratorSpreadInCall11.symbols new file mode 100644 index 00000000000..fbc31e96020 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall11.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts === +foo(...new SymbolIterator); +>foo : Symbol(foo, Decl(iteratorSpreadInCall11.ts, 0, 27)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall11.ts, 2, 42)) + +function foo(...s: T[]) { return s[0] } +>foo : Symbol(foo, Decl(iteratorSpreadInCall11.ts, 0, 27)) +>T : Symbol(T, Decl(iteratorSpreadInCall11.ts, 2, 13)) +>s : Symbol(s, Decl(iteratorSpreadInCall11.ts, 2, 16)) +>T : Symbol(T, Decl(iteratorSpreadInCall11.ts, 2, 13)) +>s : Symbol(s, Decl(iteratorSpreadInCall11.ts, 2, 16)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall11.ts, 2, 42)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall11.ts, 4, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInCall11.ts, 6, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall11.ts, 7, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall11.ts, 2, 42)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall11.types b/tests/baselines/reference/iteratorSpreadInCall11.types index a37fc6e2232..edce8b10355 100644 --- a/tests/baselines/reference/iteratorSpreadInCall11.types +++ b/tests/baselines/reference/iteratorSpreadInCall11.types @@ -13,6 +13,7 @@ function foo(...s: T[]) { return s[0] } >T : T >s[0] : T >s : T[] +>0 : number class SymbolIterator { >SymbolIterator : SymbolIterator @@ -30,6 +31,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall12.symbols b/tests/baselines/reference/iteratorSpreadInCall12.symbols new file mode 100644 index 00000000000..66a8fc2f667 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall12.symbols @@ -0,0 +1,67 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts === +new Foo(...[...new SymbolIterator, ...[...new StringIterator]]); +>Foo : Symbol(Foo, Decl(iteratorSpreadInCall12.ts, 0, 64)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall12.ts, 4, 1)) +>StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall12.ts, 17, 1)) + +class Foo { +>Foo : Symbol(Foo, Decl(iteratorSpreadInCall12.ts, 0, 64)) +>T : Symbol(T, Decl(iteratorSpreadInCall12.ts, 2, 10)) + + constructor(...s: T[]) { } +>s : Symbol(s, Decl(iteratorSpreadInCall12.ts, 3, 16)) +>T : Symbol(T, Decl(iteratorSpreadInCall12.ts, 2, 10)) +} + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall12.ts, 4, 1)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall12.ts, 6, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInCall12.ts, 8, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall12.ts, 9, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall12.ts, 4, 1)) + } +} + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall12.ts, 17, 1)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall12.ts, 19, 22)) + + return { + value: "", +>value : Symbol(value, Decl(iteratorSpreadInCall12.ts, 21, 16)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall12.ts, 22, 22)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(StringIterator, Decl(iteratorSpreadInCall12.ts, 17, 1)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall12.types b/tests/baselines/reference/iteratorSpreadInCall12.types index 78ce973a532..fcc4bbc3d45 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.types +++ b/tests/baselines/reference/iteratorSpreadInCall12.types @@ -38,6 +38,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } @@ -63,9 +64,11 @@ class StringIterator { value: "", >value : string +>"" : string done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall3.symbols b/tests/baselines/reference/iteratorSpreadInCall3.symbols new file mode 100644 index 00000000000..121c10ec977 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall3.symbols @@ -0,0 +1,35 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts === +foo(...new SymbolIterator); +>foo : Symbol(foo, Decl(iteratorSpreadInCall3.ts, 0, 27)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall3.ts, 2, 32)) + +function foo(...s: symbol[]) { } +>foo : Symbol(foo, Decl(iteratorSpreadInCall3.ts, 0, 27)) +>s : Symbol(s, Decl(iteratorSpreadInCall3.ts, 2, 13)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall3.ts, 2, 32)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall3.ts, 3, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInCall3.ts, 5, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall3.ts, 6, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall3.ts, 2, 32)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall3.types b/tests/baselines/reference/iteratorSpreadInCall3.types index 07eb149ba31..b566c3866ff 100644 --- a/tests/baselines/reference/iteratorSpreadInCall3.types +++ b/tests/baselines/reference/iteratorSpreadInCall3.types @@ -26,6 +26,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/iteratorSpreadInCall5.symbols b/tests/baselines/reference/iteratorSpreadInCall5.symbols new file mode 100644 index 00000000000..5e88a2be8a1 --- /dev/null +++ b/tests/baselines/reference/iteratorSpreadInCall5.symbols @@ -0,0 +1,62 @@ +=== tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts === +foo(...new SymbolIterator, ...new StringIterator); +>foo : Symbol(foo, Decl(iteratorSpreadInCall5.ts, 0, 50)) +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall5.ts, 2, 43)) +>StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall5.ts, 14, 1)) + +function foo(...s: (symbol | string)[]) { } +>foo : Symbol(foo, Decl(iteratorSpreadInCall5.ts, 0, 50)) +>s : Symbol(s, Decl(iteratorSpreadInCall5.ts, 2, 13)) + +class SymbolIterator { +>SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInCall5.ts, 2, 43)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall5.ts, 3, 22)) + + return { + value: Symbol(), +>value : Symbol(value, Decl(iteratorSpreadInCall5.ts, 5, 16)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall5.ts, 6, 28)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall5.ts, 2, 43)) + } +} + +class StringIterator { +>StringIterator : Symbol(StringIterator, Decl(iteratorSpreadInCall5.ts, 14, 1)) + + next() { +>next : Symbol(next, Decl(iteratorSpreadInCall5.ts, 16, 22)) + + return { + value: "", +>value : Symbol(value, Decl(iteratorSpreadInCall5.ts, 18, 16)) + + done: false +>done : Symbol(done, Decl(iteratorSpreadInCall5.ts, 19, 22)) + + }; + } + + [Symbol.iterator]() { +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) + + return this; +>this : Symbol(StringIterator, Decl(iteratorSpreadInCall5.ts, 14, 1)) + } +} diff --git a/tests/baselines/reference/iteratorSpreadInCall5.types b/tests/baselines/reference/iteratorSpreadInCall5.types index 6e924a1ef42..2401a41cca8 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.types +++ b/tests/baselines/reference/iteratorSpreadInCall5.types @@ -29,6 +29,7 @@ class SymbolIterator { done: false >done : boolean +>false : boolean }; } @@ -54,9 +55,11 @@ class StringIterator { value: "", >value : string +>"" : string done: false >done : boolean +>false : boolean }; } diff --git a/tests/baselines/reference/keywordField.symbols b/tests/baselines/reference/keywordField.symbols new file mode 100644 index 00000000000..7ea3438d985 --- /dev/null +++ b/tests/baselines/reference/keywordField.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/keywordField.ts === +var obj:any = {}; +>obj : Symbol(obj, Decl(keywordField.ts, 0, 3)) + +obj.if = 1; +>obj : Symbol(obj, Decl(keywordField.ts, 0, 3)) + +var a = { if: "test" } +>a : Symbol(a, Decl(keywordField.ts, 4, 3)) +>if : Symbol(if, Decl(keywordField.ts, 4, 9)) + +var n = a.if +>n : Symbol(n, Decl(keywordField.ts, 6, 3)) +>a.if : Symbol(if, Decl(keywordField.ts, 4, 9)) +>a : Symbol(a, Decl(keywordField.ts, 4, 3)) +>if : Symbol(if, Decl(keywordField.ts, 4, 9)) + +var q = a["if"]; +>q : Symbol(q, Decl(keywordField.ts, 8, 3)) +>a : Symbol(a, Decl(keywordField.ts, 4, 3)) +>"if" : Symbol(if, Decl(keywordField.ts, 4, 9)) + diff --git a/tests/baselines/reference/keywordField.types b/tests/baselines/reference/keywordField.types index a5c465ae39c..8bc977edd74 100644 --- a/tests/baselines/reference/keywordField.types +++ b/tests/baselines/reference/keywordField.types @@ -8,11 +8,13 @@ obj.if = 1; >obj.if : any >obj : any >if : any +>1 : number var a = { if: "test" } >a : { if: string; } >{ if: "test" } : { if: string; } >if : string +>"test" : string var n = a.if >n : string @@ -24,4 +26,5 @@ var q = a["if"]; >q : string >a["if"] : string >a : { if: string; } +>"if" : string diff --git a/tests/baselines/reference/lambdaASIEmit.symbols b/tests/baselines/reference/lambdaASIEmit.symbols new file mode 100644 index 00000000000..d33cc16817a --- /dev/null +++ b/tests/baselines/reference/lambdaASIEmit.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/lambdaASIEmit.ts === + +function Foo(x: any) +>Foo : Symbol(Foo, Decl(lambdaASIEmit.ts, 0, 0)) +>x : Symbol(x, Decl(lambdaASIEmit.ts, 1, 13)) +{ +} + +Foo(() => +>Foo : Symbol(Foo, Decl(lambdaASIEmit.ts, 0, 0)) + + // do something + 127); + diff --git a/tests/baselines/reference/lambdaASIEmit.types b/tests/baselines/reference/lambdaASIEmit.types index b72a805cd12..8ea881c4cd5 100644 --- a/tests/baselines/reference/lambdaASIEmit.types +++ b/tests/baselines/reference/lambdaASIEmit.types @@ -13,4 +13,5 @@ Foo(() => // do something 127); +>127 : number diff --git a/tests/baselines/reference/lambdaExpression.symbols b/tests/baselines/reference/lambdaExpression.symbols new file mode 100644 index 00000000000..48bda5ce07f --- /dev/null +++ b/tests/baselines/reference/lambdaExpression.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/lambdaExpression.ts === +() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) +var y = 0; +>y : Symbol(y, Decl(lambdaExpression.ts, 1, 3)) + +(()=>0); +var x = 0; +>x : Symbol(x, Decl(lambdaExpression.ts, 3, 3)) + diff --git a/tests/baselines/reference/lambdaExpression.types b/tests/baselines/reference/lambdaExpression.types index d550781ebf7..714cd851d63 100644 --- a/tests/baselines/reference/lambdaExpression.types +++ b/tests/baselines/reference/lambdaExpression.types @@ -1,14 +1,18 @@ === tests/cases/compiler/lambdaExpression.ts === () => 0; // Needs to be wrapped in parens to be a valid expression (not declaration) >() => 0 : () => number +>0 : number var y = 0; >y : number +>0 : number (()=>0); >(()=>0) : () => number >()=>0 : () => number +>0 : number var x = 0; >x : number +>0 : number diff --git a/tests/baselines/reference/letAsIdentifier.symbols b/tests/baselines/reference/letAsIdentifier.symbols new file mode 100644 index 00000000000..be5066f5ac7 --- /dev/null +++ b/tests/baselines/reference/letAsIdentifier.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/letAsIdentifier.ts === + +var let = 10; +>let : Symbol(let, Decl(letAsIdentifier.ts, 1, 3)) + +var a = 10; +>a : Symbol(a, Decl(letAsIdentifier.ts, 2, 3)) + +let = 30; +>let : Symbol(let, Decl(letAsIdentifier.ts, 1, 3)) + +let +>let : Symbol(let, Decl(letAsIdentifier.ts, 1, 3)) + +a; +>a : Symbol(a, Decl(letAsIdentifier.ts, 2, 3)) + diff --git a/tests/baselines/reference/letAsIdentifier.types b/tests/baselines/reference/letAsIdentifier.types index 95fe2b11ac9..36c190a92e4 100644 --- a/tests/baselines/reference/letAsIdentifier.types +++ b/tests/baselines/reference/letAsIdentifier.types @@ -2,13 +2,16 @@ var let = 10; >let : number +>10 : number var a = 10; >a : number +>10 : number let = 30; >let = 30 : number >let : number +>30 : number let >let : number diff --git a/tests/baselines/reference/letConstMatchingParameterNames.symbols b/tests/baselines/reference/letConstMatchingParameterNames.symbols new file mode 100644 index 00000000000..b0a2f9c3810 --- /dev/null +++ b/tests/baselines/reference/letConstMatchingParameterNames.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/letConstMatchingParameterNames.ts === +let parent = true; +>parent : Symbol(parent, Decl(letConstMatchingParameterNames.ts, 0, 3)) + +const parent2 = true; +>parent2 : Symbol(parent2, Decl(letConstMatchingParameterNames.ts, 1, 5)) + +declare function use(a: any); +>use : Symbol(use, Decl(letConstMatchingParameterNames.ts, 1, 21)) +>a : Symbol(a, Decl(letConstMatchingParameterNames.ts, 2, 21)) + +function a() { +>a : Symbol(a, Decl(letConstMatchingParameterNames.ts, 2, 29)) + + let parent = 1; +>parent : Symbol(parent, Decl(letConstMatchingParameterNames.ts, 6, 7)) + + const parent2 = 2; +>parent2 : Symbol(parent2, Decl(letConstMatchingParameterNames.ts, 7, 9)) + + function b(parent: string, parent2: number) { +>b : Symbol(b, Decl(letConstMatchingParameterNames.ts, 7, 22)) +>parent : Symbol(parent, Decl(letConstMatchingParameterNames.ts, 9, 15)) +>parent2 : Symbol(parent2, Decl(letConstMatchingParameterNames.ts, 9, 30)) + + use(parent); +>use : Symbol(use, Decl(letConstMatchingParameterNames.ts, 1, 21)) +>parent : Symbol(parent, Decl(letConstMatchingParameterNames.ts, 9, 15)) + + use(parent2); +>use : Symbol(use, Decl(letConstMatchingParameterNames.ts, 1, 21)) +>parent2 : Symbol(parent2, Decl(letConstMatchingParameterNames.ts, 9, 30)) + } +} + diff --git a/tests/baselines/reference/letConstMatchingParameterNames.types b/tests/baselines/reference/letConstMatchingParameterNames.types index 66fccc637df..2e29dff289b 100644 --- a/tests/baselines/reference/letConstMatchingParameterNames.types +++ b/tests/baselines/reference/letConstMatchingParameterNames.types @@ -1,9 +1,11 @@ === tests/cases/compiler/letConstMatchingParameterNames.ts === let parent = true; >parent : boolean +>true : boolean const parent2 = true; >parent2 : boolean +>true : boolean declare function use(a: any); >use : (a: any) => any @@ -14,9 +16,11 @@ function a() { let parent = 1; >parent : number +>1 : number const parent2 = 2; >parent2 : number +>2 : number function b(parent: string, parent2: number) { >b : (parent: string, parent2: number) => void diff --git a/tests/baselines/reference/letDeclarations-access.symbols b/tests/baselines/reference/letDeclarations-access.symbols new file mode 100644 index 00000000000..dfc9ea4c533 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-access.symbols @@ -0,0 +1,87 @@ +=== tests/cases/compiler/letDeclarations-access.ts === + +let x = 0 +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +// No errors + +x = 1; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x += 2; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x -= 3; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x *= 4; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x /= 5; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x %= 6; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x <<= 7; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x >>= 8; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x >>>= 9; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x &= 10; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x |= 11; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x ^= 12; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x++; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x--; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +++x; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +--x; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +var a = x + 1; +>a : Symbol(a, Decl(letDeclarations-access.ts, 23, 3)) +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +function f(v: number) { } +>f : Symbol(f, Decl(letDeclarations-access.ts, 23, 14)) +>v : Symbol(v, Decl(letDeclarations-access.ts, 25, 11)) + +f(x); +>f : Symbol(f, Decl(letDeclarations-access.ts, 23, 14)) +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +if (x) { } +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +(x); +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +-x; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + ++x; +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) + +x.toString(); +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(letDeclarations-access.ts, 1, 3)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + diff --git a/tests/baselines/reference/letDeclarations-access.types b/tests/baselines/reference/letDeclarations-access.types index f26d07ca5f8..673fc97f80b 100644 --- a/tests/baselines/reference/letDeclarations-access.types +++ b/tests/baselines/reference/letDeclarations-access.types @@ -2,56 +2,69 @@ let x = 0 >x : number +>0 : number // No errors x = 1; >x = 1 : number >x : number +>1 : number x += 2; >x += 2 : number >x : number +>2 : number x -= 3; >x -= 3 : number >x : number +>3 : number x *= 4; >x *= 4 : number >x : number +>4 : number x /= 5; >x /= 5 : number >x : number +>5 : number x %= 6; >x %= 6 : number >x : number +>6 : number x <<= 7; >x <<= 7 : number >x : number +>7 : number x >>= 8; >x >>= 8 : number >x : number +>8 : number x >>>= 9; >x >>>= 9 : number >x : number +>9 : number x &= 10; >x &= 10 : number >x : number +>10 : number x |= 11; >x |= 11 : number >x : number +>11 : number x ^= 12; >x ^= 12 : number >x : number +>12 : number x++; >x++ : number @@ -73,6 +86,7 @@ var a = x + 1; >a : number >x + 1 : number >x : number +>1 : number function f(v: number) { } >f : (v: number) => void diff --git a/tests/baselines/reference/letDeclarations-es5-1.symbols b/tests/baselines/reference/letDeclarations-es5-1.symbols new file mode 100644 index 00000000000..22ae7bd6c18 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-es5-1.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/letDeclarations-es5-1.ts === + let l1; +>l1 : Symbol(l1, Decl(letDeclarations-es5-1.ts, 0, 7)) + + let l2: number; +>l2 : Symbol(l2, Decl(letDeclarations-es5-1.ts, 1, 7)) + + let l3, l4, l5 :string, l6; +>l3 : Symbol(l3, Decl(letDeclarations-es5-1.ts, 2, 7)) +>l4 : Symbol(l4, Decl(letDeclarations-es5-1.ts, 2, 11)) +>l5 : Symbol(l5, Decl(letDeclarations-es5-1.ts, 2, 15)) +>l6 : Symbol(l6, Decl(letDeclarations-es5-1.ts, 2, 27)) + + let l7 = false; +>l7 : Symbol(l7, Decl(letDeclarations-es5-1.ts, 3, 7)) + + let l8: number = 23; +>l8 : Symbol(l8, Decl(letDeclarations-es5-1.ts, 4, 7)) + + let l9 = 0, l10 :string = "", l11 = null; +>l9 : Symbol(l9, Decl(letDeclarations-es5-1.ts, 5, 7)) +>l10 : Symbol(l10, Decl(letDeclarations-es5-1.ts, 5, 15)) +>l11 : Symbol(l11, Decl(letDeclarations-es5-1.ts, 5, 33)) + diff --git a/tests/baselines/reference/letDeclarations-es5-1.types b/tests/baselines/reference/letDeclarations-es5-1.types index fb45d521bd3..b088677cd0a 100644 --- a/tests/baselines/reference/letDeclarations-es5-1.types +++ b/tests/baselines/reference/letDeclarations-es5-1.types @@ -13,12 +13,17 @@ let l7 = false; >l7 : boolean +>false : boolean let l8: number = 23; >l8 : number +>23 : number let l9 = 0, l10 :string = "", l11 = null; >l9 : number +>0 : number >l10 : string +>"" : string >l11 : any +>null : null diff --git a/tests/baselines/reference/letDeclarations-es5.symbols b/tests/baselines/reference/letDeclarations-es5.symbols new file mode 100644 index 00000000000..ac2daaaac89 --- /dev/null +++ b/tests/baselines/reference/letDeclarations-es5.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/letDeclarations-es5.ts === + +let l1; +>l1 : Symbol(l1, Decl(letDeclarations-es5.ts, 1, 3)) + +let l2: number; +>l2 : Symbol(l2, Decl(letDeclarations-es5.ts, 2, 3)) + +let l3, l4, l5 :string, l6; +>l3 : Symbol(l3, Decl(letDeclarations-es5.ts, 3, 3)) +>l4 : Symbol(l4, Decl(letDeclarations-es5.ts, 3, 7)) +>l5 : Symbol(l5, Decl(letDeclarations-es5.ts, 3, 11)) +>l6 : Symbol(l6, Decl(letDeclarations-es5.ts, 3, 23)) + +let l7 = false; +>l7 : Symbol(l7, Decl(letDeclarations-es5.ts, 5, 3)) + +let l8: number = 23; +>l8 : Symbol(l8, Decl(letDeclarations-es5.ts, 6, 3)) + +let l9 = 0, l10 :string = "", l11 = null; +>l9 : Symbol(l9, Decl(letDeclarations-es5.ts, 7, 3)) +>l10 : Symbol(l10, Decl(letDeclarations-es5.ts, 7, 11)) +>l11 : Symbol(l11, Decl(letDeclarations-es5.ts, 7, 29)) + +for(let l11 in {}) { } +>l11 : Symbol(l11, Decl(letDeclarations-es5.ts, 9, 7)) + +for(let l12 = 0; l12 < 9; l12++) { } +>l12 : Symbol(l12, Decl(letDeclarations-es5.ts, 11, 7)) +>l12 : Symbol(l12, Decl(letDeclarations-es5.ts, 11, 7)) +>l12 : Symbol(l12, Decl(letDeclarations-es5.ts, 11, 7)) + diff --git a/tests/baselines/reference/letDeclarations-es5.types b/tests/baselines/reference/letDeclarations-es5.types index 0d6e9928868..005e0b26155 100644 --- a/tests/baselines/reference/letDeclarations-es5.types +++ b/tests/baselines/reference/letDeclarations-es5.types @@ -14,14 +14,19 @@ let l3, l4, l5 :string, l6; let l7 = false; >l7 : boolean +>false : boolean let l8: number = 23; >l8 : number +>23 : number let l9 = 0, l10 :string = "", l11 = null; >l9 : number +>0 : number >l10 : string +>"" : string >l11 : any +>null : null for(let l11 in {}) { } >l11 : any @@ -29,8 +34,10 @@ for(let l11 in {}) { } for(let l12 = 0; l12 < 9; l12++) { } >l12 : number +>0 : number >l12 < 9 : boolean >l12 : number +>9 : number >l12++ : number >l12 : number diff --git a/tests/baselines/reference/letDeclarations.symbols b/tests/baselines/reference/letDeclarations.symbols new file mode 100644 index 00000000000..dbbaac211ac --- /dev/null +++ b/tests/baselines/reference/letDeclarations.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/letDeclarations.ts === + +let l1; +>l1 : Symbol(l1, Decl(letDeclarations.ts, 1, 3)) + +let l2: number; +>l2 : Symbol(l2, Decl(letDeclarations.ts, 2, 3)) + +let l3, l4, l5 :string, l6; +>l3 : Symbol(l3, Decl(letDeclarations.ts, 3, 3)) +>l4 : Symbol(l4, Decl(letDeclarations.ts, 3, 7)) +>l5 : Symbol(l5, Decl(letDeclarations.ts, 3, 11)) +>l6 : Symbol(l6, Decl(letDeclarations.ts, 3, 23)) + +let l7 = false; +>l7 : Symbol(l7, Decl(letDeclarations.ts, 5, 3)) + +let l8: number = 23; +>l8 : Symbol(l8, Decl(letDeclarations.ts, 6, 3)) + +let l9 = 0, l10 :string = "", l11 = null; +>l9 : Symbol(l9, Decl(letDeclarations.ts, 7, 3)) +>l10 : Symbol(l10, Decl(letDeclarations.ts, 7, 11)) +>l11 : Symbol(l11, Decl(letDeclarations.ts, 7, 29)) + +for(let l11 in {}) { } +>l11 : Symbol(l11, Decl(letDeclarations.ts, 9, 7)) + +for(let l12 = 0; l12 < 9; l12++) { } +>l12 : Symbol(l12, Decl(letDeclarations.ts, 11, 7)) +>l12 : Symbol(l12, Decl(letDeclarations.ts, 11, 7)) +>l12 : Symbol(l12, Decl(letDeclarations.ts, 11, 7)) + diff --git a/tests/baselines/reference/letDeclarations.types b/tests/baselines/reference/letDeclarations.types index aa47a7f0006..55be4326b19 100644 --- a/tests/baselines/reference/letDeclarations.types +++ b/tests/baselines/reference/letDeclarations.types @@ -14,14 +14,19 @@ let l3, l4, l5 :string, l6; let l7 = false; >l7 : boolean +>false : boolean let l8: number = 23; >l8 : number +>23 : number let l9 = 0, l10 :string = "", l11 = null; >l9 : number +>0 : number >l10 : string +>"" : string >l11 : any +>null : null for(let l11 in {}) { } >l11 : any @@ -29,8 +34,10 @@ for(let l11 in {}) { } for(let l12 = 0; l12 < 9; l12++) { } >l12 : number +>0 : number >l12 < 9 : boolean >l12 : number +>9 : number >l12++ : number >l12 : number diff --git a/tests/baselines/reference/letDeclarations2.symbols b/tests/baselines/reference/letDeclarations2.symbols new file mode 100644 index 00000000000..1f4bcb12420 --- /dev/null +++ b/tests/baselines/reference/letDeclarations2.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/letDeclarations2.ts === + +module M { +>M : Symbol(M, Decl(letDeclarations2.ts, 0, 0)) + + let l1 = "s"; +>l1 : Symbol(l1, Decl(letDeclarations2.ts, 2, 7)) + + export let l2 = 0; +>l2 : Symbol(l2, Decl(letDeclarations2.ts, 3, 14)) +} diff --git a/tests/baselines/reference/letDeclarations2.types b/tests/baselines/reference/letDeclarations2.types index 2fa08b6d940..eeb66838a6a 100644 --- a/tests/baselines/reference/letDeclarations2.types +++ b/tests/baselines/reference/letDeclarations2.types @@ -5,7 +5,9 @@ module M { let l1 = "s"; >l1 : string +>"s" : string export let l2 = 0; >l2 : number +>0 : number } diff --git a/tests/baselines/reference/letInNonStrictMode.js b/tests/baselines/reference/letInNonStrictMode.js index 8a431535ae2..8e4920cc220 100644 --- a/tests/baselines/reference/letInNonStrictMode.js +++ b/tests/baselines/reference/letInNonStrictMode.js @@ -3,5 +3,5 @@ let [x] = [1]; let {a: y} = {a: 1}; //// [letInNonStrictMode.js] -var x = ([1])[0]; -var y = ({ a: 1 }).a; +var x = [1][0]; +var y = { a: 1 }.a; diff --git a/tests/baselines/reference/letInNonStrictMode.symbols b/tests/baselines/reference/letInNonStrictMode.symbols new file mode 100644 index 00000000000..2b854a8c03f --- /dev/null +++ b/tests/baselines/reference/letInNonStrictMode.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/letInNonStrictMode.ts === +let [x] = [1]; +>x : Symbol(x, Decl(letInNonStrictMode.ts, 0, 5)) + +let {a: y} = {a: 1}; +>y : Symbol(y, Decl(letInNonStrictMode.ts, 1, 5)) +>a : Symbol(a, Decl(letInNonStrictMode.ts, 1, 14)) + diff --git a/tests/baselines/reference/letInNonStrictMode.types b/tests/baselines/reference/letInNonStrictMode.types index 4f2cbe4a703..ceb59dba6a3 100644 --- a/tests/baselines/reference/letInNonStrictMode.types +++ b/tests/baselines/reference/letInNonStrictMode.types @@ -2,10 +2,12 @@ let [x] = [1]; >x : number >[1] : [number] +>1 : number let {a: y} = {a: 1}; ->a : unknown +>a : any >y : number >{a: 1} : { a: number; } >a : number +>1 : number diff --git a/tests/baselines/reference/letKeepNamesOfTopLevelItems.symbols b/tests/baselines/reference/letKeepNamesOfTopLevelItems.symbols new file mode 100644 index 00000000000..dc6e579a73f --- /dev/null +++ b/tests/baselines/reference/letKeepNamesOfTopLevelItems.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/letKeepNamesOfTopLevelItems.ts === +let x; +>x : Symbol(x, Decl(letKeepNamesOfTopLevelItems.ts, 0, 3)) + +function foo() { +>foo : Symbol(foo, Decl(letKeepNamesOfTopLevelItems.ts, 0, 6)) + + let x; +>x : Symbol(x, Decl(letKeepNamesOfTopLevelItems.ts, 2, 7)) +} + +module A { +>A : Symbol(A, Decl(letKeepNamesOfTopLevelItems.ts, 3, 1)) + + let x; +>x : Symbol(x, Decl(letKeepNamesOfTopLevelItems.ts, 6, 7)) +} diff --git a/tests/baselines/reference/libdtsFix.symbols b/tests/baselines/reference/libdtsFix.symbols new file mode 100644 index 00000000000..158b0587ec6 --- /dev/null +++ b/tests/baselines/reference/libdtsFix.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/libdtsFix.ts === +interface HTMLElement { +>HTMLElement : Symbol(HTMLElement, Decl(libdtsFix.ts, 0, 0)) + + type: string; +>type : Symbol(type, Decl(libdtsFix.ts, 0, 23)) +} + diff --git a/tests/baselines/reference/library_ArraySlice.symbols b/tests/baselines/reference/library_ArraySlice.symbols new file mode 100644 index 00000000000..25e6fbd5b5b --- /dev/null +++ b/tests/baselines/reference/library_ArraySlice.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/library_ArraySlice.ts === +// Array.prototype.slice can have zero, one, or two arguments +Array.prototype.slice(); +>Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + +Array.prototype.slice(0); +>Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + +Array.prototype.slice(0, 1); +>Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, 1167, 31)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + diff --git a/tests/baselines/reference/library_ArraySlice.types b/tests/baselines/reference/library_ArraySlice.types index 378724c74e4..b92d9254390 100644 --- a/tests/baselines/reference/library_ArraySlice.types +++ b/tests/baselines/reference/library_ArraySlice.types @@ -15,6 +15,7 @@ Array.prototype.slice(0); >Array : ArrayConstructor >prototype : any[] >slice : (start?: number, end?: number) => any[] +>0 : number Array.prototype.slice(0, 1); >Array.prototype.slice(0, 1) : any[] @@ -23,4 +24,6 @@ Array.prototype.slice(0, 1); >Array : ArrayConstructor >prototype : any[] >slice : (start?: number, end?: number) => any[] +>0 : number +>1 : number diff --git a/tests/baselines/reference/library_DatePrototypeProperties.symbols b/tests/baselines/reference/library_DatePrototypeProperties.symbols new file mode 100644 index 00000000000..c6d0b7e87fb --- /dev/null +++ b/tests/baselines/reference/library_DatePrototypeProperties.symbols @@ -0,0 +1,311 @@ +=== tests/cases/compiler/library_DatePrototypeProperties.ts === +// Properties of the Date prototype object as per ES5 spec +// http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.5 +Date.prototype.constructor; +>Date.prototype.constructor : Symbol(Object.constructor, Decl(lib.d.ts, 94, 18)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>constructor : Symbol(Object.constructor, Decl(lib.d.ts, 94, 18)) + +Date.prototype.toString(); +>Date.prototype.toString : Symbol(Date.toString, Decl(lib.d.ts, 636, 16)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toString : Symbol(Date.toString, Decl(lib.d.ts, 636, 16)) + +Date.prototype.toDateString(); +>Date.prototype.toDateString : Symbol(Date.toDateString, Decl(lib.d.ts, 638, 23)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toDateString : Symbol(Date.toDateString, Decl(lib.d.ts, 638, 23)) + +Date.prototype.toTimeString(); +>Date.prototype.toTimeString : Symbol(Date.toTimeString, Decl(lib.d.ts, 640, 27)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toTimeString : Symbol(Date.toTimeString, Decl(lib.d.ts, 640, 27)) + +Date.prototype.toLocaleString(); +>Date.prototype.toLocaleString : Symbol(Date.toLocaleString, Decl(lib.d.ts, 642, 27)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toLocaleString : Symbol(Date.toLocaleString, Decl(lib.d.ts, 642, 27)) + +Date.prototype.toLocaleDateString(); +>Date.prototype.toLocaleDateString : Symbol(Date.toLocaleDateString, Decl(lib.d.ts, 644, 29)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toLocaleDateString : Symbol(Date.toLocaleDateString, Decl(lib.d.ts, 644, 29)) + +Date.prototype.toLocaleTimeString(); +>Date.prototype.toLocaleTimeString : Symbol(Date.toLocaleTimeString, Decl(lib.d.ts, 646, 33)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toLocaleTimeString : Symbol(Date.toLocaleTimeString, Decl(lib.d.ts, 646, 33)) + +Date.prototype.valueOf(); +>Date.prototype.valueOf : Symbol(Date.valueOf, Decl(lib.d.ts, 648, 33)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>valueOf : Symbol(Date.valueOf, Decl(lib.d.ts, 648, 33)) + +Date.prototype.getTime(); +>Date.prototype.getTime : Symbol(Date.getTime, Decl(lib.d.ts, 650, 22)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getTime : Symbol(Date.getTime, Decl(lib.d.ts, 650, 22)) + +Date.prototype.getFullYear(); +>Date.prototype.getFullYear : Symbol(Date.getFullYear, Decl(lib.d.ts, 652, 22)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getFullYear : Symbol(Date.getFullYear, Decl(lib.d.ts, 652, 22)) + +Date.prototype.getUTCFullYear(); +>Date.prototype.getUTCFullYear : Symbol(Date.getUTCFullYear, Decl(lib.d.ts, 654, 26)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCFullYear : Symbol(Date.getUTCFullYear, Decl(lib.d.ts, 654, 26)) + +Date.prototype.getMonth(); +>Date.prototype.getMonth : Symbol(Date.getMonth, Decl(lib.d.ts, 656, 29)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getMonth : Symbol(Date.getMonth, Decl(lib.d.ts, 656, 29)) + +Date.prototype.getUTCMonth(); +>Date.prototype.getUTCMonth : Symbol(Date.getUTCMonth, Decl(lib.d.ts, 658, 23)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCMonth : Symbol(Date.getUTCMonth, Decl(lib.d.ts, 658, 23)) + +Date.prototype.getDate(); +>Date.prototype.getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getDate : Symbol(Date.getDate, Decl(lib.d.ts, 660, 26)) + +Date.prototype.getUTCDate(); +>Date.prototype.getUTCDate : Symbol(Date.getUTCDate, Decl(lib.d.ts, 662, 22)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCDate : Symbol(Date.getUTCDate, Decl(lib.d.ts, 662, 22)) + +Date.prototype.getDay(); +>Date.prototype.getDay : Symbol(Date.getDay, Decl(lib.d.ts, 664, 25)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getDay : Symbol(Date.getDay, Decl(lib.d.ts, 664, 25)) + +Date.prototype.getUTCDay(); +>Date.prototype.getUTCDay : Symbol(Date.getUTCDay, Decl(lib.d.ts, 666, 21)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCDay : Symbol(Date.getUTCDay, Decl(lib.d.ts, 666, 21)) + +Date.prototype.getHours(); +>Date.prototype.getHours : Symbol(Date.getHours, Decl(lib.d.ts, 668, 24)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getHours : Symbol(Date.getHours, Decl(lib.d.ts, 668, 24)) + +Date.prototype.getUTCHours(); +>Date.prototype.getUTCHours : Symbol(Date.getUTCHours, Decl(lib.d.ts, 670, 23)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCHours : Symbol(Date.getUTCHours, Decl(lib.d.ts, 670, 23)) + +Date.prototype.getMinutes(); +>Date.prototype.getMinutes : Symbol(Date.getMinutes, Decl(lib.d.ts, 672, 26)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getMinutes : Symbol(Date.getMinutes, Decl(lib.d.ts, 672, 26)) + +Date.prototype.getUTCMinutes(); +>Date.prototype.getUTCMinutes : Symbol(Date.getUTCMinutes, Decl(lib.d.ts, 674, 25)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCMinutes : Symbol(Date.getUTCMinutes, Decl(lib.d.ts, 674, 25)) + +Date.prototype.getSeconds(); +>Date.prototype.getSeconds : Symbol(Date.getSeconds, Decl(lib.d.ts, 676, 28)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getSeconds : Symbol(Date.getSeconds, Decl(lib.d.ts, 676, 28)) + +Date.prototype.getUTCSeconds(); +>Date.prototype.getUTCSeconds : Symbol(Date.getUTCSeconds, Decl(lib.d.ts, 678, 25)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCSeconds : Symbol(Date.getUTCSeconds, Decl(lib.d.ts, 678, 25)) + +Date.prototype.getMilliseconds(); +>Date.prototype.getMilliseconds : Symbol(Date.getMilliseconds, Decl(lib.d.ts, 680, 28)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getMilliseconds : Symbol(Date.getMilliseconds, Decl(lib.d.ts, 680, 28)) + +Date.prototype.getUTCMilliseconds(); +>Date.prototype.getUTCMilliseconds : Symbol(Date.getUTCMilliseconds, Decl(lib.d.ts, 682, 30)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getUTCMilliseconds : Symbol(Date.getUTCMilliseconds, Decl(lib.d.ts, 682, 30)) + +Date.prototype.getTimezoneOffset(); +>Date.prototype.getTimezoneOffset : Symbol(Date.getTimezoneOffset, Decl(lib.d.ts, 684, 33)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>getTimezoneOffset : Symbol(Date.getTimezoneOffset, Decl(lib.d.ts, 684, 33)) + +Date.prototype.setTime(0); +>Date.prototype.setTime : Symbol(Date.setTime, Decl(lib.d.ts, 686, 32)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setTime : Symbol(Date.setTime, Decl(lib.d.ts, 686, 32)) + +Date.prototype.setMilliseconds(0); +>Date.prototype.setMilliseconds : Symbol(Date.setMilliseconds, Decl(lib.d.ts, 691, 34)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setMilliseconds : Symbol(Date.setMilliseconds, Decl(lib.d.ts, 691, 34)) + +Date.prototype.setUTCMilliseconds(0); +>Date.prototype.setUTCMilliseconds : Symbol(Date.setUTCMilliseconds, Decl(lib.d.ts, 696, 40)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCMilliseconds : Symbol(Date.setUTCMilliseconds, Decl(lib.d.ts, 696, 40)) + +Date.prototype.setSeconds(0); +>Date.prototype.setSeconds : Symbol(Date.setSeconds, Decl(lib.d.ts, 701, 43)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setSeconds : Symbol(Date.setSeconds, Decl(lib.d.ts, 701, 43)) + +Date.prototype.setUTCSeconds(0); +>Date.prototype.setUTCSeconds : Symbol(Date.setUTCSeconds, Decl(lib.d.ts, 708, 49)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCSeconds : Symbol(Date.setUTCSeconds, Decl(lib.d.ts, 708, 49)) + +Date.prototype.setMinutes(0); +>Date.prototype.setMinutes : Symbol(Date.setMinutes, Decl(lib.d.ts, 714, 52)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setMinutes : Symbol(Date.setMinutes, Decl(lib.d.ts, 714, 52)) + +Date.prototype.setUTCMinutes(0); +>Date.prototype.setUTCMinutes : Symbol(Date.setUTCMinutes, Decl(lib.d.ts, 721, 63)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCMinutes : Symbol(Date.setUTCMinutes, Decl(lib.d.ts, 721, 63)) + +Date.prototype.setHours(0); +>Date.prototype.setHours : Symbol(Date.setHours, Decl(lib.d.ts, 728, 66)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setHours : Symbol(Date.setHours, Decl(lib.d.ts, 728, 66)) + +Date.prototype.setUTCHours(0); +>Date.prototype.setUTCHours : Symbol(Date.setUTCHours, Decl(lib.d.ts, 736, 77)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCHours : Symbol(Date.setUTCHours, Decl(lib.d.ts, 736, 77)) + +Date.prototype.setDate(0); +>Date.prototype.setDate : Symbol(Date.setDate, Decl(lib.d.ts, 744, 80)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setDate : Symbol(Date.setDate, Decl(lib.d.ts, 744, 80)) + +Date.prototype.setUTCDate(0); +>Date.prototype.setUTCDate : Symbol(Date.setUTCDate, Decl(lib.d.ts, 749, 34)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCDate : Symbol(Date.setUTCDate, Decl(lib.d.ts, 749, 34)) + +Date.prototype.setMonth(0); +>Date.prototype.setMonth : Symbol(Date.setMonth, Decl(lib.d.ts, 754, 37)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setMonth : Symbol(Date.setMonth, Decl(lib.d.ts, 754, 37)) + +Date.prototype.setUTCMonth(0); +>Date.prototype.setUTCMonth : Symbol(Date.setUTCMonth, Decl(lib.d.ts, 760, 51)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCMonth : Symbol(Date.setUTCMonth, Decl(lib.d.ts, 760, 51)) + +Date.prototype.setFullYear(0); +>Date.prototype.setFullYear : Symbol(Date.setFullYear, Decl(lib.d.ts, 766, 54)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setFullYear : Symbol(Date.setFullYear, Decl(lib.d.ts, 766, 54)) + +Date.prototype.setUTCFullYear(0); +>Date.prototype.setUTCFullYear : Symbol(Date.setUTCFullYear, Decl(lib.d.ts, 773, 69)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>setUTCFullYear : Symbol(Date.setUTCFullYear, Decl(lib.d.ts, 773, 69)) + +Date.prototype.toUTCString(); +>Date.prototype.toUTCString : Symbol(Date.toUTCString, Decl(lib.d.ts, 780, 72)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toUTCString : Symbol(Date.toUTCString, Decl(lib.d.ts, 780, 72)) + +Date.prototype.toISOString(); +>Date.prototype.toISOString : Symbol(Date.toISOString, Decl(lib.d.ts, 782, 26)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toISOString : Symbol(Date.toISOString, Decl(lib.d.ts, 782, 26)) + +Date.prototype.toJSON(null); +>Date.prototype.toJSON : Symbol(Date.toJSON, Decl(lib.d.ts, 784, 26)) +>Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, 794, 15)) +>toJSON : Symbol(Date.toJSON, Decl(lib.d.ts, 784, 26)) + diff --git a/tests/baselines/reference/library_DatePrototypeProperties.types b/tests/baselines/reference/library_DatePrototypeProperties.types index 35dcea318be..79aad91245b 100644 --- a/tests/baselines/reference/library_DatePrototypeProperties.types +++ b/tests/baselines/reference/library_DatePrototypeProperties.types @@ -215,6 +215,7 @@ Date.prototype.setTime(0); >Date : DateConstructor >prototype : Date >setTime : (time: number) => number +>0 : number Date.prototype.setMilliseconds(0); >Date.prototype.setMilliseconds(0) : number @@ -223,6 +224,7 @@ Date.prototype.setMilliseconds(0); >Date : DateConstructor >prototype : Date >setMilliseconds : (ms: number) => number +>0 : number Date.prototype.setUTCMilliseconds(0); >Date.prototype.setUTCMilliseconds(0) : number @@ -231,6 +233,7 @@ Date.prototype.setUTCMilliseconds(0); >Date : DateConstructor >prototype : Date >setUTCMilliseconds : (ms: number) => number +>0 : number Date.prototype.setSeconds(0); >Date.prototype.setSeconds(0) : number @@ -239,6 +242,7 @@ Date.prototype.setSeconds(0); >Date : DateConstructor >prototype : Date >setSeconds : (sec: number, ms?: number) => number +>0 : number Date.prototype.setUTCSeconds(0); >Date.prototype.setUTCSeconds(0) : number @@ -247,6 +251,7 @@ Date.prototype.setUTCSeconds(0); >Date : DateConstructor >prototype : Date >setUTCSeconds : (sec: number, ms?: number) => number +>0 : number Date.prototype.setMinutes(0); >Date.prototype.setMinutes(0) : number @@ -255,6 +260,7 @@ Date.prototype.setMinutes(0); >Date : DateConstructor >prototype : Date >setMinutes : (min: number, sec?: number, ms?: number) => number +>0 : number Date.prototype.setUTCMinutes(0); >Date.prototype.setUTCMinutes(0) : number @@ -263,6 +269,7 @@ Date.prototype.setUTCMinutes(0); >Date : DateConstructor >prototype : Date >setUTCMinutes : (min: number, sec?: number, ms?: number) => number +>0 : number Date.prototype.setHours(0); >Date.prototype.setHours(0) : number @@ -271,6 +278,7 @@ Date.prototype.setHours(0); >Date : DateConstructor >prototype : Date >setHours : (hours: number, min?: number, sec?: number, ms?: number) => number +>0 : number Date.prototype.setUTCHours(0); >Date.prototype.setUTCHours(0) : number @@ -279,6 +287,7 @@ Date.prototype.setUTCHours(0); >Date : DateConstructor >prototype : Date >setUTCHours : (hours: number, min?: number, sec?: number, ms?: number) => number +>0 : number Date.prototype.setDate(0); >Date.prototype.setDate(0) : number @@ -287,6 +296,7 @@ Date.prototype.setDate(0); >Date : DateConstructor >prototype : Date >setDate : (date: number) => number +>0 : number Date.prototype.setUTCDate(0); >Date.prototype.setUTCDate(0) : number @@ -295,6 +305,7 @@ Date.prototype.setUTCDate(0); >Date : DateConstructor >prototype : Date >setUTCDate : (date: number) => number +>0 : number Date.prototype.setMonth(0); >Date.prototype.setMonth(0) : number @@ -303,6 +314,7 @@ Date.prototype.setMonth(0); >Date : DateConstructor >prototype : Date >setMonth : (month: number, date?: number) => number +>0 : number Date.prototype.setUTCMonth(0); >Date.prototype.setUTCMonth(0) : number @@ -311,6 +323,7 @@ Date.prototype.setUTCMonth(0); >Date : DateConstructor >prototype : Date >setUTCMonth : (month: number, date?: number) => number +>0 : number Date.prototype.setFullYear(0); >Date.prototype.setFullYear(0) : number @@ -319,6 +332,7 @@ Date.prototype.setFullYear(0); >Date : DateConstructor >prototype : Date >setFullYear : (year: number, month?: number, date?: number) => number +>0 : number Date.prototype.setUTCFullYear(0); >Date.prototype.setUTCFullYear(0) : number @@ -327,6 +341,7 @@ Date.prototype.setUTCFullYear(0); >Date : DateConstructor >prototype : Date >setUTCFullYear : (year: number, month?: number, date?: number) => number +>0 : number Date.prototype.toUTCString(); >Date.prototype.toUTCString() : string @@ -351,4 +366,5 @@ Date.prototype.toJSON(null); >Date : DateConstructor >prototype : Date >toJSON : (key?: any) => string +>null : null diff --git a/tests/baselines/reference/library_ObjectPrototypeProperties.symbols b/tests/baselines/reference/library_ObjectPrototypeProperties.symbols new file mode 100644 index 00000000000..eb24374af2a --- /dev/null +++ b/tests/baselines/reference/library_ObjectPrototypeProperties.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/library_ObjectPrototypeProperties.ts === +// Properties of the Object Prototype Object as per ES5 spec +// http://www.ecma-international.org/ecma-262/5.1/#sec-15.2.4 +Object.prototype.constructor; +>Object.prototype.constructor : Symbol(Object.constructor, Decl(lib.d.ts, 94, 18)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>constructor : Symbol(Object.constructor, Decl(lib.d.ts, 94, 18)) + +Object.prototype.toString(); +>Object.prototype.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +Object.prototype.toLocaleString(); +>Object.prototype.toLocaleString : Symbol(Object.toLocaleString, Decl(lib.d.ts, 99, 23)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>toLocaleString : Symbol(Object.toLocaleString, Decl(lib.d.ts, 99, 23)) + +Object.prototype.valueOf(); +>Object.prototype.valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>valueOf : Symbol(Object.valueOf, Decl(lib.d.ts, 102, 29)) + +Object.prototype.hasOwnProperty("string"); +>Object.prototype.hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) + +Object.prototype.isPrototypeOf(Object); +>Object.prototype.isPrototypeOf : Symbol(Object.isPrototypeOf, Decl(lib.d.ts, 111, 39)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>isPrototypeOf : Symbol(Object.isPrototypeOf, Decl(lib.d.ts, 111, 39)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +Object.prototype.propertyIsEnumerable("string"); +>Object.prototype.propertyIsEnumerable : Symbol(Object.propertyIsEnumerable, Decl(lib.d.ts, 117, 38)) +>Object.prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>prototype : Symbol(ObjectConstructor.prototype, Decl(lib.d.ts, 129, 22)) +>propertyIsEnumerable : Symbol(Object.propertyIsEnumerable, Decl(lib.d.ts, 117, 38)) + diff --git a/tests/baselines/reference/library_ObjectPrototypeProperties.types b/tests/baselines/reference/library_ObjectPrototypeProperties.types index c848ccbe512..616a9da633b 100644 --- a/tests/baselines/reference/library_ObjectPrototypeProperties.types +++ b/tests/baselines/reference/library_ObjectPrototypeProperties.types @@ -39,6 +39,7 @@ Object.prototype.hasOwnProperty("string"); >Object : ObjectConstructor >prototype : Object >hasOwnProperty : (v: string) => boolean +>"string" : string Object.prototype.isPrototypeOf(Object); >Object.prototype.isPrototypeOf(Object) : boolean @@ -56,4 +57,5 @@ Object.prototype.propertyIsEnumerable("string"); >Object : ObjectConstructor >prototype : Object >propertyIsEnumerable : (v: string) => boolean +>"string" : string diff --git a/tests/baselines/reference/library_RegExpExecArraySlice.symbols b/tests/baselines/reference/library_RegExpExecArraySlice.symbols new file mode 100644 index 00000000000..bc460801fe8 --- /dev/null +++ b/tests/baselines/reference/library_RegExpExecArraySlice.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/library_RegExpExecArraySlice.ts === +// RegExpExecArray.slice can have zero, one, or two arguments +var regExpExecArrayValue: RegExpExecArray; +>regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) +>RegExpExecArray : Symbol(RegExpExecArray, Decl(lib.d.ts, 820, 1)) + +regExpExecArrayValue.slice(); +>regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + +regExpExecArrayValue.slice(0); +>regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + +regExpExecArrayValue.slice(0,1); +>regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) +>regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, 1048, 15)) + diff --git a/tests/baselines/reference/library_RegExpExecArraySlice.types b/tests/baselines/reference/library_RegExpExecArraySlice.types index ba5c3ccfb21..b4673adb988 100644 --- a/tests/baselines/reference/library_RegExpExecArraySlice.types +++ b/tests/baselines/reference/library_RegExpExecArraySlice.types @@ -15,10 +15,13 @@ regExpExecArrayValue.slice(0); >regExpExecArrayValue.slice : (start?: number, end?: number) => string[] >regExpExecArrayValue : RegExpExecArray >slice : (start?: number, end?: number) => string[] +>0 : number regExpExecArrayValue.slice(0,1); >regExpExecArrayValue.slice(0,1) : string[] >regExpExecArrayValue.slice : (start?: number, end?: number) => string[] >regExpExecArrayValue : RegExpExecArray >slice : (start?: number, end?: number) => string[] +>0 : number +>1 : number diff --git a/tests/baselines/reference/library_StringSlice.symbols b/tests/baselines/reference/library_StringSlice.symbols new file mode 100644 index 00000000000..92c80089511 --- /dev/null +++ b/tests/baselines/reference/library_StringSlice.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/library_StringSlice.ts === +// String.prototype.slice can have zero, one, or two arguments +String.prototype.slice(); +>String.prototype.slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) +>String.prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) + +String.prototype.slice(0); +>String.prototype.slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) +>String.prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) + +String.prototype.slice(0,1); +>String.prototype.slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) +>String.prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>prototype : Symbol(StringConstructor.prototype, Decl(lib.d.ts, 435, 26)) +>slice : Symbol(String.slice, Decl(lib.d.ts, 369, 35)) + diff --git a/tests/baselines/reference/library_StringSlice.types b/tests/baselines/reference/library_StringSlice.types index c40c4d744e0..09b2a0b3995 100644 --- a/tests/baselines/reference/library_StringSlice.types +++ b/tests/baselines/reference/library_StringSlice.types @@ -15,6 +15,7 @@ String.prototype.slice(0); >String : StringConstructor >prototype : String >slice : (start?: number, end?: number) => string +>0 : number String.prototype.slice(0,1); >String.prototype.slice(0,1) : string @@ -23,4 +24,6 @@ String.prototype.slice(0,1); >String : StringConstructor >prototype : String >slice : (start?: number, end?: number) => string +>0 : number +>1 : number diff --git a/tests/baselines/reference/listFailure.symbols b/tests/baselines/reference/listFailure.symbols new file mode 100644 index 00000000000..53b1acf09ee --- /dev/null +++ b/tests/baselines/reference/listFailure.symbols @@ -0,0 +1,120 @@ +=== tests/cases/compiler/listFailure.ts === +module Editor { +>Editor : Symbol(Editor, Decl(listFailure.ts, 0, 0)) + + export class Buffer { +>Buffer : Symbol(Buffer, Decl(listFailure.ts, 0, 15)) + + lines: List = ListMakeHead(); +>lines : Symbol(lines, Decl(listFailure.ts, 2, 25)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) +>ListMakeHead : Symbol(ListMakeHead, Decl(listFailure.ts, 16, 5)) +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) + + addLine(lineText: string): List { +>addLine : Symbol(addLine, Decl(listFailure.ts, 3, 46)) +>lineText : Symbol(lineText, Decl(listFailure.ts, 5, 16)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) + + var line: Line = new Line(); +>line : Symbol(line, Decl(listFailure.ts, 7, 15)) +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) + + var lineEntry = this.lines.add(line); +>lineEntry : Symbol(lineEntry, Decl(listFailure.ts, 8, 15)) +>this.lines.add : Symbol(List.add, Decl(listFailure.ts, 27, 29)) +>this.lines : Symbol(lines, Decl(listFailure.ts, 2, 25)) +>this : Symbol(Buffer, Decl(listFailure.ts, 0, 15)) +>lines : Symbol(lines, Decl(listFailure.ts, 2, 25)) +>add : Symbol(List.add, Decl(listFailure.ts, 27, 29)) +>line : Symbol(line, Decl(listFailure.ts, 7, 15)) + + return lineEntry; +>lineEntry : Symbol(lineEntry, Decl(listFailure.ts, 8, 15)) + } + } + + export function ListRemoveEntry(entry: List): List { +>ListRemoveEntry : Symbol(ListRemoveEntry, Decl(listFailure.ts, 12, 5)) +>U : Symbol(U, Decl(listFailure.ts, 14, 36)) +>entry : Symbol(entry, Decl(listFailure.ts, 14, 39)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>U : Symbol(U, Decl(listFailure.ts, 14, 36)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>U : Symbol(U, Decl(listFailure.ts, 14, 36)) + + return entry; +>entry : Symbol(entry, Decl(listFailure.ts, 14, 39)) + } + + export function ListMakeHead(): List { +>ListMakeHead : Symbol(ListMakeHead, Decl(listFailure.ts, 16, 5)) +>U : Symbol(U, Decl(listFailure.ts, 18, 33)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>U : Symbol(U, Decl(listFailure.ts, 18, 33)) + + return null; + } + + export function ListMakeEntry(data: U): List { +>ListMakeEntry : Symbol(ListMakeEntry, Decl(listFailure.ts, 20, 5)) +>U : Symbol(U, Decl(listFailure.ts, 22, 34)) +>data : Symbol(data, Decl(listFailure.ts, 22, 37)) +>U : Symbol(U, Decl(listFailure.ts, 22, 34)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>U : Symbol(U, Decl(listFailure.ts, 22, 34)) + + return null; + } + + class List { +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) + + public next: List; +>next : Symbol(next, Decl(listFailure.ts, 26, 19)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) + + add(data: T): List { +>add : Symbol(add, Decl(listFailure.ts, 27, 29)) +>data : Symbol(data, Decl(listFailure.ts, 29, 12)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) + + this.next = ListMakeEntry(data); +>this.next : Symbol(next, Decl(listFailure.ts, 26, 19)) +>this : Symbol(List, Decl(listFailure.ts, 24, 5)) +>next : Symbol(next, Decl(listFailure.ts, 26, 19)) +>ListMakeEntry : Symbol(ListMakeEntry, Decl(listFailure.ts, 20, 5)) +>data : Symbol(data, Decl(listFailure.ts, 29, 12)) + + return this.next; +>this.next : Symbol(next, Decl(listFailure.ts, 26, 19)) +>this : Symbol(List, Decl(listFailure.ts, 24, 5)) +>next : Symbol(next, Decl(listFailure.ts, 26, 19)) + } + + popEntry(head: List): List { +>popEntry : Symbol(popEntry, Decl(listFailure.ts, 32, 9)) +>head : Symbol(head, Decl(listFailure.ts, 34, 17)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) +>List : Symbol(List, Decl(listFailure.ts, 24, 5)) +>T : Symbol(T, Decl(listFailure.ts, 26, 15)) + + return (ListRemoveEntry(this.next)); +>ListRemoveEntry : Symbol(ListRemoveEntry, Decl(listFailure.ts, 12, 5)) +>this.next : Symbol(next, Decl(listFailure.ts, 26, 19)) +>this : Symbol(List, Decl(listFailure.ts, 24, 5)) +>next : Symbol(next, Decl(listFailure.ts, 26, 19)) + } + } + + export class Line {} +>Line : Symbol(Line, Decl(listFailure.ts, 37, 5)) +} diff --git a/tests/baselines/reference/listFailure.types b/tests/baselines/reference/listFailure.types index de3c33bbfad..05c3cb5dfad 100644 --- a/tests/baselines/reference/listFailure.types +++ b/tests/baselines/reference/listFailure.types @@ -60,6 +60,7 @@ module Editor { >U : U return null; +>null : null } export function ListMakeEntry(data: U): List { @@ -71,6 +72,7 @@ module Editor { >U : U return null; +>null : null } class List { diff --git a/tests/baselines/reference/literals1.symbols b/tests/baselines/reference/literals1.symbols new file mode 100644 index 00000000000..067e49a2717 --- /dev/null +++ b/tests/baselines/reference/literals1.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/literals1.ts === +var a = 42; +>a : Symbol(a, Decl(literals1.ts, 0, 3)) + +var b = 0xFA34; +>b : Symbol(b, Decl(literals1.ts, 1, 3)) + +var c = 0.1715; +>c : Symbol(c, Decl(literals1.ts, 2, 3)) + +var d = 3.14E5; +>d : Symbol(d, Decl(literals1.ts, 3, 3)) + +var e = 8.14e-5; +>e : Symbol(e, Decl(literals1.ts, 4, 3)) + +var f = true; +>f : Symbol(f, Decl(literals1.ts, 6, 3)) + +var g = false; +>g : Symbol(g, Decl(literals1.ts, 7, 3)) + +var h = ""; +>h : Symbol(h, Decl(literals1.ts, 9, 3)) + +var i = "hi"; +>i : Symbol(i, Decl(literals1.ts, 10, 3)) + +var j = ''; +>j : Symbol(j, Decl(literals1.ts, 11, 3)) + +var k = 'q\tq'; +>k : Symbol(k, Decl(literals1.ts, 12, 3)) + +var m = /q/; +>m : Symbol(m, Decl(literals1.ts, 14, 3)) + +var n = /\d+/g; +>n : Symbol(n, Decl(literals1.ts, 15, 3)) + +var o = /[3-5]+/i; +>o : Symbol(o, Decl(literals1.ts, 16, 3)) + diff --git a/tests/baselines/reference/literals1.types b/tests/baselines/reference/literals1.types index f1d6736fdca..69e50c22f4a 100644 --- a/tests/baselines/reference/literals1.types +++ b/tests/baselines/reference/literals1.types @@ -1,43 +1,57 @@ === tests/cases/compiler/literals1.ts === var a = 42; >a : number +>42 : number var b = 0xFA34; >b : number +>0xFA34 : number var c = 0.1715; >c : number +>0.1715 : number var d = 3.14E5; >d : number +>3.14E5 : number var e = 8.14e-5; >e : number +>8.14e-5 : number var f = true; >f : boolean +>true : boolean var g = false; >g : boolean +>false : boolean var h = ""; >h : string +>"" : string var i = "hi"; >i : string +>"hi" : string var j = ''; >j : string +>'' : string var k = 'q\tq'; >k : string +>'q\tq' : string var m = /q/; >m : RegExp +>/q/ : RegExp var n = /\d+/g; >n : RegExp +>/\d+/g : RegExp var o = /[3-5]+/i; >o : RegExp +>/[3-5]+/i : RegExp diff --git a/tests/baselines/reference/localAliasExportAssignment.symbols b/tests/baselines/reference/localAliasExportAssignment.symbols new file mode 100644 index 00000000000..43c99941384 --- /dev/null +++ b/tests/baselines/reference/localAliasExportAssignment.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/localAliasExportAssignment_1.ts === +/// +import connect = require('localAliasExportAssignment_0'); +>connect : Symbol(connect, Decl(localAliasExportAssignment_1.ts, 0, 0)) + +connect(); +>connect : Symbol(connect, Decl(localAliasExportAssignment_1.ts, 0, 0)) + + + +=== tests/cases/compiler/localAliasExportAssignment_0.ts === +var server: { +>server : Symbol(server, Decl(localAliasExportAssignment_0.ts, 0, 3)) + + (): any; +}; + +export = server; +>server : Symbol(server, Decl(localAliasExportAssignment_0.ts, 0, 3)) + diff --git a/tests/baselines/reference/localImportNameVsGlobalName.symbols b/tests/baselines/reference/localImportNameVsGlobalName.symbols new file mode 100644 index 00000000000..d1f00d79078 --- /dev/null +++ b/tests/baselines/reference/localImportNameVsGlobalName.symbols @@ -0,0 +1,43 @@ +=== tests/cases/compiler/localImportNameVsGlobalName.ts === +module Keyboard { +>Keyboard : Symbol(Keyboard, Decl(localImportNameVsGlobalName.ts, 0, 0)) + + export enum Key { UP, DOWN, LEFT, RIGHT } +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 0, 17)) +>UP : Symbol(Key.UP, Decl(localImportNameVsGlobalName.ts, 1, 19)) +>DOWN : Symbol(Key.DOWN, Decl(localImportNameVsGlobalName.ts, 1, 23)) +>LEFT : Symbol(Key.LEFT, Decl(localImportNameVsGlobalName.ts, 1, 29)) +>RIGHT : Symbol(Key.RIGHT, Decl(localImportNameVsGlobalName.ts, 1, 35)) +} + +module App { +>App : Symbol(App, Decl(localImportNameVsGlobalName.ts, 2, 1)) + + import Key = Keyboard.Key; +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 4, 12)) +>Keyboard : Symbol(Keyboard, Decl(localImportNameVsGlobalName.ts, 0, 0)) +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 0, 17)) + + export function foo(key: Key): void {} +>foo : Symbol(foo, Decl(localImportNameVsGlobalName.ts, 5, 28)) +>key : Symbol(key, Decl(localImportNameVsGlobalName.ts, 7, 22)) +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 4, 12)) + + foo(Key.UP); +>foo : Symbol(foo, Decl(localImportNameVsGlobalName.ts, 5, 28)) +>Key.UP : Symbol(Key.UP, Decl(localImportNameVsGlobalName.ts, 1, 19)) +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 4, 12)) +>UP : Symbol(Key.UP, Decl(localImportNameVsGlobalName.ts, 1, 19)) + + foo(Key.DOWN); +>foo : Symbol(foo, Decl(localImportNameVsGlobalName.ts, 5, 28)) +>Key.DOWN : Symbol(Key.DOWN, Decl(localImportNameVsGlobalName.ts, 1, 23)) +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 4, 12)) +>DOWN : Symbol(Key.DOWN, Decl(localImportNameVsGlobalName.ts, 1, 23)) + + foo(Key.LEFT); +>foo : Symbol(foo, Decl(localImportNameVsGlobalName.ts, 5, 28)) +>Key.LEFT : Symbol(Key.LEFT, Decl(localImportNameVsGlobalName.ts, 1, 29)) +>Key : Symbol(Key, Decl(localImportNameVsGlobalName.ts, 4, 12)) +>LEFT : Symbol(Key.LEFT, Decl(localImportNameVsGlobalName.ts, 1, 29)) +} diff --git a/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.symbols b/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.symbols new file mode 100644 index 00000000000..b97ac7163d5 --- /dev/null +++ b/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/localVariablesReturnedFromCatchBlocks.ts === +function f() { +>f : Symbol(f, Decl(localVariablesReturnedFromCatchBlocks.ts, 0, 0)) + + try { + } catch (e) { +>e : Symbol(e, Decl(localVariablesReturnedFromCatchBlocks.ts, 2, 13)) + + var stack2 = e.stack; +>stack2 : Symbol(stack2, Decl(localVariablesReturnedFromCatchBlocks.ts, 3, 11)) +>e : Symbol(e, Decl(localVariablesReturnedFromCatchBlocks.ts, 2, 13)) + + return stack2; //error TS2095: Could not find symbol 'stack2'. +>stack2 : Symbol(stack2, Decl(localVariablesReturnedFromCatchBlocks.ts, 3, 11)) + } +} diff --git a/tests/baselines/reference/logicalAndOperatorWithEveryType.symbols b/tests/baselines/reference/logicalAndOperatorWithEveryType.symbols new file mode 100644 index 00000000000..440bfbf5651 --- /dev/null +++ b/tests/baselines/reference/logicalAndOperatorWithEveryType.symbols @@ -0,0 +1,515 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorWithEveryType.ts === +// The && operator permits the operands to be of any type and produces a result of the same +// type as the second operand. + +enum E { a, b, c } +>E : Symbol(E, Decl(logicalAndOperatorWithEveryType.ts, 0, 0)) +>a : Symbol(E.a, Decl(logicalAndOperatorWithEveryType.ts, 3, 8)) +>b : Symbol(E.b, Decl(logicalAndOperatorWithEveryType.ts, 3, 11)) +>c : Symbol(E.c, Decl(logicalAndOperatorWithEveryType.ts, 3, 14)) + +var a1: any; +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var a2: boolean; +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var a3: number +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var a4: string; +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var a5: void; +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var a6: E; +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>E : Symbol(E, Decl(logicalAndOperatorWithEveryType.ts, 0, 0)) + +var a7: {}; +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var a8: string[]; +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var ra1 = a1 && a1; +>ra1 : Symbol(ra1, Decl(logicalAndOperatorWithEveryType.ts, 14, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra2 = a2 && a1; +>ra2 : Symbol(ra2, Decl(logicalAndOperatorWithEveryType.ts, 15, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra3 = a3 && a1; +>ra3 : Symbol(ra3, Decl(logicalAndOperatorWithEveryType.ts, 16, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra4 = a4 && a1; +>ra4 : Symbol(ra4, Decl(logicalAndOperatorWithEveryType.ts, 17, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra5 = a5 && a1; +>ra5 : Symbol(ra5, Decl(logicalAndOperatorWithEveryType.ts, 18, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra6 = a6 && a1; +>ra6 : Symbol(ra6, Decl(logicalAndOperatorWithEveryType.ts, 19, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra7 = a7 && a1; +>ra7 : Symbol(ra7, Decl(logicalAndOperatorWithEveryType.ts, 20, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra8 = a8 && a1; +>ra8 : Symbol(ra8, Decl(logicalAndOperatorWithEveryType.ts, 21, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra9 = null && a1; +>ra9 : Symbol(ra9, Decl(logicalAndOperatorWithEveryType.ts, 22, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ra10 = undefined && a1; +>ra10 : Symbol(ra10, Decl(logicalAndOperatorWithEveryType.ts, 23, 3)) +>undefined : Symbol(undefined) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var rb1 = a1 && a2; +>rb1 : Symbol(rb1, Decl(logicalAndOperatorWithEveryType.ts, 25, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb2 = a2 && a2; +>rb2 : Symbol(rb2, Decl(logicalAndOperatorWithEveryType.ts, 26, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb3 = a3 && a2; +>rb3 : Symbol(rb3, Decl(logicalAndOperatorWithEveryType.ts, 27, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb4 = a4 && a2; +>rb4 : Symbol(rb4, Decl(logicalAndOperatorWithEveryType.ts, 28, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb5 = a5 && a2; +>rb5 : Symbol(rb5, Decl(logicalAndOperatorWithEveryType.ts, 29, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb6 = a6 && a2; +>rb6 : Symbol(rb6, Decl(logicalAndOperatorWithEveryType.ts, 30, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb7 = a7 && a2; +>rb7 : Symbol(rb7, Decl(logicalAndOperatorWithEveryType.ts, 31, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb8 = a8 && a2; +>rb8 : Symbol(rb8, Decl(logicalAndOperatorWithEveryType.ts, 32, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb9 = null && a2; +>rb9 : Symbol(rb9, Decl(logicalAndOperatorWithEveryType.ts, 33, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rb10 = undefined && a2; +>rb10 : Symbol(rb10, Decl(logicalAndOperatorWithEveryType.ts, 34, 3)) +>undefined : Symbol(undefined) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var rc1 = a1 && a3; +>rc1 : Symbol(rc1, Decl(logicalAndOperatorWithEveryType.ts, 36, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc2 = a2 && a3; +>rc2 : Symbol(rc2, Decl(logicalAndOperatorWithEveryType.ts, 37, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc3 = a3 && a3; +>rc3 : Symbol(rc3, Decl(logicalAndOperatorWithEveryType.ts, 38, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc4 = a4 && a3; +>rc4 : Symbol(rc4, Decl(logicalAndOperatorWithEveryType.ts, 39, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc5 = a5 && a3; +>rc5 : Symbol(rc5, Decl(logicalAndOperatorWithEveryType.ts, 40, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc6 = a6 && a3; +>rc6 : Symbol(rc6, Decl(logicalAndOperatorWithEveryType.ts, 41, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc7 = a7 && a3; +>rc7 : Symbol(rc7, Decl(logicalAndOperatorWithEveryType.ts, 42, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc8 = a8 && a3; +>rc8 : Symbol(rc8, Decl(logicalAndOperatorWithEveryType.ts, 43, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc9 = null && a3; +>rc9 : Symbol(rc9, Decl(logicalAndOperatorWithEveryType.ts, 44, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rc10 = undefined && a3; +>rc10 : Symbol(rc10, Decl(logicalAndOperatorWithEveryType.ts, 45, 3)) +>undefined : Symbol(undefined) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var rd1 = a1 && a4; +>rd1 : Symbol(rd1, Decl(logicalAndOperatorWithEveryType.ts, 47, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd2 = a2 && a4; +>rd2 : Symbol(rd2, Decl(logicalAndOperatorWithEveryType.ts, 48, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd3 = a3 && a4; +>rd3 : Symbol(rd3, Decl(logicalAndOperatorWithEveryType.ts, 49, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd4 = a4 && a4; +>rd4 : Symbol(rd4, Decl(logicalAndOperatorWithEveryType.ts, 50, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd5 = a5 && a4; +>rd5 : Symbol(rd5, Decl(logicalAndOperatorWithEveryType.ts, 51, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd6 = a6 && a4; +>rd6 : Symbol(rd6, Decl(logicalAndOperatorWithEveryType.ts, 52, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd7 = a7 && a4; +>rd7 : Symbol(rd7, Decl(logicalAndOperatorWithEveryType.ts, 53, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd8 = a8 && a4; +>rd8 : Symbol(rd8, Decl(logicalAndOperatorWithEveryType.ts, 54, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd9 = null && a4; +>rd9 : Symbol(rd9, Decl(logicalAndOperatorWithEveryType.ts, 55, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var rd10 = undefined && a4; +>rd10 : Symbol(rd10, Decl(logicalAndOperatorWithEveryType.ts, 56, 3)) +>undefined : Symbol(undefined) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var re1 = a1 && a5; +>re1 : Symbol(re1, Decl(logicalAndOperatorWithEveryType.ts, 58, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re2 = a2 && a5; +>re2 : Symbol(re2, Decl(logicalAndOperatorWithEveryType.ts, 59, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re3 = a3 && a5; +>re3 : Symbol(re3, Decl(logicalAndOperatorWithEveryType.ts, 60, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re4 = a4 && a5; +>re4 : Symbol(re4, Decl(logicalAndOperatorWithEveryType.ts, 61, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re5 = a5 && a5; +>re5 : Symbol(re5, Decl(logicalAndOperatorWithEveryType.ts, 62, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re6 = a6 && a5; +>re6 : Symbol(re6, Decl(logicalAndOperatorWithEveryType.ts, 63, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re7 = a7 && a5; +>re7 : Symbol(re7, Decl(logicalAndOperatorWithEveryType.ts, 64, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re8 = a8 && a5; +>re8 : Symbol(re8, Decl(logicalAndOperatorWithEveryType.ts, 65, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re9 = null && a5; +>re9 : Symbol(re9, Decl(logicalAndOperatorWithEveryType.ts, 66, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var re10 = undefined && a5; +>re10 : Symbol(re10, Decl(logicalAndOperatorWithEveryType.ts, 67, 3)) +>undefined : Symbol(undefined) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var rf1 = a1 && a6; +>rf1 : Symbol(rf1, Decl(logicalAndOperatorWithEveryType.ts, 69, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf2 = a2 && a6; +>rf2 : Symbol(rf2, Decl(logicalAndOperatorWithEveryType.ts, 70, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf3 = a3 && a6; +>rf3 : Symbol(rf3, Decl(logicalAndOperatorWithEveryType.ts, 71, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf4 = a4 && a6; +>rf4 : Symbol(rf4, Decl(logicalAndOperatorWithEveryType.ts, 72, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf5 = a5 && a6; +>rf5 : Symbol(rf5, Decl(logicalAndOperatorWithEveryType.ts, 73, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf6 = a6 && a6; +>rf6 : Symbol(rf6, Decl(logicalAndOperatorWithEveryType.ts, 74, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf7 = a7 && a6; +>rf7 : Symbol(rf7, Decl(logicalAndOperatorWithEveryType.ts, 75, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf8 = a8 && a6; +>rf8 : Symbol(rf8, Decl(logicalAndOperatorWithEveryType.ts, 76, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf9 = null && a6; +>rf9 : Symbol(rf9, Decl(logicalAndOperatorWithEveryType.ts, 77, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rf10 = undefined && a6; +>rf10 : Symbol(rf10, Decl(logicalAndOperatorWithEveryType.ts, 78, 3)) +>undefined : Symbol(undefined) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var rg1 = a1 && a7; +>rg1 : Symbol(rg1, Decl(logicalAndOperatorWithEveryType.ts, 80, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg2 = a2 && a7; +>rg2 : Symbol(rg2, Decl(logicalAndOperatorWithEveryType.ts, 81, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg3 = a3 && a7; +>rg3 : Symbol(rg3, Decl(logicalAndOperatorWithEveryType.ts, 82, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg4 = a4 && a7; +>rg4 : Symbol(rg4, Decl(logicalAndOperatorWithEveryType.ts, 83, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg5 = a5 && a7; +>rg5 : Symbol(rg5, Decl(logicalAndOperatorWithEveryType.ts, 84, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg6 = a6 && a7; +>rg6 : Symbol(rg6, Decl(logicalAndOperatorWithEveryType.ts, 85, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg7 = a7 && a7; +>rg7 : Symbol(rg7, Decl(logicalAndOperatorWithEveryType.ts, 86, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg8 = a8 && a7; +>rg8 : Symbol(rg8, Decl(logicalAndOperatorWithEveryType.ts, 87, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg9 = null && a7; +>rg9 : Symbol(rg9, Decl(logicalAndOperatorWithEveryType.ts, 88, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rg10 = undefined && a7; +>rg10 : Symbol(rg10, Decl(logicalAndOperatorWithEveryType.ts, 89, 3)) +>undefined : Symbol(undefined) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var rh1 = a1 && a8; +>rh1 : Symbol(rh1, Decl(logicalAndOperatorWithEveryType.ts, 91, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh2 = a2 && a8; +>rh2 : Symbol(rh2, Decl(logicalAndOperatorWithEveryType.ts, 92, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh3 = a3 && a8; +>rh3 : Symbol(rh3, Decl(logicalAndOperatorWithEveryType.ts, 93, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh4 = a4 && a8; +>rh4 : Symbol(rh4, Decl(logicalAndOperatorWithEveryType.ts, 94, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh5 = a5 && a8; +>rh5 : Symbol(rh5, Decl(logicalAndOperatorWithEveryType.ts, 95, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh6 = a6 && a8; +>rh6 : Symbol(rh6, Decl(logicalAndOperatorWithEveryType.ts, 96, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh7 = a7 && a8; +>rh7 : Symbol(rh7, Decl(logicalAndOperatorWithEveryType.ts, 97, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh8 = a8 && a8; +>rh8 : Symbol(rh8, Decl(logicalAndOperatorWithEveryType.ts, 98, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh9 = null && a8; +>rh9 : Symbol(rh9, Decl(logicalAndOperatorWithEveryType.ts, 99, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var rh10 = undefined && a8; +>rh10 : Symbol(rh10, Decl(logicalAndOperatorWithEveryType.ts, 100, 3)) +>undefined : Symbol(undefined) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var ri1 = a1 && null; +>ri1 : Symbol(ri1, Decl(logicalAndOperatorWithEveryType.ts, 102, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) + +var ri2 = a2 && null; +>ri2 : Symbol(ri2, Decl(logicalAndOperatorWithEveryType.ts, 103, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) + +var ri3 = a3 && null; +>ri3 : Symbol(ri3, Decl(logicalAndOperatorWithEveryType.ts, 104, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) + +var ri4 = a4 && null; +>ri4 : Symbol(ri4, Decl(logicalAndOperatorWithEveryType.ts, 105, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) + +var ri5 = a5 && null; +>ri5 : Symbol(ri5, Decl(logicalAndOperatorWithEveryType.ts, 106, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) + +var ri6 = a6 && null; +>ri6 : Symbol(ri6, Decl(logicalAndOperatorWithEveryType.ts, 107, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) + +var ri7 = a7 && null; +>ri7 : Symbol(ri7, Decl(logicalAndOperatorWithEveryType.ts, 108, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) + +var ri8 = a8 && null; +>ri8 : Symbol(ri8, Decl(logicalAndOperatorWithEveryType.ts, 109, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) + +var ri9 = null && null; +>ri9 : Symbol(ri9, Decl(logicalAndOperatorWithEveryType.ts, 110, 3)) + +var ri10 = undefined && null; +>ri10 : Symbol(ri10, Decl(logicalAndOperatorWithEveryType.ts, 111, 3)) +>undefined : Symbol(undefined) + +var rj1 = a1 && undefined; +>rj1 : Symbol(rj1, Decl(logicalAndOperatorWithEveryType.ts, 113, 3)) +>a1 : Symbol(a1, Decl(logicalAndOperatorWithEveryType.ts, 5, 3)) +>undefined : Symbol(undefined) + +var rj2 = a2 && undefined; +>rj2 : Symbol(rj2, Decl(logicalAndOperatorWithEveryType.ts, 114, 3)) +>a2 : Symbol(a2, Decl(logicalAndOperatorWithEveryType.ts, 6, 3)) +>undefined : Symbol(undefined) + +var rj3 = a3 && undefined; +>rj3 : Symbol(rj3, Decl(logicalAndOperatorWithEveryType.ts, 115, 3)) +>a3 : Symbol(a3, Decl(logicalAndOperatorWithEveryType.ts, 7, 3)) +>undefined : Symbol(undefined) + +var rj4 = a4 && undefined; +>rj4 : Symbol(rj4, Decl(logicalAndOperatorWithEveryType.ts, 116, 3)) +>a4 : Symbol(a4, Decl(logicalAndOperatorWithEveryType.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rj5 = a5 && undefined; +>rj5 : Symbol(rj5, Decl(logicalAndOperatorWithEveryType.ts, 117, 3)) +>a5 : Symbol(a5, Decl(logicalAndOperatorWithEveryType.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rj6 = a6 && undefined; +>rj6 : Symbol(rj6, Decl(logicalAndOperatorWithEveryType.ts, 118, 3)) +>a6 : Symbol(a6, Decl(logicalAndOperatorWithEveryType.ts, 10, 3)) +>undefined : Symbol(undefined) + +var rj7 = a7 && undefined; +>rj7 : Symbol(rj7, Decl(logicalAndOperatorWithEveryType.ts, 119, 3)) +>a7 : Symbol(a7, Decl(logicalAndOperatorWithEveryType.ts, 11, 3)) +>undefined : Symbol(undefined) + +var rj8 = a8 && undefined; +>rj8 : Symbol(rj8, Decl(logicalAndOperatorWithEveryType.ts, 120, 3)) +>a8 : Symbol(a8, Decl(logicalAndOperatorWithEveryType.ts, 12, 3)) +>undefined : Symbol(undefined) + +var rj9 = null && undefined; +>rj9 : Symbol(rj9, Decl(logicalAndOperatorWithEveryType.ts, 121, 3)) +>undefined : Symbol(undefined) + +var rj10 = undefined && undefined; +>rj10 : Symbol(rj10, Decl(logicalAndOperatorWithEveryType.ts, 122, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/logicalAndOperatorWithEveryType.types b/tests/baselines/reference/logicalAndOperatorWithEveryType.types index 54f04926e98..bd913e94da5 100644 --- a/tests/baselines/reference/logicalAndOperatorWithEveryType.types +++ b/tests/baselines/reference/logicalAndOperatorWithEveryType.types @@ -84,6 +84,7 @@ var ra8 = a8 && a1; var ra9 = null && a1; >ra9 : any >null && a1 : any +>null : null >a1 : any var ra10 = undefined && a1; @@ -143,6 +144,7 @@ var rb8 = a8 && a2; var rb9 = null && a2; >rb9 : boolean >null && a2 : boolean +>null : null >a2 : boolean var rb10 = undefined && a2; @@ -202,6 +204,7 @@ var rc8 = a8 && a3; var rc9 = null && a3; >rc9 : number >null && a3 : number +>null : null >a3 : number var rc10 = undefined && a3; @@ -261,6 +264,7 @@ var rd8 = a8 && a4; var rd9 = null && a4; >rd9 : string >null && a4 : string +>null : null >a4 : string var rd10 = undefined && a4; @@ -320,6 +324,7 @@ var re8 = a8 && a5; var re9 = null && a5; >re9 : void >null && a5 : void +>null : null >a5 : void var re10 = undefined && a5; @@ -379,6 +384,7 @@ var rf8 = a8 && a6; var rf9 = null && a6; >rf9 : E >null && a6 : E +>null : null >a6 : E var rf10 = undefined && a6; @@ -438,6 +444,7 @@ var rg8 = a8 && a7; var rg9 = null && a7; >rg9 : {} >null && a7 : {} +>null : null >a7 : {} var rg10 = undefined && a7; @@ -497,6 +504,7 @@ var rh8 = a8 && a8; var rh9 = null && a8; >rh9 : string[] >null && a8 : string[] +>null : null >a8 : string[] var rh10 = undefined && a8; @@ -509,50 +517,61 @@ var ri1 = a1 && null; >ri1 : any >a1 && null : null >a1 : any +>null : null var ri2 = a2 && null; >ri2 : any >a2 && null : null >a2 : boolean +>null : null var ri3 = a3 && null; >ri3 : any >a3 && null : null >a3 : number +>null : null var ri4 = a4 && null; >ri4 : any >a4 && null : null >a4 : string +>null : null var ri5 = a5 && null; >ri5 : any >a5 && null : null >a5 : void +>null : null var ri6 = a6 && null; >ri6 : any >a6 && null : null >a6 : E +>null : null var ri7 = a7 && null; >ri7 : any >a7 && null : null >a7 : {} +>null : null var ri8 = a8 && null; >ri8 : any >a8 && null : null >a8 : string[] +>null : null var ri9 = null && null; >ri9 : any >null && null : null +>null : null +>null : null var ri10 = undefined && null; >ri10 : any >undefined && null : null >undefined : undefined +>null : null var rj1 = a1 && undefined; >rj1 : any @@ -605,6 +624,7 @@ var rj8 = a8 && undefined; var rj9 = null && undefined; >rj9 : any >null && undefined : undefined +>null : null >undefined : undefined var rj10 = undefined && undefined; diff --git a/tests/baselines/reference/logicalAndOperatorWithTypeParameters.symbols b/tests/baselines/reference/logicalAndOperatorWithTypeParameters.symbols new file mode 100644 index 00000000000..c64544ffe15 --- /dev/null +++ b/tests/baselines/reference/logicalAndOperatorWithTypeParameters.symbols @@ -0,0 +1,69 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorWithTypeParameters.ts === +// The && operator permits the operands to be of any type and produces a result of the same +// type as the second operand. + +function foo(t: T, u: U, v: V) { +>foo : Symbol(foo, Decl(logicalAndOperatorWithTypeParameters.ts, 0, 0)) +>T : Symbol(T, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 13)) +>U : Symbol(U, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 15)) +>V : Symbol(V, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 18)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) +>T : Symbol(T, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 13)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) +>U : Symbol(U, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 15)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) +>V : Symbol(V, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 18)) + + var r1 = t && t; +>r1 : Symbol(r1, Decl(logicalAndOperatorWithTypeParameters.ts, 4, 7)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) + + var r2 = u && t; +>r2 : Symbol(r2, Decl(logicalAndOperatorWithTypeParameters.ts, 5, 7)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) + + var r3 = v && t; +>r3 : Symbol(r3, Decl(logicalAndOperatorWithTypeParameters.ts, 6, 7)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) + + var r4 = t && u; +>r4 : Symbol(r4, Decl(logicalAndOperatorWithTypeParameters.ts, 8, 7)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) + + var r5 = u && u; +>r5 : Symbol(r5, Decl(logicalAndOperatorWithTypeParameters.ts, 9, 7)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) + + var r6 = v && u; +>r6 : Symbol(r6, Decl(logicalAndOperatorWithTypeParameters.ts, 10, 7)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) + + var r7 = t && v; +>r7 : Symbol(r7, Decl(logicalAndOperatorWithTypeParameters.ts, 12, 7)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) + + var r8 = u && v; +>r8 : Symbol(r8, Decl(logicalAndOperatorWithTypeParameters.ts, 13, 7)) +>u : Symbol(u, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 41)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) + + var r9 = v && v; +>r9 : Symbol(r9, Decl(logicalAndOperatorWithTypeParameters.ts, 14, 7)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) +>v : Symbol(v, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 47)) + + var a: number; +>a : Symbol(a, Decl(logicalAndOperatorWithTypeParameters.ts, 16, 7)) + + var r10 = t && a; +>r10 : Symbol(r10, Decl(logicalAndOperatorWithTypeParameters.ts, 17, 7)) +>t : Symbol(t, Decl(logicalAndOperatorWithTypeParameters.ts, 3, 36)) +>a : Symbol(a, Decl(logicalAndOperatorWithTypeParameters.ts, 16, 7)) +} diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.symbols b/tests/baselines/reference/logicalNotOperatorWithBooleanType.symbols new file mode 100644 index 00000000000..b42b9d7922e --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.symbols @@ -0,0 +1,89 @@ +=== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts === +// ! operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(logicalNotOperatorWithBooleanType.ts, 1, 3)) + +function foo(): boolean { return true; } +>foo : Symbol(foo, Decl(logicalNotOperatorWithBooleanType.ts, 1, 21)) + +class A { +>A : Symbol(A, Decl(logicalNotOperatorWithBooleanType.ts, 3, 40)) + + public a: boolean; +>a : Symbol(a, Decl(logicalNotOperatorWithBooleanType.ts, 5, 9)) + + static foo() { return false; } +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithBooleanType.ts, 6, 22)) +} +module M { +>M : Symbol(M, Decl(logicalNotOperatorWithBooleanType.ts, 8, 1)) + + export var n: boolean; +>n : Symbol(n, Decl(logicalNotOperatorWithBooleanType.ts, 10, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(logicalNotOperatorWithBooleanType.ts, 13, 3)) +>A : Symbol(A, Decl(logicalNotOperatorWithBooleanType.ts, 3, 40)) + +// boolean type var +var ResultIsBoolean1 = !BOOLEAN; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(logicalNotOperatorWithBooleanType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(logicalNotOperatorWithBooleanType.ts, 1, 3)) + +// boolean type literal +var ResultIsBoolean2 = !true; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(logicalNotOperatorWithBooleanType.ts, 19, 3)) + +var ResultIsBoolean3 = !{ x: true, y: false }; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(logicalNotOperatorWithBooleanType.ts, 20, 3)) +>x : Symbol(x, Decl(logicalNotOperatorWithBooleanType.ts, 20, 25)) +>y : Symbol(y, Decl(logicalNotOperatorWithBooleanType.ts, 20, 34)) + +// boolean type expressions +var ResultIsBoolean4 = !objA.a; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(logicalNotOperatorWithBooleanType.ts, 23, 3)) +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithBooleanType.ts, 5, 9)) + +var ResultIsBoolean5 = !M.n; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(logicalNotOperatorWithBooleanType.ts, 24, 3)) +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithBooleanType.ts, 10, 14)) + +var ResultIsBoolean6 = !foo(); +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(logicalNotOperatorWithBooleanType.ts, 25, 3)) +>foo : Symbol(foo, Decl(logicalNotOperatorWithBooleanType.ts, 1, 21)) + +var ResultIsBoolean7 = !A.foo(); +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(logicalNotOperatorWithBooleanType.ts, 26, 3)) +>A.foo : Symbol(A.foo, Decl(logicalNotOperatorWithBooleanType.ts, 6, 22)) +>A : Symbol(A, Decl(logicalNotOperatorWithBooleanType.ts, 3, 40)) +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithBooleanType.ts, 6, 22)) + +// multiple ! operators +var ResultIsBoolean = !!BOOLEAN; +>ResultIsBoolean : Symbol(ResultIsBoolean, Decl(logicalNotOperatorWithBooleanType.ts, 29, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(logicalNotOperatorWithBooleanType.ts, 1, 3)) + +// miss assignment operators +!true; +!BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(logicalNotOperatorWithBooleanType.ts, 1, 3)) + +!foo(); +>foo : Symbol(foo, Decl(logicalNotOperatorWithBooleanType.ts, 1, 21)) + +!true, false; +!objA.a; +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithBooleanType.ts, 5, 9)) + +!M.n; +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithBooleanType.ts, 10, 14)) + diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types index e232ae2af80..b8aa6feac4c 100644 --- a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types @@ -5,6 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean +>true : boolean class A { >A : A @@ -14,6 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean +>false : boolean } module M { >M : typeof M @@ -37,13 +39,16 @@ var ResultIsBoolean1 = !BOOLEAN; var ResultIsBoolean2 = !true; >ResultIsBoolean2 : boolean >!true : boolean +>true : boolean var ResultIsBoolean3 = !{ x: true, y: false }; >ResultIsBoolean3 : boolean >!{ x: true, y: false } : boolean >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean +>true : boolean >y : boolean +>false : boolean // boolean type expressions var ResultIsBoolean4 = !objA.a; @@ -84,6 +89,7 @@ var ResultIsBoolean = !!BOOLEAN; // miss assignment operators !true; >!true : boolean +>true : boolean !BOOLEAN; >!BOOLEAN : boolean @@ -97,6 +103,8 @@ var ResultIsBoolean = !!BOOLEAN; !true, false; >!true, false : boolean >!true : boolean +>true : boolean +>false : boolean !objA.a; >!objA.a : boolean diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.symbols b/tests/baselines/reference/logicalNotOperatorWithEnumType.symbols new file mode 100644 index 00000000000..5f4dee7a3ea --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.symbols @@ -0,0 +1,60 @@ +=== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts === +// ! operator on enum type + +enum ENUM { A, B, C }; +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>A : Symbol(ENUM.A, Decl(logicalNotOperatorWithEnumType.ts, 2, 11)) +>B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) +>C : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17)) + +enum ENUM1 { }; +>ENUM1 : Symbol(ENUM1, Decl(logicalNotOperatorWithEnumType.ts, 2, 22)) + +// enum type var +var ResultIsBoolean1 = !ENUM; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(logicalNotOperatorWithEnumType.ts, 6, 3)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) + +// enum type expressions +var ResultIsBoolean2 = !ENUM["B"]; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(logicalNotOperatorWithEnumType.ts, 9, 3)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>"B" : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) + +var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(logicalNotOperatorWithEnumType.ts, 10, 3)) +>ENUM.B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>"C" : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17)) + +// multiple ! operators +var ResultIsBoolean4 = !!ENUM; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(logicalNotOperatorWithEnumType.ts, 13, 3)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) + +var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(logicalNotOperatorWithEnumType.ts, 14, 3)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>"B" : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) +>ENUM.C : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>C : Symbol(ENUM.C, Decl(logicalNotOperatorWithEnumType.ts, 2, 17)) + +// miss assignment operators +!ENUM; +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) + +!ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(logicalNotOperatorWithEnumType.ts, 2, 22)) + +!ENUM.B; +>ENUM.B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>B : Symbol(ENUM.B, Decl(logicalNotOperatorWithEnumType.ts, 2, 14)) + +!ENUM, ENUM1; +>ENUM : Symbol(ENUM, Decl(logicalNotOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(logicalNotOperatorWithEnumType.ts, 2, 22)) + diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.types b/tests/baselines/reference/logicalNotOperatorWithEnumType.types index f3c9d98c95b..5d57916ceaa 100644 --- a/tests/baselines/reference/logicalNotOperatorWithEnumType.types +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.types @@ -22,6 +22,7 @@ var ResultIsBoolean2 = !ENUM["B"]; >!ENUM["B"] : boolean >ENUM["B"] : ENUM >ENUM : typeof ENUM +>"B" : string var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); >ResultIsBoolean3 : boolean @@ -33,6 +34,7 @@ var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); >B : ENUM >ENUM["C"] : ENUM >ENUM : typeof ENUM +>"C" : string // multiple ! operators var ResultIsBoolean4 = !!ENUM; @@ -50,6 +52,7 @@ var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); >ENUM["B"] + ENUM.C : number >ENUM["B"] : ENUM >ENUM : typeof ENUM +>"B" : string >ENUM.C : ENUM >ENUM : typeof ENUM >C : ENUM diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.symbols b/tests/baselines/reference/logicalNotOperatorWithNumberType.symbols new file mode 100644 index 00000000000..4f277a8db54 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.symbols @@ -0,0 +1,127 @@ +=== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts === +// ! operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3)) + +function foo(): number { return 1; } +>foo : Symbol(foo, Decl(logicalNotOperatorWithNumberType.ts, 2, 31)) + +class A { +>A : Symbol(A, Decl(logicalNotOperatorWithNumberType.ts, 4, 36)) + + public a: number; +>a : Symbol(a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) + + static foo() { return 1; } +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithNumberType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1)) + + export var n: number; +>n : Symbol(n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3)) +>A : Symbol(A, Decl(logicalNotOperatorWithNumberType.ts, 4, 36)) + +// number type var +var ResultIsBoolean1 = !NUMBER; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(logicalNotOperatorWithNumberType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +var ResultIsBoolean2 = !NUMBER1; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(logicalNotOperatorWithNumberType.ts, 18, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3)) + +// number type literal +var ResultIsBoolean3 = !1; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(logicalNotOperatorWithNumberType.ts, 21, 3)) + +var ResultIsBoolean4 = !{ x: 1, y: 2}; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(logicalNotOperatorWithNumberType.ts, 22, 3)) +>x : Symbol(x, Decl(logicalNotOperatorWithNumberType.ts, 22, 25)) +>y : Symbol(y, Decl(logicalNotOperatorWithNumberType.ts, 22, 31)) + +var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } }; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(logicalNotOperatorWithNumberType.ts, 23, 3)) +>x : Symbol(x, Decl(logicalNotOperatorWithNumberType.ts, 23, 25)) +>y : Symbol(y, Decl(logicalNotOperatorWithNumberType.ts, 23, 31)) +>n : Symbol(n, Decl(logicalNotOperatorWithNumberType.ts, 23, 36)) +>n : Symbol(n, Decl(logicalNotOperatorWithNumberType.ts, 23, 36)) + +// number type expressions +var ResultIsBoolean6 = !objA.a; +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(logicalNotOperatorWithNumberType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) + +var ResultIsBoolean7 = !M.n; +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(logicalNotOperatorWithNumberType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) + +var ResultIsBoolean8 = !NUMBER1[0]; +>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(logicalNotOperatorWithNumberType.ts, 28, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3)) + +var ResultIsBoolean9 = !foo(); +>ResultIsBoolean9 : Symbol(ResultIsBoolean9, Decl(logicalNotOperatorWithNumberType.ts, 29, 3)) +>foo : Symbol(foo, Decl(logicalNotOperatorWithNumberType.ts, 2, 31)) + +var ResultIsBoolean10 = !A.foo(); +>ResultIsBoolean10 : Symbol(ResultIsBoolean10, Decl(logicalNotOperatorWithNumberType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(logicalNotOperatorWithNumberType.ts, 7, 21)) +>A : Symbol(A, Decl(logicalNotOperatorWithNumberType.ts, 4, 36)) +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithNumberType.ts, 7, 21)) + +var ResultIsBoolean11 = !(NUMBER + NUMBER); +>ResultIsBoolean11 : Symbol(ResultIsBoolean11, Decl(logicalNotOperatorWithNumberType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +// multiple ! operator +var ResultIsBoolean12 = !!NUMBER; +>ResultIsBoolean12 : Symbol(ResultIsBoolean12, Decl(logicalNotOperatorWithNumberType.ts, 34, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +var ResultIsBoolean13 = !!!(NUMBER + NUMBER); +>ResultIsBoolean13 : Symbol(ResultIsBoolean13, Decl(logicalNotOperatorWithNumberType.ts, 35, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +// miss assignment operators +!1; +!NUMBER; +>NUMBER : Symbol(NUMBER, Decl(logicalNotOperatorWithNumberType.ts, 1, 3)) + +!NUMBER1; +>NUMBER1 : Symbol(NUMBER1, Decl(logicalNotOperatorWithNumberType.ts, 2, 3)) + +!foo(); +>foo : Symbol(foo, Decl(logicalNotOperatorWithNumberType.ts, 2, 31)) + +!objA.a; +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) + +!M.n; +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) + +!objA.a, M.n; +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithNumberType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithNumberType.ts, 11, 14)) + diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.types b/tests/baselines/reference/logicalNotOperatorWithNumberType.types index 4bcc8a14041..6b7ce5b6088 100644 --- a/tests/baselines/reference/logicalNotOperatorWithNumberType.types +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.types @@ -6,9 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number function foo(): number { return 1; } >foo : () => number +>1 : number class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return 1; } >foo : () => number +>1 : number } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsBoolean2 = !NUMBER1; var ResultIsBoolean3 = !1; >ResultIsBoolean3 : boolean >!1 : boolean +>1 : number var ResultIsBoolean4 = !{ x: 1, y: 2}; >ResultIsBoolean4 : boolean >!{ x: 1, y: 2} : boolean >{ x: 1, y: 2} : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } }; >ResultIsBoolean5 : boolean >!{ x: 1, y: (n: number) => { return n; } } : boolean >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number +>1 : number >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -84,6 +92,7 @@ var ResultIsBoolean8 = !NUMBER1[0]; >!NUMBER1[0] : boolean >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number var ResultIsBoolean9 = !foo(); >ResultIsBoolean9 : boolean @@ -127,6 +136,7 @@ var ResultIsBoolean13 = !!!(NUMBER + NUMBER); // miss assignment operators !1; >!1 : boolean +>1 : number !NUMBER; >!NUMBER : boolean diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.symbols b/tests/baselines/reference/logicalNotOperatorWithStringType.symbols new file mode 100644 index 00000000000..ff266361321 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.symbols @@ -0,0 +1,123 @@ +=== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts === +// ! operator on string type +var STRING: string; +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +var STRING1: string[] = ["", "abc"]; +>STRING1 : Symbol(STRING1, Decl(logicalNotOperatorWithStringType.ts, 2, 3)) + +function foo(): string { return "abc"; } +>foo : Symbol(foo, Decl(logicalNotOperatorWithStringType.ts, 2, 36)) + +class A { +>A : Symbol(A, Decl(logicalNotOperatorWithStringType.ts, 4, 40)) + + public a: string; +>a : Symbol(a, Decl(logicalNotOperatorWithStringType.ts, 6, 9)) + + static foo() { return ""; } +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithStringType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(logicalNotOperatorWithStringType.ts, 9, 1)) + + export var n: string; +>n : Symbol(n, Decl(logicalNotOperatorWithStringType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(logicalNotOperatorWithStringType.ts, 14, 3)) +>A : Symbol(A, Decl(logicalNotOperatorWithStringType.ts, 4, 40)) + +// string type var +var ResultIsBoolean1 = !STRING; +>ResultIsBoolean1 : Symbol(ResultIsBoolean1, Decl(logicalNotOperatorWithStringType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean2 = !STRING1; +>ResultIsBoolean2 : Symbol(ResultIsBoolean2, Decl(logicalNotOperatorWithStringType.ts, 18, 3)) +>STRING1 : Symbol(STRING1, Decl(logicalNotOperatorWithStringType.ts, 2, 3)) + +// string type literal +var ResultIsBoolean3 = !""; +>ResultIsBoolean3 : Symbol(ResultIsBoolean3, Decl(logicalNotOperatorWithStringType.ts, 21, 3)) + +var ResultIsBoolean4 = !{ x: "", y: "" }; +>ResultIsBoolean4 : Symbol(ResultIsBoolean4, Decl(logicalNotOperatorWithStringType.ts, 22, 3)) +>x : Symbol(x, Decl(logicalNotOperatorWithStringType.ts, 22, 25)) +>y : Symbol(y, Decl(logicalNotOperatorWithStringType.ts, 22, 32)) + +var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } }; +>ResultIsBoolean5 : Symbol(ResultIsBoolean5, Decl(logicalNotOperatorWithStringType.ts, 23, 3)) +>x : Symbol(x, Decl(logicalNotOperatorWithStringType.ts, 23, 25)) +>y : Symbol(y, Decl(logicalNotOperatorWithStringType.ts, 23, 32)) +>s : Symbol(s, Decl(logicalNotOperatorWithStringType.ts, 23, 37)) +>s : Symbol(s, Decl(logicalNotOperatorWithStringType.ts, 23, 37)) + +// string type expressions +var ResultIsBoolean6 = !objA.a; +>ResultIsBoolean6 : Symbol(ResultIsBoolean6, Decl(logicalNotOperatorWithStringType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithStringType.ts, 6, 9)) + +var ResultIsBoolean7 = !M.n; +>ResultIsBoolean7 : Symbol(ResultIsBoolean7, Decl(logicalNotOperatorWithStringType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithStringType.ts, 11, 14)) + +var ResultIsBoolean8 = !STRING1[0]; +>ResultIsBoolean8 : Symbol(ResultIsBoolean8, Decl(logicalNotOperatorWithStringType.ts, 28, 3)) +>STRING1 : Symbol(STRING1, Decl(logicalNotOperatorWithStringType.ts, 2, 3)) + +var ResultIsBoolean9 = !foo(); +>ResultIsBoolean9 : Symbol(ResultIsBoolean9, Decl(logicalNotOperatorWithStringType.ts, 29, 3)) +>foo : Symbol(foo, Decl(logicalNotOperatorWithStringType.ts, 2, 36)) + +var ResultIsBoolean10 = !A.foo(); +>ResultIsBoolean10 : Symbol(ResultIsBoolean10, Decl(logicalNotOperatorWithStringType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(logicalNotOperatorWithStringType.ts, 7, 21)) +>A : Symbol(A, Decl(logicalNotOperatorWithStringType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(logicalNotOperatorWithStringType.ts, 7, 21)) + +var ResultIsBoolean11 = !(STRING + STRING); +>ResultIsBoolean11 : Symbol(ResultIsBoolean11, Decl(logicalNotOperatorWithStringType.ts, 31, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean12 = !STRING.charAt(0); +>ResultIsBoolean12 : Symbol(ResultIsBoolean12, Decl(logicalNotOperatorWithStringType.ts, 32, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +// multiple ! operator +var ResultIsBoolean13 = !!STRING; +>ResultIsBoolean13 : Symbol(ResultIsBoolean13, Decl(logicalNotOperatorWithStringType.ts, 35, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +var ResultIsBoolean14 = !!!(STRING + STRING); +>ResultIsBoolean14 : Symbol(ResultIsBoolean14, Decl(logicalNotOperatorWithStringType.ts, 36, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +// miss assignment operators +!""; +!STRING; +>STRING : Symbol(STRING, Decl(logicalNotOperatorWithStringType.ts, 1, 3)) + +!STRING1; +>STRING1 : Symbol(STRING1, Decl(logicalNotOperatorWithStringType.ts, 2, 3)) + +!foo(); +>foo : Symbol(foo, Decl(logicalNotOperatorWithStringType.ts, 2, 36)) + +!objA.a,M.n; +>objA.a : Symbol(A.a, Decl(logicalNotOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(logicalNotOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(logicalNotOperatorWithStringType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(logicalNotOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(logicalNotOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(logicalNotOperatorWithStringType.ts, 11, 14)) + diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.types b/tests/baselines/reference/logicalNotOperatorWithStringType.types index 2decb1ade18..5ca820ea6d0 100644 --- a/tests/baselines/reference/logicalNotOperatorWithStringType.types +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.types @@ -6,9 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] +>"" : string +>"abc" : string function foo(): string { return "abc"; } >foo : () => string +>"abc" : string class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return ""; } >foo : () => string +>"" : string } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsBoolean2 = !STRING1; var ResultIsBoolean3 = !""; >ResultIsBoolean3 : boolean >!"" : boolean +>"" : string var ResultIsBoolean4 = !{ x: "", y: "" }; >ResultIsBoolean4 : boolean >!{ x: "", y: "" } : boolean >{ x: "", y: "" } : { x: string; y: string; } >x : string +>"" : string >y : string +>"" : string var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } }; >ResultIsBoolean5 : boolean >!{ x: "", y: (s: string) => { return s; } } : boolean >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string +>"" : string >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -84,6 +92,7 @@ var ResultIsBoolean8 = !STRING1[0]; >!STRING1[0] : boolean >STRING1[0] : string >STRING1 : string[] +>0 : number var ResultIsBoolean9 = !foo(); >ResultIsBoolean9 : boolean @@ -114,6 +123,7 @@ var ResultIsBoolean12 = !STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number // multiple ! operator var ResultIsBoolean13 = !!STRING; @@ -135,6 +145,7 @@ var ResultIsBoolean14 = !!!(STRING + STRING); // miss assignment operators !""; >!"" : boolean +>"" : string !STRING; >!STRING : boolean diff --git a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.symbols b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.symbols new file mode 100644 index 00000000000..90fc4ac163c --- /dev/null +++ b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrExpressionIsContextuallyTyped.ts === +// The || operator permits the operands to be of any type. +// If the || expression is contextually typed, the operands are contextually typed by the +// same type and the result is of the best common type of the contextual type and the two +// operand types. + +var r: { a: string } = { a: '', b: 123 } || { a: '', b: true }; +>r : Symbol(r, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 3)) +>a : Symbol(a, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 8)) +>a : Symbol(a, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 24)) +>b : Symbol(b, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 31)) +>a : Symbol(a, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 45)) +>b : Symbol(b, Decl(logicalOrExpressionIsContextuallyTyped.ts, 5, 52)) + diff --git a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types index 95c9643c29a..52315226bb6 100644 --- a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types +++ b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types @@ -10,8 +10,12 @@ var r: { a: string } = { a: '', b: 123 } || { a: '', b: true }; >{ a: '', b: 123 } || { a: '', b: true } : { a: string; b: number; } | { a: string; b: boolean; } >{ a: '', b: 123 } : { a: string; b: number; } >a : string +>'' : string >b : number +>123 : number >{ a: '', b: true } : { a: string; b: boolean; } >a : string +>'' : string >b : boolean +>true : boolean diff --git a/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.symbols b/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.symbols new file mode 100644 index 00000000000..6cfbf7ea6b6 --- /dev/null +++ b/tests/baselines/reference/logicalOrExpressionIsNotContextuallyTyped.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrExpressionIsNotContextuallyTyped.ts === +// The || operator permits the operands to be of any type. +// If the || expression is not contextually typed, the right operand is contextually typed +// by the type of the left operand and the result is of the best common type of the two +// operand types. + + +var a: (a: string) => string; +>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 6, 3)) +>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 6, 8)) + +// bug 786110 +var r = a || ((a) => a.toLowerCase()); +>r : Symbol(r, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 9, 3)) +>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 6, 3)) +>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 9, 15)) +>a.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) +>a : Symbol(a, Decl(logicalOrExpressionIsNotContextuallyTyped.ts, 9, 15)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, 399, 51)) + diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.symbols b/tests/baselines/reference/logicalOrOperatorWithEveryType.symbols new file mode 100644 index 00000000000..df2084351df --- /dev/null +++ b/tests/baselines/reference/logicalOrOperatorWithEveryType.symbols @@ -0,0 +1,518 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrOperatorWithEveryType.ts === +// The || operator permits the operands to be of any type. +// If the || expression is not contextually typed, the right operand is contextually typed +// by the type of the left operand and the result is of the best common type of the two +// operand types. + +enum E { a, b, c } +>E : Symbol(E, Decl(logicalOrOperatorWithEveryType.ts, 0, 0)) +>a : Symbol(E.a, Decl(logicalOrOperatorWithEveryType.ts, 5, 8)) +>b : Symbol(E.b, Decl(logicalOrOperatorWithEveryType.ts, 5, 11)) +>c : Symbol(E.c, Decl(logicalOrOperatorWithEveryType.ts, 5, 14)) + +var a1: any; +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var a2: boolean; +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var a3: number +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var a4: string; +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var a5: void; +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var a6: E; +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>E : Symbol(E, Decl(logicalOrOperatorWithEveryType.ts, 0, 0)) + +var a7: {a: string}; +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a : Symbol(a, Decl(logicalOrOperatorWithEveryType.ts, 13, 9)) + +var a8: string[]; +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ra1 = a1 || a1; // any || any is any +>ra1 : Symbol(ra1, Decl(logicalOrOperatorWithEveryType.ts, 16, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra2 = a2 || a1; // boolean || any is any +>ra2 : Symbol(ra2, Decl(logicalOrOperatorWithEveryType.ts, 17, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra3 = a3 || a1; // number || any is any +>ra3 : Symbol(ra3, Decl(logicalOrOperatorWithEveryType.ts, 18, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra4 = a4 || a1; // string || any is any +>ra4 : Symbol(ra4, Decl(logicalOrOperatorWithEveryType.ts, 19, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra5 = a5 || a1; // void || any is any +>ra5 : Symbol(ra5, Decl(logicalOrOperatorWithEveryType.ts, 20, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra6 = a6 || a1; // enum || any is any +>ra6 : Symbol(ra6, Decl(logicalOrOperatorWithEveryType.ts, 21, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra7 = a7 || a1; // object || any is any +>ra7 : Symbol(ra7, Decl(logicalOrOperatorWithEveryType.ts, 22, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra8 = a8 || a1; // array || any is any +>ra8 : Symbol(ra8, Decl(logicalOrOperatorWithEveryType.ts, 23, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra9 = null || a1; // null || any is any +>ra9 : Symbol(ra9, Decl(logicalOrOperatorWithEveryType.ts, 24, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var ra10 = undefined || a1; // undefined || any is any +>ra10 : Symbol(ra10, Decl(logicalOrOperatorWithEveryType.ts, 25, 3)) +>undefined : Symbol(undefined) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var rb1 = a1 || a2; // any || boolean is any +>rb1 : Symbol(rb1, Decl(logicalOrOperatorWithEveryType.ts, 27, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb2 = a2 || a2; // boolean || boolean is boolean +>rb2 : Symbol(rb2, Decl(logicalOrOperatorWithEveryType.ts, 28, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb3 = a3 || a2; // number || boolean is number | boolean +>rb3 : Symbol(rb3, Decl(logicalOrOperatorWithEveryType.ts, 29, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb4 = a4 || a2; // string || boolean is string | boolean +>rb4 : Symbol(rb4, Decl(logicalOrOperatorWithEveryType.ts, 30, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb5 = a5 || a2; // void || boolean is void | boolean +>rb5 : Symbol(rb5, Decl(logicalOrOperatorWithEveryType.ts, 31, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb6 = a6 || a2; // enum || boolean is E | boolean +>rb6 : Symbol(rb6, Decl(logicalOrOperatorWithEveryType.ts, 32, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb7 = a7 || a2; // object || boolean is object | boolean +>rb7 : Symbol(rb7, Decl(logicalOrOperatorWithEveryType.ts, 33, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb8 = a8 || a2; // array || boolean is array | boolean +>rb8 : Symbol(rb8, Decl(logicalOrOperatorWithEveryType.ts, 34, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb9 = null || a2; // null || boolean is boolean +>rb9 : Symbol(rb9, Decl(logicalOrOperatorWithEveryType.ts, 35, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rb10= undefined || a2; // undefined || boolean is boolean +>rb10 : Symbol(rb10, Decl(logicalOrOperatorWithEveryType.ts, 36, 3)) +>undefined : Symbol(undefined) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rc1 = a1 || a3; // any || number is any +>rc1 : Symbol(rc1, Decl(logicalOrOperatorWithEveryType.ts, 38, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc2 = a2 || a3; // boolean || number is boolean | number +>rc2 : Symbol(rc2, Decl(logicalOrOperatorWithEveryType.ts, 39, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc3 = a3 || a3; // number || number is number +>rc3 : Symbol(rc3, Decl(logicalOrOperatorWithEveryType.ts, 40, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc4 = a4 || a3; // string || number is string | number +>rc4 : Symbol(rc4, Decl(logicalOrOperatorWithEveryType.ts, 41, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc5 = a5 || a3; // void || number is void | number +>rc5 : Symbol(rc5, Decl(logicalOrOperatorWithEveryType.ts, 42, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc6 = a6 || a3; // enum || number is number +>rc6 : Symbol(rc6, Decl(logicalOrOperatorWithEveryType.ts, 43, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc7 = a7 || a3; // object || number is object | number +>rc7 : Symbol(rc7, Decl(logicalOrOperatorWithEveryType.ts, 44, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc8 = a8 || a3; // array || number is array | number +>rc8 : Symbol(rc8, Decl(logicalOrOperatorWithEveryType.ts, 45, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc9 = null || a3; // null || number is number +>rc9 : Symbol(rc9, Decl(logicalOrOperatorWithEveryType.ts, 46, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rc10 = undefined || a3; // undefined || number is number +>rc10 : Symbol(rc10, Decl(logicalOrOperatorWithEveryType.ts, 47, 3)) +>undefined : Symbol(undefined) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rd1 = a1 || a4; // any || string is any +>rd1 : Symbol(rd1, Decl(logicalOrOperatorWithEveryType.ts, 49, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd2 = a2 || a4; // boolean || string is boolean | string +>rd2 : Symbol(rd2, Decl(logicalOrOperatorWithEveryType.ts, 50, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd3 = a3 || a4; // number || string is number | string +>rd3 : Symbol(rd3, Decl(logicalOrOperatorWithEveryType.ts, 51, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd4 = a4 || a4; // string || string is string +>rd4 : Symbol(rd4, Decl(logicalOrOperatorWithEveryType.ts, 52, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd5 = a5 || a4; // void || string is void | string +>rd5 : Symbol(rd5, Decl(logicalOrOperatorWithEveryType.ts, 53, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd6 = a6 || a4; // enum || string is enum | string +>rd6 : Symbol(rd6, Decl(logicalOrOperatorWithEveryType.ts, 54, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd7 = a7 || a4; // object || string is object | string +>rd7 : Symbol(rd7, Decl(logicalOrOperatorWithEveryType.ts, 55, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd8 = a8 || a4; // array || string is array | string +>rd8 : Symbol(rd8, Decl(logicalOrOperatorWithEveryType.ts, 56, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd9 = null || a4; // null || string is string +>rd9 : Symbol(rd9, Decl(logicalOrOperatorWithEveryType.ts, 57, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rd10 = undefined || a4; // undefined || string is string +>rd10 : Symbol(rd10, Decl(logicalOrOperatorWithEveryType.ts, 58, 3)) +>undefined : Symbol(undefined) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var re1 = a1 || a5; // any || void is any +>re1 : Symbol(re1, Decl(logicalOrOperatorWithEveryType.ts, 60, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re2 = a2 || a5; // boolean || void is boolean | void +>re2 : Symbol(re2, Decl(logicalOrOperatorWithEveryType.ts, 61, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re3 = a3 || a5; // number || void is number | void +>re3 : Symbol(re3, Decl(logicalOrOperatorWithEveryType.ts, 62, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re4 = a4 || a5; // string || void is string | void +>re4 : Symbol(re4, Decl(logicalOrOperatorWithEveryType.ts, 63, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re5 = a5 || a5; // void || void is void +>re5 : Symbol(re5, Decl(logicalOrOperatorWithEveryType.ts, 64, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re6 = a6 || a5; // enum || void is enum | void +>re6 : Symbol(re6, Decl(logicalOrOperatorWithEveryType.ts, 65, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re7 = a7 || a5; // object || void is object | void +>re7 : Symbol(re7, Decl(logicalOrOperatorWithEveryType.ts, 66, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re8 = a8 || a5; // array || void is array | void +>re8 : Symbol(re8, Decl(logicalOrOperatorWithEveryType.ts, 67, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re9 = null || a5; // null || void is void +>re9 : Symbol(re9, Decl(logicalOrOperatorWithEveryType.ts, 68, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var re10 = undefined || a5; // undefined || void is void +>re10 : Symbol(re10, Decl(logicalOrOperatorWithEveryType.ts, 69, 3)) +>undefined : Symbol(undefined) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var rg1 = a1 || a6; // any || enum is any +>rg1 : Symbol(rg1, Decl(logicalOrOperatorWithEveryType.ts, 71, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg2 = a2 || a6; // boolean || enum is boolean | enum +>rg2 : Symbol(rg2, Decl(logicalOrOperatorWithEveryType.ts, 72, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg3 = a3 || a6; // number || enum is number +>rg3 : Symbol(rg3, Decl(logicalOrOperatorWithEveryType.ts, 73, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg4 = a4 || a6; // string || enum is string | enum +>rg4 : Symbol(rg4, Decl(logicalOrOperatorWithEveryType.ts, 74, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg5 = a5 || a6; // void || enum is void | enum +>rg5 : Symbol(rg5, Decl(logicalOrOperatorWithEveryType.ts, 75, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg6 = a6 || a6; // enum || enum is E +>rg6 : Symbol(rg6, Decl(logicalOrOperatorWithEveryType.ts, 76, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg7 = a7 || a6; // object || enum is object | enum +>rg7 : Symbol(rg7, Decl(logicalOrOperatorWithEveryType.ts, 77, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg8 = a8 || a6; // array || enum is array | enum +>rg8 : Symbol(rg8, Decl(logicalOrOperatorWithEveryType.ts, 78, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg9 = null || a6; // null || enum is E +>rg9 : Symbol(rg9, Decl(logicalOrOperatorWithEveryType.ts, 79, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rg10 = undefined || a6; // undefined || enum is E +>rg10 : Symbol(rg10, Decl(logicalOrOperatorWithEveryType.ts, 80, 3)) +>undefined : Symbol(undefined) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rh1 = a1 || a7; // any || object is any +>rh1 : Symbol(rh1, Decl(logicalOrOperatorWithEveryType.ts, 82, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh2 = a2 || a7; // boolean || object is boolean | object +>rh2 : Symbol(rh2, Decl(logicalOrOperatorWithEveryType.ts, 83, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh3 = a3 || a7; // number || object is number | object +>rh3 : Symbol(rh3, Decl(logicalOrOperatorWithEveryType.ts, 84, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh4 = a4 || a7; // string || object is string | object +>rh4 : Symbol(rh4, Decl(logicalOrOperatorWithEveryType.ts, 85, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh5 = a5 || a7; // void || object is void | object +>rh5 : Symbol(rh5, Decl(logicalOrOperatorWithEveryType.ts, 86, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh6 = a6 || a7; // enum || object is enum | object +>rh6 : Symbol(rh6, Decl(logicalOrOperatorWithEveryType.ts, 87, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh7 = a7 || a7; // object || object is object +>rh7 : Symbol(rh7, Decl(logicalOrOperatorWithEveryType.ts, 88, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh8 = a8 || a7; // array || object is array | object +>rh8 : Symbol(rh8, Decl(logicalOrOperatorWithEveryType.ts, 89, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh9 = null || a7; // null || object is object +>rh9 : Symbol(rh9, Decl(logicalOrOperatorWithEveryType.ts, 90, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rh10 = undefined || a7; // undefined || object is object +>rh10 : Symbol(rh10, Decl(logicalOrOperatorWithEveryType.ts, 91, 3)) +>undefined : Symbol(undefined) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var ri1 = a1 || a8; // any || array is any +>ri1 : Symbol(ri1, Decl(logicalOrOperatorWithEveryType.ts, 93, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri2 = a2 || a8; // boolean || array is boolean | array +>ri2 : Symbol(ri2, Decl(logicalOrOperatorWithEveryType.ts, 94, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri3 = a3 || a8; // number || array is number | array +>ri3 : Symbol(ri3, Decl(logicalOrOperatorWithEveryType.ts, 95, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri4 = a4 || a8; // string || array is string | array +>ri4 : Symbol(ri4, Decl(logicalOrOperatorWithEveryType.ts, 96, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri5 = a5 || a8; // void || array is void | array +>ri5 : Symbol(ri5, Decl(logicalOrOperatorWithEveryType.ts, 97, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri6 = a6 || a8; // enum || array is enum | array +>ri6 : Symbol(ri6, Decl(logicalOrOperatorWithEveryType.ts, 98, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri7 = a7 || a8; // object || array is object | array +>ri7 : Symbol(ri7, Decl(logicalOrOperatorWithEveryType.ts, 99, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri8 = a8 || a8; // array || array is array +>ri8 : Symbol(ri8, Decl(logicalOrOperatorWithEveryType.ts, 100, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri9 = null || a8; // null || array is array +>ri9 : Symbol(ri9, Decl(logicalOrOperatorWithEveryType.ts, 101, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var ri10 = undefined || a8; // undefined || array is array +>ri10 : Symbol(ri10, Decl(logicalOrOperatorWithEveryType.ts, 102, 3)) +>undefined : Symbol(undefined) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var rj1 = a1 || null; // any || null is any +>rj1 : Symbol(rj1, Decl(logicalOrOperatorWithEveryType.ts, 104, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) + +var rj2 = a2 || null; // boolean || null is boolean +>rj2 : Symbol(rj2, Decl(logicalOrOperatorWithEveryType.ts, 105, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) + +var rj3 = a3 || null; // number || null is number +>rj3 : Symbol(rj3, Decl(logicalOrOperatorWithEveryType.ts, 106, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) + +var rj4 = a4 || null; // string || null is string +>rj4 : Symbol(rj4, Decl(logicalOrOperatorWithEveryType.ts, 107, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) + +var rj5 = a5 || null; // void || null is void +>rj5 : Symbol(rj5, Decl(logicalOrOperatorWithEveryType.ts, 108, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) + +var rj6 = a6 || null; // enum || null is E +>rj6 : Symbol(rj6, Decl(logicalOrOperatorWithEveryType.ts, 109, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) + +var rj7 = a7 || null; // object || null is object +>rj7 : Symbol(rj7, Decl(logicalOrOperatorWithEveryType.ts, 110, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) + +var rj8 = a8 || null; // array || null is array +>rj8 : Symbol(rj8, Decl(logicalOrOperatorWithEveryType.ts, 111, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) + +var rj9 = null || null; // null || null is any +>rj9 : Symbol(rj9, Decl(logicalOrOperatorWithEveryType.ts, 112, 3)) + +var rj10 = undefined || null; // undefined || null is any +>rj10 : Symbol(rj10, Decl(logicalOrOperatorWithEveryType.ts, 113, 3)) +>undefined : Symbol(undefined) + +var rf1 = a1 || undefined; // any || undefined is any +>rf1 : Symbol(rf1, Decl(logicalOrOperatorWithEveryType.ts, 115, 3)) +>a1 : Symbol(a1, Decl(logicalOrOperatorWithEveryType.ts, 7, 3)) +>undefined : Symbol(undefined) + +var rf2 = a2 || undefined; // boolean || undefined is boolean +>rf2 : Symbol(rf2, Decl(logicalOrOperatorWithEveryType.ts, 116, 3)) +>a2 : Symbol(a2, Decl(logicalOrOperatorWithEveryType.ts, 8, 3)) +>undefined : Symbol(undefined) + +var rf3 = a3 || undefined; // number || undefined is number +>rf3 : Symbol(rf3, Decl(logicalOrOperatorWithEveryType.ts, 117, 3)) +>a3 : Symbol(a3, Decl(logicalOrOperatorWithEveryType.ts, 9, 3)) +>undefined : Symbol(undefined) + +var rf4 = a4 || undefined; // string || undefined is string +>rf4 : Symbol(rf4, Decl(logicalOrOperatorWithEveryType.ts, 118, 3)) +>a4 : Symbol(a4, Decl(logicalOrOperatorWithEveryType.ts, 10, 3)) +>undefined : Symbol(undefined) + +var rf5 = a5 || undefined; // void || undefined is void +>rf5 : Symbol(rf5, Decl(logicalOrOperatorWithEveryType.ts, 119, 3)) +>a5 : Symbol(a5, Decl(logicalOrOperatorWithEveryType.ts, 11, 3)) +>undefined : Symbol(undefined) + +var rf6 = a6 || undefined; // enum || undefined is E +>rf6 : Symbol(rf6, Decl(logicalOrOperatorWithEveryType.ts, 120, 3)) +>a6 : Symbol(a6, Decl(logicalOrOperatorWithEveryType.ts, 12, 3)) +>undefined : Symbol(undefined) + +var rf7 = a7 || undefined; // object || undefined is object +>rf7 : Symbol(rf7, Decl(logicalOrOperatorWithEveryType.ts, 121, 3)) +>a7 : Symbol(a7, Decl(logicalOrOperatorWithEveryType.ts, 13, 3)) +>undefined : Symbol(undefined) + +var rf8 = a8 || undefined; // array || undefined is array +>rf8 : Symbol(rf8, Decl(logicalOrOperatorWithEveryType.ts, 122, 3)) +>a8 : Symbol(a8, Decl(logicalOrOperatorWithEveryType.ts, 14, 3)) +>undefined : Symbol(undefined) + +var rf9 = null || undefined; // null || undefined is any +>rf9 : Symbol(rf9, Decl(logicalOrOperatorWithEveryType.ts, 123, 3)) +>undefined : Symbol(undefined) + +var rf10 = undefined || undefined; // undefined || undefined is any +>rf10 : Symbol(rf10, Decl(logicalOrOperatorWithEveryType.ts, 124, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.types b/tests/baselines/reference/logicalOrOperatorWithEveryType.types index ae8dab8c71c..c98966acb98 100644 --- a/tests/baselines/reference/logicalOrOperatorWithEveryType.types +++ b/tests/baselines/reference/logicalOrOperatorWithEveryType.types @@ -87,6 +87,7 @@ var ra8 = a8 || a1; // array || any is any var ra9 = null || a1; // null || any is any >ra9 : any >null || a1 : any +>null : null >a1 : any var ra10 = undefined || a1; // undefined || any is any @@ -146,6 +147,7 @@ var rb8 = a8 || a2; // array || boolean is array | boolean var rb9 = null || a2; // null || boolean is boolean >rb9 : boolean >null || a2 : boolean +>null : null >a2 : boolean var rb10= undefined || a2; // undefined || boolean is boolean @@ -205,6 +207,7 @@ var rc8 = a8 || a3; // array || number is array | number var rc9 = null || a3; // null || number is number >rc9 : number >null || a3 : number +>null : null >a3 : number var rc10 = undefined || a3; // undefined || number is number @@ -264,6 +267,7 @@ var rd8 = a8 || a4; // array || string is array | string var rd9 = null || a4; // null || string is string >rd9 : string >null || a4 : string +>null : null >a4 : string var rd10 = undefined || a4; // undefined || string is string @@ -323,6 +327,7 @@ var re8 = a8 || a5; // array || void is array | void var re9 = null || a5; // null || void is void >re9 : void >null || a5 : void +>null : null >a5 : void var re10 = undefined || a5; // undefined || void is void @@ -382,6 +387,7 @@ var rg8 = a8 || a6; // array || enum is array | enum var rg9 = null || a6; // null || enum is E >rg9 : E >null || a6 : E +>null : null >a6 : E var rg10 = undefined || a6; // undefined || enum is E @@ -441,6 +447,7 @@ var rh8 = a8 || a7; // array || object is array | object var rh9 = null || a7; // null || object is object >rh9 : { a: string; } >null || a7 : { a: string; } +>null : null >a7 : { a: string; } var rh10 = undefined || a7; // undefined || object is object @@ -500,6 +507,7 @@ var ri8 = a8 || a8; // array || array is array var ri9 = null || a8; // null || array is array >ri9 : string[] >null || a8 : string[] +>null : null >a8 : string[] var ri10 = undefined || a8; // undefined || array is array @@ -512,50 +520,61 @@ var rj1 = a1 || null; // any || null is any >rj1 : any >a1 || null : any >a1 : any +>null : null var rj2 = a2 || null; // boolean || null is boolean >rj2 : boolean >a2 || null : boolean >a2 : boolean +>null : null var rj3 = a3 || null; // number || null is number >rj3 : number >a3 || null : number >a3 : number +>null : null var rj4 = a4 || null; // string || null is string >rj4 : string >a4 || null : string >a4 : string +>null : null var rj5 = a5 || null; // void || null is void >rj5 : void >a5 || null : void >a5 : void +>null : null var rj6 = a6 || null; // enum || null is E >rj6 : E >a6 || null : E >a6 : E +>null : null var rj7 = a7 || null; // object || null is object >rj7 : { a: string; } >a7 || null : { a: string; } >a7 : { a: string; } +>null : null var rj8 = a8 || null; // array || null is array >rj8 : string[] >a8 || null : string[] >a8 : string[] +>null : null var rj9 = null || null; // null || null is any >rj9 : any >null || null : null +>null : null +>null : null var rj10 = undefined || null; // undefined || null is any >rj10 : any >undefined || null : null >undefined : undefined +>null : null var rf1 = a1 || undefined; // any || undefined is any >rf1 : any @@ -608,6 +627,7 @@ var rf8 = a8 || undefined; // array || undefined is array var rf9 = null || undefined; // null || undefined is any >rf9 : any >null || undefined : null +>null : null >undefined : undefined var rf10 = undefined || undefined; // undefined || undefined is any diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.types.pull b/tests/baselines/reference/logicalOrOperatorWithEveryType.types.pull deleted file mode 100644 index e0d75463414..00000000000 --- a/tests/baselines/reference/logicalOrOperatorWithEveryType.types.pull +++ /dev/null @@ -1,618 +0,0 @@ -=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrOperatorWithEveryType.ts === -// The || operator permits the operands to be of any type. -// If the || expression is not contextually typed, the right operand is contextually typed -// by the type of the left operand and the result is of the best common type of the two -// operand types. - -enum E { a, b, c } ->E : E ->a : E ->b : E ->c : E - -var a1: any; ->a1 : any - -var a2: boolean; ->a2 : boolean - -var a3: number ->a3 : number - -var a4: string; ->a4 : string - -var a5: void; ->a5 : void - -var a6: E; ->a6 : E ->E : E - -var a7: {a: string}; ->a7 : { a: string; } ->a : string - -var a8: string[]; ->a8 : string[] - -var ra1 = a1 || a1; // any || any is any ->ra1 : any ->a1 || a1 : any ->a1 : any ->a1 : any - -var ra2 = a2 || a1; // boolean || any is any ->ra2 : any ->a2 || a1 : any ->a2 : boolean ->a1 : any - -var ra3 = a3 || a1; // number || any is any ->ra3 : any ->a3 || a1 : any ->a3 : number ->a1 : any - -var ra4 = a4 || a1; // string || any is any ->ra4 : any ->a4 || a1 : any ->a4 : string ->a1 : any - -var ra5 = a5 || a1; // void || any is any ->ra5 : any ->a5 || a1 : any ->a5 : void ->a1 : any - -var ra6 = a6 || a1; // enum || any is any ->ra6 : any ->a6 || a1 : any ->a6 : E ->a1 : any - -var ra7 = a7 || a1; // object || any is any ->ra7 : any ->a7 || a1 : any ->a7 : { a: string; } ->a1 : any - -var ra8 = a8 || a1; // array || any is any ->ra8 : any ->a8 || a1 : any ->a8 : string[] ->a1 : any - -var ra9 = null || a1; // null || any is any ->ra9 : any ->null || a1 : any ->a1 : any - -var ra10 = undefined || a1; // undefined || any is any ->ra10 : any ->undefined || a1 : any ->undefined : undefined ->a1 : any - -var rb1 = a1 || a2; // any || boolean is any ->rb1 : any ->a1 || a2 : any ->a1 : any ->a2 : boolean - -var rb2 = a2 || a2; // boolean || boolean is boolean ->rb2 : boolean ->a2 || a2 : boolean ->a2 : boolean ->a2 : boolean - -var rb3 = a3 || a2; // number || boolean is number | boolean ->rb3 : number | boolean ->a3 || a2 : number | boolean ->a3 : number ->a2 : boolean - -var rb4 = a4 || a2; // string || boolean is string | boolean ->rb4 : string | boolean ->a4 || a2 : string | boolean ->a4 : string ->a2 : boolean - -var rb5 = a5 || a2; // void || boolean is void | boolean ->rb5 : boolean | void ->a5 || a2 : boolean | void ->a5 : void ->a2 : boolean - -var rb6 = a6 || a2; // enum || boolean is E | boolean ->rb6 : boolean | E ->a6 || a2 : boolean | E ->a6 : E ->a2 : boolean - -var rb7 = a7 || a2; // object || boolean is object | boolean ->rb7 : boolean | { a: string; } ->a7 || a2 : boolean | { a: string; } ->a7 : { a: string; } ->a2 : boolean - -var rb8 = a8 || a2; // array || boolean is array | boolean ->rb8 : boolean | string[] ->a8 || a2 : boolean | string[] ->a8 : string[] ->a2 : boolean - -var rb9 = null || a2; // null || boolean is boolean ->rb9 : boolean ->null || a2 : boolean ->a2 : boolean - -var rb10= undefined || a2; // undefined || boolean is boolean ->rb10 : boolean ->undefined || a2 : boolean ->undefined : undefined ->a2 : boolean - -var rc1 = a1 || a3; // any || number is any ->rc1 : any ->a1 || a3 : any ->a1 : any ->a3 : number - -var rc2 = a2 || a3; // boolean || number is boolean | number ->rc2 : number | boolean ->a2 || a3 : number | boolean ->a2 : boolean ->a3 : number - -var rc3 = a3 || a3; // number || number is number ->rc3 : number ->a3 || a3 : number ->a3 : number ->a3 : number - -var rc4 = a4 || a3; // string || number is string | number ->rc4 : string | number ->a4 || a3 : string | number ->a4 : string ->a3 : number - -var rc5 = a5 || a3; // void || number is void | number ->rc5 : number | void ->a5 || a3 : number | void ->a5 : void ->a3 : number - -var rc6 = a6 || a3; // enum || number is number ->rc6 : number ->a6 || a3 : number ->a6 : E ->a3 : number - -var rc7 = a7 || a3; // object || number is object | number ->rc7 : number | { a: string; } ->a7 || a3 : number | { a: string; } ->a7 : { a: string; } ->a3 : number - -var rc8 = a8 || a3; // array || number is array | number ->rc8 : number | string[] ->a8 || a3 : number | string[] ->a8 : string[] ->a3 : number - -var rc9 = null || a3; // null || number is number ->rc9 : number ->null || a3 : number ->a3 : number - -var rc10 = undefined || a3; // undefined || number is number ->rc10 : number ->undefined || a3 : number ->undefined : undefined ->a3 : number - -var rd1 = a1 || a4; // any || string is any ->rd1 : any ->a1 || a4 : any ->a1 : any ->a4 : string - -var rd2 = a2 || a4; // boolean || string is boolean | string ->rd2 : string | boolean ->a2 || a4 : string | boolean ->a2 : boolean ->a4 : string - -var rd3 = a3 || a4; // number || string is number | string ->rd3 : string | number ->a3 || a4 : string | number ->a3 : number ->a4 : string - -var rd4 = a4 || a4; // string || string is string ->rd4 : string ->a4 || a4 : string ->a4 : string ->a4 : string - -var rd5 = a5 || a4; // void || string is void | string ->rd5 : string | void ->a5 || a4 : string | void ->a5 : void ->a4 : string - -var rd6 = a6 || a4; // enum || string is enum | string ->rd6 : string | E ->a6 || a4 : string | E ->a6 : E ->a4 : string - -var rd7 = a7 || a4; // object || string is object | string ->rd7 : string | { a: string; } ->a7 || a4 : string | { a: string; } ->a7 : { a: string; } ->a4 : string - -var rd8 = a8 || a4; // array || string is array | string ->rd8 : string | string[] ->a8 || a4 : string | string[] ->a8 : string[] ->a4 : string - -var rd9 = null || a4; // null || string is string ->rd9 : string ->null || a4 : string ->a4 : string - -var rd10 = undefined || a4; // undefined || string is string ->rd10 : string ->undefined || a4 : string ->undefined : undefined ->a4 : string - -var re1 = a1 || a5; // any || void is any ->re1 : any ->a1 || a5 : any ->a1 : any ->a5 : void - -var re2 = a2 || a5; // boolean || void is boolean | void ->re2 : boolean | void ->a2 || a5 : boolean | void ->a2 : boolean ->a5 : void - -var re3 = a3 || a5; // number || void is number | void ->re3 : number | void ->a3 || a5 : number | void ->a3 : number ->a5 : void - -var re4 = a4 || a5; // string || void is string | void ->re4 : string | void ->a4 || a5 : string | void ->a4 : string ->a5 : void - -var re5 = a5 || a5; // void || void is void ->re5 : void ->a5 || a5 : void ->a5 : void ->a5 : void - -var re6 = a6 || a5; // enum || void is enum | void ->re6 : void | E ->a6 || a5 : void | E ->a6 : E ->a5 : void - -var re7 = a7 || a5; // object || void is object | void ->re7 : void | { a: string; } ->a7 || a5 : void | { a: string; } ->a7 : { a: string; } ->a5 : void - -var re8 = a8 || a5; // array || void is array | void ->re8 : void | string[] ->a8 || a5 : void | string[] ->a8 : string[] ->a5 : void - -var re9 = null || a5; // null || void is void ->re9 : void ->null || a5 : void ->a5 : void - -var re10 = undefined || a5; // undefined || void is void ->re10 : void ->undefined || a5 : void ->undefined : undefined ->a5 : void - -var rg1 = a1 || a6; // any || enum is any ->rg1 : any ->a1 || a6 : any ->a1 : any ->a6 : E - -var rg2 = a2 || a6; // boolean || enum is boolean | enum ->rg2 : boolean | E ->a2 || a6 : boolean | E ->a2 : boolean ->a6 : E - -var rg3 = a3 || a6; // number || enum is number ->rg3 : number ->a3 || a6 : number ->a3 : number ->a6 : E - -var rg4 = a4 || a6; // string || enum is string | enum ->rg4 : string | E ->a4 || a6 : string | E ->a4 : string ->a6 : E - -var rg5 = a5 || a6; // void || enum is void | enum ->rg5 : void | E ->a5 || a6 : void | E ->a5 : void ->a6 : E - -var rg6 = a6 || a6; // enum || enum is E ->rg6 : E ->a6 || a6 : E ->a6 : E ->a6 : E - -var rg7 = a7 || a6; // object || enum is object | enum ->rg7 : E | { a: string; } ->a7 || a6 : E | { a: string; } ->a7 : { a: string; } ->a6 : E - -var rg8 = a8 || a6; // array || enum is array | enum ->rg8 : E | string[] ->a8 || a6 : E | string[] ->a8 : string[] ->a6 : E - -var rg9 = null || a6; // null || enum is E ->rg9 : E ->null || a6 : E ->a6 : E - -var rg10 = undefined || a6; // undefined || enum is E ->rg10 : E ->undefined || a6 : E ->undefined : undefined ->a6 : E - -var rh1 = a1 || a7; // any || object is any ->rh1 : any ->a1 || a7 : any ->a1 : any ->a7 : { a: string; } - -var rh2 = a2 || a7; // boolean || object is boolean | object ->rh2 : boolean | { a: string; } ->a2 || a7 : boolean | { a: string; } ->a2 : boolean ->a7 : { a: string; } - -var rh3 = a3 || a7; // number || object is number | object ->rh3 : number | { a: string; } ->a3 || a7 : number | { a: string; } ->a3 : number ->a7 : { a: string; } - -var rh4 = a4 || a7; // string || object is string | object ->rh4 : string | { a: string; } ->a4 || a7 : string | { a: string; } ->a4 : string ->a7 : { a: string; } - -var rh5 = a5 || a7; // void || object is void | object ->rh5 : void | { a: string; } ->a5 || a7 : void | { a: string; } ->a5 : void ->a7 : { a: string; } - -var rh6 = a6 || a7; // enum || object is enum | object ->rh6 : E | { a: string; } ->a6 || a7 : E | { a: string; } ->a6 : E ->a7 : { a: string; } - -var rh7 = a7 || a7; // object || object is object ->rh7 : { a: string; } ->a7 || a7 : { a: string; } ->a7 : { a: string; } ->a7 : { a: string; } - -var rh8 = a8 || a7; // array || object is array | object ->rh8 : { a: string; } | string[] ->a8 || a7 : { a: string; } | string[] ->a8 : string[] ->a7 : { a: string; } - -var rh9 = null || a7; // null || object is object ->rh9 : { a: string; } ->null || a7 : { a: string; } ->a7 : { a: string; } - -var rh10 = undefined || a7; // undefined || object is object ->rh10 : { a: string; } ->undefined || a7 : { a: string; } ->undefined : undefined ->a7 : { a: string; } - -var ri1 = a1 || a8; // any || array is any ->ri1 : any ->a1 || a8 : any ->a1 : any ->a8 : string[] - -var ri2 = a2 || a8; // boolean || array is boolean | array ->ri2 : boolean | string[] ->a2 || a8 : boolean | string[] ->a2 : boolean ->a8 : string[] - -var ri3 = a3 || a8; // number || array is number | array ->ri3 : number | string[] ->a3 || a8 : number | string[] ->a3 : number ->a8 : string[] - -var ri4 = a4 || a8; // string || array is string | array ->ri4 : string | string[] ->a4 || a8 : string | string[] ->a4 : string ->a8 : string[] - -var ri5 = a5 || a8; // void || array is void | array ->ri5 : void | string[] ->a5 || a8 : void | string[] ->a5 : void ->a8 : string[] - -var ri6 = a6 || a8; // enum || array is enum | array ->ri6 : E | string[] ->a6 || a8 : E | string[] ->a6 : E ->a8 : string[] - -var ri7 = a7 || a8; // object || array is object | array ->ri7 : { a: string; } | string[] ->a7 || a8 : { a: string; } | string[] ->a7 : { a: string; } ->a8 : string[] - -var ri8 = a8 || a8; // array || array is array ->ri8 : string[] ->a8 || a8 : string[] ->a8 : string[] ->a8 : string[] - -var ri9 = null || a8; // null || array is array ->ri9 : string[] ->null || a8 : string[] ->a8 : string[] - -var ri10 = undefined || a8; // undefined || array is array ->ri10 : string[] ->undefined || a8 : string[] ->undefined : undefined ->a8 : string[] - -var rj1 = a1 || null; // any || null is any ->rj1 : any ->a1 || null : any ->a1 : any - -var rj2 = a2 || null; // boolean || null is boolean ->rj2 : boolean ->a2 || null : boolean ->a2 : boolean - -var rj3 = a3 || null; // number || null is number ->rj3 : number ->a3 || null : number ->a3 : number - -var rj4 = a4 || null; // string || null is string ->rj4 : string ->a4 || null : string ->a4 : string - -var rj5 = a5 || null; // void || null is void ->rj5 : void ->a5 || null : void ->a5 : void - -var rj6 = a6 || null; // enum || null is E ->rj6 : E ->a6 || null : E ->a6 : E - -var rj7 = a7 || null; // object || null is object ->rj7 : { a: string; } ->a7 || null : { a: string; } ->a7 : { a: string; } - -var rj8 = a8 || null; // array || null is array ->rj8 : string[] ->a8 || null : string[] ->a8 : string[] - -var rj9 = null || null; // null || null is any ->rj9 : any ->null || null : null - -var rj10 = undefined || null; // undefined || null is any ->rj10 : any ->undefined || null : null ->undefined : undefined - -var rf1 = a1 || undefined; // any || undefined is any ->rf1 : any ->a1 || undefined : any ->a1 : any ->undefined : undefined - -var rf2 = a2 || undefined; // boolean || undefined is boolean ->rf2 : boolean ->a2 || undefined : boolean ->a2 : boolean ->undefined : undefined - -var rf3 = a3 || undefined; // number || undefined is number ->rf3 : number ->a3 || undefined : number ->a3 : number ->undefined : undefined - -var rf4 = a4 || undefined; // string || undefined is string ->rf4 : string ->a4 || undefined : string ->a4 : string ->undefined : undefined - -var rf5 = a5 || undefined; // void || undefined is void ->rf5 : void ->a5 || undefined : void ->a5 : void ->undefined : undefined - -var rf6 = a6 || undefined; // enum || undefined is E ->rf6 : E ->a6 || undefined : E ->a6 : E ->undefined : undefined - -var rf7 = a7 || undefined; // object || undefined is object ->rf7 : { a: string; } ->a7 || undefined : { a: string; } ->a7 : { a: string; } ->undefined : undefined - -var rf8 = a8 || undefined; // array || undefined is array ->rf8 : string[] ->a8 || undefined : string[] ->a8 : string[] ->undefined : undefined - -var rf9 = null || undefined; // null || undefined is any ->rf9 : any ->null || undefined : null ->undefined : undefined - -var rf10 = undefined || undefined; // undefined || undefined is any ->rf10 : any ->undefined || undefined : undefined ->undefined : undefined ->undefined : undefined - diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.symbols b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.symbols new file mode 100644 index 00000000000..05b33a2b185 --- /dev/null +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.symbols @@ -0,0 +1,108 @@ +=== tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrOperatorWithTypeParameters.ts === +function fn1(t: T, u: U) { +>fn1 : Symbol(fn1, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 0)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 13)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 15)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 13)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 24)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 15)) + + var r1 = t || t; +>r1 : Symbol(r1, Decl(logicalOrOperatorWithTypeParameters.ts, 1, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) + + var r2: T = t || t; +>r2 : Symbol(r2, Decl(logicalOrOperatorWithTypeParameters.ts, 2, 7)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 13)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) + + var r3 = t || u; +>r3 : Symbol(r3, Decl(logicalOrOperatorWithTypeParameters.ts, 3, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 24)) + + var r4: {} = t || u; +>r4 : Symbol(r4, Decl(logicalOrOperatorWithTypeParameters.ts, 4, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 19)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 0, 24)) +} + +function fn2(t: T, u: U, v: V) { +>fn2 : Symbol(fn2, Decl(logicalOrOperatorWithTypeParameters.ts, 5, 1)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 13)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 15)) +>V : Symbol(V, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 32)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 50)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 13)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 15)) +>v : Symbol(v, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 61)) +>V : Symbol(V, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 32)) + + var r1 = t || u; +>r1 : Symbol(r1, Decl(logicalOrOperatorWithTypeParameters.ts, 8, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 50)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) + + //var r2: T = t || u; + var r3 = u || u; +>r3 : Symbol(r3, Decl(logicalOrOperatorWithTypeParameters.ts, 10, 7)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) + + var r4: U = u || u; +>r4 : Symbol(r4, Decl(logicalOrOperatorWithTypeParameters.ts, 11, 7)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 15)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) + + var r5 = u || v; +>r5 : Symbol(r5, Decl(logicalOrOperatorWithTypeParameters.ts, 12, 7)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) +>v : Symbol(v, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 61)) + + var r6: {} = u || v; +>r6 : Symbol(r6, Decl(logicalOrOperatorWithTypeParameters.ts, 13, 7)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 55)) +>v : Symbol(v, Decl(logicalOrOperatorWithTypeParameters.ts, 7, 61)) + + //var r7: T = u || v; +} + +function fn3(t: T, u: U) { +>fn3 : Symbol(fn3, Decl(logicalOrOperatorWithTypeParameters.ts, 15, 1)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 13)) +>a : Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 24)) +>b : Symbol(b, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 35)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 48)) +>a : Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 60)) +>b : Symbol(b, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 71)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85)) +>T : Symbol(T, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 13)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90)) +>U : Symbol(U, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 48)) + + var r1 = t || u; +>r1 : Symbol(r1, Decl(logicalOrOperatorWithTypeParameters.ts, 18, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90)) + + var r2: {} = t || u; +>r2 : Symbol(r2, Decl(logicalOrOperatorWithTypeParameters.ts, 19, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90)) + + var r3 = t || { a: '' }; +>r3 : Symbol(r3, Decl(logicalOrOperatorWithTypeParameters.ts, 20, 7)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85)) +>a : Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 20, 19)) + + var r4: { a: string } = t || u; +>r4 : Symbol(r4, Decl(logicalOrOperatorWithTypeParameters.ts, 21, 7)) +>a : Symbol(a, Decl(logicalOrOperatorWithTypeParameters.ts, 21, 13)) +>t : Symbol(t, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 85)) +>u : Symbol(u, Decl(logicalOrOperatorWithTypeParameters.ts, 17, 90)) +} diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types index 4008fbbff50..f887ad7ae14 100644 --- a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types @@ -112,6 +112,7 @@ function fn3t : T >{ a: '' } : { a: string; } >a : string +>'' : string var r4: { a: string } = t || u; >r4 : { a: string; } diff --git a/tests/baselines/reference/m7Bugs.symbols b/tests/baselines/reference/m7Bugs.symbols new file mode 100644 index 00000000000..be6d798a8a5 --- /dev/null +++ b/tests/baselines/reference/m7Bugs.symbols @@ -0,0 +1,57 @@ +=== tests/cases/compiler/m7Bugs.ts === +// scenario 1 +interface ISomething { +>ISomething : Symbol(ISomething, Decl(m7Bugs.ts, 0, 0)) + + something: number; +>something : Symbol(something, Decl(m7Bugs.ts, 1, 22)) +} + +var s: ISomething = ({ }); +>s : Symbol(s, Decl(m7Bugs.ts, 5, 3)) +>ISomething : Symbol(ISomething, Decl(m7Bugs.ts, 0, 0)) +>ISomething : Symbol(ISomething, Decl(m7Bugs.ts, 0, 0)) + + +// scenario 2 +interface A { x: string; } +>A : Symbol(A, Decl(m7Bugs.ts, 5, 38)) +>x : Symbol(x, Decl(m7Bugs.ts, 9, 13)) + +interface B extends A { } +>B : Symbol(B, Decl(m7Bugs.ts, 9, 26)) +>A : Symbol(A, Decl(m7Bugs.ts, 5, 38)) + +var x: B = { }; +>x : Symbol(x, Decl(m7Bugs.ts, 13, 3)) +>B : Symbol(B, Decl(m7Bugs.ts, 9, 26)) +>B : Symbol(B, Decl(m7Bugs.ts, 9, 26)) + +class C1 { +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) + + public x: string; +>x : Symbol(x, Decl(m7Bugs.ts, 15, 10)) +} + +class C2 extends C1 {} +>C2 : Symbol(C2, Decl(m7Bugs.ts, 17, 1)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) + +var y1: C1 = new C2(); +>y1 : Symbol(y1, Decl(m7Bugs.ts, 21, 3)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) +>C2 : Symbol(C2, Decl(m7Bugs.ts, 17, 1)) + +var y2: C1 = new C2(); +>y2 : Symbol(y2, Decl(m7Bugs.ts, 22, 3)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) +>C2 : Symbol(C2, Decl(m7Bugs.ts, 17, 1)) + +var y3: C1 = {}; +>y3 : Symbol(y3, Decl(m7Bugs.ts, 23, 3)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) +>C1 : Symbol(C1, Decl(m7Bugs.ts, 13, 18)) + + diff --git a/tests/baselines/reference/memberAccessMustUseModuleInstances.symbols b/tests/baselines/reference/memberAccessMustUseModuleInstances.symbols new file mode 100644 index 00000000000..434a2370520 --- /dev/null +++ b/tests/baselines/reference/memberAccessMustUseModuleInstances.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/memberAccessMustUseModuleInstances_1.ts === +/// +import WinJS = require('memberAccessMustUseModuleInstances_0'); +>WinJS : Symbol(WinJS, Decl(memberAccessMustUseModuleInstances_1.ts, 0, 0)) + +WinJS.Promise.timeout(10); +>WinJS.Promise.timeout : Symbol(WinJS.Promise.timeout, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 22)) +>WinJS.Promise : Symbol(WinJS.Promise, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 0)) +>WinJS : Symbol(WinJS, Decl(memberAccessMustUseModuleInstances_1.ts, 0, 0)) +>Promise : Symbol(WinJS.Promise, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 0)) +>timeout : Symbol(WinJS.Promise.timeout, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 22)) + +=== tests/cases/compiler/memberAccessMustUseModuleInstances_0.ts === +export class Promise { +>Promise : Symbol(Promise, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 0)) + + static timeout(delay: number): Promise { +>timeout : Symbol(Promise.timeout, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 22)) +>delay : Symbol(delay, Decl(memberAccessMustUseModuleInstances_0.ts, 1, 19)) +>Promise : Symbol(Promise, Decl(memberAccessMustUseModuleInstances_0.ts, 0, 0)) + + return null; + } +} + diff --git a/tests/baselines/reference/memberAccessMustUseModuleInstances.types b/tests/baselines/reference/memberAccessMustUseModuleInstances.types index 4e95362f782..b1848660dac 100644 --- a/tests/baselines/reference/memberAccessMustUseModuleInstances.types +++ b/tests/baselines/reference/memberAccessMustUseModuleInstances.types @@ -10,6 +10,7 @@ WinJS.Promise.timeout(10); >WinJS : typeof WinJS >Promise : typeof WinJS.Promise >timeout : (delay: number) => WinJS.Promise +>10 : number === tests/cases/compiler/memberAccessMustUseModuleInstances_0.ts === export class Promise { @@ -21,6 +22,7 @@ export class Promise { >Promise : Promise return null; +>null : null } } diff --git a/tests/baselines/reference/memberAccessOnConstructorType.symbols b/tests/baselines/reference/memberAccessOnConstructorType.symbols new file mode 100644 index 00000000000..0e3c707c4f9 --- /dev/null +++ b/tests/baselines/reference/memberAccessOnConstructorType.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/memberAccessOnConstructorType.ts === +var f: new () => void; +>f : Symbol(f, Decl(memberAccessOnConstructorType.ts, 0, 3)) + +f.arguments == 0; +>f.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>f : Symbol(f, Decl(memberAccessOnConstructorType.ts, 0, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + diff --git a/tests/baselines/reference/memberAccessOnConstructorType.types b/tests/baselines/reference/memberAccessOnConstructorType.types index d4d722619d4..a767336ec12 100644 --- a/tests/baselines/reference/memberAccessOnConstructorType.types +++ b/tests/baselines/reference/memberAccessOnConstructorType.types @@ -7,4 +7,5 @@ f.arguments == 0; >f.arguments : any >f : new () => void >arguments : any +>0 : number diff --git a/tests/baselines/reference/memberFunctionsWithPublicOverloads.symbols b/tests/baselines/reference/memberFunctionsWithPublicOverloads.symbols new file mode 100644 index 00000000000..435af50a5f7 --- /dev/null +++ b/tests/baselines/reference/memberFunctionsWithPublicOverloads.symbols @@ -0,0 +1,142 @@ +=== tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/memberFunctionsWithPublicOverloads.ts === +class C { +>C : Symbol(C, Decl(memberFunctionsWithPublicOverloads.ts, 0, 0)) + + public foo(x: number); +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 0, 9), Decl(memberFunctionsWithPublicOverloads.ts, 1, 26), Decl(memberFunctionsWithPublicOverloads.ts, 2, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 1, 15)) + + public foo(x: number, y: string); +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 0, 9), Decl(memberFunctionsWithPublicOverloads.ts, 1, 26), Decl(memberFunctionsWithPublicOverloads.ts, 2, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 2, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 2, 25)) + + public foo(x: any, y?: any) { } +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 0, 9), Decl(memberFunctionsWithPublicOverloads.ts, 1, 26), Decl(memberFunctionsWithPublicOverloads.ts, 2, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 3, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 3, 22)) + + public bar(x: 'hi'); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 3, 35), Decl(memberFunctionsWithPublicOverloads.ts, 5, 24), Decl(memberFunctionsWithPublicOverloads.ts, 6, 26), Decl(memberFunctionsWithPublicOverloads.ts, 7, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 5, 15)) + + public bar(x: string); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 3, 35), Decl(memberFunctionsWithPublicOverloads.ts, 5, 24), Decl(memberFunctionsWithPublicOverloads.ts, 6, 26), Decl(memberFunctionsWithPublicOverloads.ts, 7, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 6, 15)) + + public bar(x: number, y: string); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 3, 35), Decl(memberFunctionsWithPublicOverloads.ts, 5, 24), Decl(memberFunctionsWithPublicOverloads.ts, 6, 26), Decl(memberFunctionsWithPublicOverloads.ts, 7, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 7, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 7, 25)) + + public bar(x: any, y?: any) { } +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 3, 35), Decl(memberFunctionsWithPublicOverloads.ts, 5, 24), Decl(memberFunctionsWithPublicOverloads.ts, 6, 26), Decl(memberFunctionsWithPublicOverloads.ts, 7, 37)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 8, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 8, 22)) + + public static foo(x: number); +>foo : Symbol(C.foo, Decl(memberFunctionsWithPublicOverloads.ts, 8, 35), Decl(memberFunctionsWithPublicOverloads.ts, 10, 33), Decl(memberFunctionsWithPublicOverloads.ts, 11, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 10, 22)) + + public static foo(x: number, y: string); +>foo : Symbol(C.foo, Decl(memberFunctionsWithPublicOverloads.ts, 8, 35), Decl(memberFunctionsWithPublicOverloads.ts, 10, 33), Decl(memberFunctionsWithPublicOverloads.ts, 11, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 11, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 11, 32)) + + public static foo(x: any, y?: any) { } +>foo : Symbol(C.foo, Decl(memberFunctionsWithPublicOverloads.ts, 8, 35), Decl(memberFunctionsWithPublicOverloads.ts, 10, 33), Decl(memberFunctionsWithPublicOverloads.ts, 11, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 12, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 12, 29)) + + public static bar(x: 'hi'); +>bar : Symbol(C.bar, Decl(memberFunctionsWithPublicOverloads.ts, 12, 42), Decl(memberFunctionsWithPublicOverloads.ts, 14, 31), Decl(memberFunctionsWithPublicOverloads.ts, 15, 33), Decl(memberFunctionsWithPublicOverloads.ts, 16, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 14, 22)) + + public static bar(x: string); +>bar : Symbol(C.bar, Decl(memberFunctionsWithPublicOverloads.ts, 12, 42), Decl(memberFunctionsWithPublicOverloads.ts, 14, 31), Decl(memberFunctionsWithPublicOverloads.ts, 15, 33), Decl(memberFunctionsWithPublicOverloads.ts, 16, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 15, 22)) + + public static bar(x: number, y: string); +>bar : Symbol(C.bar, Decl(memberFunctionsWithPublicOverloads.ts, 12, 42), Decl(memberFunctionsWithPublicOverloads.ts, 14, 31), Decl(memberFunctionsWithPublicOverloads.ts, 15, 33), Decl(memberFunctionsWithPublicOverloads.ts, 16, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 16, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 16, 32)) + + public static bar(x: any, y?: any) { } +>bar : Symbol(C.bar, Decl(memberFunctionsWithPublicOverloads.ts, 12, 42), Decl(memberFunctionsWithPublicOverloads.ts, 14, 31), Decl(memberFunctionsWithPublicOverloads.ts, 15, 33), Decl(memberFunctionsWithPublicOverloads.ts, 16, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 17, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 17, 29)) +} + +class D { +>D : Symbol(D, Decl(memberFunctionsWithPublicOverloads.ts, 18, 1)) +>T : Symbol(T, Decl(memberFunctionsWithPublicOverloads.ts, 20, 8)) + + public foo(x: number); +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 20, 12), Decl(memberFunctionsWithPublicOverloads.ts, 21, 26), Decl(memberFunctionsWithPublicOverloads.ts, 22, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 21, 15)) + + public foo(x: T, y: T); +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 20, 12), Decl(memberFunctionsWithPublicOverloads.ts, 21, 26), Decl(memberFunctionsWithPublicOverloads.ts, 22, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 22, 15)) +>T : Symbol(T, Decl(memberFunctionsWithPublicOverloads.ts, 20, 8)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 22, 20)) +>T : Symbol(T, Decl(memberFunctionsWithPublicOverloads.ts, 20, 8)) + + public foo(x: any, y?: any) { } +>foo : Symbol(foo, Decl(memberFunctionsWithPublicOverloads.ts, 20, 12), Decl(memberFunctionsWithPublicOverloads.ts, 21, 26), Decl(memberFunctionsWithPublicOverloads.ts, 22, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 23, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 23, 22)) + + public bar(x: 'hi'); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 23, 35), Decl(memberFunctionsWithPublicOverloads.ts, 25, 24), Decl(memberFunctionsWithPublicOverloads.ts, 26, 26), Decl(memberFunctionsWithPublicOverloads.ts, 27, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 25, 15)) + + public bar(x: string); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 23, 35), Decl(memberFunctionsWithPublicOverloads.ts, 25, 24), Decl(memberFunctionsWithPublicOverloads.ts, 26, 26), Decl(memberFunctionsWithPublicOverloads.ts, 27, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 26, 15)) + + public bar(x: T, y: T); +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 23, 35), Decl(memberFunctionsWithPublicOverloads.ts, 25, 24), Decl(memberFunctionsWithPublicOverloads.ts, 26, 26), Decl(memberFunctionsWithPublicOverloads.ts, 27, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 27, 15)) +>T : Symbol(T, Decl(memberFunctionsWithPublicOverloads.ts, 20, 8)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 27, 20)) +>T : Symbol(T, Decl(memberFunctionsWithPublicOverloads.ts, 20, 8)) + + public bar(x: any, y?: any) { } +>bar : Symbol(bar, Decl(memberFunctionsWithPublicOverloads.ts, 23, 35), Decl(memberFunctionsWithPublicOverloads.ts, 25, 24), Decl(memberFunctionsWithPublicOverloads.ts, 26, 26), Decl(memberFunctionsWithPublicOverloads.ts, 27, 27)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 28, 15)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 28, 22)) + + public static foo(x: number); +>foo : Symbol(D.foo, Decl(memberFunctionsWithPublicOverloads.ts, 28, 35), Decl(memberFunctionsWithPublicOverloads.ts, 30, 33), Decl(memberFunctionsWithPublicOverloads.ts, 31, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 30, 22)) + + public static foo(x: number, y: string); +>foo : Symbol(D.foo, Decl(memberFunctionsWithPublicOverloads.ts, 28, 35), Decl(memberFunctionsWithPublicOverloads.ts, 30, 33), Decl(memberFunctionsWithPublicOverloads.ts, 31, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 31, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 31, 32)) + + public static foo(x: any, y?: any) { } +>foo : Symbol(D.foo, Decl(memberFunctionsWithPublicOverloads.ts, 28, 35), Decl(memberFunctionsWithPublicOverloads.ts, 30, 33), Decl(memberFunctionsWithPublicOverloads.ts, 31, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 32, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 32, 29)) + + public static bar(x: 'hi'); +>bar : Symbol(D.bar, Decl(memberFunctionsWithPublicOverloads.ts, 32, 42), Decl(memberFunctionsWithPublicOverloads.ts, 34, 31), Decl(memberFunctionsWithPublicOverloads.ts, 35, 33), Decl(memberFunctionsWithPublicOverloads.ts, 36, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 34, 22)) + + public static bar(x: string); +>bar : Symbol(D.bar, Decl(memberFunctionsWithPublicOverloads.ts, 32, 42), Decl(memberFunctionsWithPublicOverloads.ts, 34, 31), Decl(memberFunctionsWithPublicOverloads.ts, 35, 33), Decl(memberFunctionsWithPublicOverloads.ts, 36, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 35, 22)) + + public static bar(x: number, y: string); +>bar : Symbol(D.bar, Decl(memberFunctionsWithPublicOverloads.ts, 32, 42), Decl(memberFunctionsWithPublicOverloads.ts, 34, 31), Decl(memberFunctionsWithPublicOverloads.ts, 35, 33), Decl(memberFunctionsWithPublicOverloads.ts, 36, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 36, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 36, 32)) + + public static bar(x: any, y?: any) { } +>bar : Symbol(D.bar, Decl(memberFunctionsWithPublicOverloads.ts, 32, 42), Decl(memberFunctionsWithPublicOverloads.ts, 34, 31), Decl(memberFunctionsWithPublicOverloads.ts, 35, 33), Decl(memberFunctionsWithPublicOverloads.ts, 36, 44)) +>x : Symbol(x, Decl(memberFunctionsWithPublicOverloads.ts, 37, 22)) +>y : Symbol(y, Decl(memberFunctionsWithPublicOverloads.ts, 37, 29)) + +} diff --git a/tests/baselines/reference/memberVariableDeclarations1.symbols b/tests/baselines/reference/memberVariableDeclarations1.symbols new file mode 100644 index 00000000000..fbd3529262b --- /dev/null +++ b/tests/baselines/reference/memberVariableDeclarations1.symbols @@ -0,0 +1,78 @@ +=== tests/cases/compiler/memberVariableDeclarations1.ts === +// from spec + +class Employee { +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) + + public name: string; +>name : Symbol(name, Decl(memberVariableDeclarations1.ts, 2, 16)) + + public address: string; +>address : Symbol(address, Decl(memberVariableDeclarations1.ts, 3, 24)) + + public retired = false; +>retired : Symbol(retired, Decl(memberVariableDeclarations1.ts, 4, 27)) + + public manager: Employee = null; +>manager : Symbol(manager, Decl(memberVariableDeclarations1.ts, 5, 27)) +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) + + public reports: Employee[] = []; +>reports : Symbol(reports, Decl(memberVariableDeclarations1.ts, 6, 36)) +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) +} + +class Employee2 { +>Employee2 : Symbol(Employee2, Decl(memberVariableDeclarations1.ts, 8, 1)) + + public name: string; +>name : Symbol(name, Decl(memberVariableDeclarations1.ts, 10, 17)) + + public address: string; +>address : Symbol(address, Decl(memberVariableDeclarations1.ts, 11, 24)) + + public retired: boolean; +>retired : Symbol(retired, Decl(memberVariableDeclarations1.ts, 12, 27)) + + public manager: Employee; +>manager : Symbol(manager, Decl(memberVariableDeclarations1.ts, 13, 28)) +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) + + public reports: Employee[]; +>reports : Symbol(reports, Decl(memberVariableDeclarations1.ts, 14, 29)) +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) + + constructor() { + this.retired = false; +>this.retired : Symbol(retired, Decl(memberVariableDeclarations1.ts, 12, 27)) +>this : Symbol(Employee2, Decl(memberVariableDeclarations1.ts, 8, 1)) +>retired : Symbol(retired, Decl(memberVariableDeclarations1.ts, 12, 27)) + + this.manager = null; +>this.manager : Symbol(manager, Decl(memberVariableDeclarations1.ts, 13, 28)) +>this : Symbol(Employee2, Decl(memberVariableDeclarations1.ts, 8, 1)) +>manager : Symbol(manager, Decl(memberVariableDeclarations1.ts, 13, 28)) + + this.reports = []; +>this.reports : Symbol(reports, Decl(memberVariableDeclarations1.ts, 14, 29)) +>this : Symbol(Employee2, Decl(memberVariableDeclarations1.ts, 8, 1)) +>reports : Symbol(reports, Decl(memberVariableDeclarations1.ts, 14, 29)) + } +} + +var e1: Employee; +>e1 : Symbol(e1, Decl(memberVariableDeclarations1.ts, 23, 3)) +>Employee : Symbol(Employee, Decl(memberVariableDeclarations1.ts, 0, 0)) + +var e2: Employee2; +>e2 : Symbol(e2, Decl(memberVariableDeclarations1.ts, 24, 3)) +>Employee2 : Symbol(Employee2, Decl(memberVariableDeclarations1.ts, 8, 1)) + +e1 = e2; +>e1 : Symbol(e1, Decl(memberVariableDeclarations1.ts, 23, 3)) +>e2 : Symbol(e2, Decl(memberVariableDeclarations1.ts, 24, 3)) + +e2 = e1; +>e2 : Symbol(e2, Decl(memberVariableDeclarations1.ts, 24, 3)) +>e1 : Symbol(e1, Decl(memberVariableDeclarations1.ts, 23, 3)) + diff --git a/tests/baselines/reference/memberVariableDeclarations1.types b/tests/baselines/reference/memberVariableDeclarations1.types index 4dd68cdeb35..9aec8aa12aa 100644 --- a/tests/baselines/reference/memberVariableDeclarations1.types +++ b/tests/baselines/reference/memberVariableDeclarations1.types @@ -12,10 +12,12 @@ class Employee { public retired = false; >retired : boolean +>false : boolean public manager: Employee = null; >manager : Employee >Employee : Employee +>null : null public reports: Employee[] = []; >reports : Employee[] @@ -49,12 +51,14 @@ class Employee2 { >this.retired : boolean >this : Employee2 >retired : boolean +>false : boolean this.manager = null; >this.manager = null : null >this.manager : Employee >this : Employee2 >manager : Employee +>null : null this.reports = []; >this.reports = [] : undefined[] diff --git a/tests/baselines/reference/mergeThreeInterfaces.symbols b/tests/baselines/reference/mergeThreeInterfaces.symbols new file mode 100644 index 00000000000..24bebf49de6 --- /dev/null +++ b/tests/baselines/reference/mergeThreeInterfaces.symbols @@ -0,0 +1,197 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergeThreeInterfaces.ts === +// interfaces with the same root module should merge + +// basic case +interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1)) + + foo: string; +>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 3, 13)) +} + +interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1)) + + bar: number; +>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 7, 13)) +} + +interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1)) + + baz: boolean; +>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 11, 13)) +} + +var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3)) +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 0, 0), Decl(mergeThreeInterfaces.ts, 5, 1), Decl(mergeThreeInterfaces.ts, 9, 1)) + +var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeThreeInterfaces.ts, 16, 3)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 3, 13)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 3, 13)) + +var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces.ts, 17, 3)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 7, 13)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 7, 13)) + +var r3 = a.baz; +>r3 : Symbol(r3, Decl(mergeThreeInterfaces.ts, 18, 3)) +>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 11, 13)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 15, 3)) +>baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 11, 13)) + +// basic generic case +interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) + + foo: T; +>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 21, 16)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) +} + +interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) + + bar: T; +>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 25, 16)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) +} + +interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) + + baz: T; +>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 29, 16)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 21, 12), Decl(mergeThreeInterfaces.ts, 25, 12), Decl(mergeThreeInterfaces.ts, 29, 12)) +} + +var b: B; +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3)) +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 18, 15), Decl(mergeThreeInterfaces.ts, 23, 1), Decl(mergeThreeInterfaces.ts, 27, 1)) + +var r4 = b.foo +>r4 : Symbol(r4, Decl(mergeThreeInterfaces.ts, 34, 3)) +>b.foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 21, 16)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3)) +>foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 21, 16)) + +var r5 = b.bar; +>r5 : Symbol(r5, Decl(mergeThreeInterfaces.ts, 35, 3)) +>b.bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 25, 16)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3)) +>bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 25, 16)) + +var r6 = b.baz; +>r6 : Symbol(r6, Decl(mergeThreeInterfaces.ts, 36, 3)) +>b.baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 29, 16)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 33, 3)) +>baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 29, 16)) + +// basic non-generic and generic case inside a module +module M { +>M : Symbol(M, Decl(mergeThreeInterfaces.ts, 36, 15)) + + interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5)) + + foo: string; +>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 40, 17)) + } + + interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5)) + + bar: number; +>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 44, 17)) + } + + interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5)) + + baz: boolean; +>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 48, 17)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7)) +>A : Symbol(A, Decl(mergeThreeInterfaces.ts, 39, 10), Decl(mergeThreeInterfaces.ts, 42, 5), Decl(mergeThreeInterfaces.ts, 46, 5)) + + var r1 = a.foo; +>r1 : Symbol(r1, Decl(mergeThreeInterfaces.ts, 53, 7)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 40, 17)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces.ts, 40, 17)) + + // BUG 856491 + var r2 = a.bar; // any, should be number +>r2 : Symbol(r2, Decl(mergeThreeInterfaces.ts, 55, 7)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 44, 17)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces.ts, 44, 17)) + + // BUG 856491 + var r3 = a.baz; // any, should be boolean +>r3 : Symbol(r3, Decl(mergeThreeInterfaces.ts, 57, 7)) +>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 48, 17)) +>a : Symbol(a, Decl(mergeThreeInterfaces.ts, 52, 7)) +>baz : Symbol(A.baz, Decl(mergeThreeInterfaces.ts, 48, 17)) + + interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + + foo: T; +>foo : Symbol(foo, Decl(mergeThreeInterfaces.ts, 59, 20)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + } + + interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + + bar: T; +>bar : Symbol(bar, Decl(mergeThreeInterfaces.ts, 63, 20)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + } + + interface B { +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + + baz: T; +>baz : Symbol(baz, Decl(mergeThreeInterfaces.ts, 67, 20)) +>T : Symbol(T, Decl(mergeThreeInterfaces.ts, 59, 16), Decl(mergeThreeInterfaces.ts, 63, 16), Decl(mergeThreeInterfaces.ts, 67, 16)) + } + + var b: B; +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7)) +>B : Symbol(B, Decl(mergeThreeInterfaces.ts, 57, 19), Decl(mergeThreeInterfaces.ts, 61, 5), Decl(mergeThreeInterfaces.ts, 65, 5)) + + var r4 = b.foo +>r4 : Symbol(r4, Decl(mergeThreeInterfaces.ts, 72, 7)) +>b.foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 59, 20)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7)) +>foo : Symbol(B.foo, Decl(mergeThreeInterfaces.ts, 59, 20)) + + // BUG 856491 + var r5 = b.bar; // any, should be number +>r5 : Symbol(r5, Decl(mergeThreeInterfaces.ts, 74, 7)) +>b.bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 63, 20)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7)) +>bar : Symbol(B.bar, Decl(mergeThreeInterfaces.ts, 63, 20)) + + // BUG 856491 + var r6 = b.baz; // any, should be boolean +>r6 : Symbol(r6, Decl(mergeThreeInterfaces.ts, 76, 7)) +>b.baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 67, 20)) +>b : Symbol(b, Decl(mergeThreeInterfaces.ts, 71, 7)) +>baz : Symbol(B.baz, Decl(mergeThreeInterfaces.ts, 67, 20)) +} diff --git a/tests/baselines/reference/mergeThreeInterfaces2.symbols b/tests/baselines/reference/mergeThreeInterfaces2.symbols new file mode 100644 index 00000000000..66942fd660d --- /dev/null +++ b/tests/baselines/reference/mergeThreeInterfaces2.symbols @@ -0,0 +1,176 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergeThreeInterfaces2.ts === +// two interfaces with the same root module should merge + +// root module now multiple module declarations +module M2 { +>M2 : Symbol(M2, Decl(mergeThreeInterfaces2.ts, 0, 0), Decl(mergeThreeInterfaces2.ts, 11, 1), Decl(mergeThreeInterfaces2.ts, 26, 1), Decl(mergeThreeInterfaces2.ts, 39, 1), Decl(mergeThreeInterfaces2.ts, 53, 1)) + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 3, 11), Decl(mergeThreeInterfaces2.ts, 13, 11), Decl(mergeThreeInterfaces2.ts, 16, 5)) + + foo: string; +>foo : Symbol(foo, Decl(mergeThreeInterfaces2.ts, 4, 24)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 8, 7)) +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 3, 11), Decl(mergeThreeInterfaces2.ts, 13, 11), Decl(mergeThreeInterfaces2.ts, 16, 5)) + + var r1 = a.foo; +>r1 : Symbol(r1, Decl(mergeThreeInterfaces2.ts, 9, 7)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 4, 24)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 8, 7)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 4, 24)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces2.ts, 10, 7)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 14, 24)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 8, 7)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 14, 24)) +} + +module M2 { +>M2 : Symbol(M2, Decl(mergeThreeInterfaces2.ts, 0, 0), Decl(mergeThreeInterfaces2.ts, 11, 1), Decl(mergeThreeInterfaces2.ts, 26, 1), Decl(mergeThreeInterfaces2.ts, 39, 1), Decl(mergeThreeInterfaces2.ts, 53, 1)) + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 3, 11), Decl(mergeThreeInterfaces2.ts, 13, 11), Decl(mergeThreeInterfaces2.ts, 16, 5)) + + bar: number; +>bar : Symbol(bar, Decl(mergeThreeInterfaces2.ts, 14, 24)) + } + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 3, 11), Decl(mergeThreeInterfaces2.ts, 13, 11), Decl(mergeThreeInterfaces2.ts, 16, 5)) + + baz: boolean; +>baz : Symbol(baz, Decl(mergeThreeInterfaces2.ts, 18, 24)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 22, 7)) +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 3, 11), Decl(mergeThreeInterfaces2.ts, 13, 11), Decl(mergeThreeInterfaces2.ts, 16, 5)) + + var r1 = a.foo; +>r1 : Symbol(r1, Decl(mergeThreeInterfaces2.ts, 23, 7)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 4, 24)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 22, 7)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 4, 24)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces2.ts, 24, 7)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 14, 24)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 22, 7)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 14, 24)) + + var r3 = a.baz; +>r3 : Symbol(r3, Decl(mergeThreeInterfaces2.ts, 25, 7)) +>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 18, 24)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 22, 7)) +>baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 18, 24)) +} + +// same as above but with an additional level of nesting and third module declaration +module M2 { +>M2 : Symbol(M2, Decl(mergeThreeInterfaces2.ts, 0, 0), Decl(mergeThreeInterfaces2.ts, 11, 1), Decl(mergeThreeInterfaces2.ts, 26, 1), Decl(mergeThreeInterfaces2.ts, 39, 1), Decl(mergeThreeInterfaces2.ts, 53, 1)) + + export module M3 { +>M3 : Symbol(M3, Decl(mergeThreeInterfaces2.ts, 29, 11), Decl(mergeThreeInterfaces2.ts, 41, 11), Decl(mergeThreeInterfaces2.ts, 55, 11)) + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + foo: string; +>foo : Symbol(foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 35, 11)) +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + var r1 = a.foo; +>r1 : Symbol(r1, Decl(mergeThreeInterfaces2.ts, 36, 11)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 35, 11)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces2.ts, 37, 11)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 35, 11)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(mergeThreeInterfaces2.ts, 0, 0), Decl(mergeThreeInterfaces2.ts, 11, 1), Decl(mergeThreeInterfaces2.ts, 26, 1), Decl(mergeThreeInterfaces2.ts, 39, 1), Decl(mergeThreeInterfaces2.ts, 53, 1)) + + export module M3 { +>M3 : Symbol(M3, Decl(mergeThreeInterfaces2.ts, 29, 11), Decl(mergeThreeInterfaces2.ts, 41, 11), Decl(mergeThreeInterfaces2.ts, 55, 11)) + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + bar: number; +>bar : Symbol(bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 47, 11)) +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeThreeInterfaces2.ts, 49, 11)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 47, 11)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces2.ts, 50, 11)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 47, 11)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) + + var r3 = a.baz; +>r3 : Symbol(r3, Decl(mergeThreeInterfaces2.ts, 51, 11)) +>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 57, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 47, 11)) +>baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 57, 28)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(mergeThreeInterfaces2.ts, 0, 0), Decl(mergeThreeInterfaces2.ts, 11, 1), Decl(mergeThreeInterfaces2.ts, 26, 1), Decl(mergeThreeInterfaces2.ts, 39, 1), Decl(mergeThreeInterfaces2.ts, 53, 1)) + + export module M3 { +>M3 : Symbol(M3, Decl(mergeThreeInterfaces2.ts, 29, 11), Decl(mergeThreeInterfaces2.ts, 41, 11), Decl(mergeThreeInterfaces2.ts, 55, 11)) + + export interface A { +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + baz: boolean; +>baz : Symbol(baz, Decl(mergeThreeInterfaces2.ts, 57, 28)) + } + + var a: A; +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 61, 11)) +>A : Symbol(A, Decl(mergeThreeInterfaces2.ts, 30, 22), Decl(mergeThreeInterfaces2.ts, 42, 22), Decl(mergeThreeInterfaces2.ts, 56, 22)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeThreeInterfaces2.ts, 62, 11)) +>a.foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 61, 11)) +>foo : Symbol(A.foo, Decl(mergeThreeInterfaces2.ts, 31, 28)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeThreeInterfaces2.ts, 63, 11)) +>a.bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 61, 11)) +>bar : Symbol(A.bar, Decl(mergeThreeInterfaces2.ts, 43, 28)) + + var r3 = a.baz; +>r3 : Symbol(r3, Decl(mergeThreeInterfaces2.ts, 64, 11)) +>a.baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 57, 28)) +>a : Symbol(a, Decl(mergeThreeInterfaces2.ts, 61, 11)) +>baz : Symbol(A.baz, Decl(mergeThreeInterfaces2.ts, 57, 28)) + } +} diff --git a/tests/baselines/reference/mergeTwoInterfaces.symbols b/tests/baselines/reference/mergeTwoInterfaces.symbols new file mode 100644 index 00000000000..d34ad6ec9a2 --- /dev/null +++ b/tests/baselines/reference/mergeTwoInterfaces.symbols @@ -0,0 +1,142 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergeTwoInterfaces.ts === +// two interfaces with the same root module should merge + +// basic case +interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 0, 0), Decl(mergeTwoInterfaces.ts, 5, 1)) + + foo: string; +>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 3, 13)) +} + +interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 0, 0), Decl(mergeTwoInterfaces.ts, 5, 1)) + + bar: number; +>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 7, 13)) +} + +var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 11, 3)) +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 0, 0), Decl(mergeTwoInterfaces.ts, 5, 1)) + +var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeTwoInterfaces.ts, 12, 3)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 3, 13)) +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 11, 3)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 3, 13)) + +var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeTwoInterfaces.ts, 13, 3)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 7, 13)) +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 11, 3)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 7, 13)) + +// basic generic case +interface B { +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 13, 15), Decl(mergeTwoInterfaces.ts, 19, 1)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12)) + + baz: string; +>baz : Symbol(baz, Decl(mergeTwoInterfaces.ts, 16, 16)) + + foo: T; +>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 17, 16)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12)) +} + +interface B { +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 13, 15), Decl(mergeTwoInterfaces.ts, 19, 1)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12)) + + bar: T; +>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 21, 16)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 16, 12), Decl(mergeTwoInterfaces.ts, 21, 12)) +} + +var b: B; +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 25, 3)) +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 13, 15), Decl(mergeTwoInterfaces.ts, 19, 1)) + +var r3 = b.foo +>r3 : Symbol(r3, Decl(mergeTwoInterfaces.ts, 26, 3)) +>b.foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 17, 16)) +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 25, 3)) +>foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 17, 16)) + +var r4 = b.bar; +>r4 : Symbol(r4, Decl(mergeTwoInterfaces.ts, 27, 3)) +>b.bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 21, 16)) +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 25, 3)) +>bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 21, 16)) + +// basic non-generic and generic case inside a module +module M { +>M : Symbol(M, Decl(mergeTwoInterfaces.ts, 27, 15)) + + interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 30, 10), Decl(mergeTwoInterfaces.ts, 33, 5)) + + foo: string; +>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 31, 17)) + } + + interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 30, 10), Decl(mergeTwoInterfaces.ts, 33, 5)) + + bar: number; +>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 35, 17)) + } + + var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 39, 7)) +>A : Symbol(A, Decl(mergeTwoInterfaces.ts, 30, 10), Decl(mergeTwoInterfaces.ts, 33, 5)) + + var r1 = a.foo; +>r1 : Symbol(r1, Decl(mergeTwoInterfaces.ts, 40, 7)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 31, 17)) +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 39, 7)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces.ts, 31, 17)) + + // BUG 856491 + var r2 = a.bar; // any, should be number +>r2 : Symbol(r2, Decl(mergeTwoInterfaces.ts, 42, 7)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 35, 17)) +>a : Symbol(a, Decl(mergeTwoInterfaces.ts, 39, 7)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces.ts, 35, 17)) + + interface B { +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 42, 19), Decl(mergeTwoInterfaces.ts, 46, 5)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16)) + + foo: T; +>foo : Symbol(foo, Decl(mergeTwoInterfaces.ts, 44, 20)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16)) + } + + interface B { +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 42, 19), Decl(mergeTwoInterfaces.ts, 46, 5)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16)) + + bar: T; +>bar : Symbol(bar, Decl(mergeTwoInterfaces.ts, 48, 20)) +>T : Symbol(T, Decl(mergeTwoInterfaces.ts, 44, 16), Decl(mergeTwoInterfaces.ts, 48, 16)) + } + + var b: B; +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 52, 7)) +>B : Symbol(B, Decl(mergeTwoInterfaces.ts, 42, 19), Decl(mergeTwoInterfaces.ts, 46, 5)) + + var r3 = b.foo +>r3 : Symbol(r3, Decl(mergeTwoInterfaces.ts, 53, 7)) +>b.foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 44, 20)) +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 52, 7)) +>foo : Symbol(B.foo, Decl(mergeTwoInterfaces.ts, 44, 20)) + + // BUG 856491 + var r4 = b.bar; // any, should be string +>r4 : Symbol(r4, Decl(mergeTwoInterfaces.ts, 55, 7)) +>b.bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 48, 20)) +>b : Symbol(b, Decl(mergeTwoInterfaces.ts, 52, 7)) +>bar : Symbol(B.bar, Decl(mergeTwoInterfaces.ts, 48, 20)) +} diff --git a/tests/baselines/reference/mergeTwoInterfaces2.symbols b/tests/baselines/reference/mergeTwoInterfaces2.symbols new file mode 100644 index 00000000000..661fbdc14d4 --- /dev/null +++ b/tests/baselines/reference/mergeTwoInterfaces2.symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergeTwoInterfaces2.ts === +// two interfaces with the same root module should merge + +// root module now multiple module declarations +module M2 { +>M2 : Symbol(M2, Decl(mergeTwoInterfaces2.ts, 0, 0), Decl(mergeTwoInterfaces2.ts, 11, 1), Decl(mergeTwoInterfaces2.ts, 21, 1), Decl(mergeTwoInterfaces2.ts, 34, 1)) + + export interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 3, 11), Decl(mergeTwoInterfaces2.ts, 13, 11)) + + foo: string; +>foo : Symbol(foo, Decl(mergeTwoInterfaces2.ts, 4, 24)) + } + + var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 8, 7)) +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 3, 11), Decl(mergeTwoInterfaces2.ts, 13, 11)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeTwoInterfaces2.ts, 9, 7)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 4, 24)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 8, 7)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 4, 24)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeTwoInterfaces2.ts, 10, 7)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 14, 24)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 8, 7)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 14, 24)) +} + +module M2 { +>M2 : Symbol(M2, Decl(mergeTwoInterfaces2.ts, 0, 0), Decl(mergeTwoInterfaces2.ts, 11, 1), Decl(mergeTwoInterfaces2.ts, 21, 1), Decl(mergeTwoInterfaces2.ts, 34, 1)) + + export interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 3, 11), Decl(mergeTwoInterfaces2.ts, 13, 11)) + + bar: number; +>bar : Symbol(bar, Decl(mergeTwoInterfaces2.ts, 14, 24)) + } + + var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 18, 7)) +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 3, 11), Decl(mergeTwoInterfaces2.ts, 13, 11)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeTwoInterfaces2.ts, 19, 7)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 4, 24)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 18, 7)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 4, 24)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeTwoInterfaces2.ts, 20, 7)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 14, 24)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 18, 7)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 14, 24)) +} + +// same as above but with an additional level of nesting +module M2 { +>M2 : Symbol(M2, Decl(mergeTwoInterfaces2.ts, 0, 0), Decl(mergeTwoInterfaces2.ts, 11, 1), Decl(mergeTwoInterfaces2.ts, 21, 1), Decl(mergeTwoInterfaces2.ts, 34, 1)) + + export module M3 { +>M3 : Symbol(M3, Decl(mergeTwoInterfaces2.ts, 24, 11), Decl(mergeTwoInterfaces2.ts, 36, 11)) + + export interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 25, 22), Decl(mergeTwoInterfaces2.ts, 37, 22)) + + foo: string; +>foo : Symbol(foo, Decl(mergeTwoInterfaces2.ts, 26, 28)) + } + + var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 30, 11)) +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 25, 22), Decl(mergeTwoInterfaces2.ts, 37, 22)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeTwoInterfaces2.ts, 31, 11)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 26, 28)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 30, 11)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 26, 28)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeTwoInterfaces2.ts, 32, 11)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 38, 28)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 30, 11)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 38, 28)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(mergeTwoInterfaces2.ts, 0, 0), Decl(mergeTwoInterfaces2.ts, 11, 1), Decl(mergeTwoInterfaces2.ts, 21, 1), Decl(mergeTwoInterfaces2.ts, 34, 1)) + + export module M3 { +>M3 : Symbol(M3, Decl(mergeTwoInterfaces2.ts, 24, 11), Decl(mergeTwoInterfaces2.ts, 36, 11)) + + export interface A { +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 25, 22), Decl(mergeTwoInterfaces2.ts, 37, 22)) + + bar: number; +>bar : Symbol(bar, Decl(mergeTwoInterfaces2.ts, 38, 28)) + } + + var a: A; +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 42, 11)) +>A : Symbol(A, Decl(mergeTwoInterfaces2.ts, 25, 22), Decl(mergeTwoInterfaces2.ts, 37, 22)) + + var r1 = a.foo +>r1 : Symbol(r1, Decl(mergeTwoInterfaces2.ts, 43, 11)) +>a.foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 26, 28)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 42, 11)) +>foo : Symbol(A.foo, Decl(mergeTwoInterfaces2.ts, 26, 28)) + + var r2 = a.bar; +>r2 : Symbol(r2, Decl(mergeTwoInterfaces2.ts, 44, 11)) +>a.bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 38, 28)) +>a : Symbol(a, Decl(mergeTwoInterfaces2.ts, 42, 11)) +>bar : Symbol(A.bar, Decl(mergeTwoInterfaces2.ts, 38, 28)) + } +} diff --git a/tests/baselines/reference/mergedDeclarations1.symbols b/tests/baselines/reference/mergedDeclarations1.symbols new file mode 100644 index 00000000000..733b9c4ee32 --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations1.symbols @@ -0,0 +1,69 @@ +=== tests/cases/compiler/mergedDeclarations1.ts === +interface Point { +>Point : Symbol(Point, Decl(mergedDeclarations1.ts, 0, 0)) + + x: number; +>x : Symbol(x, Decl(mergedDeclarations1.ts, 0, 17)) + + y: number; +>y : Symbol(y, Decl(mergedDeclarations1.ts, 1, 14)) +} +function point(x: number, y: number): Point { +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) +>x : Symbol(x, Decl(mergedDeclarations1.ts, 4, 15)) +>y : Symbol(y, Decl(mergedDeclarations1.ts, 4, 25)) +>Point : Symbol(Point, Decl(mergedDeclarations1.ts, 0, 0)) + + return { x: x, y: y }; +>x : Symbol(x, Decl(mergedDeclarations1.ts, 5, 12)) +>x : Symbol(x, Decl(mergedDeclarations1.ts, 4, 15)) +>y : Symbol(y, Decl(mergedDeclarations1.ts, 5, 18)) +>y : Symbol(y, Decl(mergedDeclarations1.ts, 4, 25)) +} +module point { +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) + + export var origin = point(0, 0); +>origin : Symbol(origin, Decl(mergedDeclarations1.ts, 8, 14)) +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) + + export function equals(p1: Point, p2: Point) { +>equals : Symbol(equals, Decl(mergedDeclarations1.ts, 8, 36)) +>p1 : Symbol(p1, Decl(mergedDeclarations1.ts, 9, 27)) +>Point : Symbol(Point, Decl(mergedDeclarations1.ts, 0, 0)) +>p2 : Symbol(p2, Decl(mergedDeclarations1.ts, 9, 37)) +>Point : Symbol(Point, Decl(mergedDeclarations1.ts, 0, 0)) + + return p1.x == p2.x && p1.y == p2.y; +>p1.x : Symbol(Point.x, Decl(mergedDeclarations1.ts, 0, 17)) +>p1 : Symbol(p1, Decl(mergedDeclarations1.ts, 9, 27)) +>x : Symbol(Point.x, Decl(mergedDeclarations1.ts, 0, 17)) +>p2.x : Symbol(Point.x, Decl(mergedDeclarations1.ts, 0, 17)) +>p2 : Symbol(p2, Decl(mergedDeclarations1.ts, 9, 37)) +>x : Symbol(Point.x, Decl(mergedDeclarations1.ts, 0, 17)) +>p1.y : Symbol(Point.y, Decl(mergedDeclarations1.ts, 1, 14)) +>p1 : Symbol(p1, Decl(mergedDeclarations1.ts, 9, 27)) +>y : Symbol(Point.y, Decl(mergedDeclarations1.ts, 1, 14)) +>p2.y : Symbol(Point.y, Decl(mergedDeclarations1.ts, 1, 14)) +>p2 : Symbol(p2, Decl(mergedDeclarations1.ts, 9, 37)) +>y : Symbol(Point.y, Decl(mergedDeclarations1.ts, 1, 14)) + } +} +var p1 = point(0, 0); +>p1 : Symbol(p1, Decl(mergedDeclarations1.ts, 13, 3)) +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) + +var p2 = point.origin; +>p2 : Symbol(p2, Decl(mergedDeclarations1.ts, 14, 3)) +>point.origin : Symbol(point.origin, Decl(mergedDeclarations1.ts, 8, 14)) +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) +>origin : Symbol(point.origin, Decl(mergedDeclarations1.ts, 8, 14)) + +var b = point.equals(p1, p2); +>b : Symbol(b, Decl(mergedDeclarations1.ts, 15, 3)) +>point.equals : Symbol(point.equals, Decl(mergedDeclarations1.ts, 8, 36)) +>point : Symbol(point, Decl(mergedDeclarations1.ts, 3, 1), Decl(mergedDeclarations1.ts, 6, 1)) +>equals : Symbol(point.equals, Decl(mergedDeclarations1.ts, 8, 36)) +>p1 : Symbol(p1, Decl(mergedDeclarations1.ts, 13, 3)) +>p2 : Symbol(p2, Decl(mergedDeclarations1.ts, 14, 3)) + diff --git a/tests/baselines/reference/mergedDeclarations1.types b/tests/baselines/reference/mergedDeclarations1.types index 20249ab94e1..2a4f18947ce 100644 --- a/tests/baselines/reference/mergedDeclarations1.types +++ b/tests/baselines/reference/mergedDeclarations1.types @@ -28,6 +28,8 @@ module point { >origin : Point >point(0, 0) : Point >point : typeof point +>0 : number +>0 : number export function equals(p1: Point, p2: Point) { >equals : (p1: Point, p2: Point) => boolean @@ -58,6 +60,8 @@ var p1 = point(0, 0); >p1 : Point >point(0, 0) : Point >point : typeof point +>0 : number +>0 : number var p2 = point.origin; >p2 : Point diff --git a/tests/baselines/reference/mergedDeclarations4.symbols b/tests/baselines/reference/mergedDeclarations4.symbols new file mode 100644 index 00000000000..7cd2728843a --- /dev/null +++ b/tests/baselines/reference/mergedDeclarations4.symbols @@ -0,0 +1,58 @@ +=== tests/cases/compiler/mergedDeclarations4.ts === +module M { +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) + + export function f() { } +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + f(); +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + M.f(); +>M.f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + var r = f.hello; +>r : Symbol(r, Decl(mergedDeclarations4.ts, 4, 7)) +>f.hello : Symbol(f.hello, Decl(mergedDeclarations4.ts, 9, 18)) +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>hello : Symbol(f.hello, Decl(mergedDeclarations4.ts, 9, 18)) +} + +module M { +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) + + export module f { +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + export var hello = 1; +>hello : Symbol(hello, Decl(mergedDeclarations4.ts, 9, 18)) + } + f(); +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + M.f(); +>M.f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + + var r = f.hello; +>r : Symbol(r, Decl(mergedDeclarations4.ts, 13, 7)) +>f.hello : Symbol(f.hello, Decl(mergedDeclarations4.ts, 9, 18)) +>f : Symbol(f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>hello : Symbol(f.hello, Decl(mergedDeclarations4.ts, 9, 18)) +} + +M.f(); +>M.f : Symbol(M.f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) +>f : Symbol(M.f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) + +M.f.hello; +>M.f.hello : Symbol(M.f.hello, Decl(mergedDeclarations4.ts, 9, 18)) +>M.f : Symbol(M.f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>M : Symbol(M, Decl(mergedDeclarations4.ts, 0, 0), Decl(mergedDeclarations4.ts, 5, 1)) +>f : Symbol(M.f, Decl(mergedDeclarations4.ts, 0, 10), Decl(mergedDeclarations4.ts, 7, 10)) +>hello : Symbol(M.f.hello, Decl(mergedDeclarations4.ts, 9, 18)) + diff --git a/tests/baselines/reference/mergedDeclarations4.types b/tests/baselines/reference/mergedDeclarations4.types index 068a08d35f5..9c55747c6f6 100644 --- a/tests/baselines/reference/mergedDeclarations4.types +++ b/tests/baselines/reference/mergedDeclarations4.types @@ -30,6 +30,7 @@ module M { export var hello = 1; >hello : number +>1 : number } f(); >f() : void diff --git a/tests/baselines/reference/mergedEnumDeclarationCodeGen.symbols b/tests/baselines/reference/mergedEnumDeclarationCodeGen.symbols new file mode 100644 index 00000000000..7a15860d490 --- /dev/null +++ b/tests/baselines/reference/mergedEnumDeclarationCodeGen.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/mergedEnumDeclarationCodeGen.ts === +enum E { +>E : Symbol(E, Decl(mergedEnumDeclarationCodeGen.ts, 0, 0), Decl(mergedEnumDeclarationCodeGen.ts, 3, 1)) + + a, +>a : Symbol(E.a, Decl(mergedEnumDeclarationCodeGen.ts, 0, 8)) + + b = a +>b : Symbol(E.b, Decl(mergedEnumDeclarationCodeGen.ts, 1, 6)) +>a : Symbol(E.a, Decl(mergedEnumDeclarationCodeGen.ts, 0, 8)) +} +enum E { +>E : Symbol(E, Decl(mergedEnumDeclarationCodeGen.ts, 0, 0), Decl(mergedEnumDeclarationCodeGen.ts, 3, 1)) + + c = a +>c : Symbol(E.c, Decl(mergedEnumDeclarationCodeGen.ts, 4, 8)) +>a : Symbol(E.a, Decl(mergedEnumDeclarationCodeGen.ts, 0, 8)) +} diff --git a/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.symbols b/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.symbols new file mode 100644 index 00000000000..f34501f025b --- /dev/null +++ b/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/mergedInterfaceFromMultipleFiles1_1.ts === +/// + +interface D { bar(): number; } +>D : Symbol(D, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 0, 0)) +>bar : Symbol(bar, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 13)) + +interface C extends D { +>C : Symbol(C, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 30), Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 30)) +>D : Symbol(D, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 0, 0)) + + b(): Date; +>b : Symbol(b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 4, 23)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var c:C; +>c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) +>C : Symbol(C, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 30), Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 30)) + +var a: string = c.foo(); +>a : Symbol(a, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 9, 3)) +>c.foo : Symbol(I.foo, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 13)) +>c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) +>foo : Symbol(I.foo, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 13)) + +var b: number = c.bar(); +>b : Symbol(b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 10, 3)) +>c.bar : Symbol(D.bar, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 13)) +>c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) +>bar : Symbol(D.bar, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 13)) + +var d: number = c.a(); +>d : Symbol(d, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 11, 3)) +>c.a : Symbol(C.a, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 3, 23)) +>c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) +>a : Symbol(C.a, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 3, 23)) + +var e: Date = c.b(); +>e : Symbol(e, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 12, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>c.b : Symbol(C.b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 4, 23)) +>c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) +>b : Symbol(C.b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 4, 23)) + +=== tests/cases/compiler/mergedInterfaceFromMultipleFiles1_0.ts === + +interface I { foo(): string; } +>I : Symbol(I, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 0, 0)) +>foo : Symbol(foo, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 13)) + +interface C extends I { +>C : Symbol(C, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 1, 30), Decl(mergedInterfaceFromMultipleFiles1_1.ts, 2, 30)) +>I : Symbol(I, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 0, 0)) + + a(): number; +>a : Symbol(a, Decl(mergedInterfaceFromMultipleFiles1_0.ts, 3, 23)) +} + diff --git a/tests/baselines/reference/mergedInterfacesWithIndexers.symbols b/tests/baselines/reference/mergedInterfacesWithIndexers.symbols new file mode 100644 index 00000000000..b4e47c58878 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithIndexers.symbols @@ -0,0 +1,35 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithIndexers.ts === +// indexers should behave like other members when merging interface declarations + +interface A { +>A : Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1)) + + [x: number]: string; +>x : Symbol(x, Decl(mergedInterfacesWithIndexers.ts, 3, 5)) +} + + +interface A { +>A : Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1)) + + [x: string]: { length: number }; +>x : Symbol(x, Decl(mergedInterfacesWithIndexers.ts, 8, 5)) +>length : Symbol(length, Decl(mergedInterfacesWithIndexers.ts, 8, 18)) +} + +var a: A; +>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3)) +>A : Symbol(A, Decl(mergedInterfacesWithIndexers.ts, 0, 0), Decl(mergedInterfacesWithIndexers.ts, 4, 1)) + +var r = a[1]; +>r : Symbol(r, Decl(mergedInterfacesWithIndexers.ts, 12, 3)) +>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3)) + +var r2 = a['1']; +>r2 : Symbol(r2, Decl(mergedInterfacesWithIndexers.ts, 13, 3)) +>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3)) + +var r3 = a['hi']; +>r3 : Symbol(r3, Decl(mergedInterfacesWithIndexers.ts, 14, 3)) +>a : Symbol(a, Decl(mergedInterfacesWithIndexers.ts, 11, 3)) + diff --git a/tests/baselines/reference/mergedInterfacesWithIndexers.types b/tests/baselines/reference/mergedInterfacesWithIndexers.types index cd082153626..b228931660a 100644 --- a/tests/baselines/reference/mergedInterfacesWithIndexers.types +++ b/tests/baselines/reference/mergedInterfacesWithIndexers.types @@ -25,14 +25,17 @@ var r = a[1]; >r : string >a[1] : string >a : A +>1 : number var r2 = a['1']; >r2 : { length: number; } >a['1'] : { length: number; } >a : A +>'1' : string var r3 = a['hi']; >r3 : { length: number; } >a['hi'] : { length: number; } >a : A +>'hi' : string diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases.symbols b/tests/baselines/reference/mergedInterfacesWithMultipleBases.symbols new file mode 100644 index 00000000000..b3fe87bca29 --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases.symbols @@ -0,0 +1,121 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases.ts === +// merged interfaces behave as if all extends clauses from each declaration are merged together +// no errors expected + +class C { +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases.ts, 0, 0)) + + a: number; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 3, 9)) +} + +class C2 { +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases.ts, 5, 1)) + + b: number; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases.ts, 7, 10)) +} + +interface A extends C { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 9, 1), Decl(mergedInterfacesWithMultipleBases.ts, 13, 1)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases.ts, 0, 0)) + + y: string; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases.ts, 11, 23)) +} + +interface A extends C2 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 9, 1), Decl(mergedInterfacesWithMultipleBases.ts, 13, 1)) +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases.ts, 5, 1)) + + z: string; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases.ts, 15, 24)) +} + +class D implements A { +>D : Symbol(D, Decl(mergedInterfacesWithMultipleBases.ts, 17, 1)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 9, 1), Decl(mergedInterfacesWithMultipleBases.ts, 13, 1)) + + a: number; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 19, 22)) + + b: number; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases.ts, 20, 14)) + + y: string; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases.ts, 21, 14)) + + z: string; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases.ts, 22, 14)) +} + +var a: A; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 26, 3)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 9, 1), Decl(mergedInterfacesWithMultipleBases.ts, 13, 1)) + +var r = a.a; +>r : Symbol(r, Decl(mergedInterfacesWithMultipleBases.ts, 27, 3)) +>a.a : Symbol(C.a, Decl(mergedInterfacesWithMultipleBases.ts, 3, 9)) +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 26, 3)) +>a : Symbol(C.a, Decl(mergedInterfacesWithMultipleBases.ts, 3, 9)) + +// generic interfaces in a module +module M { +>M : Symbol(M, Decl(mergedInterfacesWithMultipleBases.ts, 27, 12)) + + class C { +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases.ts, 30, 10)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 31, 12)) + + a: T; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 31, 16)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 31, 12)) + } + + class C2 { +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases.ts, 33, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 35, 13)) + + b: T; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases.ts, 35, 17)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 35, 13)) + } + + interface A extends C { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 37, 5), Decl(mergedInterfacesWithMultipleBases.ts, 41, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 39, 16), Decl(mergedInterfacesWithMultipleBases.ts, 43, 16)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases.ts, 30, 10)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 39, 16), Decl(mergedInterfacesWithMultipleBases.ts, 43, 16)) + + y: T; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases.ts, 39, 33)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 39, 16), Decl(mergedInterfacesWithMultipleBases.ts, 43, 16)) + } + + interface A extends C2 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 37, 5), Decl(mergedInterfacesWithMultipleBases.ts, 41, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 39, 16), Decl(mergedInterfacesWithMultipleBases.ts, 43, 16)) +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases.ts, 33, 5)) + + z: T; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases.ts, 43, 39)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases.ts, 39, 16), Decl(mergedInterfacesWithMultipleBases.ts, 43, 16)) + } + + class D implements A { +>D : Symbol(D, Decl(mergedInterfacesWithMultipleBases.ts, 45, 5)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases.ts, 37, 5), Decl(mergedInterfacesWithMultipleBases.ts, 41, 5)) + + a: boolean; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases.ts, 47, 35)) + + b: string; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases.ts, 48, 19)) + + y: boolean; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases.ts, 49, 18)) + + z: boolean; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases.ts, 50, 19)) + } +} diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases2.symbols b/tests/baselines/reference/mergedInterfacesWithMultipleBases2.symbols new file mode 100644 index 00000000000..7424e0d110b --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases2.symbols @@ -0,0 +1,171 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases2.ts === +// merged interfaces behave as if all extends clauses from each declaration are merged together +// no errors expected + +class C { +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases2.ts, 0, 0)) + + a: number; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 3, 9)) +} + +class C2 { +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases2.ts, 5, 1)) + + b: number; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases2.ts, 7, 10)) +} + +class C3 { +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases2.ts, 9, 1)) + + c: string; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases2.ts, 11, 10)) +} + +class C4 { +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases2.ts, 13, 1)) + + d: string; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases2.ts, 15, 10)) +} + + +interface A extends C, C3 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases2.ts, 22, 1)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases2.ts, 0, 0)) +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases2.ts, 9, 1)) + + y: string; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases2.ts, 20, 27)) +} + +interface A extends C2, C4 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases2.ts, 22, 1)) +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases2.ts, 5, 1)) +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases2.ts, 13, 1)) + + z: string; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases2.ts, 24, 28)) +} + +class D implements A { +>D : Symbol(D, Decl(mergedInterfacesWithMultipleBases2.ts, 26, 1)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases2.ts, 22, 1)) + + a: number; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 28, 22)) + + b: number; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases2.ts, 29, 14)) + + c: string; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases2.ts, 30, 14)) + + d: string; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases2.ts, 31, 14)) + + y: string; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases2.ts, 32, 14)) + + z: string; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases2.ts, 33, 14)) +} + +var a: A; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 37, 3)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases2.ts, 22, 1)) + +var r = a.a; +>r : Symbol(r, Decl(mergedInterfacesWithMultipleBases2.ts, 38, 3)) +>a.a : Symbol(C.a, Decl(mergedInterfacesWithMultipleBases2.ts, 3, 9)) +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 37, 3)) +>a : Symbol(C.a, Decl(mergedInterfacesWithMultipleBases2.ts, 3, 9)) + +// generic interfaces in a module +module M { +>M : Symbol(M, Decl(mergedInterfacesWithMultipleBases2.ts, 38, 12)) + + class C { +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases2.ts, 41, 10)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 42, 12)) + + a: T; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 42, 16)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 42, 12)) + } + + class C2 { +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases2.ts, 44, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 46, 13)) + + b: T; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases2.ts, 46, 17)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 46, 13)) + } + + class C3 { +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases2.ts, 48, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 50, 13)) + + c: T; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases2.ts, 50, 17)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 50, 13)) + } + + class C4 { +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases2.ts, 52, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 54, 13)) + + d: T; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases2.ts, 54, 17)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 54, 13)) + } + + interface A extends C, C3 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 56, 5), Decl(mergedInterfacesWithMultipleBases2.ts, 60, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases2.ts, 41, 10)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases2.ts, 48, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) + + y: T; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 40)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) + } + + interface A extends C2, C4 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 56, 5), Decl(mergedInterfacesWithMultipleBases2.ts, 60, 5)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases2.ts, 44, 5)) +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases2.ts, 52, 5)) + + z: T; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases2.ts, 62, 51)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases2.ts, 58, 16), Decl(mergedInterfacesWithMultipleBases2.ts, 62, 16)) + } + + class D implements A { +>D : Symbol(D, Decl(mergedInterfacesWithMultipleBases2.ts, 64, 5)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases2.ts, 56, 5), Decl(mergedInterfacesWithMultipleBases2.ts, 60, 5)) + + a: boolean; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases2.ts, 66, 35)) + + b: string; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases2.ts, 67, 19)) + + c: boolean; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases2.ts, 68, 18)) + + d: string; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases2.ts, 69, 19)) + + y: boolean; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases2.ts, 70, 18)) + + z: boolean; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases2.ts, 71, 19)) + } +} diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases3.symbols b/tests/baselines/reference/mergedInterfacesWithMultipleBases3.symbols new file mode 100644 index 00000000000..337ef1dbb1c --- /dev/null +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases3.symbols @@ -0,0 +1,85 @@ +=== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithMultipleBases3.ts === +// merged interfaces behave as if all extends clauses from each declaration are merged together +// no errors expected + +class C { +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases3.ts, 0, 0)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 3, 8)) + + a: T; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases3.ts, 3, 12)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 3, 8)) +} + +class C2 { +>C2 : Symbol(C2, Decl(mergedInterfacesWithMultipleBases3.ts, 5, 1)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 7, 9)) + + b: T; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases3.ts, 7, 13)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 7, 9)) +} + +class C3 { +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases3.ts, 9, 1)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 11, 9)) + + c: T; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases3.ts, 11, 13)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 11, 9)) +} + +class C4 { +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases3.ts, 13, 1)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 15, 9)) + + d: T; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases3.ts, 15, 13)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 15, 9)) +} + +interface A extends C, C3 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases3.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases3.ts, 21, 1)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 19, 12), Decl(mergedInterfacesWithMultipleBases3.ts, 23, 12)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases3.ts, 0, 0)) +>C3 : Symbol(C3, Decl(mergedInterfacesWithMultipleBases3.ts, 9, 1)) + + y: T; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases3.ts, 19, 46)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 19, 12), Decl(mergedInterfacesWithMultipleBases3.ts, 23, 12)) +} + +interface A extends C, C4 { +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases3.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases3.ts, 21, 1)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 19, 12), Decl(mergedInterfacesWithMultipleBases3.ts, 23, 12)) +>C : Symbol(C, Decl(mergedInterfacesWithMultipleBases3.ts, 0, 0)) +>C4 : Symbol(C4, Decl(mergedInterfacesWithMultipleBases3.ts, 13, 1)) + + z: T; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases3.ts, 23, 46)) +>T : Symbol(T, Decl(mergedInterfacesWithMultipleBases3.ts, 19, 12), Decl(mergedInterfacesWithMultipleBases3.ts, 23, 12)) +} + +class D implements A { +>D : Symbol(D, Decl(mergedInterfacesWithMultipleBases3.ts, 25, 1)) +>A : Symbol(A, Decl(mergedInterfacesWithMultipleBases3.ts, 17, 1), Decl(mergedInterfacesWithMultipleBases3.ts, 21, 1)) + + a: string; +>a : Symbol(a, Decl(mergedInterfacesWithMultipleBases3.ts, 27, 31)) + + b: Date; +>b : Symbol(b, Decl(mergedInterfacesWithMultipleBases3.ts, 28, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + c: string; +>c : Symbol(c, Decl(mergedInterfacesWithMultipleBases3.ts, 29, 12)) + + d: string; +>d : Symbol(d, Decl(mergedInterfacesWithMultipleBases3.ts, 30, 14)) + + y: boolean; +>y : Symbol(y, Decl(mergedInterfacesWithMultipleBases3.ts, 31, 14)) + + z: boolean; +>z : Symbol(z, Decl(mergedInterfacesWithMultipleBases3.ts, 32, 15)) +} diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.symbols b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.symbols new file mode 100644 index 00000000000..a58a2443ff9 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/mergedModuleDeclarationCodeGen2.ts === +module my.data.foo { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen2.ts, 2, 1)) +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 10), Decl(mergedModuleDeclarationCodeGen2.ts, 3, 10)) +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 15)) + + export function buz() { } +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 20)) +} +module my.data { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen2.ts, 2, 1)) +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 10), Decl(mergedModuleDeclarationCodeGen2.ts, 3, 10)) + + function data(my) { +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen2.ts, 3, 16)) +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen2.ts, 4, 18)) + + foo.buz(); +>foo.buz : Symbol(foo.buz, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 20)) +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 15)) +>buz : Symbol(foo.buz, Decl(mergedModuleDeclarationCodeGen2.ts, 0, 20)) + } +} diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.symbols b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.symbols new file mode 100644 index 00000000000..f991b90f869 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/mergedModuleDeclarationCodeGen3.ts === +module my.data { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen3.ts, 2, 1)) +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 10), Decl(mergedModuleDeclarationCodeGen3.ts, 3, 10)) + + export function buz() { } +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 16)) +} +module my.data.foo { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen3.ts, 2, 1)) +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 10), Decl(mergedModuleDeclarationCodeGen3.ts, 3, 10)) +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen3.ts, 3, 15)) + + function data(my, foo) { +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen3.ts, 3, 20)) +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen3.ts, 4, 18)) +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen3.ts, 4, 21)) + + buz(); +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen3.ts, 0, 16)) + } +} diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.symbols b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.symbols new file mode 100644 index 00000000000..86e6b979881 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/mergedModuleDeclarationCodeGen4.ts === +module superContain { +>superContain : Symbol(superContain, Decl(mergedModuleDeclarationCodeGen4.ts, 0, 0)) + + export module contain { +>contain : Symbol(contain, Decl(mergedModuleDeclarationCodeGen4.ts, 0, 21)) + + export module my.buz { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen4.ts, 1, 27), Decl(mergedModuleDeclarationCodeGen4.ts, 6, 9)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen4.ts, 2, 25), Decl(mergedModuleDeclarationCodeGen4.ts, 7, 25)) + + export module data { +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen4.ts, 2, 30), Decl(mergedModuleDeclarationCodeGen4.ts, 7, 30)) + + export function foo() { } +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen4.ts, 3, 32)) + } + } + export module my.buz { +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen4.ts, 1, 27), Decl(mergedModuleDeclarationCodeGen4.ts, 6, 9)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen4.ts, 2, 25), Decl(mergedModuleDeclarationCodeGen4.ts, 7, 25)) + + export module data { +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen4.ts, 2, 30), Decl(mergedModuleDeclarationCodeGen4.ts, 7, 30)) + + export function bar(contain, my, buz, data) { +>bar : Symbol(bar, Decl(mergedModuleDeclarationCodeGen4.ts, 8, 32)) +>contain : Symbol(contain, Decl(mergedModuleDeclarationCodeGen4.ts, 9, 36)) +>my : Symbol(my, Decl(mergedModuleDeclarationCodeGen4.ts, 9, 44)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen4.ts, 9, 48)) +>data : Symbol(data, Decl(mergedModuleDeclarationCodeGen4.ts, 9, 53)) + + foo(); +>foo : Symbol(foo, Decl(mergedModuleDeclarationCodeGen4.ts, 3, 32)) + } + } + } + } +} diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.symbols b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.symbols new file mode 100644 index 00000000000..6f4cc0ef3e5 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.symbols @@ -0,0 +1,54 @@ +=== tests/cases/compiler/mergedModuleDeclarationCodeGen5.ts === +module M.buz.plop { +>M : Symbol(M, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen5.ts, 3, 1)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 9), Decl(mergedModuleDeclarationCodeGen5.ts, 4, 9)) +>plop : Symbol(plop, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 13), Decl(mergedModuleDeclarationCodeGen5.ts, 4, 13)) + + export function doom() { } +>doom : Symbol(doom, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 19)) + + export function M() { } +>M : Symbol(M, Decl(mergedModuleDeclarationCodeGen5.ts, 1, 30)) +} +module M.buz.plop { +>M : Symbol(M, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen5.ts, 3, 1)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 9), Decl(mergedModuleDeclarationCodeGen5.ts, 4, 9)) +>plop : Symbol(plop, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 13), Decl(mergedModuleDeclarationCodeGen5.ts, 4, 13)) + + function gunk() { } +>gunk : Symbol(gunk, Decl(mergedModuleDeclarationCodeGen5.ts, 4, 19)) + + function buz() { } +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen5.ts, 5, 23)) + + export class fudge { } +>fudge : Symbol(fudge, Decl(mergedModuleDeclarationCodeGen5.ts, 6, 22)) + + export enum plop { } +>plop : Symbol(plop, Decl(mergedModuleDeclarationCodeGen5.ts, 7, 26)) + + // Emit these references as follows + var v1 = gunk; // gunk +>v1 : Symbol(v1, Decl(mergedModuleDeclarationCodeGen5.ts, 11, 7)) +>gunk : Symbol(gunk, Decl(mergedModuleDeclarationCodeGen5.ts, 4, 19)) + + var v2 = buz; // buz +>v2 : Symbol(v2, Decl(mergedModuleDeclarationCodeGen5.ts, 12, 7)) +>buz : Symbol(buz, Decl(mergedModuleDeclarationCodeGen5.ts, 5, 23)) + + export var v3 = doom; // _plop.doom +>v3 : Symbol(v3, Decl(mergedModuleDeclarationCodeGen5.ts, 13, 14)) +>doom : Symbol(doom, Decl(mergedModuleDeclarationCodeGen5.ts, 0, 19)) + + export var v4 = M; // _plop.M +>v4 : Symbol(v4, Decl(mergedModuleDeclarationCodeGen5.ts, 14, 14)) +>M : Symbol(M, Decl(mergedModuleDeclarationCodeGen5.ts, 1, 30)) + + export var v5 = fudge; // fudge +>v5 : Symbol(v5, Decl(mergedModuleDeclarationCodeGen5.ts, 15, 14)) +>fudge : Symbol(fudge, Decl(mergedModuleDeclarationCodeGen5.ts, 6, 22)) + + export var v6 = plop; // plop +>v6 : Symbol(v6, Decl(mergedModuleDeclarationCodeGen5.ts, 16, 14)) +>plop : Symbol(plop, Decl(mergedModuleDeclarationCodeGen5.ts, 7, 26)) +} diff --git a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.symbols b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.symbols new file mode 100644 index 00000000000..a7f074023a6 --- /dev/null +++ b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/mergedModuleDeclarationWithSharedExportedVar.ts === +module M { +>M : Symbol(M, Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 0, 0), Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 3, 1)) + + export var v = 10; +>v : Symbol(v, Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 1, 14)) + + v; +>v : Symbol(v, Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 1, 14)) +} +module M { +>M : Symbol(M, Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 0, 0), Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 3, 1)) + + v; +>v : Symbol(v, Decl(mergedModuleDeclarationWithSharedExportedVar.ts, 1, 14)) +} diff --git a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types index 89d155861a5..484cee0b0af 100644 --- a/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types +++ b/tests/baselines/reference/mergedModuleDeclarationWithSharedExportedVar.types @@ -4,6 +4,7 @@ module M { export var v = 10; >v : number +>10 : number v; >v : number diff --git a/tests/baselines/reference/methodContainingLocalFunction.symbols b/tests/baselines/reference/methodContainingLocalFunction.symbols new file mode 100644 index 00000000000..e449d68562f --- /dev/null +++ b/tests/baselines/reference/methodContainingLocalFunction.symbols @@ -0,0 +1,122 @@ +=== tests/cases/compiler/methodContainingLocalFunction.ts === +// The first case here (BugExhibition) caused a crash. Try with different permutations of features. +class BugExhibition { +>BugExhibition : Symbol(BugExhibition, Decl(methodContainingLocalFunction.ts, 0, 0)) +>T : Symbol(T, Decl(methodContainingLocalFunction.ts, 1, 20)) + + public exhibitBug() { +>exhibitBug : Symbol(exhibitBug, Decl(methodContainingLocalFunction.ts, 1, 24)) + + function localFunction() { } +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 2, 25)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 4, 11)) + + x = localFunction; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 4, 11)) +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 2, 25)) + } +} + +class BugExhibition2 { +>BugExhibition2 : Symbol(BugExhibition2, Decl(methodContainingLocalFunction.ts, 7, 1)) +>T : Symbol(T, Decl(methodContainingLocalFunction.ts, 9, 21)) + + private static get exhibitBug() { +>exhibitBug : Symbol(BugExhibition2.exhibitBug, Decl(methodContainingLocalFunction.ts, 9, 25)) + + function localFunction() { } +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 10, 37)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 12, 11)) + + x = localFunction; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 12, 11)) +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 10, 37)) + + return null; + } +} + +class BugExhibition3 { +>BugExhibition3 : Symbol(BugExhibition3, Decl(methodContainingLocalFunction.ts, 16, 1)) +>T : Symbol(T, Decl(methodContainingLocalFunction.ts, 18, 21)) + + public exhibitBug() { +>exhibitBug : Symbol(exhibitBug, Decl(methodContainingLocalFunction.ts, 18, 25)) + + function localGenericFunction(u?: U) { } +>localGenericFunction : Symbol(localGenericFunction, Decl(methodContainingLocalFunction.ts, 19, 25)) +>U : Symbol(U, Decl(methodContainingLocalFunction.ts, 20, 38)) +>u : Symbol(u, Decl(methodContainingLocalFunction.ts, 20, 41)) +>U : Symbol(U, Decl(methodContainingLocalFunction.ts, 20, 38)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 21, 11)) + + x = localGenericFunction; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 21, 11)) +>localGenericFunction : Symbol(localGenericFunction, Decl(methodContainingLocalFunction.ts, 19, 25)) + } +} + +class C { +>C : Symbol(C, Decl(methodContainingLocalFunction.ts, 24, 1)) + + exhibit() { +>exhibit : Symbol(exhibit, Decl(methodContainingLocalFunction.ts, 26, 9)) + + var funcExpr = (u?: U) => { }; +>funcExpr : Symbol(funcExpr, Decl(methodContainingLocalFunction.ts, 28, 11)) +>U : Symbol(U, Decl(methodContainingLocalFunction.ts, 28, 24)) +>u : Symbol(u, Decl(methodContainingLocalFunction.ts, 28, 27)) +>U : Symbol(U, Decl(methodContainingLocalFunction.ts, 28, 24)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 29, 11)) + + x = funcExpr; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 29, 11)) +>funcExpr : Symbol(funcExpr, Decl(methodContainingLocalFunction.ts, 28, 11)) + } +} + +module M { +>M : Symbol(M, Decl(methodContainingLocalFunction.ts, 32, 1)) + + export function exhibitBug() { +>exhibitBug : Symbol(exhibitBug, Decl(methodContainingLocalFunction.ts, 34, 10)) + + function localFunction() { } +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 35, 34)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 37, 11)) + + x = localFunction; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 37, 11)) +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 35, 34)) + } +} + +enum E { +>E : Symbol(E, Decl(methodContainingLocalFunction.ts, 40, 1)) + + A = (() => { +>A : Symbol(E.A, Decl(methodContainingLocalFunction.ts, 42, 8)) + + function localFunction() { } +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 43, 16)) + + var x: { (): void; }; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 45, 11)) + + x = localFunction; +>x : Symbol(x, Decl(methodContainingLocalFunction.ts, 45, 11)) +>localFunction : Symbol(localFunction, Decl(methodContainingLocalFunction.ts, 43, 16)) + + return 0; + })() +} diff --git a/tests/baselines/reference/methodContainingLocalFunction.types b/tests/baselines/reference/methodContainingLocalFunction.types index 48c4be12631..8b6d102ade8 100644 --- a/tests/baselines/reference/methodContainingLocalFunction.types +++ b/tests/baselines/reference/methodContainingLocalFunction.types @@ -39,6 +39,7 @@ class BugExhibition2 { >localFunction : () => void return null; +>null : null } } @@ -128,5 +129,7 @@ enum E { >localFunction : () => void return 0; +>0 : number + })() } diff --git a/tests/baselines/reference/methodSignatureDeclarationEmit1.symbols b/tests/baselines/reference/methodSignatureDeclarationEmit1.symbols new file mode 100644 index 00000000000..80e0d2e1e6c --- /dev/null +++ b/tests/baselines/reference/methodSignatureDeclarationEmit1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/methodSignatureDeclarationEmit1.ts === +class C { +>C : Symbol(C, Decl(methodSignatureDeclarationEmit1.ts, 0, 0)) + + public foo(n: number): void; +>foo : Symbol(foo, Decl(methodSignatureDeclarationEmit1.ts, 0, 9), Decl(methodSignatureDeclarationEmit1.ts, 1, 30), Decl(methodSignatureDeclarationEmit1.ts, 2, 30)) +>n : Symbol(n, Decl(methodSignatureDeclarationEmit1.ts, 1, 13)) + + public foo(s: string): void; +>foo : Symbol(foo, Decl(methodSignatureDeclarationEmit1.ts, 0, 9), Decl(methodSignatureDeclarationEmit1.ts, 1, 30), Decl(methodSignatureDeclarationEmit1.ts, 2, 30)) +>s : Symbol(s, Decl(methodSignatureDeclarationEmit1.ts, 2, 13)) + + public foo(a: any): void { +>foo : Symbol(foo, Decl(methodSignatureDeclarationEmit1.ts, 0, 9), Decl(methodSignatureDeclarationEmit1.ts, 1, 30), Decl(methodSignatureDeclarationEmit1.ts, 2, 30)) +>a : Symbol(a, Decl(methodSignatureDeclarationEmit1.ts, 3, 13)) + } +} diff --git a/tests/baselines/reference/methodSignaturesWithOverloads2.symbols b/tests/baselines/reference/methodSignaturesWithOverloads2.symbols new file mode 100644 index 00000000000..6446c128405 --- /dev/null +++ b/tests/baselines/reference/methodSignaturesWithOverloads2.symbols @@ -0,0 +1,92 @@ +=== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads2.ts === +// Object type literals permit overloads with optionality but they must match + +var c: { +>c : Symbol(c, Decl(methodSignaturesWithOverloads2.ts, 2, 3)) + + func4?(x: number): number; +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) +>x : Symbol(x, Decl(methodSignaturesWithOverloads2.ts, 3, 11)) + + func4?(s: string): string; +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) +>s : Symbol(s, Decl(methodSignaturesWithOverloads2.ts, 4, 11)) + + func5?: { +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 4, 30)) + + (x: number): number; +>x : Symbol(x, Decl(methodSignaturesWithOverloads2.ts, 6, 9)) + + (s: string): string; +>s : Symbol(s, Decl(methodSignaturesWithOverloads2.ts, 7, 9)) + + }; +}; + +// no errors +c.func4 = c.func5; +>c.func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) +>c : Symbol(c, Decl(methodSignaturesWithOverloads2.ts, 2, 3)) +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) +>c.func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 4, 30)) +>c : Symbol(c, Decl(methodSignaturesWithOverloads2.ts, 2, 3)) +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 4, 30)) + +c.func5 = c.func4; +>c.func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 4, 30)) +>c : Symbol(c, Decl(methodSignaturesWithOverloads2.ts, 2, 3)) +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 4, 30)) +>c.func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) +>c : Symbol(c, Decl(methodSignaturesWithOverloads2.ts, 2, 3)) +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 2, 8), Decl(methodSignaturesWithOverloads2.ts, 3, 30)) + + +var c2: { +>c2 : Symbol(c2, Decl(methodSignaturesWithOverloads2.ts, 16, 3)) + + func4?(x: T): number; +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 17, 11)) +>x : Symbol(x, Decl(methodSignaturesWithOverloads2.ts, 17, 14)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 17, 11)) + + func4? (s: T): string; +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 18, 12)) +>s : Symbol(s, Decl(methodSignaturesWithOverloads2.ts, 18, 15)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 18, 12)) + + func5?: { +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 18, 29)) + + (x: T): number; +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 20, 9)) +>x : Symbol(x, Decl(methodSignaturesWithOverloads2.ts, 20, 12)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 20, 9)) + + (s: T): string; +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 21, 9)) +>s : Symbol(s, Decl(methodSignaturesWithOverloads2.ts, 21, 12)) +>T : Symbol(T, Decl(methodSignaturesWithOverloads2.ts, 21, 9)) + + }; +}; + +// no errors +c2.func4 = c2.func5; +>c2.func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) +>c2 : Symbol(c2, Decl(methodSignaturesWithOverloads2.ts, 16, 3)) +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) +>c2.func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 18, 29)) +>c2 : Symbol(c2, Decl(methodSignaturesWithOverloads2.ts, 16, 3)) +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 18, 29)) + +c2.func5 = c2.func4; +>c2.func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 18, 29)) +>c2 : Symbol(c2, Decl(methodSignaturesWithOverloads2.ts, 16, 3)) +>func5 : Symbol(func5, Decl(methodSignaturesWithOverloads2.ts, 18, 29)) +>c2.func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) +>c2 : Symbol(c2, Decl(methodSignaturesWithOverloads2.ts, 16, 3)) +>func4 : Symbol(func4, Decl(methodSignaturesWithOverloads2.ts, 16, 9), Decl(methodSignaturesWithOverloads2.ts, 17, 28)) + diff --git a/tests/baselines/reference/mismatchedGenericArguments1.symbols b/tests/baselines/reference/mismatchedGenericArguments1.symbols new file mode 100644 index 00000000000..f540c3d7ccb --- /dev/null +++ b/tests/baselines/reference/mismatchedGenericArguments1.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/mismatchedGenericArguments1.ts === +interface IFoo { +>IFoo : Symbol(IFoo, Decl(mismatchedGenericArguments1.ts, 0, 0)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 0, 15)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(mismatchedGenericArguments1.ts, 0, 19)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 1, 7)) +>x : Symbol(x, Decl(mismatchedGenericArguments1.ts, 1, 10)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 1, 7)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 1, 7)) +} +class C implements IFoo { +>C : Symbol(C, Decl(mismatchedGenericArguments1.ts, 2, 1)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 3, 8)) +>IFoo : Symbol(IFoo, Decl(mismatchedGenericArguments1.ts, 0, 0)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 3, 8)) + + foo(x: string): number { +>foo : Symbol(foo, Decl(mismatchedGenericArguments1.ts, 3, 31)) +>x : Symbol(x, Decl(mismatchedGenericArguments1.ts, 4, 7)) + + return null; + } +} + +class C2 implements IFoo { +>C2 : Symbol(C2, Decl(mismatchedGenericArguments1.ts, 7, 1)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 9, 9)) +>IFoo : Symbol(IFoo, Decl(mismatchedGenericArguments1.ts, 0, 0)) +>T : Symbol(T, Decl(mismatchedGenericArguments1.ts, 9, 9)) + + foo(x: string): number { +>foo : Symbol(foo, Decl(mismatchedGenericArguments1.ts, 9, 32)) +>U : Symbol(U, Decl(mismatchedGenericArguments1.ts, 10, 7)) +>x : Symbol(x, Decl(mismatchedGenericArguments1.ts, 10, 10)) + + return null; + } +} + diff --git a/tests/baselines/reference/mismatchedGenericArguments1.types b/tests/baselines/reference/mismatchedGenericArguments1.types index 4d4d216bef1..c681445ab16 100644 --- a/tests/baselines/reference/mismatchedGenericArguments1.types +++ b/tests/baselines/reference/mismatchedGenericArguments1.types @@ -21,6 +21,7 @@ class C implements IFoo { >x : string return null; +>null : null } } @@ -36,6 +37,7 @@ class C2 implements IFoo { >x : string return null; +>null : null } } diff --git a/tests/baselines/reference/missingImportAfterModuleImport.symbols b/tests/baselines/reference/missingImportAfterModuleImport.symbols new file mode 100644 index 00000000000..3ed1d93431c --- /dev/null +++ b/tests/baselines/reference/missingImportAfterModuleImport.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/missingImportAfterModuleImport_1.ts === +/// +import SubModule = require('SubModule'); +>SubModule : Symbol(SubModule, Decl(missingImportAfterModuleImport_1.ts, 0, 0)) + +class MainModule { +>MainModule : Symbol(MainModule, Decl(missingImportAfterModuleImport_1.ts, 1, 40)) + + // public static SubModule: SubModule; + public SubModule: SubModule; +>SubModule : Symbol(SubModule, Decl(missingImportAfterModuleImport_1.ts, 2, 18)) +>SubModule : Symbol(SubModule, Decl(missingImportAfterModuleImport_1.ts, 0, 0)) + + constructor() { } +} +export = MainModule; +>MainModule : Symbol(MainModule, Decl(missingImportAfterModuleImport_1.ts, 1, 40)) + + +=== tests/cases/compiler/missingImportAfterModuleImport_0.ts === + +declare module "SubModule" { + class SubModule { +>SubModule : Symbol(SubModule, Decl(missingImportAfterModuleImport_0.ts, 1, 28)) + + public static StaticVar: number; +>StaticVar : Symbol(SubModule.StaticVar, Decl(missingImportAfterModuleImport_0.ts, 2, 21)) + + public InstanceVar: number; +>InstanceVar : Symbol(InstanceVar, Decl(missingImportAfterModuleImport_0.ts, 3, 40)) + + constructor(); + } + export = SubModule; +>SubModule : Symbol(SubModule, Decl(missingImportAfterModuleImport_0.ts, 1, 28)) +} + diff --git a/tests/baselines/reference/missingSelf.symbols b/tests/baselines/reference/missingSelf.symbols new file mode 100644 index 00000000000..b4b5bd0b905 --- /dev/null +++ b/tests/baselines/reference/missingSelf.symbols @@ -0,0 +1,46 @@ +=== tests/cases/compiler/missingSelf.ts === +class CalcButton +>CalcButton : Symbol(CalcButton, Decl(missingSelf.ts, 0, 0)) +{ + public a() { this.onClick(); } +>a : Symbol(a, Decl(missingSelf.ts, 1, 1)) +>this.onClick : Symbol(onClick, Decl(missingSelf.ts, 2, 34)) +>this : Symbol(CalcButton, Decl(missingSelf.ts, 0, 0)) +>onClick : Symbol(onClick, Decl(missingSelf.ts, 2, 34)) + + public onClick() { } +>onClick : Symbol(onClick, Decl(missingSelf.ts, 2, 34)) +} + +class CalcButton2 +>CalcButton2 : Symbol(CalcButton2, Decl(missingSelf.ts, 4, 1)) +{ + public b() { () => this.onClick(); } +>b : Symbol(b, Decl(missingSelf.ts, 7, 1)) +>this.onClick : Symbol(onClick, Decl(missingSelf.ts, 8, 40)) +>this : Symbol(CalcButton2, Decl(missingSelf.ts, 4, 1)) +>onClick : Symbol(onClick, Decl(missingSelf.ts, 8, 40)) + + public onClick() { } +>onClick : Symbol(onClick, Decl(missingSelf.ts, 8, 40)) +} + +var c = new CalcButton(); +>c : Symbol(c, Decl(missingSelf.ts, 12, 3)) +>CalcButton : Symbol(CalcButton, Decl(missingSelf.ts, 0, 0)) + +c.a(); +>c.a : Symbol(CalcButton.a, Decl(missingSelf.ts, 1, 1)) +>c : Symbol(c, Decl(missingSelf.ts, 12, 3)) +>a : Symbol(CalcButton.a, Decl(missingSelf.ts, 1, 1)) + +var c2 = new CalcButton2(); +>c2 : Symbol(c2, Decl(missingSelf.ts, 14, 3)) +>CalcButton2 : Symbol(CalcButton2, Decl(missingSelf.ts, 4, 1)) + +c2.b(); +>c2.b : Symbol(CalcButton2.b, Decl(missingSelf.ts, 7, 1)) +>c2 : Symbol(c2, Decl(missingSelf.ts, 14, 3)) +>b : Symbol(CalcButton2.b, Decl(missingSelf.ts, 7, 1)) + + diff --git a/tests/baselines/reference/missingTypeArguments3.symbols b/tests/baselines/reference/missingTypeArguments3.symbols new file mode 100644 index 00000000000..4bd7943eace --- /dev/null +++ b/tests/baselines/reference/missingTypeArguments3.symbols @@ -0,0 +1,172 @@ +=== tests/cases/compiler/missingTypeArguments3.ts === +declare module linq { +>linq : Symbol(linq, Decl(missingTypeArguments3.ts, 0, 0)) + + interface Enumerable { +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) + + OrderByDescending(keySelector?: string): OrderedEnumerable; +>OrderByDescending : Symbol(OrderByDescending, Decl(missingTypeArguments3.ts, 2, 29)) +>keySelector : Symbol(keySelector, Decl(missingTypeArguments3.ts, 3, 26)) +>OrderedEnumerable : Symbol(OrderedEnumerable, Decl(missingTypeArguments3.ts, 7, 5)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) + + GroupBy(keySelector: (element: T) => TKey): Enumerable>; +>GroupBy : Symbol(GroupBy, Decl(missingTypeArguments3.ts, 3, 70), Decl(missingTypeArguments3.ts, 4, 88)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 4, 16)) +>keySelector : Symbol(keySelector, Decl(missingTypeArguments3.ts, 4, 22)) +>element : Symbol(element, Decl(missingTypeArguments3.ts, 4, 36)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 4, 16)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>Grouping : Symbol(Grouping, Decl(missingTypeArguments3.ts, 11, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 4, 16)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) + + GroupBy(keySelector: (element: T) => TKey, elementSelector: (element: T) => TElement): Enumerable>; +>GroupBy : Symbol(GroupBy, Decl(missingTypeArguments3.ts, 3, 70), Decl(missingTypeArguments3.ts, 4, 88)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 5, 16)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 5, 21)) +>keySelector : Symbol(keySelector, Decl(missingTypeArguments3.ts, 5, 32)) +>element : Symbol(element, Decl(missingTypeArguments3.ts, 5, 46)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 5, 16)) +>elementSelector : Symbol(elementSelector, Decl(missingTypeArguments3.ts, 5, 66)) +>element : Symbol(element, Decl(missingTypeArguments3.ts, 5, 85)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 5, 21)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>Grouping : Symbol(Grouping, Decl(missingTypeArguments3.ts, 11, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 5, 16)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 5, 21)) + + ToDictionary(keySelector: (element: T) => TKey): Dictionary; +>ToDictionary : Symbol(ToDictionary, Decl(missingTypeArguments3.ts, 5, 148)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 6, 21)) +>keySelector : Symbol(keySelector, Decl(missingTypeArguments3.ts, 6, 27)) +>element : Symbol(element, Decl(missingTypeArguments3.ts, 6, 41)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 6, 21)) +>Dictionary : Symbol(Dictionary, Decl(missingTypeArguments3.ts, 22, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 6, 21)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 2, 25)) + } + + interface OrderedEnumerable extends Enumerable { +>OrderedEnumerable : Symbol(OrderedEnumerable, Decl(missingTypeArguments3.ts, 7, 5)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 9, 32)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 9, 32)) + + ThenBy(keySelector: (element: T) => TCompare): OrderedEnumerable; // used to incorrectly think this was missing a type argument +>ThenBy : Symbol(ThenBy, Decl(missingTypeArguments3.ts, 9, 58)) +>TCompare : Symbol(TCompare, Decl(missingTypeArguments3.ts, 10, 15)) +>keySelector : Symbol(keySelector, Decl(missingTypeArguments3.ts, 10, 25)) +>element : Symbol(element, Decl(missingTypeArguments3.ts, 10, 39)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 9, 32)) +>TCompare : Symbol(TCompare, Decl(missingTypeArguments3.ts, 10, 15)) +>OrderedEnumerable : Symbol(OrderedEnumerable, Decl(missingTypeArguments3.ts, 7, 5)) +>T : Symbol(T, Decl(missingTypeArguments3.ts, 9, 32)) + } + + interface Grouping extends Enumerable { +>Grouping : Symbol(Grouping, Decl(missingTypeArguments3.ts, 11, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 13, 23)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 13, 28)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 13, 28)) + + Key(): TKey; +>Key : Symbol(Key, Decl(missingTypeArguments3.ts, 13, 69)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 13, 23)) + } + + interface Lookup { +>Lookup : Symbol(Lookup, Decl(missingTypeArguments3.ts, 15, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 17, 21)) +>TElement : Symbol(TElement, Decl(missingTypeArguments3.ts, 17, 26)) + + Count(): number; +>Count : Symbol(Count, Decl(missingTypeArguments3.ts, 17, 38)) + + Get(key): Enumerable; +>Get : Symbol(Get, Decl(missingTypeArguments3.ts, 18, 24)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 19, 12)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) + + Contains(key): boolean; +>Contains : Symbol(Contains, Decl(missingTypeArguments3.ts, 19, 34)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 20, 17)) + + ToEnumerable(): Enumerable>; +>ToEnumerable : Symbol(ToEnumerable, Decl(missingTypeArguments3.ts, 20, 31)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>Grouping : Symbol(Grouping, Decl(missingTypeArguments3.ts, 11, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 17, 21)) + } + + interface Dictionary { +>Dictionary : Symbol(Dictionary, Decl(missingTypeArguments3.ts, 22, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 24, 30)) + + Add(key: TKey, value: TValue): void; +>Add : Symbol(Add, Decl(missingTypeArguments3.ts, 24, 40)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 25, 12)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) +>value : Symbol(value, Decl(missingTypeArguments3.ts, 25, 22)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 24, 30)) + + Get(ke: TKey): TValue; +>Get : Symbol(Get, Decl(missingTypeArguments3.ts, 25, 44)) +>ke : Symbol(ke, Decl(missingTypeArguments3.ts, 26, 12)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 24, 30)) + + Set(key: TKey, value: TValue): boolean; +>Set : Symbol(Set, Decl(missingTypeArguments3.ts, 26, 30)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 27, 12)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) +>value : Symbol(value, Decl(missingTypeArguments3.ts, 27, 22)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 24, 30)) + + Contains(key: TKey): boolean; +>Contains : Symbol(Contains, Decl(missingTypeArguments3.ts, 27, 47)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 28, 17)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) + + Clear(): void; +>Clear : Symbol(Clear, Decl(missingTypeArguments3.ts, 28, 37)) + + Remove(key: TKey): void; +>Remove : Symbol(Remove, Decl(missingTypeArguments3.ts, 29, 22)) +>key : Symbol(key, Decl(missingTypeArguments3.ts, 30, 15)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) + + Count(): number; +>Count : Symbol(Count, Decl(missingTypeArguments3.ts, 30, 32)) + + ToEnumerable(): Enumerable>; +>ToEnumerable : Symbol(ToEnumerable, Decl(missingTypeArguments3.ts, 31, 24)) +>Enumerable : Symbol(Enumerable, Decl(missingTypeArguments3.ts, 0, 21)) +>KeyValuePair : Symbol(KeyValuePair, Decl(missingTypeArguments3.ts, 33, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 24, 25)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 24, 30)) + } + + interface KeyValuePair { +>KeyValuePair : Symbol(KeyValuePair, Decl(missingTypeArguments3.ts, 33, 5)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 35, 27)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 35, 32)) + + Key: TKey; +>Key : Symbol(Key, Decl(missingTypeArguments3.ts, 35, 42)) +>TKey : Symbol(TKey, Decl(missingTypeArguments3.ts, 35, 27)) + + Value: TValue; +>Value : Symbol(Value, Decl(missingTypeArguments3.ts, 36, 18)) +>TValue : Symbol(TValue, Decl(missingTypeArguments3.ts, 35, 32)) + } +} + diff --git a/tests/baselines/reference/missingTypeArguments3.types b/tests/baselines/reference/missingTypeArguments3.types index ec6d9944924..d7f850916f9 100644 --- a/tests/baselines/reference/missingTypeArguments3.types +++ b/tests/baselines/reference/missingTypeArguments3.types @@ -1,6 +1,6 @@ === tests/cases/compiler/missingTypeArguments3.ts === declare module linq { ->linq : unknown +>linq : any interface Enumerable { >Enumerable : Enumerable diff --git a/tests/baselines/reference/mixedExports.symbols b/tests/baselines/reference/mixedExports.symbols new file mode 100644 index 00000000000..317b60e0a8c --- /dev/null +++ b/tests/baselines/reference/mixedExports.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/mixedExports.ts === +declare module M { +>M : Symbol(M, Decl(mixedExports.ts, 0, 0)) + + function foo(); +>foo : Symbol(foo, Decl(mixedExports.ts, 0, 18), Decl(mixedExports.ts, 1, 20), Decl(mixedExports.ts, 2, 27)) + + export function foo(); +>foo : Symbol(foo, Decl(mixedExports.ts, 0, 18), Decl(mixedExports.ts, 1, 20), Decl(mixedExports.ts, 2, 27)) + + function foo(); +>foo : Symbol(foo, Decl(mixedExports.ts, 0, 18), Decl(mixedExports.ts, 1, 20), Decl(mixedExports.ts, 2, 27)) +} + +declare module M1 { +>M1 : Symbol(M1, Decl(mixedExports.ts, 4, 1)) + + export interface Foo {} +>Foo : Symbol(Foo, Decl(mixedExports.ts, 6, 19), Decl(mixedExports.ts, 7, 28)) + + interface Foo {} +>Foo : Symbol(Foo, Decl(mixedExports.ts, 6, 19), Decl(mixedExports.ts, 7, 28)) +} + +module A { +>A : Symbol(A, Decl(mixedExports.ts, 9, 1)) + + interface X {x} +>X : Symbol(X, Decl(mixedExports.ts, 11, 10), Decl(mixedExports.ts, 12, 20), Decl(mixedExports.ts, 13, 23)) +>x : Symbol(x, Decl(mixedExports.ts, 12, 18)) + + export module X {} +>X : Symbol(X, Decl(mixedExports.ts, 12, 20)) + + interface X {y} +>X : Symbol(X, Decl(mixedExports.ts, 11, 10), Decl(mixedExports.ts, 12, 20), Decl(mixedExports.ts, 13, 23)) +>y : Symbol(y, Decl(mixedExports.ts, 14, 18)) +} diff --git a/tests/baselines/reference/mixedExports.types b/tests/baselines/reference/mixedExports.types index f7ff0a13c34..fd0d24391e5 100644 --- a/tests/baselines/reference/mixedExports.types +++ b/tests/baselines/reference/mixedExports.types @@ -13,7 +13,7 @@ declare module M { } declare module M1 { ->M1 : unknown +>M1 : any export interface Foo {} >Foo : Foo @@ -23,14 +23,14 @@ declare module M1 { } module A { ->A : unknown +>A : any interface X {x} >X : X >x : any export module X {} ->X : unknown +>X : any interface X {y} >X : X diff --git a/tests/baselines/reference/mixingFunctionAndAmbientModule1.symbols b/tests/baselines/reference/mixingFunctionAndAmbientModule1.symbols new file mode 100644 index 00000000000..9fc43fd4ac0 --- /dev/null +++ b/tests/baselines/reference/mixingFunctionAndAmbientModule1.symbols @@ -0,0 +1,90 @@ +=== tests/cases/compiler/mixingFunctionAndAmbientModule1.ts === +module A { +>A : Symbol(A, Decl(mixingFunctionAndAmbientModule1.ts, 0, 0)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 0, 10), Decl(mixingFunctionAndAmbientModule1.ts, 3, 5)) + + export var x: number; +>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 2, 18)) + } + function My(s: string) { } +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 0, 10), Decl(mixingFunctionAndAmbientModule1.ts, 3, 5)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 4, 16)) +} + +module B { +>B : Symbol(B, Decl(mixingFunctionAndAmbientModule1.ts, 5, 1)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 7, 10), Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28)) + + export var x: number; +>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 9, 18)) + } + function My(s: boolean); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 7, 10), Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 11, 16)) + + function My(s: any) { } +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 7, 10), Decl(mixingFunctionAndAmbientModule1.ts, 10, 5), Decl(mixingFunctionAndAmbientModule1.ts, 11, 28)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 12, 16)) +} + +module C { +>C : Symbol(C, Decl(mixingFunctionAndAmbientModule1.ts, 13, 1)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 15, 10), Decl(mixingFunctionAndAmbientModule1.ts, 18, 5)) + + export var x: number; +>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 17, 18)) + } + declare function My(s: boolean); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 15, 10), Decl(mixingFunctionAndAmbientModule1.ts, 18, 5)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 19, 24)) +} + +module D { +>D : Symbol(D, Decl(mixingFunctionAndAmbientModule1.ts, 20, 1)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 22, 10), Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36)) + + export var x: number; +>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 24, 18)) + } + declare function My(s: boolean); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 22, 10), Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 26, 24)) + + declare function My(s: any); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 22, 10), Decl(mixingFunctionAndAmbientModule1.ts, 25, 5), Decl(mixingFunctionAndAmbientModule1.ts, 26, 36)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 27, 24)) +} + + +module E { +>E : Symbol(E, Decl(mixingFunctionAndAmbientModule1.ts, 28, 1)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5)) + + export var x: number; +>x : Symbol(x, Decl(mixingFunctionAndAmbientModule1.ts, 33, 18)) + } + declare function My(s: boolean); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 35, 24)) + + declare module My { +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5)) + + export var y: number; +>y : Symbol(y, Decl(mixingFunctionAndAmbientModule1.ts, 37, 18)) + } + declare function My(s: any); +>My : Symbol(My, Decl(mixingFunctionAndAmbientModule1.ts, 31, 10), Decl(mixingFunctionAndAmbientModule1.ts, 34, 5), Decl(mixingFunctionAndAmbientModule1.ts, 35, 36), Decl(mixingFunctionAndAmbientModule1.ts, 38, 5)) +>s : Symbol(s, Decl(mixingFunctionAndAmbientModule1.ts, 39, 24)) +} + diff --git a/tests/baselines/reference/modFunctionCrash.symbols b/tests/baselines/reference/modFunctionCrash.symbols new file mode 100644 index 00000000000..b1063a40cd5 --- /dev/null +++ b/tests/baselines/reference/modFunctionCrash.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/modFunctionCrash.ts === +declare module Q { +>Q : Symbol(Q, Decl(modFunctionCrash.ts, 0, 0)) + + function f(fn:()=>void); // typechecking the function type shouldnot crash the compiler +>f : Symbol(f, Decl(modFunctionCrash.ts, 0, 18)) +>fn : Symbol(fn, Decl(modFunctionCrash.ts, 1, 15)) +} + + +Q.f(function() {this;}); +>Q.f : Symbol(Q.f, Decl(modFunctionCrash.ts, 0, 18)) +>Q : Symbol(Q, Decl(modFunctionCrash.ts, 0, 0)) +>f : Symbol(Q.f, Decl(modFunctionCrash.ts, 0, 18)) + diff --git a/tests/baselines/reference/modKeyword.symbols b/tests/baselines/reference/modKeyword.symbols new file mode 100644 index 00000000000..e308cb0a46c --- /dev/null +++ b/tests/baselines/reference/modKeyword.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/modKeyword.ts === +var module:any; +>module : Symbol(module, Decl(modKeyword.ts, 0, 3)) + +var foo:any; +>foo : Symbol(foo, Decl(modKeyword.ts, 1, 3)) + +var _ = module.exports = foo +>_ : Symbol(_, Decl(modKeyword.ts, 3, 3)) +>module : Symbol(module, Decl(modKeyword.ts, 0, 3)) +>foo : Symbol(foo, Decl(modKeyword.ts, 1, 3)) + diff --git a/tests/baselines/reference/moduleAliasAsFunctionArgument.symbols b/tests/baselines/reference/moduleAliasAsFunctionArgument.symbols new file mode 100644 index 00000000000..520dba18d06 --- /dev/null +++ b/tests/baselines/reference/moduleAliasAsFunctionArgument.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/moduleAliasAsFunctionArgument_1.ts === +/// +import a = require('moduleAliasAsFunctionArgument_0'); +>a : Symbol(a, Decl(moduleAliasAsFunctionArgument_1.ts, 0, 0)) + +function fn(arg: { x: number }) { +>fn : Symbol(fn, Decl(moduleAliasAsFunctionArgument_1.ts, 1, 54)) +>arg : Symbol(arg, Decl(moduleAliasAsFunctionArgument_1.ts, 3, 12)) +>x : Symbol(x, Decl(moduleAliasAsFunctionArgument_1.ts, 3, 18)) +} + +a.x; // OK +>a.x : Symbol(a.x, Decl(moduleAliasAsFunctionArgument_0.ts, 0, 10)) +>a : Symbol(a, Decl(moduleAliasAsFunctionArgument_1.ts, 0, 0)) +>x : Symbol(a.x, Decl(moduleAliasAsFunctionArgument_0.ts, 0, 10)) + +fn(a); // Error: property 'x' is missing from 'a' +>fn : Symbol(fn, Decl(moduleAliasAsFunctionArgument_1.ts, 1, 54)) +>a : Symbol(a, Decl(moduleAliasAsFunctionArgument_1.ts, 0, 0)) + +=== tests/cases/compiler/moduleAliasAsFunctionArgument_0.ts === +export var x: number; +>x : Symbol(x, Decl(moduleAliasAsFunctionArgument_0.ts, 0, 10)) + diff --git a/tests/baselines/reference/moduleAliasInterface.symbols b/tests/baselines/reference/moduleAliasInterface.symbols new file mode 100644 index 00000000000..9c4cfdf9b14 --- /dev/null +++ b/tests/baselines/reference/moduleAliasInterface.symbols @@ -0,0 +1,121 @@ +=== tests/cases/compiler/moduleAliasInterface.ts === +module _modes { +>_modes : Symbol(_modes, Decl(moduleAliasInterface.ts, 0, 0)) + + export interface IMode { +>IMode : Symbol(IMode, Decl(moduleAliasInterface.ts, 0, 15)) + + } + + export class Mode { +>Mode : Symbol(Mode, Decl(moduleAliasInterface.ts, 3, 2)) + + } +} + +// _modes. // produces an internal error - please implement in derived class + +module editor { +>editor : Symbol(editor, Decl(moduleAliasInterface.ts, 8, 1)) + + import modes = _modes; +>modes : Symbol(modes, Decl(moduleAliasInterface.ts, 12, 15)) +>_modes : Symbol(modes, Decl(moduleAliasInterface.ts, 0, 0)) + + var i : modes.IMode; +>i : Symbol(i, Decl(moduleAliasInterface.ts, 15, 4)) +>modes : Symbol(modes, Decl(moduleAliasInterface.ts, 12, 15)) +>IMode : Symbol(modes.IMode, Decl(moduleAliasInterface.ts, 0, 15)) + + // If you just use p1:modes, the compiler accepts it - should be an error + class Bug { +>Bug : Symbol(Bug, Decl(moduleAliasInterface.ts, 15, 21)) + + constructor(p1: modes.IMode, p2: modes.Mode) { }// should be an error on p2 - it's not exported +>p1 : Symbol(p1, Decl(moduleAliasInterface.ts, 19, 14)) +>modes : Symbol(modes, Decl(moduleAliasInterface.ts, 12, 15)) +>IMode : Symbol(modes.IMode, Decl(moduleAliasInterface.ts, 0, 15)) +>p2 : Symbol(p2, Decl(moduleAliasInterface.ts, 19, 30)) +>modes : Symbol(modes, Decl(moduleAliasInterface.ts, 12, 15)) +>Mode : Symbol(modes.Mode, Decl(moduleAliasInterface.ts, 3, 2)) + + public foo(p1:modes.IMode) { +>foo : Symbol(foo, Decl(moduleAliasInterface.ts, 19, 50)) +>p1 : Symbol(p1, Decl(moduleAliasInterface.ts, 20, 13)) +>modes : Symbol(modes, Decl(moduleAliasInterface.ts, 12, 15)) +>IMode : Symbol(modes.IMode, Decl(moduleAliasInterface.ts, 0, 15)) + + } + } +} + +import modesOuter = _modes; +>modesOuter : Symbol(modesOuter, Decl(moduleAliasInterface.ts, 24, 1)) +>_modes : Symbol(_modes, Decl(moduleAliasInterface.ts, 0, 0)) + +module editor2 { +>editor2 : Symbol(editor2, Decl(moduleAliasInterface.ts, 26, 27)) + + var i : modesOuter.IMode; +>i : Symbol(i, Decl(moduleAliasInterface.ts, 29, 4)) +>modesOuter : Symbol(modesOuter, Decl(moduleAliasInterface.ts, 24, 1)) +>IMode : Symbol(modesOuter.IMode, Decl(moduleAliasInterface.ts, 0, 15)) + + class Bug { +>Bug : Symbol(Bug, Decl(moduleAliasInterface.ts, 29, 26)) + + constructor(p1: modesOuter.IMode, p2: modesOuter.Mode) { }// no error here, since modesOuter is declared externally +>p1 : Symbol(p1, Decl(moduleAliasInterface.ts, 32, 17)) +>modesOuter : Symbol(modesOuter, Decl(moduleAliasInterface.ts, 24, 1)) +>IMode : Symbol(modesOuter.IMode, Decl(moduleAliasInterface.ts, 0, 15)) +>p2 : Symbol(p2, Decl(moduleAliasInterface.ts, 32, 38)) +>modesOuter : Symbol(modesOuter, Decl(moduleAliasInterface.ts, 24, 1)) +>Mode : Symbol(modesOuter.Mode, Decl(moduleAliasInterface.ts, 3, 2)) + + } + + module Foo { export class Bar{} } +>Foo : Symbol(Foo, Decl(moduleAliasInterface.ts, 34, 2)) +>Bar : Symbol(Bar, Decl(moduleAliasInterface.ts, 36, 14)) + + class Bug2 { +>Bug2 : Symbol(Bug2, Decl(moduleAliasInterface.ts, 36, 35)) + + constructor(p1: Foo.Bar, p2: modesOuter.Mode) { } +>p1 : Symbol(p1, Decl(moduleAliasInterface.ts, 39, 18)) +>Foo : Symbol(Foo, Decl(moduleAliasInterface.ts, 34, 2)) +>Bar : Symbol(Foo.Bar, Decl(moduleAliasInterface.ts, 36, 14)) +>p2 : Symbol(p2, Decl(moduleAliasInterface.ts, 39, 30)) +>modesOuter : Symbol(modesOuter, Decl(moduleAliasInterface.ts, 24, 1)) +>Mode : Symbol(modesOuter.Mode, Decl(moduleAliasInterface.ts, 3, 2)) + } +} + +module A1 { +>A1 : Symbol(A1, Decl(moduleAliasInterface.ts, 41, 1)) + + export interface A1I1 {} +>A1I1 : Symbol(A1I1, Decl(moduleAliasInterface.ts, 43, 11)) + + export class A1C1 {} +>A1C1 : Symbol(A1C1, Decl(moduleAliasInterface.ts, 44, 28)) +} + +module B1 { +>B1 : Symbol(B1, Decl(moduleAliasInterface.ts, 46, 1)) + + import A1Alias1 = A1; +>A1Alias1 : Symbol(A1Alias1, Decl(moduleAliasInterface.ts, 48, 11)) +>A1 : Symbol(A1Alias1, Decl(moduleAliasInterface.ts, 41, 1)) + + var i : A1Alias1.A1I1; +>i : Symbol(i, Decl(moduleAliasInterface.ts, 51, 7)) +>A1Alias1 : Symbol(A1Alias1, Decl(moduleAliasInterface.ts, 48, 11)) +>A1I1 : Symbol(A1Alias1.A1I1, Decl(moduleAliasInterface.ts, 43, 11)) + + var c : A1Alias1.A1C1; +>c : Symbol(c, Decl(moduleAliasInterface.ts, 52, 7)) +>A1Alias1 : Symbol(A1Alias1, Decl(moduleAliasInterface.ts, 48, 11)) +>A1C1 : Symbol(A1Alias1.A1C1, Decl(moduleAliasInterface.ts, 44, 28)) +} + diff --git a/tests/baselines/reference/moduleAliasInterface.types b/tests/baselines/reference/moduleAliasInterface.types index 6d3b11197cb..8e1dd1ec82c 100644 --- a/tests/baselines/reference/moduleAliasInterface.types +++ b/tests/baselines/reference/moduleAliasInterface.types @@ -24,7 +24,7 @@ module editor { var i : modes.IMode; >i : modes.IMode ->modes : unknown +>modes : any >IMode : modes.IMode // If you just use p1:modes, the compiler accepts it - should be an error @@ -33,16 +33,16 @@ module editor { constructor(p1: modes.IMode, p2: modes.Mode) { }// should be an error on p2 - it's not exported >p1 : modes.IMode ->modes : unknown +>modes : any >IMode : modes.IMode >p2 : modes.Mode ->modes : unknown +>modes : any >Mode : modes.Mode public foo(p1:modes.IMode) { >foo : (p1: modes.IMode) => void >p1 : modes.IMode ->modes : unknown +>modes : any >IMode : modes.IMode } @@ -58,7 +58,7 @@ module editor2 { var i : modesOuter.IMode; >i : modesOuter.IMode ->modesOuter : unknown +>modesOuter : any >IMode : modesOuter.IMode class Bug { @@ -66,10 +66,10 @@ module editor2 { constructor(p1: modesOuter.IMode, p2: modesOuter.Mode) { }// no error here, since modesOuter is declared externally >p1 : modesOuter.IMode ->modesOuter : unknown +>modesOuter : any >IMode : modesOuter.IMode >p2 : modesOuter.Mode ->modesOuter : unknown +>modesOuter : any >Mode : modesOuter.Mode } @@ -83,10 +83,10 @@ module editor2 { constructor(p1: Foo.Bar, p2: modesOuter.Mode) { } >p1 : Foo.Bar ->Foo : unknown +>Foo : any >Bar : Foo.Bar >p2 : modesOuter.Mode ->modesOuter : unknown +>modesOuter : any >Mode : modesOuter.Mode } } @@ -110,12 +110,12 @@ module B1 { var i : A1Alias1.A1I1; >i : A1Alias1.A1I1 ->A1Alias1 : unknown +>A1Alias1 : any >A1I1 : A1Alias1.A1I1 var c : A1Alias1.A1C1; >c : A1Alias1.A1C1 ->A1Alias1 : unknown +>A1Alias1 : any >A1C1 : A1Alias1.A1C1 } diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName.symbols b/tests/baselines/reference/moduleAndInterfaceSharingName.symbols new file mode 100644 index 00000000000..8a3a3621e1b --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/moduleAndInterfaceSharingName.ts === +module X { +>X : Symbol(X, Decl(moduleAndInterfaceSharingName.ts, 0, 0)) + + export module Y { +>Y : Symbol(Y, Decl(moduleAndInterfaceSharingName.ts, 0, 10), Decl(moduleAndInterfaceSharingName.ts, 3, 5)) + + export interface Z { } +>Z : Symbol(Z, Decl(moduleAndInterfaceSharingName.ts, 1, 21)) + } + export interface Y { } +>Y : Symbol(Y, Decl(moduleAndInterfaceSharingName.ts, 0, 10), Decl(moduleAndInterfaceSharingName.ts, 3, 5)) +} +var z: X.Y.Z = null; +>z : Symbol(z, Decl(moduleAndInterfaceSharingName.ts, 6, 3)) +>X : Symbol(X, Decl(moduleAndInterfaceSharingName.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(moduleAndInterfaceSharingName.ts, 0, 10), Decl(moduleAndInterfaceSharingName.ts, 3, 5)) +>Z : Symbol(X.Y.Z, Decl(moduleAndInterfaceSharingName.ts, 1, 21)) + +var z2: X.Y; +>z2 : Symbol(z2, Decl(moduleAndInterfaceSharingName.ts, 7, 3)) +>X : Symbol(X, Decl(moduleAndInterfaceSharingName.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(moduleAndInterfaceSharingName.ts, 0, 10), Decl(moduleAndInterfaceSharingName.ts, 3, 5)) + diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName.types b/tests/baselines/reference/moduleAndInterfaceSharingName.types index 6a4f8998fe6..e5b537f856e 100644 --- a/tests/baselines/reference/moduleAndInterfaceSharingName.types +++ b/tests/baselines/reference/moduleAndInterfaceSharingName.types @@ -1,9 +1,9 @@ === tests/cases/compiler/moduleAndInterfaceSharingName.ts === module X { ->X : unknown +>X : any export module Y { ->Y : unknown +>Y : any export interface Z { } >Z : Z @@ -13,12 +13,13 @@ module X { } var z: X.Y.Z = null; >z : X.Y.Z ->X : unknown ->Y : unknown +>X : any +>Y : any >Z : X.Y.Z +>null : null var z2: X.Y; >z2 : X.Y ->X : unknown +>X : any >Y : X.Y diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName3.symbols b/tests/baselines/reference/moduleAndInterfaceSharingName3.symbols new file mode 100644 index 00000000000..6b57995347b --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName3.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/moduleAndInterfaceSharingName3.ts === +module X { +>X : Symbol(X, Decl(moduleAndInterfaceSharingName3.ts, 0, 0)) + + export module Y { +>Y : Symbol(Y, Decl(moduleAndInterfaceSharingName3.ts, 0, 10), Decl(moduleAndInterfaceSharingName3.ts, 3, 5)) + + export interface Z { } +>Z : Symbol(Z, Decl(moduleAndInterfaceSharingName3.ts, 1, 21)) + } + export interface Y { } +>Y : Symbol(Y, Decl(moduleAndInterfaceSharingName3.ts, 0, 10), Decl(moduleAndInterfaceSharingName3.ts, 3, 5)) +>T : Symbol(T, Decl(moduleAndInterfaceSharingName3.ts, 4, 23)) +} +var z: X.Y.Z = null; +>z : Symbol(z, Decl(moduleAndInterfaceSharingName3.ts, 6, 3)) +>X : Symbol(X, Decl(moduleAndInterfaceSharingName3.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(moduleAndInterfaceSharingName3.ts, 0, 10), Decl(moduleAndInterfaceSharingName3.ts, 3, 5)) +>Z : Symbol(X.Y.Z, Decl(moduleAndInterfaceSharingName3.ts, 1, 21)) + +var z2: X.Y; +>z2 : Symbol(z2, Decl(moduleAndInterfaceSharingName3.ts, 7, 3)) +>X : Symbol(X, Decl(moduleAndInterfaceSharingName3.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(moduleAndInterfaceSharingName3.ts, 0, 10), Decl(moduleAndInterfaceSharingName3.ts, 3, 5)) + diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName3.types b/tests/baselines/reference/moduleAndInterfaceSharingName3.types index 1b9aabea630..690256bcf08 100644 --- a/tests/baselines/reference/moduleAndInterfaceSharingName3.types +++ b/tests/baselines/reference/moduleAndInterfaceSharingName3.types @@ -1,9 +1,9 @@ === tests/cases/compiler/moduleAndInterfaceSharingName3.ts === module X { ->X : unknown +>X : any export module Y { ->Y : unknown +>Y : any export interface Z { } >Z : Z @@ -14,12 +14,13 @@ module X { } var z: X.Y.Z = null; >z : X.Y.Z ->X : unknown ->Y : unknown +>X : any +>Y : any >Z : X.Y.Z +>null : null var z2: X.Y; >z2 : X.Y ->X : unknown +>X : any >Y : X.Y diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName4.symbols b/tests/baselines/reference/moduleAndInterfaceSharingName4.symbols new file mode 100644 index 00000000000..383b1801b2d --- /dev/null +++ b/tests/baselines/reference/moduleAndInterfaceSharingName4.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/moduleAndInterfaceSharingName4.ts === +declare module D3 { +>D3 : Symbol(D3, Decl(moduleAndInterfaceSharingName4.ts, 0, 0)) + + var x: D3.Color.Color; +>x : Symbol(x, Decl(moduleAndInterfaceSharingName4.ts, 1, 7)) +>D3 : Symbol(D3, Decl(moduleAndInterfaceSharingName4.ts, 0, 0)) +>Color : Symbol(Color, Decl(moduleAndInterfaceSharingName4.ts, 1, 26)) +>Color : Symbol(Color.Color, Decl(moduleAndInterfaceSharingName4.ts, 3, 18)) + + module Color { +>Color : Symbol(Color, Decl(moduleAndInterfaceSharingName4.ts, 1, 26)) + + export interface Color { +>Color : Symbol(Color, Decl(moduleAndInterfaceSharingName4.ts, 3, 18)) + + darker: Color; +>darker : Symbol(darker, Decl(moduleAndInterfaceSharingName4.ts, 4, 32)) +>Color : Symbol(Color, Decl(moduleAndInterfaceSharingName4.ts, 3, 18)) + } + } +} diff --git a/tests/baselines/reference/moduleAndInterfaceSharingName4.types b/tests/baselines/reference/moduleAndInterfaceSharingName4.types index 8ad5a15a4ff..1b96fce2406 100644 --- a/tests/baselines/reference/moduleAndInterfaceSharingName4.types +++ b/tests/baselines/reference/moduleAndInterfaceSharingName4.types @@ -4,12 +4,12 @@ declare module D3 { var x: D3.Color.Color; >x : Color.Color ->D3 : unknown ->Color : unknown +>D3 : any +>Color : any >Color : Color.Color module Color { ->Color : unknown +>Color : any export interface Color { >Color : Color diff --git a/tests/baselines/reference/moduleCodeGenTest3.symbols b/tests/baselines/reference/moduleCodeGenTest3.symbols new file mode 100644 index 00000000000..3a14deedcbd --- /dev/null +++ b/tests/baselines/reference/moduleCodeGenTest3.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/moduleCodeGenTest3.ts === +module Baz { export var x = "hello"; } +>Baz : Symbol(Baz, Decl(moduleCodeGenTest3.ts, 0, 0)) +>x : Symbol(x, Decl(moduleCodeGenTest3.ts, 0, 23)) + +Baz.x = "goodbye"; +>Baz.x : Symbol(Baz.x, Decl(moduleCodeGenTest3.ts, 0, 23)) +>Baz : Symbol(Baz, Decl(moduleCodeGenTest3.ts, 0, 0)) +>x : Symbol(Baz.x, Decl(moduleCodeGenTest3.ts, 0, 23)) + diff --git a/tests/baselines/reference/moduleCodeGenTest3.types b/tests/baselines/reference/moduleCodeGenTest3.types index d5e10130c0d..288b794326f 100644 --- a/tests/baselines/reference/moduleCodeGenTest3.types +++ b/tests/baselines/reference/moduleCodeGenTest3.types @@ -2,10 +2,12 @@ module Baz { export var x = "hello"; } >Baz : typeof Baz >x : string +>"hello" : string Baz.x = "goodbye"; >Baz.x = "goodbye" : string >Baz.x : string >Baz : typeof Baz >x : string +>"goodbye" : string diff --git a/tests/baselines/reference/moduleCodeGenTest5.symbols b/tests/baselines/reference/moduleCodeGenTest5.symbols new file mode 100644 index 00000000000..1e68d449665 --- /dev/null +++ b/tests/baselines/reference/moduleCodeGenTest5.symbols @@ -0,0 +1,53 @@ +=== tests/cases/compiler/moduleCodeGenTest5.ts === +export var x = 0; +>x : Symbol(x, Decl(moduleCodeGenTest5.ts, 0, 10)) + +var y = 0; +>y : Symbol(y, Decl(moduleCodeGenTest5.ts, 1, 3)) + +export function f1() {} +>f1 : Symbol(f1, Decl(moduleCodeGenTest5.ts, 1, 10)) + +function f2() {} +>f2 : Symbol(f2, Decl(moduleCodeGenTest5.ts, 3, 23)) + +export class C1 { +>C1 : Symbol(C1, Decl(moduleCodeGenTest5.ts, 4, 16)) + + public p1 = 0; +>p1 : Symbol(p1, Decl(moduleCodeGenTest5.ts, 6, 17)) + + public p2() {} +>p2 : Symbol(p2, Decl(moduleCodeGenTest5.ts, 7, 15)) +} +class C2{ +>C2 : Symbol(C2, Decl(moduleCodeGenTest5.ts, 9, 1)) + + public p1 = 0; +>p1 : Symbol(p1, Decl(moduleCodeGenTest5.ts, 10, 9)) + + public p2() {} +>p2 : Symbol(p2, Decl(moduleCodeGenTest5.ts, 11, 15)) +} + +export enum E1 {A=0} +>E1 : Symbol(E1, Decl(moduleCodeGenTest5.ts, 13, 1)) +>A : Symbol(E1.A, Decl(moduleCodeGenTest5.ts, 15, 16)) + +var u = E1.A; +>u : Symbol(u, Decl(moduleCodeGenTest5.ts, 16, 3)) +>E1.A : Symbol(E1.A, Decl(moduleCodeGenTest5.ts, 15, 16)) +>E1 : Symbol(E1, Decl(moduleCodeGenTest5.ts, 13, 1)) +>A : Symbol(E1.A, Decl(moduleCodeGenTest5.ts, 15, 16)) + +enum E2 {B=0} +>E2 : Symbol(E2, Decl(moduleCodeGenTest5.ts, 16, 13)) +>B : Symbol(E2.B, Decl(moduleCodeGenTest5.ts, 17, 9)) + +var v = E2.B; +>v : Symbol(v, Decl(moduleCodeGenTest5.ts, 18, 3)) +>E2.B : Symbol(E2.B, Decl(moduleCodeGenTest5.ts, 17, 9)) +>E2 : Symbol(E2, Decl(moduleCodeGenTest5.ts, 16, 13)) +>B : Symbol(E2.B, Decl(moduleCodeGenTest5.ts, 17, 9)) + + diff --git a/tests/baselines/reference/moduleCodeGenTest5.types b/tests/baselines/reference/moduleCodeGenTest5.types index 40161509aff..c2e4ccf6d65 100644 --- a/tests/baselines/reference/moduleCodeGenTest5.types +++ b/tests/baselines/reference/moduleCodeGenTest5.types @@ -1,9 +1,11 @@ === tests/cases/compiler/moduleCodeGenTest5.ts === export var x = 0; >x : number +>0 : number var y = 0; >y : number +>0 : number export function f1() {} >f1 : () => void @@ -16,6 +18,7 @@ export class C1 { public p1 = 0; >p1 : number +>0 : number public p2() {} >p2 : () => void @@ -25,6 +28,7 @@ class C2{ public p1 = 0; >p1 : number +>0 : number public p2() {} >p2 : () => void @@ -33,6 +37,7 @@ class C2{ export enum E1 {A=0} >E1 : E1 >A : E1 +>0 : number var u = E1.A; >u : E1 @@ -43,6 +48,7 @@ var u = E1.A; enum E2 {B=0} >E2 : E2 >B : E2 +>0 : number var v = E2.B; >v : E2 diff --git a/tests/baselines/reference/moduleCodegenTest4.symbols b/tests/baselines/reference/moduleCodegenTest4.symbols new file mode 100644 index 00000000000..166ab3a8eb1 --- /dev/null +++ b/tests/baselines/reference/moduleCodegenTest4.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/moduleCodegenTest4.ts === +export module Baz { export var x = "hello"; } +>Baz : Symbol(Baz, Decl(moduleCodegenTest4.ts, 0, 0)) +>x : Symbol(x, Decl(moduleCodegenTest4.ts, 0, 30)) + +Baz.x = "goodbye"; +>Baz.x : Symbol(Baz.x, Decl(moduleCodegenTest4.ts, 0, 30)) +>Baz : Symbol(Baz, Decl(moduleCodegenTest4.ts, 0, 0)) +>x : Symbol(Baz.x, Decl(moduleCodegenTest4.ts, 0, 30)) + +void 0; diff --git a/tests/baselines/reference/moduleCodegenTest4.types b/tests/baselines/reference/moduleCodegenTest4.types index 7b9229a46c1..919432c938f 100644 --- a/tests/baselines/reference/moduleCodegenTest4.types +++ b/tests/baselines/reference/moduleCodegenTest4.types @@ -2,13 +2,16 @@ export module Baz { export var x = "hello"; } >Baz : typeof Baz >x : string +>"hello" : string Baz.x = "goodbye"; >Baz.x = "goodbye" : string >Baz.x : string >Baz : typeof Baz >x : string +>"goodbye" : string void 0; >void 0 : undefined +>0 : number diff --git a/tests/baselines/reference/moduleIdentifiers.symbols b/tests/baselines/reference/moduleIdentifiers.symbols new file mode 100644 index 00000000000..ffb3ffa7335 --- /dev/null +++ b/tests/baselines/reference/moduleIdentifiers.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/moduleIdentifiers.ts === +module M { +>M : Symbol(M, Decl(moduleIdentifiers.ts, 0, 0)) + + interface P { x: number; y: number; } +>P : Symbol(P, Decl(moduleIdentifiers.ts, 0, 10)) +>x : Symbol(x, Decl(moduleIdentifiers.ts, 1, 17)) +>y : Symbol(y, Decl(moduleIdentifiers.ts, 1, 28)) + + export var a = 1 +>a : Symbol(a, Decl(moduleIdentifiers.ts, 2, 14)) +} + +//var p: M.P; +//var m: M = M; +var x1 = M.a; +>x1 : Symbol(x1, Decl(moduleIdentifiers.ts, 7, 3)) +>M.a : Symbol(M.a, Decl(moduleIdentifiers.ts, 2, 14)) +>M : Symbol(M, Decl(moduleIdentifiers.ts, 0, 0)) +>a : Symbol(M.a, Decl(moduleIdentifiers.ts, 2, 14)) + +//var x2 = m.a; +//var q: m.P; diff --git a/tests/baselines/reference/moduleIdentifiers.types b/tests/baselines/reference/moduleIdentifiers.types index db8b1c3f720..dc540823815 100644 --- a/tests/baselines/reference/moduleIdentifiers.types +++ b/tests/baselines/reference/moduleIdentifiers.types @@ -9,6 +9,7 @@ module M { export var a = 1 >a : number +>1 : number } //var p: M.P; diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.symbols b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.symbols new file mode 100644 index 00000000000..3d443f3413b --- /dev/null +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/moduleImportedForTypeArgumentPosition_1.ts === +/**This is on import declaration*/ +import M2 = require("moduleImportedForTypeArgumentPosition_0"); +>M2 : Symbol(M2, Decl(moduleImportedForTypeArgumentPosition_1.ts, 0, 0)) + +class C1{ } +>C1 : Symbol(C1, Decl(moduleImportedForTypeArgumentPosition_1.ts, 1, 63)) +>T : Symbol(T, Decl(moduleImportedForTypeArgumentPosition_1.ts, 2, 9)) + +class Test1 extends C1 { +>Test1 : Symbol(Test1, Decl(moduleImportedForTypeArgumentPosition_1.ts, 2, 14)) +>C1 : Symbol(C1, Decl(moduleImportedForTypeArgumentPosition_1.ts, 1, 63)) +>M2 : Symbol(M2, Decl(moduleImportedForTypeArgumentPosition_1.ts, 0, 0)) +>M2C : Symbol(M2.M2C, Decl(moduleImportedForTypeArgumentPosition_0.ts, 0, 0)) +} + +=== tests/cases/compiler/moduleImportedForTypeArgumentPosition_0.ts === +export interface M2C { } +>M2C : Symbol(M2C, Decl(moduleImportedForTypeArgumentPosition_0.ts, 0, 0)) + diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.types b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.types index c5c3f427377..0a85e6e0002 100644 --- a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.types +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.types @@ -10,7 +10,7 @@ class C1{ } class Test1 extends C1 { >Test1 : Test1 >C1 : C1 ->M2 : unknown +>M2 : any >M2C : M2.M2C } diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.symbols b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.symbols new file mode 100644 index 00000000000..fb743ea4f57 --- /dev/null +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.symbols @@ -0,0 +1,113 @@ +=== tests/cases/compiler/moduleMemberWithoutTypeAnnotation1.ts === +module TypeScript.Parser { +>TypeScript : Symbol(TypeScript, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 0), Decl(moduleMemberWithoutTypeAnnotation1.ts, 6, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 22, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 34, 1)) +>Parser : Symbol(Parser, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 18)) + + class SyntaxCursor { +>SyntaxCursor : Symbol(SyntaxCursor, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 26)) + + public currentNode(): SyntaxNode { +>currentNode : Symbol(currentNode, Decl(moduleMemberWithoutTypeAnnotation1.ts, 1, 24)) +>SyntaxNode : Symbol(SyntaxNode, Decl(moduleMemberWithoutTypeAnnotation1.ts, 24, 19)) + + return null; + } + } +} + +module TypeScript { +>TypeScript : Symbol(TypeScript, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 0), Decl(moduleMemberWithoutTypeAnnotation1.ts, 6, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 22, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 34, 1)) + + export interface ISyntaxElement { }; +>ISyntaxElement : Symbol(ISyntaxElement, Decl(moduleMemberWithoutTypeAnnotation1.ts, 8, 19)) + + export interface ISyntaxToken { }; +>ISyntaxToken : Symbol(ISyntaxToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 9, 40)) + + export class PositionedElement { +>PositionedElement : Symbol(PositionedElement, Decl(moduleMemberWithoutTypeAnnotation1.ts, 10, 38)) + + public childIndex(child: ISyntaxElement) { +>childIndex : Symbol(childIndex, Decl(moduleMemberWithoutTypeAnnotation1.ts, 12, 36)) +>child : Symbol(child, Decl(moduleMemberWithoutTypeAnnotation1.ts, 13, 26)) +>ISyntaxElement : Symbol(ISyntaxElement, Decl(moduleMemberWithoutTypeAnnotation1.ts, 8, 19)) + + return Syntax.childIndex(); +>Syntax.childIndex : Symbol(Syntax.childIndex, Decl(moduleMemberWithoutTypeAnnotation1.ts, 36, 26)) +>Syntax : Symbol(Syntax, Decl(moduleMemberWithoutTypeAnnotation1.ts, 36, 18)) +>childIndex : Symbol(Syntax.childIndex, Decl(moduleMemberWithoutTypeAnnotation1.ts, 36, 26)) + } + } + + export class PositionedToken { +>PositionedToken : Symbol(PositionedToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 16, 5)) + + constructor(parent: PositionedElement, token: ISyntaxToken, fullStart: number) { +>parent : Symbol(parent, Decl(moduleMemberWithoutTypeAnnotation1.ts, 19, 20)) +>PositionedElement : Symbol(PositionedElement, Decl(moduleMemberWithoutTypeAnnotation1.ts, 10, 38)) +>token : Symbol(token, Decl(moduleMemberWithoutTypeAnnotation1.ts, 19, 46)) +>ISyntaxToken : Symbol(ISyntaxToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 9, 40)) +>fullStart : Symbol(fullStart, Decl(moduleMemberWithoutTypeAnnotation1.ts, 19, 67)) + } + } +} + +module TypeScript { +>TypeScript : Symbol(TypeScript, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 0), Decl(moduleMemberWithoutTypeAnnotation1.ts, 6, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 22, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 34, 1)) + + export class SyntaxNode { +>SyntaxNode : Symbol(SyntaxNode, Decl(moduleMemberWithoutTypeAnnotation1.ts, 24, 19)) + + public findToken(position: number, includeSkippedTokens: boolean = false): PositionedToken { +>findToken : Symbol(findToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 25, 29)) +>position : Symbol(position, Decl(moduleMemberWithoutTypeAnnotation1.ts, 26, 25)) +>includeSkippedTokens : Symbol(includeSkippedTokens, Decl(moduleMemberWithoutTypeAnnotation1.ts, 26, 42)) +>PositionedToken : Symbol(PositionedToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 16, 5)) + + var positionedToken = this.findTokenInternal(null, position, 0); +>positionedToken : Symbol(positionedToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 27, 15)) +>this.findTokenInternal : Symbol(findTokenInternal, Decl(moduleMemberWithoutTypeAnnotation1.ts, 29, 9)) +>this : Symbol(SyntaxNode, Decl(moduleMemberWithoutTypeAnnotation1.ts, 24, 19)) +>findTokenInternal : Symbol(findTokenInternal, Decl(moduleMemberWithoutTypeAnnotation1.ts, 29, 9)) +>position : Symbol(position, Decl(moduleMemberWithoutTypeAnnotation1.ts, 26, 25)) + + return null; + } + findTokenInternal(x, y, z) { +>findTokenInternal : Symbol(findTokenInternal, Decl(moduleMemberWithoutTypeAnnotation1.ts, 29, 9)) +>x : Symbol(x, Decl(moduleMemberWithoutTypeAnnotation1.ts, 30, 26)) +>y : Symbol(y, Decl(moduleMemberWithoutTypeAnnotation1.ts, 30, 28)) +>z : Symbol(z, Decl(moduleMemberWithoutTypeAnnotation1.ts, 30, 31)) + + return null; + } + } +} + +module TypeScript.Syntax { +>TypeScript : Symbol(TypeScript, Decl(moduleMemberWithoutTypeAnnotation1.ts, 0, 0), Decl(moduleMemberWithoutTypeAnnotation1.ts, 6, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 22, 1), Decl(moduleMemberWithoutTypeAnnotation1.ts, 34, 1)) +>Syntax : Symbol(Syntax, Decl(moduleMemberWithoutTypeAnnotation1.ts, 36, 18)) + + export function childIndex() { } +>childIndex : Symbol(childIndex, Decl(moduleMemberWithoutTypeAnnotation1.ts, 36, 26)) + + export class VariableWidthTokenWithTrailingTrivia implements ISyntaxToken { +>VariableWidthTokenWithTrailingTrivia : Symbol(VariableWidthTokenWithTrailingTrivia, Decl(moduleMemberWithoutTypeAnnotation1.ts, 37, 36)) +>ISyntaxToken : Symbol(ISyntaxToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 9, 40)) + + private findTokenInternal(parent: PositionedElement, position: number, fullStart: number) { +>findTokenInternal : Symbol(findTokenInternal, Decl(moduleMemberWithoutTypeAnnotation1.ts, 39, 79)) +>parent : Symbol(parent, Decl(moduleMemberWithoutTypeAnnotation1.ts, 40, 34)) +>PositionedElement : Symbol(PositionedElement, Decl(moduleMemberWithoutTypeAnnotation1.ts, 10, 38)) +>position : Symbol(position, Decl(moduleMemberWithoutTypeAnnotation1.ts, 40, 60)) +>fullStart : Symbol(fullStart, Decl(moduleMemberWithoutTypeAnnotation1.ts, 40, 78)) + + return new PositionedToken(parent, this, fullStart); +>PositionedToken : Symbol(PositionedToken, Decl(moduleMemberWithoutTypeAnnotation1.ts, 16, 5)) +>parent : Symbol(parent, Decl(moduleMemberWithoutTypeAnnotation1.ts, 40, 34)) +>this : Symbol(VariableWidthTokenWithTrailingTrivia, Decl(moduleMemberWithoutTypeAnnotation1.ts, 37, 36)) +>fullStart : Symbol(fullStart, Decl(moduleMemberWithoutTypeAnnotation1.ts, 40, 78)) + } + } +} + diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types index d8f6083b2c9..ebe70d8e6fb 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types @@ -11,6 +11,7 @@ module TypeScript.Parser { >SyntaxNode : SyntaxNode return null; +>null : null } } } @@ -63,6 +64,7 @@ module TypeScript { >findToken : (position: number, includeSkippedTokens?: boolean) => PositionedToken >position : number >includeSkippedTokens : boolean +>false : boolean >PositionedToken : PositionedToken var positionedToken = this.findTokenInternal(null, position, 0); @@ -71,9 +73,12 @@ module TypeScript { >this.findTokenInternal : (x: any, y: any, z: any) => any >this : SyntaxNode >findTokenInternal : (x: any, y: any, z: any) => any +>null : null >position : number +>0 : number return null; +>null : null } findTokenInternal(x, y, z) { >findTokenInternal : (x: any, y: any, z: any) => any @@ -82,6 +87,7 @@ module TypeScript { >z : any return null; +>null : null } } } diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.symbols b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.symbols new file mode 100644 index 00000000000..e69b8c37458 --- /dev/null +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/moduleMemberWithoutTypeAnnotation2.ts === +module TypeScript { +>TypeScript : Symbol(TypeScript, Decl(moduleMemberWithoutTypeAnnotation2.ts, 0, 0)) + + export module CompilerDiagnostics { +>CompilerDiagnostics : Symbol(CompilerDiagnostics, Decl(moduleMemberWithoutTypeAnnotation2.ts, 0, 19)) + + export interface IDiagnosticWriter { +>IDiagnosticWriter : Symbol(IDiagnosticWriter, Decl(moduleMemberWithoutTypeAnnotation2.ts, 1, 39)) + + Alert(output: string): void; +>Alert : Symbol(Alert, Decl(moduleMemberWithoutTypeAnnotation2.ts, 3, 44)) +>output : Symbol(output, Decl(moduleMemberWithoutTypeAnnotation2.ts, 4, 18)) + } + + export var diagnosticWriter = null; +>diagnosticWriter : Symbol(diagnosticWriter, Decl(moduleMemberWithoutTypeAnnotation2.ts, 7, 18)) + + export function Alert(output: string) { +>Alert : Symbol(Alert, Decl(moduleMemberWithoutTypeAnnotation2.ts, 7, 43)) +>output : Symbol(output, Decl(moduleMemberWithoutTypeAnnotation2.ts, 9, 30)) + + if (diagnosticWriter) { +>diagnosticWriter : Symbol(diagnosticWriter, Decl(moduleMemberWithoutTypeAnnotation2.ts, 7, 18)) + + diagnosticWriter.Alert(output); +>diagnosticWriter : Symbol(diagnosticWriter, Decl(moduleMemberWithoutTypeAnnotation2.ts, 7, 18)) +>output : Symbol(output, Decl(moduleMemberWithoutTypeAnnotation2.ts, 9, 30)) + } + } + } +} + diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types index 2a5d2c76e76..8a06502f1fc 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types @@ -15,6 +15,7 @@ module TypeScript { export var diagnosticWriter = null; >diagnosticWriter : any +>null : null export function Alert(output: string) { >Alert : (output: string) => void diff --git a/tests/baselines/reference/moduleMerge.symbols b/tests/baselines/reference/moduleMerge.symbols new file mode 100644 index 00000000000..2c288be6ff6 --- /dev/null +++ b/tests/baselines/reference/moduleMerge.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/moduleMerge.ts === +// This should not compile both B classes are in the same module this should be a collission + +module A +>A : Symbol(A, Decl(moduleMerge.ts, 0, 0), Decl(moduleMerge.ts, 11, 1)) +{ + class B +>B : Symbol(B, Decl(moduleMerge.ts, 3, 1)) + { + public Hello(): string +>Hello : Symbol(Hello, Decl(moduleMerge.ts, 5, 5)) + { + return "from private B"; + } + } +} + +module A +>A : Symbol(A, Decl(moduleMerge.ts, 0, 0), Decl(moduleMerge.ts, 11, 1)) +{ + export class B +>B : Symbol(B, Decl(moduleMerge.ts, 14, 1)) + { + public Hello(): string +>Hello : Symbol(Hello, Decl(moduleMerge.ts, 16, 5)) + { + return "from export B"; + } + } +} diff --git a/tests/baselines/reference/moduleMerge.types b/tests/baselines/reference/moduleMerge.types index b70f786b7a2..06d532673ed 100644 --- a/tests/baselines/reference/moduleMerge.types +++ b/tests/baselines/reference/moduleMerge.types @@ -11,6 +11,7 @@ module A >Hello : () => string { return "from private B"; +>"from private B" : string } } } @@ -25,6 +26,7 @@ module A >Hello : () => string { return "from export B"; +>"from export B" : string } } } diff --git a/tests/baselines/reference/moduleNoEmit.symbols b/tests/baselines/reference/moduleNoEmit.symbols new file mode 100644 index 00000000000..3bc3467dc6d --- /dev/null +++ b/tests/baselines/reference/moduleNoEmit.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/moduleNoEmit.ts === +module Foo { +>Foo : Symbol(Foo, Decl(moduleNoEmit.ts, 0, 0)) + + 1+1; +} diff --git a/tests/baselines/reference/moduleNoEmit.types b/tests/baselines/reference/moduleNoEmit.types index 7fb6b6164d6..1097bea5a4c 100644 --- a/tests/baselines/reference/moduleNoEmit.types +++ b/tests/baselines/reference/moduleNoEmit.types @@ -4,4 +4,6 @@ module Foo { 1+1; >1+1 : number +>1 : number +>1 : number } diff --git a/tests/baselines/reference/moduleOuterQualification.symbols b/tests/baselines/reference/moduleOuterQualification.symbols new file mode 100644 index 00000000000..32791347258 --- /dev/null +++ b/tests/baselines/reference/moduleOuterQualification.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/moduleOuterQualification.ts === + +declare module outer { +>outer : Symbol(outer, Decl(moduleOuterQualification.ts, 0, 0)) + + interface Beta { } +>Beta : Symbol(Beta, Decl(moduleOuterQualification.ts, 1, 22)) + + module inner { +>inner : Symbol(inner, Decl(moduleOuterQualification.ts, 2, 20)) + + // .d.ts emit: should be 'extends outer.Beta' + export interface Beta extends outer.Beta { } +>Beta : Symbol(Beta, Decl(moduleOuterQualification.ts, 3, 16)) +>outer.Beta : Symbol(Beta, Decl(moduleOuterQualification.ts, 1, 22)) +>outer : Symbol(outer, Decl(moduleOuterQualification.ts, 0, 0)) +>Beta : Symbol(Beta, Decl(moduleOuterQualification.ts, 1, 22)) + } +} + diff --git a/tests/baselines/reference/moduleOuterQualification.types b/tests/baselines/reference/moduleOuterQualification.types index 95a18f58bcd..7cfab635023 100644 --- a/tests/baselines/reference/moduleOuterQualification.types +++ b/tests/baselines/reference/moduleOuterQualification.types @@ -1,18 +1,19 @@ === tests/cases/compiler/moduleOuterQualification.ts === declare module outer { ->outer : unknown +>outer : any interface Beta { } >Beta : Beta module inner { ->inner : unknown +>inner : any // .d.ts emit: should be 'extends outer.Beta' export interface Beta extends outer.Beta { } >Beta : Beta ->outer : unknown +>outer.Beta : any +>outer : any >Beta : outer.Beta } } diff --git a/tests/baselines/reference/moduleRedifinitionErrors.symbols b/tests/baselines/reference/moduleRedifinitionErrors.symbols new file mode 100644 index 00000000000..ad4c07ff7f3 --- /dev/null +++ b/tests/baselines/reference/moduleRedifinitionErrors.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/moduleRedifinitionErrors.ts === +class A { +>A : Symbol(A, Decl(moduleRedifinitionErrors.ts, 0, 0), Decl(moduleRedifinitionErrors.ts, 1, 1)) +} +module A { +>A : Symbol(A, Decl(moduleRedifinitionErrors.ts, 0, 0), Decl(moduleRedifinitionErrors.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/moduleReopenedTypeOtherBlock.symbols b/tests/baselines/reference/moduleReopenedTypeOtherBlock.symbols new file mode 100644 index 00000000000..1a5017b89c7 --- /dev/null +++ b/tests/baselines/reference/moduleReopenedTypeOtherBlock.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/moduleReopenedTypeOtherBlock.ts === +module M { +>M : Symbol(M, Decl(moduleReopenedTypeOtherBlock.ts, 0, 0), Decl(moduleReopenedTypeOtherBlock.ts, 3, 1)) + + export class C1 { } +>C1 : Symbol(C1, Decl(moduleReopenedTypeOtherBlock.ts, 0, 10)) + + export interface I { n: number; } +>I : Symbol(I, Decl(moduleReopenedTypeOtherBlock.ts, 1, 23)) +>n : Symbol(n, Decl(moduleReopenedTypeOtherBlock.ts, 2, 24)) +} +module M { +>M : Symbol(M, Decl(moduleReopenedTypeOtherBlock.ts, 0, 0), Decl(moduleReopenedTypeOtherBlock.ts, 3, 1)) + + export class C2 { f(): I { return null; } } +>C2 : Symbol(C2, Decl(moduleReopenedTypeOtherBlock.ts, 4, 10)) +>f : Symbol(f, Decl(moduleReopenedTypeOtherBlock.ts, 5, 21)) +>I : Symbol(I, Decl(moduleReopenedTypeOtherBlock.ts, 1, 23)) +} + diff --git a/tests/baselines/reference/moduleReopenedTypeOtherBlock.types b/tests/baselines/reference/moduleReopenedTypeOtherBlock.types index f98c069c338..c48c43ffd9a 100644 --- a/tests/baselines/reference/moduleReopenedTypeOtherBlock.types +++ b/tests/baselines/reference/moduleReopenedTypeOtherBlock.types @@ -16,5 +16,6 @@ module M { >C2 : C2 >f : () => I >I : I +>null : null } diff --git a/tests/baselines/reference/moduleReopenedTypeSameBlock.symbols b/tests/baselines/reference/moduleReopenedTypeSameBlock.symbols new file mode 100644 index 00000000000..a593b63cd01 --- /dev/null +++ b/tests/baselines/reference/moduleReopenedTypeSameBlock.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/moduleReopenedTypeSameBlock.ts === +module M { export class C1 { } } +>M : Symbol(M, Decl(moduleReopenedTypeSameBlock.ts, 0, 0), Decl(moduleReopenedTypeSameBlock.ts, 0, 32)) +>C1 : Symbol(C1, Decl(moduleReopenedTypeSameBlock.ts, 0, 10)) + +module M { +>M : Symbol(M, Decl(moduleReopenedTypeSameBlock.ts, 0, 0), Decl(moduleReopenedTypeSameBlock.ts, 0, 32)) + + export interface I { n: number; } +>I : Symbol(I, Decl(moduleReopenedTypeSameBlock.ts, 1, 10)) +>n : Symbol(n, Decl(moduleReopenedTypeSameBlock.ts, 2, 24)) + + export class C2 { f(): I { return null; } } +>C2 : Symbol(C2, Decl(moduleReopenedTypeSameBlock.ts, 2, 37)) +>f : Symbol(f, Decl(moduleReopenedTypeSameBlock.ts, 3, 21)) +>I : Symbol(I, Decl(moduleReopenedTypeSameBlock.ts, 1, 10)) +} + diff --git a/tests/baselines/reference/moduleReopenedTypeSameBlock.types b/tests/baselines/reference/moduleReopenedTypeSameBlock.types index 8f119fff60c..7dec66f6c7b 100644 --- a/tests/baselines/reference/moduleReopenedTypeSameBlock.types +++ b/tests/baselines/reference/moduleReopenedTypeSameBlock.types @@ -14,5 +14,6 @@ module M { >C2 : C2 >f : () => I >I : I +>null : null } diff --git a/tests/baselines/reference/moduleScopingBug.symbols b/tests/baselines/reference/moduleScopingBug.symbols new file mode 100644 index 00000000000..277f1a48f7b --- /dev/null +++ b/tests/baselines/reference/moduleScopingBug.symbols @@ -0,0 +1,41 @@ +=== tests/cases/compiler/moduleScopingBug.ts === +module M +>M : Symbol(M, Decl(moduleScopingBug.ts, 0, 0)) + +{ + + var outer: number; +>outer : Symbol(outer, Decl(moduleScopingBug.ts, 4, 7)) + + function f() { +>f : Symbol(f, Decl(moduleScopingBug.ts, 4, 22)) + + var inner = outer; // Ok +>inner : Symbol(inner, Decl(moduleScopingBug.ts, 8, 11)) +>outer : Symbol(outer, Decl(moduleScopingBug.ts, 4, 7)) + + } + + class C { +>C : Symbol(C, Decl(moduleScopingBug.ts, 10, 5)) + + constructor() { + var inner = outer; // Ok +>inner : Symbol(inner, Decl(moduleScopingBug.ts, 15, 15)) +>outer : Symbol(outer, Decl(moduleScopingBug.ts, 4, 7)) + } + + } + + module X { +>X : Symbol(X, Decl(moduleScopingBug.ts, 18, 5)) + + var inner = outer; // Error: outer not visible +>inner : Symbol(inner, Decl(moduleScopingBug.ts, 22, 11)) +>outer : Symbol(outer, Decl(moduleScopingBug.ts, 4, 7)) + + } + +} + + diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.symbols b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.symbols new file mode 100644 index 00000000000..6dcd97aa0dc --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt.ts === +module Z.M { +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 12)) + + return ""; + } +} +module A.M { +>A : Symbol(A, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 4, 1)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 5, 9)) + + import M = Z.M; +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 5, 12)) +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 6, 19)) + } + M.bar(); // Should call Z.M.bar +>M.bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 12)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 5, 12)) +>bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt.ts, 0, 12)) +} diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types index 5a29a01cec7..b473adf2aa4 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt.types @@ -7,6 +7,7 @@ module Z.M { >bar : () => string return ""; +>"" : string } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.symbols b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.symbols new file mode 100644 index 00000000000..c5185cbda0a --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt2.ts === +module Z.M { +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 12)) + + return ""; + } +} +module A.M { +>A : Symbol(A, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 4, 1)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 5, 9)) + + export import M = Z.M; +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 5, 12)) +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 6, 26)) + } + M.bar(); // Should call Z.M.bar +>M.bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 12)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 5, 12)) +>bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt2.ts, 0, 12)) +} diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types index 75aba0e2d0e..56160637e0f 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt2.types @@ -7,6 +7,7 @@ module Z.M { >bar : () => string return ""; +>"" : string } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.symbols b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.symbols new file mode 100644 index 00000000000..8ef55c23d9f --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt4.ts === +module Z.M { +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 12)) + + return ""; + } +} +module A.M { +>A : Symbol(A, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 4, 1)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 5, 9)) + + interface M { } +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 5, 12), Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 6, 19)) + + import M = Z.M; +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 5, 12), Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 6, 19)) +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 7, 19)) + } + M.bar(); // Should call Z.M.bar +>M.bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 12)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 5, 12), Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 6, 19)) +>bar : Symbol(M.bar, Decl(moduleSharesNameWithImportDeclarationInsideIt4.ts, 0, 12)) +} diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types index b4df2e0ae08..b8574a2c71f 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt4.types @@ -7,6 +7,7 @@ module Z.M { >bar : () => string return ""; +>"" : string } } module A.M { diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.symbols b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.symbols new file mode 100644 index 00000000000..47761f66028 --- /dev/null +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.symbols @@ -0,0 +1,24 @@ +=== tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt6.ts === +module Z.M { +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 0, 12)) + + return ""; + } +} +module A.M { +>A : Symbol(A, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 4, 1)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 5, 9)) + + import M = Z.M; +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 5, 12)) +>Z : Symbol(Z, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 0, 0)) +>M : Symbol(M, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 0, 9)) + + export function bar() { +>bar : Symbol(bar, Decl(moduleSharesNameWithImportDeclarationInsideIt6.ts, 6, 19)) + } +} diff --git a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types index 01879d2db11..65f820e0606 100644 --- a/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types +++ b/tests/baselines/reference/moduleSharesNameWithImportDeclarationInsideIt6.types @@ -7,6 +7,7 @@ module Z.M { >bar : () => string return ""; +>"" : string } } module A.M { diff --git a/tests/baselines/reference/moduleSymbolMerging.symbols b/tests/baselines/reference/moduleSymbolMerging.symbols new file mode 100644 index 00000000000..4e8ca8a1526 --- /dev/null +++ b/tests/baselines/reference/moduleSymbolMerging.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/B.ts === +/// +module A { ; } +>A : Symbol(A, Decl(A.ts, 0, 0), Decl(B.ts, 0, 0)) + +module B { +>B : Symbol(B, Decl(B.ts, 1, 14)) + + export function f(): A.I { return null; } +>f : Symbol(f, Decl(B.ts, 2, 10)) +>A : Symbol(A, Decl(A.ts, 0, 0), Decl(B.ts, 0, 0)) +>I : Symbol(A.I, Decl(A.ts, 1, 10)) +} + + +=== tests/cases/compiler/A.ts === + +module A { export interface I {} } +>A : Symbol(A, Decl(A.ts, 0, 0), Decl(B.ts, 0, 0)) +>I : Symbol(I, Decl(A.ts, 1, 10)) + diff --git a/tests/baselines/reference/moduleSymbolMerging.types b/tests/baselines/reference/moduleSymbolMerging.types index c6b0f58ef46..0f5dfae5c3d 100644 --- a/tests/baselines/reference/moduleSymbolMerging.types +++ b/tests/baselines/reference/moduleSymbolMerging.types @@ -8,8 +8,9 @@ module B { export function f(): A.I { return null; } >f : () => A.I ->A : unknown +>A : any >I : A.I +>null : null } diff --git a/tests/baselines/reference/moduleUnassignedVariable.symbols b/tests/baselines/reference/moduleUnassignedVariable.symbols new file mode 100644 index 00000000000..fe17767dcf2 --- /dev/null +++ b/tests/baselines/reference/moduleUnassignedVariable.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/moduleUnassignedVariable.ts === +module Bar { +>Bar : Symbol(Bar, Decl(moduleUnassignedVariable.ts, 0, 0)) + + export var a = 1; +>a : Symbol(a, Decl(moduleUnassignedVariable.ts, 1, 14)) + + function fooA() { return a; } // Correct: return Bar.a +>fooA : Symbol(fooA, Decl(moduleUnassignedVariable.ts, 1, 21)) +>a : Symbol(a, Decl(moduleUnassignedVariable.ts, 1, 14)) + + export var b; +>b : Symbol(b, Decl(moduleUnassignedVariable.ts, 4, 14)) + + function fooB() { return b; } // Incorrect: return b +>fooB : Symbol(fooB, Decl(moduleUnassignedVariable.ts, 4, 17)) +>b : Symbol(b, Decl(moduleUnassignedVariable.ts, 4, 14)) +} + diff --git a/tests/baselines/reference/moduleUnassignedVariable.types b/tests/baselines/reference/moduleUnassignedVariable.types index 7d1dd8600cf..3e5ab538ad5 100644 --- a/tests/baselines/reference/moduleUnassignedVariable.types +++ b/tests/baselines/reference/moduleUnassignedVariable.types @@ -4,6 +4,7 @@ module Bar { export var a = 1; >a : number +>1 : number function fooA() { return a; } // Correct: return Bar.a >fooA : () => number diff --git a/tests/baselines/reference/moduleVariableArrayIndexer.symbols b/tests/baselines/reference/moduleVariableArrayIndexer.symbols new file mode 100644 index 00000000000..9a60da7bd6b --- /dev/null +++ b/tests/baselines/reference/moduleVariableArrayIndexer.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/moduleVariableArrayIndexer.ts === +module Bar { +>Bar : Symbol(Bar, Decl(moduleVariableArrayIndexer.ts, 0, 0)) + + export var a = 1; +>a : Symbol(a, Decl(moduleVariableArrayIndexer.ts, 1, 14)) + + var t = undefined[a][a]; // CG: var t = undefined[Bar.a][a]; +>t : Symbol(t, Decl(moduleVariableArrayIndexer.ts, 2, 7)) +>undefined : Symbol(undefined) +>a : Symbol(a, Decl(moduleVariableArrayIndexer.ts, 1, 14)) +>a : Symbol(a, Decl(moduleVariableArrayIndexer.ts, 1, 14)) +} + diff --git a/tests/baselines/reference/moduleVariableArrayIndexer.types b/tests/baselines/reference/moduleVariableArrayIndexer.types index 564de3ff972..4c8e73b9478 100644 --- a/tests/baselines/reference/moduleVariableArrayIndexer.types +++ b/tests/baselines/reference/moduleVariableArrayIndexer.types @@ -4,6 +4,7 @@ module Bar { export var a = 1; >a : number +>1 : number var t = undefined[a][a]; // CG: var t = undefined[Bar.a][a]; >t : any diff --git a/tests/baselines/reference/moduleVariables.symbols b/tests/baselines/reference/moduleVariables.symbols new file mode 100644 index 00000000000..7b4ac8e0c5c --- /dev/null +++ b/tests/baselines/reference/moduleVariables.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/moduleVariables.ts === +declare var console: any; +>console : Symbol(console, Decl(moduleVariables.ts, 0, 11)) + +var x = 1; +>x : Symbol(x, Decl(moduleVariables.ts, 2, 3)) + +module M { +>M : Symbol(M, Decl(moduleVariables.ts, 2, 10), Decl(moduleVariables.ts, 6, 1), Decl(moduleVariables.ts, 10, 1)) + + export var x = 2; +>x : Symbol(x, Decl(moduleVariables.ts, 4, 14)) + + console.log(x); // 2 +>console : Symbol(console, Decl(moduleVariables.ts, 0, 11)) +>x : Symbol(x, Decl(moduleVariables.ts, 4, 14)) +} + +module M { +>M : Symbol(M, Decl(moduleVariables.ts, 2, 10), Decl(moduleVariables.ts, 6, 1), Decl(moduleVariables.ts, 10, 1)) + + console.log(x); // 2 +>console : Symbol(console, Decl(moduleVariables.ts, 0, 11)) +>x : Symbol(x, Decl(moduleVariables.ts, 4, 14)) +} + +module M { +>M : Symbol(M, Decl(moduleVariables.ts, 2, 10), Decl(moduleVariables.ts, 6, 1), Decl(moduleVariables.ts, 10, 1)) + + var x = 3; +>x : Symbol(x, Decl(moduleVariables.ts, 13, 7)) + + console.log(x); // 3 +>console : Symbol(console, Decl(moduleVariables.ts, 0, 11)) +>x : Symbol(x, Decl(moduleVariables.ts, 13, 7)) +} + diff --git a/tests/baselines/reference/moduleVariables.types b/tests/baselines/reference/moduleVariables.types index 2c00df87f56..5bdf8490aed 100644 --- a/tests/baselines/reference/moduleVariables.types +++ b/tests/baselines/reference/moduleVariables.types @@ -4,12 +4,14 @@ declare var console: any; var x = 1; >x : number +>1 : number module M { >M : typeof M export var x = 2; >x : number +>2 : number console.log(x); // 2 >console.log(x) : any @@ -35,6 +37,7 @@ module M { var x = 3; >x : number +>3 : number console.log(x); // 3 >console.log(x) : any diff --git a/tests/baselines/reference/moduleVisibilityTest1.symbols b/tests/baselines/reference/moduleVisibilityTest1.symbols new file mode 100644 index 00000000000..9879d8a0151 --- /dev/null +++ b/tests/baselines/reference/moduleVisibilityTest1.symbols @@ -0,0 +1,166 @@ +=== tests/cases/compiler/moduleVisibilityTest1.ts === + + +module OuterMod { +>OuterMod : Symbol(OuterMod, Decl(moduleVisibilityTest1.ts, 0, 0)) + + export function someExportedOuterFunc() { return -1; } +>someExportedOuterFunc : Symbol(someExportedOuterFunc, Decl(moduleVisibilityTest1.ts, 2, 17)) + + export module OuterInnerMod { +>OuterInnerMod : Symbol(OuterInnerMod, Decl(moduleVisibilityTest1.ts, 3, 55)) + + export function someExportedOuterInnerFunc() { return "foo"; } +>someExportedOuterInnerFunc : Symbol(someExportedOuterInnerFunc, Decl(moduleVisibilityTest1.ts, 5, 30)) + } +} + +import OuterInnerAlias = OuterMod.OuterInnerMod; +>OuterInnerAlias : Symbol(OuterInnerAlias, Decl(moduleVisibilityTest1.ts, 8, 1)) +>OuterMod : Symbol(OuterMod, Decl(moduleVisibilityTest1.ts, 0, 0)) +>OuterInnerMod : Symbol(OuterInnerAlias, Decl(moduleVisibilityTest1.ts, 3, 55)) + +module M { +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) + + export module InnerMod { +>InnerMod : Symbol(InnerMod, Decl(moduleVisibilityTest1.ts, 12, 10)) + + export function someExportedInnerFunc() { return -2; } +>someExportedInnerFunc : Symbol(someExportedInnerFunc, Decl(moduleVisibilityTest1.ts, 14, 25)) + } + + export enum E { +>E : Symbol(E, Decl(moduleVisibilityTest1.ts, 16, 2)) + + A, +>A : Symbol(E.A, Decl(moduleVisibilityTest1.ts, 18, 16)) + + B, +>B : Symbol(E.B, Decl(moduleVisibilityTest1.ts, 19, 4)) + + C, +>C : Symbol(E.C, Decl(moduleVisibilityTest1.ts, 20, 4)) + } + + export var x = 5; +>x : Symbol(x, Decl(moduleVisibilityTest1.ts, 24, 11)) + + export declare var exported_var; +>exported_var : Symbol(exported_var, Decl(moduleVisibilityTest1.ts, 25, 19)) + + var y = x + x; +>y : Symbol(y, Decl(moduleVisibilityTest1.ts, 27, 4)) +>x : Symbol(x, Decl(moduleVisibilityTest1.ts, 24, 11)) +>x : Symbol(x, Decl(moduleVisibilityTest1.ts, 24, 11)) + + + export interface I { +>I : Symbol(I, Decl(moduleVisibilityTest1.ts, 27, 15)) + + someMethod():number; +>someMethod : Symbol(someMethod, Decl(moduleVisibilityTest1.ts, 30, 21)) + } + + class B {public b = 0;} +>B : Symbol(B, Decl(moduleVisibilityTest1.ts, 32, 2)) +>b : Symbol(b, Decl(moduleVisibilityTest1.ts, 34, 11)) + + export class C implements I { +>C : Symbol(C, Decl(moduleVisibilityTest1.ts, 34, 25)) +>I : Symbol(I, Decl(moduleVisibilityTest1.ts, 27, 15)) + + public someMethodThatCallsAnOuterMethod() {return OuterInnerAlias.someExportedOuterInnerFunc();} +>someMethodThatCallsAnOuterMethod : Symbol(someMethodThatCallsAnOuterMethod, Decl(moduleVisibilityTest1.ts, 36, 31)) +>OuterInnerAlias.someExportedOuterInnerFunc : Symbol(OuterInnerAlias.someExportedOuterInnerFunc, Decl(moduleVisibilityTest1.ts, 5, 30)) +>OuterInnerAlias : Symbol(OuterInnerAlias, Decl(moduleVisibilityTest1.ts, 8, 1)) +>someExportedOuterInnerFunc : Symbol(OuterInnerAlias.someExportedOuterInnerFunc, Decl(moduleVisibilityTest1.ts, 5, 30)) + + public someMethodThatCallsAnInnerMethod() {return InnerMod.someExportedInnerFunc();} +>someMethodThatCallsAnInnerMethod : Symbol(someMethodThatCallsAnInnerMethod, Decl(moduleVisibilityTest1.ts, 37, 98)) +>InnerMod.someExportedInnerFunc : Symbol(InnerMod.someExportedInnerFunc, Decl(moduleVisibilityTest1.ts, 14, 25)) +>InnerMod : Symbol(InnerMod, Decl(moduleVisibilityTest1.ts, 12, 10)) +>someExportedInnerFunc : Symbol(InnerMod.someExportedInnerFunc, Decl(moduleVisibilityTest1.ts, 14, 25)) + + public someMethodThatCallsAnOuterInnerMethod() {return OuterMod.someExportedOuterFunc();} +>someMethodThatCallsAnOuterInnerMethod : Symbol(someMethodThatCallsAnOuterInnerMethod, Decl(moduleVisibilityTest1.ts, 38, 86)) +>OuterMod.someExportedOuterFunc : Symbol(OuterMod.someExportedOuterFunc, Decl(moduleVisibilityTest1.ts, 2, 17)) +>OuterMod : Symbol(OuterMod, Decl(moduleVisibilityTest1.ts, 0, 0)) +>someExportedOuterFunc : Symbol(OuterMod.someExportedOuterFunc, Decl(moduleVisibilityTest1.ts, 2, 17)) + + public someMethod() { return 0; } +>someMethod : Symbol(someMethod, Decl(moduleVisibilityTest1.ts, 39, 91)) + + public someProp = 1; +>someProp : Symbol(someProp, Decl(moduleVisibilityTest1.ts, 40, 35)) + + constructor() { + function someInnerFunc() { return 2; } +>someInnerFunc : Symbol(someInnerFunc, Decl(moduleVisibilityTest1.ts, 43, 17)) + + var someInnerVar = 3; +>someInnerVar : Symbol(someInnerVar, Decl(moduleVisibilityTest1.ts, 45, 15)) + } + } + + var someModuleVar = 4; +>someModuleVar : Symbol(someModuleVar, Decl(moduleVisibilityTest1.ts, 49, 4)) + + function someModuleFunction() { return 5;} +>someModuleFunction : Symbol(someModuleFunction, Decl(moduleVisibilityTest1.ts, 49, 23)) +} + +module M { +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) + + export var c = x; +>c : Symbol(c, Decl(moduleVisibilityTest1.ts, 55, 11)) +>x : Symbol(x, Decl(moduleVisibilityTest1.ts, 24, 11)) + + export var meb = M.E.B; +>meb : Symbol(meb, Decl(moduleVisibilityTest1.ts, 56, 11)) +>M.E.B : Symbol(E.B, Decl(moduleVisibilityTest1.ts, 19, 4)) +>M.E : Symbol(E, Decl(moduleVisibilityTest1.ts, 16, 2)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>E : Symbol(E, Decl(moduleVisibilityTest1.ts, 16, 2)) +>B : Symbol(E.B, Decl(moduleVisibilityTest1.ts, 19, 4)) +} + +var cprime : M.I = null; +>cprime : Symbol(cprime, Decl(moduleVisibilityTest1.ts, 59, 3)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>I : Symbol(M.I, Decl(moduleVisibilityTest1.ts, 27, 15)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>I : Symbol(M.I, Decl(moduleVisibilityTest1.ts, 27, 15)) + +var c = new M.C(); +>c : Symbol(c, Decl(moduleVisibilityTest1.ts, 61, 3)) +>M.C : Symbol(M.C, Decl(moduleVisibilityTest1.ts, 34, 25)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>C : Symbol(M.C, Decl(moduleVisibilityTest1.ts, 34, 25)) + +var z = M.x; +>z : Symbol(z, Decl(moduleVisibilityTest1.ts, 62, 3)) +>M.x : Symbol(M.x, Decl(moduleVisibilityTest1.ts, 24, 11)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>x : Symbol(M.x, Decl(moduleVisibilityTest1.ts, 24, 11)) + +var alpha = M.E.A; +>alpha : Symbol(alpha, Decl(moduleVisibilityTest1.ts, 63, 3)) +>M.E.A : Symbol(M.E.A, Decl(moduleVisibilityTest1.ts, 18, 16)) +>M.E : Symbol(M.E, Decl(moduleVisibilityTest1.ts, 16, 2)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>E : Symbol(M.E, Decl(moduleVisibilityTest1.ts, 16, 2)) +>A : Symbol(M.E.A, Decl(moduleVisibilityTest1.ts, 18, 16)) + +var omega = M.exported_var; +>omega : Symbol(omega, Decl(moduleVisibilityTest1.ts, 64, 3)) +>M.exported_var : Symbol(M.exported_var, Decl(moduleVisibilityTest1.ts, 25, 19)) +>M : Symbol(M, Decl(moduleVisibilityTest1.ts, 10, 48), Decl(moduleVisibilityTest1.ts, 52, 1)) +>exported_var : Symbol(M.exported_var, Decl(moduleVisibilityTest1.ts, 25, 19)) + +c.someMethodThatCallsAnOuterMethod(); +>c.someMethodThatCallsAnOuterMethod : Symbol(M.C.someMethodThatCallsAnOuterMethod, Decl(moduleVisibilityTest1.ts, 36, 31)) +>c : Symbol(c, Decl(moduleVisibilityTest1.ts, 61, 3)) +>someMethodThatCallsAnOuterMethod : Symbol(M.C.someMethodThatCallsAnOuterMethod, Decl(moduleVisibilityTest1.ts, 36, 31)) + diff --git a/tests/baselines/reference/moduleVisibilityTest1.types b/tests/baselines/reference/moduleVisibilityTest1.types index 8c22f792049..b54f897d014 100644 --- a/tests/baselines/reference/moduleVisibilityTest1.types +++ b/tests/baselines/reference/moduleVisibilityTest1.types @@ -7,12 +7,14 @@ module OuterMod { export function someExportedOuterFunc() { return -1; } >someExportedOuterFunc : () => number >-1 : number +>1 : number export module OuterInnerMod { >OuterInnerMod : typeof OuterInnerMod export function someExportedOuterInnerFunc() { return "foo"; } >someExportedOuterInnerFunc : () => string +>"foo" : string } } @@ -30,6 +32,7 @@ module M { export function someExportedInnerFunc() { return -2; } >someExportedInnerFunc : () => number >-2 : number +>2 : number } export enum E { @@ -47,6 +50,7 @@ module M { export var x = 5; >x : number +>5 : number export declare var exported_var; >exported_var : any @@ -68,6 +72,7 @@ module M { class B {public b = 0;} >B : B >b : number +>0 : number export class C implements I { >C : C @@ -96,24 +101,30 @@ module M { public someMethod() { return 0; } >someMethod : () => number +>0 : number public someProp = 1; >someProp : number +>1 : number constructor() { function someInnerFunc() { return 2; } >someInnerFunc : () => number +>2 : number var someInnerVar = 3; >someInnerVar : number +>3 : number } } var someModuleVar = 4; >someModuleVar : number +>4 : number function someModuleFunction() { return 5;} >someModuleFunction : () => number +>5 : number } module M { @@ -134,11 +145,12 @@ module M { var cprime : M.I = null; >cprime : M.I ->M : unknown +>M : any >I : M.I >null : M.I ->M : unknown +>M : any >I : M.I +>null : null var c = new M.C(); >c : M.C diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.symbols b/tests/baselines/reference/moduleWithStatementsOfEveryKind.symbols new file mode 100644 index 00000000000..d121e6b5367 --- /dev/null +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.symbols @@ -0,0 +1,157 @@ +=== tests/cases/conformance/internalModules/moduleBody/moduleWithStatementsOfEveryKind.ts === +module A { +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 0, 0)) + + class A { s: string } +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 0, 10)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 1, 13)) + + class AA { s: T } +>AA : Symbol(AA, Decl(moduleWithStatementsOfEveryKind.ts, 1, 25)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 2, 13)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 2, 17)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 2, 13)) + + interface I { id: number } +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 2, 24)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 3, 17)) + + class B extends AA implements I { id: number } +>B : Symbol(B, Decl(moduleWithStatementsOfEveryKind.ts, 3, 30)) +>AA : Symbol(AA, Decl(moduleWithStatementsOfEveryKind.ts, 1, 25)) +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 2, 24)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 5, 45)) + + class BB extends A { +>BB : Symbol(BB, Decl(moduleWithStatementsOfEveryKind.ts, 5, 58)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 6, 13)) +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 0, 10)) + + id: number; +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 6, 27)) + } + + module Module { +>Module : Symbol(Module, Decl(moduleWithStatementsOfEveryKind.ts, 8, 5)) + + class A { s: string } +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 10, 19)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 11, 17)) + } + enum Color { Blue, Red } +>Color : Symbol(Color, Decl(moduleWithStatementsOfEveryKind.ts, 12, 5)) +>Blue : Symbol(Color.Blue, Decl(moduleWithStatementsOfEveryKind.ts, 13, 16)) +>Red : Symbol(Color.Red, Decl(moduleWithStatementsOfEveryKind.ts, 13, 22)) + + var x = 12; +>x : Symbol(x, Decl(moduleWithStatementsOfEveryKind.ts, 14, 7)) + + function F(s: string): number { +>F : Symbol(F, Decl(moduleWithStatementsOfEveryKind.ts, 14, 15)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 15, 15)) + + return 2; + } + var array: I[] = null; +>array : Symbol(array, Decl(moduleWithStatementsOfEveryKind.ts, 18, 7)) +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 2, 24)) + + var fn = (s: string) => { +>fn : Symbol(fn, Decl(moduleWithStatementsOfEveryKind.ts, 19, 7)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 19, 14)) + + return 'hello ' + s; +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 19, 14)) + } + var ol = { s: 'hello', id: 2, isvalid: true }; +>ol : Symbol(ol, Decl(moduleWithStatementsOfEveryKind.ts, 22, 7)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 22, 14)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 22, 26)) +>isvalid : Symbol(isvalid, Decl(moduleWithStatementsOfEveryKind.ts, 22, 33)) + + declare class DC { +>DC : Symbol(DC, Decl(moduleWithStatementsOfEveryKind.ts, 22, 50)) + + static x: number; +>x : Symbol(DC.x, Decl(moduleWithStatementsOfEveryKind.ts, 24, 22)) + } +} + +module Y { +>Y : Symbol(Y, Decl(moduleWithStatementsOfEveryKind.ts, 27, 1)) + + export class A { s: string } +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 29, 10)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 30, 20)) + + export class AA { s: T } +>AA : Symbol(AA, Decl(moduleWithStatementsOfEveryKind.ts, 30, 32)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 31, 20)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 31, 24)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 31, 20)) + + export interface I { id: number } +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 31, 31)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 32, 24)) + + export class B extends AA implements I { id: number } +>B : Symbol(B, Decl(moduleWithStatementsOfEveryKind.ts, 32, 37)) +>AA : Symbol(AA, Decl(moduleWithStatementsOfEveryKind.ts, 30, 32)) +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 31, 31)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 34, 52)) + + export class BB extends A { +>BB : Symbol(BB, Decl(moduleWithStatementsOfEveryKind.ts, 34, 65)) +>T : Symbol(T, Decl(moduleWithStatementsOfEveryKind.ts, 35, 20)) +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 29, 10)) + + id: number; +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 35, 34)) + } + + export module Module { +>Module : Symbol(Module, Decl(moduleWithStatementsOfEveryKind.ts, 37, 5)) + + class A { s: string } +>A : Symbol(A, Decl(moduleWithStatementsOfEveryKind.ts, 39, 26)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 40, 17)) + } + export enum Color { Blue, Red } +>Color : Symbol(Color, Decl(moduleWithStatementsOfEveryKind.ts, 41, 5)) +>Blue : Symbol(Color.Blue, Decl(moduleWithStatementsOfEveryKind.ts, 42, 23)) +>Red : Symbol(Color.Red, Decl(moduleWithStatementsOfEveryKind.ts, 42, 29)) + + export var x = 12; +>x : Symbol(x, Decl(moduleWithStatementsOfEveryKind.ts, 43, 14)) + + export function F(s: string): number { +>F : Symbol(F, Decl(moduleWithStatementsOfEveryKind.ts, 43, 22)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 44, 22)) + + return 2; + } + export var array: I[] = null; +>array : Symbol(array, Decl(moduleWithStatementsOfEveryKind.ts, 47, 14)) +>I : Symbol(I, Decl(moduleWithStatementsOfEveryKind.ts, 31, 31)) + + export var fn = (s: string) => { +>fn : Symbol(fn, Decl(moduleWithStatementsOfEveryKind.ts, 48, 14)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 48, 21)) + + return 'hello ' + s; +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 48, 21)) + } + export var ol = { s: 'hello', id: 2, isvalid: true }; +>ol : Symbol(ol, Decl(moduleWithStatementsOfEveryKind.ts, 51, 14)) +>s : Symbol(s, Decl(moduleWithStatementsOfEveryKind.ts, 51, 21)) +>id : Symbol(id, Decl(moduleWithStatementsOfEveryKind.ts, 51, 33)) +>isvalid : Symbol(isvalid, Decl(moduleWithStatementsOfEveryKind.ts, 51, 40)) + + export declare class DC { +>DC : Symbol(DC, Decl(moduleWithStatementsOfEveryKind.ts, 51, 57)) + + static x: number; +>x : Symbol(DC.x, Decl(moduleWithStatementsOfEveryKind.ts, 53, 29)) + } +} + diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.types b/tests/baselines/reference/moduleWithStatementsOfEveryKind.types index 0bade1f2d8e..9475d9cfdcb 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.types +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.types @@ -45,16 +45,19 @@ module A { var x = 12; >x : number +>12 : number function F(s: string): number { >F : (s: string) => number >s : string return 2; +>2 : number } var array: I[] = null; >array : I[] >I : I +>null : null var fn = (s: string) => { >fn : (s: string) => string @@ -63,14 +66,18 @@ module A { return 'hello ' + s; >'hello ' + s : string +>'hello ' : string >s : string } var ol = { s: 'hello', id: 2, isvalid: true }; >ol : { s: string; id: number; isvalid: boolean; } >{ s: 'hello', id: 2, isvalid: true } : { s: string; id: number; isvalid: boolean; } >s : string +>'hello' : string >id : number +>2 : number >isvalid : boolean +>true : boolean declare class DC { >DC : DC @@ -126,16 +133,19 @@ module Y { export var x = 12; >x : number +>12 : number export function F(s: string): number { >F : (s: string) => number >s : string return 2; +>2 : number } export var array: I[] = null; >array : I[] >I : I +>null : null export var fn = (s: string) => { >fn : (s: string) => string @@ -144,14 +154,18 @@ module Y { return 'hello ' + s; >'hello ' + s : string +>'hello ' : string >s : string } export var ol = { s: 'hello', id: 2, isvalid: true }; >ol : { s: string; id: number; isvalid: boolean; } >{ s: 'hello', id: 2, isvalid: true } : { s: string; id: number; isvalid: boolean; } >s : string +>'hello' : string >id : number +>2 : number >isvalid : boolean +>true : boolean export declare class DC { >DC : DC diff --git a/tests/baselines/reference/moduleWithTryStatement1.symbols b/tests/baselines/reference/moduleWithTryStatement1.symbols new file mode 100644 index 00000000000..236c1034182 --- /dev/null +++ b/tests/baselines/reference/moduleWithTryStatement1.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/moduleWithTryStatement1.ts === +module M { +>M : Symbol(M, Decl(moduleWithTryStatement1.ts, 0, 0)) + + try { + } + catch (e) { +>e : Symbol(e, Decl(moduleWithTryStatement1.ts, 3, 9)) + } +} +var v = M; +>v : Symbol(v, Decl(moduleWithTryStatement1.ts, 6, 3)) +>M : Symbol(M, Decl(moduleWithTryStatement1.ts, 0, 0)) + diff --git a/tests/baselines/reference/multiCallOverloads.symbols b/tests/baselines/reference/multiCallOverloads.symbols new file mode 100644 index 00000000000..26b414b463f --- /dev/null +++ b/tests/baselines/reference/multiCallOverloads.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/multiCallOverloads.ts === +interface ICallback { +>ICallback : Symbol(ICallback, Decl(multiCallOverloads.ts, 0, 0)) + + (x?: string):void; +>x : Symbol(x, Decl(multiCallOverloads.ts, 1, 5)) +} + +function load(f: ICallback) {} +>load : Symbol(load, Decl(multiCallOverloads.ts, 2, 1)) +>f : Symbol(f, Decl(multiCallOverloads.ts, 4, 14)) +>ICallback : Symbol(ICallback, Decl(multiCallOverloads.ts, 0, 0)) + +var f1: ICallback = function(z?) {} +>f1 : Symbol(f1, Decl(multiCallOverloads.ts, 6, 3)) +>ICallback : Symbol(ICallback, Decl(multiCallOverloads.ts, 0, 0)) +>z : Symbol(z, Decl(multiCallOverloads.ts, 6, 29)) + +var f2: ICallback = function(z?) {} +>f2 : Symbol(f2, Decl(multiCallOverloads.ts, 7, 3)) +>ICallback : Symbol(ICallback, Decl(multiCallOverloads.ts, 0, 0)) +>z : Symbol(z, Decl(multiCallOverloads.ts, 7, 29)) + +load(f1) // ok +>load : Symbol(load, Decl(multiCallOverloads.ts, 2, 1)) +>f1 : Symbol(f1, Decl(multiCallOverloads.ts, 6, 3)) + +load(f2) // ok +>load : Symbol(load, Decl(multiCallOverloads.ts, 2, 1)) +>f2 : Symbol(f2, Decl(multiCallOverloads.ts, 7, 3)) + +load(function() {}) // this shouldn’t be an error +>load : Symbol(load, Decl(multiCallOverloads.ts, 2, 1)) + +load(function(z?) {}) // this shouldn't be an error +>load : Symbol(load, Decl(multiCallOverloads.ts, 2, 1)) +>z : Symbol(z, Decl(multiCallOverloads.ts, 11, 14)) + diff --git a/tests/baselines/reference/multiExtendsSplitInterfaces2.symbols b/tests/baselines/reference/multiExtendsSplitInterfaces2.symbols new file mode 100644 index 00000000000..c9f390f1621 --- /dev/null +++ b/tests/baselines/reference/multiExtendsSplitInterfaces2.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/multiExtendsSplitInterfaces2.ts === +interface A { +>A : Symbol(A, Decl(multiExtendsSplitInterfaces2.ts, 0, 0)) + + a: number; +>a : Symbol(a, Decl(multiExtendsSplitInterfaces2.ts, 0, 13)) +} + +interface I extends A { +>I : Symbol(I, Decl(multiExtendsSplitInterfaces2.ts, 2, 1), Decl(multiExtendsSplitInterfaces2.ts, 10, 1)) +>A : Symbol(A, Decl(multiExtendsSplitInterfaces2.ts, 0, 0)) + + i1: number; +>i1 : Symbol(i1, Decl(multiExtendsSplitInterfaces2.ts, 4, 23)) +} + +interface B { +>B : Symbol(B, Decl(multiExtendsSplitInterfaces2.ts, 6, 1)) + + b: number; +>b : Symbol(b, Decl(multiExtendsSplitInterfaces2.ts, 8, 13)) +} + +interface I extends B { +>I : Symbol(I, Decl(multiExtendsSplitInterfaces2.ts, 2, 1), Decl(multiExtendsSplitInterfaces2.ts, 10, 1)) +>B : Symbol(B, Decl(multiExtendsSplitInterfaces2.ts, 6, 1)) + + i2: number; +>i2 : Symbol(i2, Decl(multiExtendsSplitInterfaces2.ts, 12, 23)) +} + +var i: I; +>i : Symbol(i, Decl(multiExtendsSplitInterfaces2.ts, 16, 3)) +>I : Symbol(I, Decl(multiExtendsSplitInterfaces2.ts, 2, 1), Decl(multiExtendsSplitInterfaces2.ts, 10, 1)) + +var a = i.a; +>a : Symbol(a, Decl(multiExtendsSplitInterfaces2.ts, 18, 3)) +>i.a : Symbol(A.a, Decl(multiExtendsSplitInterfaces2.ts, 0, 13)) +>i : Symbol(i, Decl(multiExtendsSplitInterfaces2.ts, 16, 3)) +>a : Symbol(A.a, Decl(multiExtendsSplitInterfaces2.ts, 0, 13)) + +var i1 = i.i1; +>i1 : Symbol(i1, Decl(multiExtendsSplitInterfaces2.ts, 19, 3)) +>i.i1 : Symbol(I.i1, Decl(multiExtendsSplitInterfaces2.ts, 4, 23)) +>i : Symbol(i, Decl(multiExtendsSplitInterfaces2.ts, 16, 3)) +>i1 : Symbol(I.i1, Decl(multiExtendsSplitInterfaces2.ts, 4, 23)) + +var b = i.b; +>b : Symbol(b, Decl(multiExtendsSplitInterfaces2.ts, 20, 3)) +>i.b : Symbol(B.b, Decl(multiExtendsSplitInterfaces2.ts, 8, 13)) +>i : Symbol(i, Decl(multiExtendsSplitInterfaces2.ts, 16, 3)) +>b : Symbol(B.b, Decl(multiExtendsSplitInterfaces2.ts, 8, 13)) + +var i2 = i.i2; +>i2 : Symbol(i2, Decl(multiExtendsSplitInterfaces2.ts, 21, 3)) +>i.i2 : Symbol(I.i2, Decl(multiExtendsSplitInterfaces2.ts, 12, 23)) +>i : Symbol(i, Decl(multiExtendsSplitInterfaces2.ts, 16, 3)) +>i2 : Symbol(I.i2, Decl(multiExtendsSplitInterfaces2.ts, 12, 23)) + diff --git a/tests/baselines/reference/multiImportExport.symbols b/tests/baselines/reference/multiImportExport.symbols new file mode 100644 index 00000000000..6601571aabc --- /dev/null +++ b/tests/baselines/reference/multiImportExport.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/consumer.ts === +import Drawing = require('./Drawing'); +>Drawing : Symbol(Drawing, Decl(consumer.ts, 0, 0)) + +var addr = new Drawing.Math.Adder(); +>addr : Symbol(addr, Decl(consumer.ts, 1, 3)) +>Drawing.Math.Adder : Symbol(Adder, Decl(Math.ts, 2, 12)) +>Drawing.Math : Symbol(Drawing.Math, Decl(Drawing.ts, 0, 0)) +>Drawing : Symbol(Drawing, Decl(consumer.ts, 0, 0)) +>Math : Symbol(Drawing.Math, Decl(Drawing.ts, 0, 0)) +>Adder : Symbol(Adder, Decl(Math.ts, 2, 12)) + +=== tests/cases/compiler/Drawing.ts === +export import Math = require('Math/Math') +>Math : Symbol(Math, Decl(Drawing.ts, 0, 0)) + +=== tests/cases/compiler/Math/Math.ts === +import Adder = require('Math/Adder'); +>Adder : Symbol(Adder, Decl(Math.ts, 0, 0)) + +var Math = { +>Math : Symbol(Math, Decl(Math.ts, 2, 3)) + + Adder:Adder +>Adder : Symbol(Adder, Decl(Math.ts, 2, 12)) +>Adder : Symbol(Adder, Decl(Math.ts, 0, 0)) + +}; + +export = Math +>Math : Symbol(Math, Decl(Math.ts, 2, 3)) + +=== tests/cases/compiler/Math/Adder.ts === +class Adder { +>Adder : Symbol(Adder, Decl(Adder.ts, 0, 0)) + + add(a: number, b: number) { +>add : Symbol(add, Decl(Adder.ts, 0, 13)) +>a : Symbol(a, Decl(Adder.ts, 1, 8)) +>b : Symbol(b, Decl(Adder.ts, 1, 18)) + + } +} + +export = Adder; +>Adder : Symbol(Adder, Decl(Adder.ts, 0, 0)) + diff --git a/tests/baselines/reference/multiModuleClodule1.symbols b/tests/baselines/reference/multiModuleClodule1.symbols new file mode 100644 index 00000000000..8f83e58ed26 --- /dev/null +++ b/tests/baselines/reference/multiModuleClodule1.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/multiModuleClodule1.ts === +class C { +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) + + constructor(x: number) { } +>x : Symbol(x, Decl(multiModuleClodule1.ts, 1, 16)) + + foo() { } +>foo : Symbol(foo, Decl(multiModuleClodule1.ts, 1, 30)) + + bar() { } +>bar : Symbol(bar, Decl(multiModuleClodule1.ts, 2, 13)) + + static boo() { } +>boo : Symbol(C.boo, Decl(multiModuleClodule1.ts, 3, 13)) +} + +module C { +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) + + export var x = 1; +>x : Symbol(x, Decl(multiModuleClodule1.ts, 8, 14)) + + var y = 2; +>y : Symbol(y, Decl(multiModuleClodule1.ts, 9, 7)) +} +module C { +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) + + export function foo() { } +>foo : Symbol(foo, Decl(multiModuleClodule1.ts, 11, 10)) + + function baz() { return ''; } +>baz : Symbol(baz, Decl(multiModuleClodule1.ts, 12, 29)) +} + +var c = new C(C.x); +>c : Symbol(c, Decl(multiModuleClodule1.ts, 16, 3)) +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) +>C.x : Symbol(C.x, Decl(multiModuleClodule1.ts, 8, 14)) +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) +>x : Symbol(C.x, Decl(multiModuleClodule1.ts, 8, 14)) + +c.foo = C.foo; +>c.foo : Symbol(C.foo, Decl(multiModuleClodule1.ts, 1, 30)) +>c : Symbol(c, Decl(multiModuleClodule1.ts, 16, 3)) +>foo : Symbol(C.foo, Decl(multiModuleClodule1.ts, 1, 30)) +>C.foo : Symbol(C.foo, Decl(multiModuleClodule1.ts, 11, 10)) +>C : Symbol(C, Decl(multiModuleClodule1.ts, 0, 0), Decl(multiModuleClodule1.ts, 5, 1), Decl(multiModuleClodule1.ts, 10, 1)) +>foo : Symbol(C.foo, Decl(multiModuleClodule1.ts, 11, 10)) + diff --git a/tests/baselines/reference/multiModuleClodule1.types b/tests/baselines/reference/multiModuleClodule1.types index f7379e33173..b958d18f984 100644 --- a/tests/baselines/reference/multiModuleClodule1.types +++ b/tests/baselines/reference/multiModuleClodule1.types @@ -20,9 +20,11 @@ module C { export var x = 1; >x : number +>1 : number var y = 2; >y : number +>2 : number } module C { >C : typeof C @@ -32,6 +34,7 @@ module C { function baz() { return ''; } >baz : () => string +>'' : string } var c = new C(C.x); diff --git a/tests/baselines/reference/multiModuleFundule1.symbols b/tests/baselines/reference/multiModuleFundule1.symbols new file mode 100644 index 00000000000..39b2e7e6be0 --- /dev/null +++ b/tests/baselines/reference/multiModuleFundule1.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/multiModuleFundule1.ts === +function C(x: number) { } +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) +>x : Symbol(x, Decl(multiModuleFundule1.ts, 0, 11)) + +module C { +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) + + export var x = 1; +>x : Symbol(x, Decl(multiModuleFundule1.ts, 3, 14)) +} +module C { +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) + + export function foo() { } +>foo : Symbol(foo, Decl(multiModuleFundule1.ts, 5, 10)) +} + +var r = C(2); +>r : Symbol(r, Decl(multiModuleFundule1.ts, 9, 3)) +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) + +var r2 = new C(2); // using void returning function as constructor +>r2 : Symbol(r2, Decl(multiModuleFundule1.ts, 10, 3)) +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) + +var r3 = C.foo(); +>r3 : Symbol(r3, Decl(multiModuleFundule1.ts, 11, 3)) +>C.foo : Symbol(C.foo, Decl(multiModuleFundule1.ts, 5, 10)) +>C : Symbol(C, Decl(multiModuleFundule1.ts, 0, 0), Decl(multiModuleFundule1.ts, 0, 25), Decl(multiModuleFundule1.ts, 4, 1)) +>foo : Symbol(C.foo, Decl(multiModuleFundule1.ts, 5, 10)) + diff --git a/tests/baselines/reference/multiModuleFundule1.types b/tests/baselines/reference/multiModuleFundule1.types index c78a195f4b1..7eed100c199 100644 --- a/tests/baselines/reference/multiModuleFundule1.types +++ b/tests/baselines/reference/multiModuleFundule1.types @@ -8,6 +8,7 @@ module C { export var x = 1; >x : number +>1 : number } module C { >C : typeof C @@ -20,11 +21,13 @@ var r = C(2); >r : void >C(2) : void >C : typeof C +>2 : number var r2 = new C(2); // using void returning function as constructor >r2 : any >new C(2) : any >C : typeof C +>2 : number var r3 = C.foo(); >r3 : void diff --git a/tests/baselines/reference/mutrec.symbols b/tests/baselines/reference/mutrec.symbols new file mode 100644 index 00000000000..2a24cc4c65e --- /dev/null +++ b/tests/baselines/reference/mutrec.symbols @@ -0,0 +1,102 @@ +=== tests/cases/compiler/mutrec.ts === +interface A { +>A : Symbol(A, Decl(mutrec.ts, 0, 0)) + + x:B[]; +>x : Symbol(x, Decl(mutrec.ts, 0, 13)) +>B : Symbol(B, Decl(mutrec.ts, 2, 1)) +} + +interface B { +>B : Symbol(B, Decl(mutrec.ts, 2, 1)) + + x:A[]; +>x : Symbol(x, Decl(mutrec.ts, 4, 13)) +>A : Symbol(A, Decl(mutrec.ts, 0, 0)) +} + +function f(p: A) { return p }; +>f : Symbol(f, Decl(mutrec.ts, 6, 1)) +>p : Symbol(p, Decl(mutrec.ts, 8, 11)) +>A : Symbol(A, Decl(mutrec.ts, 0, 0)) +>p : Symbol(p, Decl(mutrec.ts, 8, 11)) + +var b:B; +>b : Symbol(b, Decl(mutrec.ts, 9, 3)) +>B : Symbol(B, Decl(mutrec.ts, 2, 1)) + +f(b); +>f : Symbol(f, Decl(mutrec.ts, 6, 1)) +>b : Symbol(b, Decl(mutrec.ts, 9, 3)) + +interface I1 { +>I1 : Symbol(I1, Decl(mutrec.ts, 10, 5)) + + y:I2; +>y : Symbol(y, Decl(mutrec.ts, 12, 14)) +>I2 : Symbol(I2, Decl(mutrec.ts, 14, 1)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(mutrec.ts, 14, 1)) + + y:I3; +>y : Symbol(y, Decl(mutrec.ts, 16, 14)) +>I3 : Symbol(I3, Decl(mutrec.ts, 18, 1)) +} + +interface I3 { +>I3 : Symbol(I3, Decl(mutrec.ts, 18, 1)) + + y:I1; +>y : Symbol(y, Decl(mutrec.ts, 20, 14)) +>I1 : Symbol(I1, Decl(mutrec.ts, 10, 5)) +} + +function g(p: I1) { return p }; +>g : Symbol(g, Decl(mutrec.ts, 22, 1)) +>p : Symbol(p, Decl(mutrec.ts, 24, 11)) +>I1 : Symbol(I1, Decl(mutrec.ts, 10, 5)) +>p : Symbol(p, Decl(mutrec.ts, 24, 11)) + +var i2:I2; +>i2 : Symbol(i2, Decl(mutrec.ts, 25, 3)) +>I2 : Symbol(I2, Decl(mutrec.ts, 14, 1)) + +g(i2); +>g : Symbol(g, Decl(mutrec.ts, 22, 1)) +>i2 : Symbol(i2, Decl(mutrec.ts, 25, 3)) + +var i3:I3; +>i3 : Symbol(i3, Decl(mutrec.ts, 27, 3)) +>I3 : Symbol(I3, Decl(mutrec.ts, 18, 1)) + +g(i3); +>g : Symbol(g, Decl(mutrec.ts, 22, 1)) +>i3 : Symbol(i3, Decl(mutrec.ts, 27, 3)) + +interface I4 { +>I4 : Symbol(I4, Decl(mutrec.ts, 28, 6)) + + y:I5; +>y : Symbol(y, Decl(mutrec.ts, 30, 14)) +>I5 : Symbol(I5, Decl(mutrec.ts, 32, 1)) +} + +interface I5 { +>I5 : Symbol(I5, Decl(mutrec.ts, 32, 1)) + + y:I4; +>y : Symbol(y, Decl(mutrec.ts, 34, 14)) +>I4 : Symbol(I4, Decl(mutrec.ts, 28, 6)) +} + +var i4:I4; +>i4 : Symbol(i4, Decl(mutrec.ts, 38, 3)) +>I4 : Symbol(I4, Decl(mutrec.ts, 28, 6)) + +g(i4); +>g : Symbol(g, Decl(mutrec.ts, 22, 1)) +>i4 : Symbol(i4, Decl(mutrec.ts, 38, 3)) + + diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes1.symbols b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes1.symbols new file mode 100644 index 00000000000..67871a590cb --- /dev/null +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes1.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/mutuallyRecursiveGenericBaseTypes1.ts === +interface A { +>A : Symbol(A, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 12)) + + foo(): B; // instead of B does see this +>foo : Symbol(foo, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 16), Decl(mutuallyRecursiveGenericBaseTypes1.ts, 1, 16)) +>B : Symbol(B, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 5, 1)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 12)) + + foo(): void; // instead of B does see this +>foo : Symbol(foo, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 16), Decl(mutuallyRecursiveGenericBaseTypes1.ts, 1, 16)) + + foo2(): B; +>foo2 : Symbol(foo2, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 2, 16)) +>B : Symbol(B, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 5, 1)) +} + +interface B extends A { +>B : Symbol(B, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 5, 1)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 7, 12)) +>A : Symbol(A, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 7, 12)) + + bar(): void; +>bar : Symbol(bar, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 7, 29)) +} + +var b: B; +>b : Symbol(b, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 11, 3)) +>B : Symbol(B, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 5, 1)) + +b.foo(); // should not error +>b.foo : Symbol(A.foo, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 16), Decl(mutuallyRecursiveGenericBaseTypes1.ts, 1, 16)) +>b : Symbol(b, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 11, 3)) +>foo : Symbol(A.foo, Decl(mutuallyRecursiveGenericBaseTypes1.ts, 0, 16), Decl(mutuallyRecursiveGenericBaseTypes1.ts, 1, 16)) + + + diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.symbols b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.symbols new file mode 100644 index 00000000000..d66f6a0c66f --- /dev/null +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/mutuallyRecursiveGenericBaseTypes2.ts === +class foo +>foo : Symbol(foo, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 0, 10)) +{ + bar(): foo2 { return null; } +>bar : Symbol(bar, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 1, 1)) +>foo2 : Symbol(foo2, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 3, 1)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 0, 10)) +} + +class foo2 extends foo { +>foo2 : Symbol(foo2, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 3, 1)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 5, 11)) +>foo : Symbol(foo, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 5, 11)) +} + +var test = new foo(); +>test : Symbol(test, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 8, 3)) +>foo : Symbol(foo, Decl(mutuallyRecursiveGenericBaseTypes2.ts, 0, 0)) + diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.types b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.types index 5cadfa780fe..ac722f8a063 100644 --- a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.types +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.types @@ -7,6 +7,7 @@ class foo >bar : () => foo2 >foo2 : foo2 >T : T +>null : null } class foo2 extends foo { diff --git a/tests/baselines/reference/nameCollision.symbols b/tests/baselines/reference/nameCollision.symbols new file mode 100644 index 00000000000..064726e21fa --- /dev/null +++ b/tests/baselines/reference/nameCollision.symbols @@ -0,0 +1,88 @@ +=== tests/cases/conformance/internalModules/codeGeneration/nameCollision.ts === +module A { +>A : Symbol(A, Decl(nameCollision.ts, 0, 0)) + + // these 2 statements force an underscore before the 'A' + // in the generated function call. + var A = 12; +>A : Symbol(A, Decl(nameCollision.ts, 3, 7)) + + var _A = ''; +>_A : Symbol(_A, Decl(nameCollision.ts, 4, 7)) +} + +module B { +>B : Symbol(B, Decl(nameCollision.ts, 5, 1), Decl(nameCollision.ts, 9, 1)) + + var A = 12; +>A : Symbol(A, Decl(nameCollision.ts, 8, 7)) +} + +module B { +>B : Symbol(B, Decl(nameCollision.ts, 5, 1), Decl(nameCollision.ts, 9, 1)) + + // re-opened module with colliding name + // this should add an underscore. + class B { +>B : Symbol(B, Decl(nameCollision.ts, 11, 10)) + + name: string; +>name : Symbol(name, Decl(nameCollision.ts, 14, 13)) + } +} + +module X { +>X : Symbol(X, Decl(nameCollision.ts, 17, 1)) + + var X = 13; +>X : Symbol(X, Decl(nameCollision.ts, 20, 7)) + + export module Y { +>Y : Symbol(Y, Decl(nameCollision.ts, 20, 15)) + + var Y = 13; +>Y : Symbol(Y, Decl(nameCollision.ts, 22, 11)) + + export module Z { +>Z : Symbol(Z, Decl(nameCollision.ts, 22, 19)) + + var X = 12; +>X : Symbol(X, Decl(nameCollision.ts, 24, 15)) + + var Y = 12; +>Y : Symbol(Y, Decl(nameCollision.ts, 25, 15)) + + var Z = 12; +>Z : Symbol(Z, Decl(nameCollision.ts, 26, 15)) + } + } +} + +module Y.Y { +>Y : Symbol(Y, Decl(nameCollision.ts, 29, 1)) +>Y : Symbol(Y, Decl(nameCollision.ts, 31, 9)) + + export enum Y { +>Y : Symbol(Y, Decl(nameCollision.ts, 31, 12)) + + Red, Blue +>Red : Symbol(Y.Red, Decl(nameCollision.ts, 32, 19)) +>Blue : Symbol(Y.Blue, Decl(nameCollision.ts, 33, 12)) + } +} + +// no collision, since interface doesn't +// generate code. +module D { +>D : Symbol(D, Decl(nameCollision.ts, 35, 1)) + + export interface D { +>D : Symbol(D, Decl(nameCollision.ts, 39, 10)) + + id: number; +>id : Symbol(id, Decl(nameCollision.ts, 40, 24)) + } + + export var E = 'hello'; +>E : Symbol(E, Decl(nameCollision.ts, 44, 14)) +} diff --git a/tests/baselines/reference/nameCollision.types b/tests/baselines/reference/nameCollision.types index be14150308b..e8badb7ab92 100644 --- a/tests/baselines/reference/nameCollision.types +++ b/tests/baselines/reference/nameCollision.types @@ -6,9 +6,11 @@ module A { // in the generated function call. var A = 12; >A : number +>12 : number var _A = ''; >_A : string +>'' : string } module B { @@ -16,6 +18,7 @@ module B { var A = 12; >A : number +>12 : number } module B { @@ -36,24 +39,29 @@ module X { var X = 13; >X : number +>13 : number export module Y { >Y : typeof X.Y var Y = 13; >Y : number +>13 : number export module Z { >Z : typeof X.Y.Z var X = 12; >X : number +>12 : number var Y = 12; >Y : number +>12 : number var Z = 12; >Z : number +>12 : number } } } @@ -85,4 +93,5 @@ module D { export var E = 'hello'; >E : string +>'hello' : string } diff --git a/tests/baselines/reference/nameCollisionsInPropertyAssignments.symbols b/tests/baselines/reference/nameCollisionsInPropertyAssignments.symbols new file mode 100644 index 00000000000..2e40d0f8bc5 --- /dev/null +++ b/tests/baselines/reference/nameCollisionsInPropertyAssignments.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/nameCollisionsInPropertyAssignments.ts === +var x = 1 +>x : Symbol(x, Decl(nameCollisionsInPropertyAssignments.ts, 0, 3)) + +var y = { x() { x++; } }; +>y : Symbol(y, Decl(nameCollisionsInPropertyAssignments.ts, 1, 3)) +>x : Symbol(x, Decl(nameCollisionsInPropertyAssignments.ts, 1, 9)) +>x : Symbol(x, Decl(nameCollisionsInPropertyAssignments.ts, 0, 3)) + diff --git a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types index 41bcdd99a71..bffe75896c4 100644 --- a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types +++ b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types @@ -1,6 +1,7 @@ === tests/cases/compiler/nameCollisionsInPropertyAssignments.ts === var x = 1 >x : number +>1 : number var y = { x() { x++; } }; >y : { x(): void; } diff --git a/tests/baselines/reference/nameDelimitedBySlashes.symbols b/tests/baselines/reference/nameDelimitedBySlashes.symbols new file mode 100644 index 00000000000..d09ce913419 --- /dev/null +++ b/tests/baselines/reference/nameDelimitedBySlashes.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/externalModules/foo_1.ts === +import foo = require('./test/foo_0'); +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) + +var x = foo.foo + 42; +>x : Symbol(x, Decl(foo_1.ts, 1, 3)) +>foo.foo : Symbol(foo.foo, Decl(foo_0.ts, 0, 10)) +>foo : Symbol(foo, Decl(foo_1.ts, 0, 0)) +>foo : Symbol(foo.foo, Decl(foo_0.ts, 0, 10)) + +=== tests/cases/conformance/externalModules/test/foo_0.ts === +export var foo = 42; +>foo : Symbol(foo, Decl(foo_0.ts, 0, 10)) + diff --git a/tests/baselines/reference/nameDelimitedBySlashes.types b/tests/baselines/reference/nameDelimitedBySlashes.types index cea87ff2241..4987a52196f 100644 --- a/tests/baselines/reference/nameDelimitedBySlashes.types +++ b/tests/baselines/reference/nameDelimitedBySlashes.types @@ -8,8 +8,10 @@ var x = foo.foo + 42; >foo.foo : number >foo : typeof foo >foo : number +>42 : number === tests/cases/conformance/externalModules/test/foo_0.ts === export var foo = 42; >foo : number +>42 : number diff --git a/tests/baselines/reference/nameWithRelativePaths.symbols b/tests/baselines/reference/nameWithRelativePaths.symbols new file mode 100644 index 00000000000..d86eb64bff2 --- /dev/null +++ b/tests/baselines/reference/nameWithRelativePaths.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/externalModules/test/foo_3.ts === +import foo0 = require('../foo_0'); +>foo0 : Symbol(foo0, Decl(foo_3.ts, 0, 0)) + +import foo1 = require('./test/foo_1'); +>foo1 : Symbol(foo1, Decl(foo_3.ts, 0, 34)) + +import foo2 = require('./.././test/foo_2'); +>foo2 : Symbol(foo2, Decl(foo_3.ts, 1, 38)) + +if(foo2.M2.x){ +>foo2.M2.x : Symbol(foo2.M2.x, Decl(foo_2.ts, 1, 11)) +>foo2.M2 : Symbol(foo2.M2, Decl(foo_2.ts, 0, 0)) +>foo2 : Symbol(foo2, Decl(foo_3.ts, 1, 38)) +>M2 : Symbol(foo2.M2, Decl(foo_2.ts, 0, 0)) +>x : Symbol(foo2.M2.x, Decl(foo_2.ts, 1, 11)) + + var x = foo0.foo + foo1.f(); +>x : Symbol(x, Decl(foo_3.ts, 5, 4)) +>foo0.foo : Symbol(foo0.foo, Decl(foo_0.ts, 0, 10)) +>foo0 : Symbol(foo0, Decl(foo_3.ts, 0, 0)) +>foo : Symbol(foo0.foo, Decl(foo_0.ts, 0, 10)) +>foo1.f : Symbol(foo1.f, Decl(foo_1.ts, 0, 0)) +>foo1 : Symbol(foo1, Decl(foo_3.ts, 0, 34)) +>f : Symbol(foo1.f, Decl(foo_1.ts, 0, 0)) +} + +=== tests/cases/conformance/externalModules/foo_0.ts === +export var foo = 42; +>foo : Symbol(foo, Decl(foo_0.ts, 0, 10)) + +=== tests/cases/conformance/externalModules/test/test/foo_1.ts === +export function f(){ +>f : Symbol(f, Decl(foo_1.ts, 0, 0)) + + return 42; +} + +=== tests/cases/conformance/externalModules/test/foo_2.ts === +export module M2 { +>M2 : Symbol(M2, Decl(foo_2.ts, 0, 0)) + + export var x = true; +>x : Symbol(x, Decl(foo_2.ts, 1, 11)) +} + diff --git a/tests/baselines/reference/nameWithRelativePaths.types b/tests/baselines/reference/nameWithRelativePaths.types index 2dc303b2583..ea552cfa531 100644 --- a/tests/baselines/reference/nameWithRelativePaths.types +++ b/tests/baselines/reference/nameWithRelativePaths.types @@ -30,12 +30,14 @@ if(foo2.M2.x){ === tests/cases/conformance/externalModules/foo_0.ts === export var foo = 42; >foo : number +>42 : number === tests/cases/conformance/externalModules/test/test/foo_1.ts === export function f(){ >f : () => number return 42; +>42 : number } === tests/cases/conformance/externalModules/test/foo_2.ts === @@ -44,5 +46,6 @@ export module M2 { export var x = true; >x : boolean +>true : boolean } diff --git a/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.symbols b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.symbols new file mode 100644 index 00000000000..707bc64571f --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/namedFunctionExpressionAssignedToClassProperty.ts === +class Foo{ +>Foo : Symbol(Foo, Decl(namedFunctionExpressionAssignedToClassProperty.ts, 0, 0)) + + a = function bar(){ +>a : Symbol(a, Decl(namedFunctionExpressionAssignedToClassProperty.ts, 0, 10)) +>bar : Symbol(bar, Decl(namedFunctionExpressionAssignedToClassProperty.ts, 2, 10)) + + }; // this shouldn't crash the compiler... + + + + constructor(){ + + } + +} + diff --git a/tests/baselines/reference/namedFunctionExpressionCall.symbols b/tests/baselines/reference/namedFunctionExpressionCall.symbols new file mode 100644 index 00000000000..c4ee0d3db4b --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionCall.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/namedFunctionExpressionCall.ts === +var recurser = function foo() { +>recurser : Symbol(recurser, Decl(namedFunctionExpressionCall.ts, 0, 3)) +>foo : Symbol(foo, Decl(namedFunctionExpressionCall.ts, 0, 14)) + + // using the local name + foo(); +>foo : Symbol(foo, Decl(namedFunctionExpressionCall.ts, 0, 14)) + + // using the globally visible name + recurser(); +>recurser : Symbol(recurser, Decl(namedFunctionExpressionCall.ts, 0, 3)) + +}; + + +(function bar() { +>bar : Symbol(bar, Decl(namedFunctionExpressionCall.ts, 9, 1)) + + bar(); +>bar : Symbol(bar, Decl(namedFunctionExpressionCall.ts, 9, 1)) + +}); diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.symbols b/tests/baselines/reference/namedFunctionExpressionInModule.symbols new file mode 100644 index 00000000000..703cce7bf14 --- /dev/null +++ b/tests/baselines/reference/namedFunctionExpressionInModule.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/namedFunctionExpressionInModule.ts === +module Variables{ +>Variables : Symbol(Variables, Decl(namedFunctionExpressionInModule.ts, 0, 0)) + + var x = function bar(a, b, c) { +>x : Symbol(x, Decl(namedFunctionExpressionInModule.ts, 1, 7)) +>bar : Symbol(bar, Decl(namedFunctionExpressionInModule.ts, 1, 11)) +>a : Symbol(a, Decl(namedFunctionExpressionInModule.ts, 1, 25)) +>b : Symbol(b, Decl(namedFunctionExpressionInModule.ts, 1, 27)) +>c : Symbol(c, Decl(namedFunctionExpressionInModule.ts, 1, 30)) + } + x(1, 2, 3); +>x : Symbol(x, Decl(namedFunctionExpressionInModule.ts, 1, 7)) +} + diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.types b/tests/baselines/reference/namedFunctionExpressionInModule.types index 9643d9ca069..8202cfbaf1b 100644 --- a/tests/baselines/reference/namedFunctionExpressionInModule.types +++ b/tests/baselines/reference/namedFunctionExpressionInModule.types @@ -13,5 +13,8 @@ module Variables{ x(1, 2, 3); >x(1, 2, 3) : void >x : (a: any, b: any, c: any) => void +>1 : number +>2 : number +>3 : number } diff --git a/tests/baselines/reference/namespaces1.symbols b/tests/baselines/reference/namespaces1.symbols new file mode 100644 index 00000000000..f31860b5a27 --- /dev/null +++ b/tests/baselines/reference/namespaces1.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/namespaces1.ts === +module X { +>X : Symbol(X, Decl(namespaces1.ts, 0, 0)) + + export module Y { +>Y : Symbol(Y, Decl(namespaces1.ts, 0, 10), Decl(namespaces1.ts, 3, 5)) + + export interface Z { } +>Z : Symbol(Z, Decl(namespaces1.ts, 1, 21)) + } + export interface Y { } +>Y : Symbol(Y, Decl(namespaces1.ts, 0, 10), Decl(namespaces1.ts, 3, 5)) +} + +var x: X.Y.Z; +>x : Symbol(x, Decl(namespaces1.ts, 7, 3)) +>X : Symbol(X, Decl(namespaces1.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(namespaces1.ts, 0, 10), Decl(namespaces1.ts, 3, 5)) +>Z : Symbol(X.Y.Z, Decl(namespaces1.ts, 1, 21)) + +var x2: X.Y; +>x2 : Symbol(x2, Decl(namespaces1.ts, 8, 3)) +>X : Symbol(X, Decl(namespaces1.ts, 0, 0)) +>Y : Symbol(X.Y, Decl(namespaces1.ts, 0, 10), Decl(namespaces1.ts, 3, 5)) + diff --git a/tests/baselines/reference/namespaces1.types b/tests/baselines/reference/namespaces1.types index b4b41fbeda9..9aa0f8f4dfa 100644 --- a/tests/baselines/reference/namespaces1.types +++ b/tests/baselines/reference/namespaces1.types @@ -1,9 +1,9 @@ === tests/cases/compiler/namespaces1.ts === module X { ->X : unknown +>X : any export module Y { ->Y : unknown +>Y : any export interface Z { } >Z : Z @@ -14,12 +14,12 @@ module X { var x: X.Y.Z; >x : X.Y.Z ->X : unknown ->Y : unknown +>X : any +>Y : any >Z : X.Y.Z var x2: X.Y; >x2 : X.Y ->X : unknown +>X : any >Y : X.Y diff --git a/tests/baselines/reference/namespaces2.symbols b/tests/baselines/reference/namespaces2.symbols new file mode 100644 index 00000000000..a02d9e1c1cc --- /dev/null +++ b/tests/baselines/reference/namespaces2.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/namespaces2.ts === +module A { +>A : Symbol(A, Decl(namespaces2.ts, 0, 0)) + + export module B { +>B : Symbol(B, Decl(namespaces2.ts, 0, 10)) + + export class C { } +>C : Symbol(C, Decl(namespaces2.ts, 1, 21)) + } +} + +var c: A.B.C = new A.B.C(); +>c : Symbol(c, Decl(namespaces2.ts, 6, 3)) +>A : Symbol(A, Decl(namespaces2.ts, 0, 0)) +>B : Symbol(A.B, Decl(namespaces2.ts, 0, 10)) +>C : Symbol(A.B.C, Decl(namespaces2.ts, 1, 21)) +>A.B.C : Symbol(A.B.C, Decl(namespaces2.ts, 1, 21)) +>A.B : Symbol(A.B, Decl(namespaces2.ts, 0, 10)) +>A : Symbol(A, Decl(namespaces2.ts, 0, 0)) +>B : Symbol(A.B, Decl(namespaces2.ts, 0, 10)) +>C : Symbol(A.B.C, Decl(namespaces2.ts, 1, 21)) + diff --git a/tests/baselines/reference/namespaces2.types b/tests/baselines/reference/namespaces2.types index 909f56f561a..cc175a93d54 100644 --- a/tests/baselines/reference/namespaces2.types +++ b/tests/baselines/reference/namespaces2.types @@ -12,8 +12,8 @@ module A { var c: A.B.C = new A.B.C(); >c : A.B.C ->A : unknown ->B : unknown +>A : any +>B : any >C : A.B.C >new A.B.C() : A.B.C >A.B.C : typeof A.B.C diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.symbols b/tests/baselines/reference/negateOperatorWithAnyOtherType.symbols new file mode 100644 index 00000000000..891fc363dbd --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.symbols @@ -0,0 +1,156 @@ +=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts === +// - operator on any type + +var ANY: any; +>ANY : Symbol(ANY, Decl(negateOperatorWithAnyOtherType.ts, 2, 3)) + +var ANY1; +>ANY1 : Symbol(ANY1, Decl(negateOperatorWithAnyOtherType.ts, 3, 3)) + +var ANY2: any[] = ["", ""]; +>ANY2 : Symbol(ANY2, Decl(negateOperatorWithAnyOtherType.ts, 4, 3)) + +var obj: () => {} +>obj : Symbol(obj, Decl(negateOperatorWithAnyOtherType.ts, 5, 3)) + +var obj1 = { x: "", y: () => { }}; +>obj1 : Symbol(obj1, Decl(negateOperatorWithAnyOtherType.ts, 6, 3)) +>x : Symbol(x, Decl(negateOperatorWithAnyOtherType.ts, 6, 12)) +>y : Symbol(y, Decl(negateOperatorWithAnyOtherType.ts, 6, 19)) + +function foo(): any { +>foo : Symbol(foo, Decl(negateOperatorWithAnyOtherType.ts, 6, 34)) + + var a; +>a : Symbol(a, Decl(negateOperatorWithAnyOtherType.ts, 9, 7)) + + return a; +>a : Symbol(a, Decl(negateOperatorWithAnyOtherType.ts, 9, 7)) +} +class A { +>A : Symbol(A, Decl(negateOperatorWithAnyOtherType.ts, 11, 1)) + + public a: any; +>a : Symbol(a, Decl(negateOperatorWithAnyOtherType.ts, 12, 9)) + + static foo() { +>foo : Symbol(A.foo, Decl(negateOperatorWithAnyOtherType.ts, 13, 18)) + + var a; +>a : Symbol(a, Decl(negateOperatorWithAnyOtherType.ts, 15, 11)) + + return a; +>a : Symbol(a, Decl(negateOperatorWithAnyOtherType.ts, 15, 11)) + } +} +module M { +>M : Symbol(M, Decl(negateOperatorWithAnyOtherType.ts, 18, 1)) + + export var n: any; +>n : Symbol(n, Decl(negateOperatorWithAnyOtherType.ts, 20, 14)) +} +var objA = new A(); +>objA : Symbol(objA, Decl(negateOperatorWithAnyOtherType.ts, 22, 3)) +>A : Symbol(A, Decl(negateOperatorWithAnyOtherType.ts, 11, 1)) + +// any type var +var ResultIsNumber1 = -ANY1; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(negateOperatorWithAnyOtherType.ts, 25, 3)) +>ANY1 : Symbol(ANY1, Decl(negateOperatorWithAnyOtherType.ts, 3, 3)) + +var ResultIsNumber2 = -ANY2; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(negateOperatorWithAnyOtherType.ts, 26, 3)) +>ANY2 : Symbol(ANY2, Decl(negateOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber3 = -A; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(negateOperatorWithAnyOtherType.ts, 27, 3)) +>A : Symbol(A, Decl(negateOperatorWithAnyOtherType.ts, 11, 1)) + +var ResultIsNumber4 = -M; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(negateOperatorWithAnyOtherType.ts, 28, 3)) +>M : Symbol(M, Decl(negateOperatorWithAnyOtherType.ts, 18, 1)) + +var ResultIsNumber5 = -obj; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(negateOperatorWithAnyOtherType.ts, 29, 3)) +>obj : Symbol(obj, Decl(negateOperatorWithAnyOtherType.ts, 5, 3)) + +var ResultIsNumber6 = -obj1; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(negateOperatorWithAnyOtherType.ts, 30, 3)) +>obj1 : Symbol(obj1, Decl(negateOperatorWithAnyOtherType.ts, 6, 3)) + +// any type literal +var ResultIsNumber7 = -undefined; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(negateOperatorWithAnyOtherType.ts, 33, 3)) +>undefined : Symbol(undefined) + +var ResultIsNumber = -null; +>ResultIsNumber : Symbol(ResultIsNumber, Decl(negateOperatorWithAnyOtherType.ts, 34, 3)) + +// any type expressions +var ResultIsNumber8 = -ANY2[0]; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(negateOperatorWithAnyOtherType.ts, 37, 3)) +>ANY2 : Symbol(ANY2, Decl(negateOperatorWithAnyOtherType.ts, 4, 3)) + +var ResultIsNumber9 = -obj1.x; +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(negateOperatorWithAnyOtherType.ts, 38, 3)) +>obj1.x : Symbol(x, Decl(negateOperatorWithAnyOtherType.ts, 6, 12)) +>obj1 : Symbol(obj1, Decl(negateOperatorWithAnyOtherType.ts, 6, 3)) +>x : Symbol(x, Decl(negateOperatorWithAnyOtherType.ts, 6, 12)) + +var ResultIsNumber10 = -obj1.y; +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(negateOperatorWithAnyOtherType.ts, 39, 3)) +>obj1.y : Symbol(y, Decl(negateOperatorWithAnyOtherType.ts, 6, 19)) +>obj1 : Symbol(obj1, Decl(negateOperatorWithAnyOtherType.ts, 6, 3)) +>y : Symbol(y, Decl(negateOperatorWithAnyOtherType.ts, 6, 19)) + +var ResultIsNumber11 = -objA.a; +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(negateOperatorWithAnyOtherType.ts, 40, 3)) +>objA.a : Symbol(A.a, Decl(negateOperatorWithAnyOtherType.ts, 12, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithAnyOtherType.ts, 22, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithAnyOtherType.ts, 12, 9)) + +var ResultIsNumber12 = -M.n; +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(negateOperatorWithAnyOtherType.ts, 41, 3)) +>M.n : Symbol(M.n, Decl(negateOperatorWithAnyOtherType.ts, 20, 14)) +>M : Symbol(M, Decl(negateOperatorWithAnyOtherType.ts, 18, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithAnyOtherType.ts, 20, 14)) + +var ResultIsNumber13 = -foo(); +>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(negateOperatorWithAnyOtherType.ts, 42, 3)) +>foo : Symbol(foo, Decl(negateOperatorWithAnyOtherType.ts, 6, 34)) + +var ResultIsNumber14 = -A.foo(); +>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(negateOperatorWithAnyOtherType.ts, 43, 3)) +>A.foo : Symbol(A.foo, Decl(negateOperatorWithAnyOtherType.ts, 13, 18)) +>A : Symbol(A, Decl(negateOperatorWithAnyOtherType.ts, 11, 1)) +>foo : Symbol(A.foo, Decl(negateOperatorWithAnyOtherType.ts, 13, 18)) + +var ResultIsNumber15 = -(ANY - ANY1); +>ResultIsNumber15 : Symbol(ResultIsNumber15, Decl(negateOperatorWithAnyOtherType.ts, 44, 3)) +>ANY : Symbol(ANY, Decl(negateOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(negateOperatorWithAnyOtherType.ts, 3, 3)) + +// miss assignment operators +-ANY; +>ANY : Symbol(ANY, Decl(negateOperatorWithAnyOtherType.ts, 2, 3)) + +-ANY1; +>ANY1 : Symbol(ANY1, Decl(negateOperatorWithAnyOtherType.ts, 3, 3)) + +-ANY2[0]; +>ANY2 : Symbol(ANY2, Decl(negateOperatorWithAnyOtherType.ts, 4, 3)) + +-ANY, ANY1; +>ANY : Symbol(ANY, Decl(negateOperatorWithAnyOtherType.ts, 2, 3)) +>ANY1 : Symbol(ANY1, Decl(negateOperatorWithAnyOtherType.ts, 3, 3)) + +-objA.a; +>objA.a : Symbol(A.a, Decl(negateOperatorWithAnyOtherType.ts, 12, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithAnyOtherType.ts, 22, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithAnyOtherType.ts, 12, 9)) + +-M.n; +>M.n : Symbol(M.n, Decl(negateOperatorWithAnyOtherType.ts, 20, 14)) +>M : Symbol(M, Decl(negateOperatorWithAnyOtherType.ts, 18, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithAnyOtherType.ts, 20, 14)) + diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.types b/tests/baselines/reference/negateOperatorWithAnyOtherType.types index 85a2d9c9233..f864c9d166c 100644 --- a/tests/baselines/reference/negateOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.types @@ -10,6 +10,8 @@ var ANY1; var ANY2: any[] = ["", ""]; >ANY2 : any[] >["", ""] : string[] +>"" : string +>"" : string var obj: () => {} >obj : () => {} @@ -18,6 +20,7 @@ var obj1 = { x: "", y: () => { }}; >obj1 : { x: string; y: () => void; } >{ x: "", y: () => { }} : { x: string; y: () => void; } >x : string +>"" : string >y : () => void >() => { } : () => void @@ -97,6 +100,7 @@ var ResultIsNumber7 = -undefined; var ResultIsNumber = -null; >ResultIsNumber : number >-null : number +>null : null // any type expressions var ResultIsNumber8 = -ANY2[0]; @@ -104,6 +108,7 @@ var ResultIsNumber8 = -ANY2[0]; >-ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number var ResultIsNumber9 = -obj1.x; >ResultIsNumber9 : number @@ -168,6 +173,7 @@ var ResultIsNumber15 = -(ANY - ANY1); >-ANY2[0] : number >ANY2[0] : any >ANY2 : any[] +>0 : number -ANY, ANY1; >-ANY, ANY1 : any diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.symbols b/tests/baselines/reference/negateOperatorWithBooleanType.symbols new file mode 100644 index 00000000000..55b35026b97 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithBooleanType.symbols @@ -0,0 +1,84 @@ +=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts === +// - operator on boolean type +var BOOLEAN: boolean; +>BOOLEAN : Symbol(BOOLEAN, Decl(negateOperatorWithBooleanType.ts, 1, 3)) + +function foo(): boolean { return true; } +>foo : Symbol(foo, Decl(negateOperatorWithBooleanType.ts, 1, 21)) + +class A { +>A : Symbol(A, Decl(negateOperatorWithBooleanType.ts, 3, 40)) + + public a: boolean; +>a : Symbol(a, Decl(negateOperatorWithBooleanType.ts, 5, 9)) + + static foo() { return false; } +>foo : Symbol(A.foo, Decl(negateOperatorWithBooleanType.ts, 6, 22)) +} +module M { +>M : Symbol(M, Decl(negateOperatorWithBooleanType.ts, 8, 1)) + + export var n: boolean; +>n : Symbol(n, Decl(negateOperatorWithBooleanType.ts, 10, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(negateOperatorWithBooleanType.ts, 13, 3)) +>A : Symbol(A, Decl(negateOperatorWithBooleanType.ts, 3, 40)) + +// boolean type var +var ResultIsNumber1 = -BOOLEAN; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(negateOperatorWithBooleanType.ts, 16, 3)) +>BOOLEAN : Symbol(BOOLEAN, Decl(negateOperatorWithBooleanType.ts, 1, 3)) + +// boolean type literal +var ResultIsNumber2 = -true; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(negateOperatorWithBooleanType.ts, 19, 3)) + +var ResultIsNumber3 = -{ x: true, y: false }; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(negateOperatorWithBooleanType.ts, 20, 3)) +>x : Symbol(x, Decl(negateOperatorWithBooleanType.ts, 20, 24)) +>y : Symbol(y, Decl(negateOperatorWithBooleanType.ts, 20, 33)) + +// boolean type expressions +var ResultIsNumber4 = -objA.a; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(negateOperatorWithBooleanType.ts, 23, 3)) +>objA.a : Symbol(A.a, Decl(negateOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithBooleanType.ts, 5, 9)) + +var ResultIsNumber5 = -M.n; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(negateOperatorWithBooleanType.ts, 24, 3)) +>M.n : Symbol(M.n, Decl(negateOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(negateOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithBooleanType.ts, 10, 14)) + +var ResultIsNumber6 = -foo(); +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(negateOperatorWithBooleanType.ts, 25, 3)) +>foo : Symbol(foo, Decl(negateOperatorWithBooleanType.ts, 1, 21)) + +var ResultIsNumber7 = -A.foo(); +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(negateOperatorWithBooleanType.ts, 26, 3)) +>A.foo : Symbol(A.foo, Decl(negateOperatorWithBooleanType.ts, 6, 22)) +>A : Symbol(A, Decl(negateOperatorWithBooleanType.ts, 3, 40)) +>foo : Symbol(A.foo, Decl(negateOperatorWithBooleanType.ts, 6, 22)) + +// miss assignment operators +-true; +-BOOLEAN; +>BOOLEAN : Symbol(BOOLEAN, Decl(negateOperatorWithBooleanType.ts, 1, 3)) + +-foo(); +>foo : Symbol(foo, Decl(negateOperatorWithBooleanType.ts, 1, 21)) + +-true, false; +-objA.a; +>objA.a : Symbol(A.a, Decl(negateOperatorWithBooleanType.ts, 5, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithBooleanType.ts, 13, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithBooleanType.ts, 5, 9)) + +-M.n; +>M.n : Symbol(M.n, Decl(negateOperatorWithBooleanType.ts, 10, 14)) +>M : Symbol(M, Decl(negateOperatorWithBooleanType.ts, 8, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithBooleanType.ts, 10, 14)) + diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.types b/tests/baselines/reference/negateOperatorWithBooleanType.types index 49467d87845..89f5afc1c2b 100644 --- a/tests/baselines/reference/negateOperatorWithBooleanType.types +++ b/tests/baselines/reference/negateOperatorWithBooleanType.types @@ -5,6 +5,7 @@ var BOOLEAN: boolean; function foo(): boolean { return true; } >foo : () => boolean +>true : boolean class A { >A : A @@ -14,6 +15,7 @@ class A { static foo() { return false; } >foo : () => boolean +>false : boolean } module M { >M : typeof M @@ -37,13 +39,16 @@ var ResultIsNumber1 = -BOOLEAN; var ResultIsNumber2 = -true; >ResultIsNumber2 : number >-true : number +>true : boolean var ResultIsNumber3 = -{ x: true, y: false }; >ResultIsNumber3 : number >-{ x: true, y: false } : number >{ x: true, y: false } : { x: boolean; y: boolean; } >x : boolean +>true : boolean >y : boolean +>false : boolean // boolean type expressions var ResultIsNumber4 = -objA.a; @@ -77,6 +82,7 @@ var ResultIsNumber7 = -A.foo(); // miss assignment operators -true; >-true : number +>true : boolean -BOOLEAN; >-BOOLEAN : number @@ -90,6 +96,8 @@ var ResultIsNumber7 = -A.foo(); -true, false; >-true, false : boolean >-true : number +>true : boolean +>false : boolean -objA.a; >-objA.a : number diff --git a/tests/baselines/reference/negateOperatorWithEnumType.symbols b/tests/baselines/reference/negateOperatorWithEnumType.symbols new file mode 100644 index 00000000000..9d97cda0466 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithEnumType.symbols @@ -0,0 +1,45 @@ +=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts === +// - operator on enum type + +enum ENUM { }; +>ENUM : Symbol(ENUM, Decl(negateOperatorWithEnumType.ts, 0, 0)) + +enum ENUM1 { A, B, "" }; +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) +>A : Symbol(ENUM1.A, Decl(negateOperatorWithEnumType.ts, 3, 12)) +>B : Symbol(ENUM1.B, Decl(negateOperatorWithEnumType.ts, 3, 15)) + +// enum type var +var ResultIsNumber1 = -ENUM; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(negateOperatorWithEnumType.ts, 6, 3)) +>ENUM : Symbol(ENUM, Decl(negateOperatorWithEnumType.ts, 0, 0)) + +// expressions +var ResultIsNumber2 = -ENUM1["B"]; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(negateOperatorWithEnumType.ts, 9, 3)) +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) +>"B" : Symbol(ENUM1.B, Decl(negateOperatorWithEnumType.ts, 3, 15)) + +var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(negateOperatorWithEnumType.ts, 10, 3)) +>ENUM1.B : Symbol(ENUM1.B, Decl(negateOperatorWithEnumType.ts, 3, 15)) +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) +>B : Symbol(ENUM1.B, Decl(negateOperatorWithEnumType.ts, 3, 15)) +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) +>"" : Symbol(ENUM1."", Decl(negateOperatorWithEnumType.ts, 3, 18)) + +// miss assignment operators +-ENUM; +>ENUM : Symbol(ENUM, Decl(negateOperatorWithEnumType.ts, 0, 0)) + +-ENUM1; +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) + +-ENUM1["B"]; +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) +>"B" : Symbol(ENUM1.B, Decl(negateOperatorWithEnumType.ts, 3, 15)) + +-ENUM, ENUM1; +>ENUM : Symbol(ENUM, Decl(negateOperatorWithEnumType.ts, 0, 0)) +>ENUM1 : Symbol(ENUM1, Decl(negateOperatorWithEnumType.ts, 2, 14)) + diff --git a/tests/baselines/reference/negateOperatorWithEnumType.types b/tests/baselines/reference/negateOperatorWithEnumType.types index 96a33ff4c6e..2f39a581ef8 100644 --- a/tests/baselines/reference/negateOperatorWithEnumType.types +++ b/tests/baselines/reference/negateOperatorWithEnumType.types @@ -21,6 +21,7 @@ var ResultIsNumber2 = -ENUM1["B"]; >-ENUM1["B"] : number >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); >ResultIsNumber3 : number @@ -32,6 +33,7 @@ var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); >B : ENUM1 >ENUM1[""] : ENUM1 >ENUM1 : typeof ENUM1 +>"" : string // miss assignment operators -ENUM; @@ -46,6 +48,7 @@ var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); >-ENUM1["B"] : number >ENUM1["B"] : ENUM1 >ENUM1 : typeof ENUM1 +>"B" : string -ENUM, ENUM1; >-ENUM, ENUM1 : typeof ENUM1 diff --git a/tests/baselines/reference/negateOperatorWithNumberType.symbols b/tests/baselines/reference/negateOperatorWithNumberType.symbols new file mode 100644 index 00000000000..1f75d922b09 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithNumberType.symbols @@ -0,0 +1,117 @@ +=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts === +// - operator on number type +var NUMBER: number; +>NUMBER : Symbol(NUMBER, Decl(negateOperatorWithNumberType.ts, 1, 3)) + +var NUMBER1: number[] = [1, 2]; +>NUMBER1 : Symbol(NUMBER1, Decl(negateOperatorWithNumberType.ts, 2, 3)) + +function foo(): number { return 1; } +>foo : Symbol(foo, Decl(negateOperatorWithNumberType.ts, 2, 31)) + +class A { +>A : Symbol(A, Decl(negateOperatorWithNumberType.ts, 4, 36)) + + public a: number; +>a : Symbol(a, Decl(negateOperatorWithNumberType.ts, 6, 9)) + + static foo() { return 1; } +>foo : Symbol(A.foo, Decl(negateOperatorWithNumberType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(negateOperatorWithNumberType.ts, 9, 1)) + + export var n: number; +>n : Symbol(n, Decl(negateOperatorWithNumberType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(negateOperatorWithNumberType.ts, 14, 3)) +>A : Symbol(A, Decl(negateOperatorWithNumberType.ts, 4, 36)) + +// number type var +var ResultIsNumber1 = -NUMBER; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(negateOperatorWithNumberType.ts, 17, 3)) +>NUMBER : Symbol(NUMBER, Decl(negateOperatorWithNumberType.ts, 1, 3)) + +var ResultIsNumber2 = -NUMBER1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(negateOperatorWithNumberType.ts, 18, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(negateOperatorWithNumberType.ts, 2, 3)) + +// number type literal +var ResultIsNumber3 = -1; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(negateOperatorWithNumberType.ts, 21, 3)) + +var ResultIsNumber4 = -{ x: 1, y: 2}; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(negateOperatorWithNumberType.ts, 22, 3)) +>x : Symbol(x, Decl(negateOperatorWithNumberType.ts, 22, 24)) +>y : Symbol(y, Decl(negateOperatorWithNumberType.ts, 22, 30)) + +var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } }; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(negateOperatorWithNumberType.ts, 23, 3)) +>x : Symbol(x, Decl(negateOperatorWithNumberType.ts, 23, 24)) +>y : Symbol(y, Decl(negateOperatorWithNumberType.ts, 23, 30)) +>n : Symbol(n, Decl(negateOperatorWithNumberType.ts, 23, 35)) +>n : Symbol(n, Decl(negateOperatorWithNumberType.ts, 23, 35)) + +// number type expressions +var ResultIsNumber6 = -objA.a; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(negateOperatorWithNumberType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) + +var ResultIsNumber7 = -M.n; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(negateOperatorWithNumberType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(negateOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) + +var ResultIsNumber8 = -NUMBER1[0]; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(negateOperatorWithNumberType.ts, 28, 3)) +>NUMBER1 : Symbol(NUMBER1, Decl(negateOperatorWithNumberType.ts, 2, 3)) + +var ResultIsNumber9 = -foo(); +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(negateOperatorWithNumberType.ts, 29, 3)) +>foo : Symbol(foo, Decl(negateOperatorWithNumberType.ts, 2, 31)) + +var ResultIsNumber10 = -A.foo(); +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(negateOperatorWithNumberType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(negateOperatorWithNumberType.ts, 7, 21)) +>A : Symbol(A, Decl(negateOperatorWithNumberType.ts, 4, 36)) +>foo : Symbol(A.foo, Decl(negateOperatorWithNumberType.ts, 7, 21)) + +var ResultIsNumber11 = -(NUMBER - NUMBER); +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(negateOperatorWithNumberType.ts, 31, 3)) +>NUMBER : Symbol(NUMBER, Decl(negateOperatorWithNumberType.ts, 1, 3)) +>NUMBER : Symbol(NUMBER, Decl(negateOperatorWithNumberType.ts, 1, 3)) + +// miss assignment operators +-1; +-NUMBER; +>NUMBER : Symbol(NUMBER, Decl(negateOperatorWithNumberType.ts, 1, 3)) + +-NUMBER1; +>NUMBER1 : Symbol(NUMBER1, Decl(negateOperatorWithNumberType.ts, 2, 3)) + +-foo(); +>foo : Symbol(foo, Decl(negateOperatorWithNumberType.ts, 2, 31)) + +-objA.a; +>objA.a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) + +-M.n; +>M.n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(negateOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) + +-objA.a, M.n; +>objA.a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithNumberType.ts, 14, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithNumberType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) +>M : Symbol(M, Decl(negateOperatorWithNumberType.ts, 9, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithNumberType.ts, 11, 14)) + diff --git a/tests/baselines/reference/negateOperatorWithNumberType.types b/tests/baselines/reference/negateOperatorWithNumberType.types index f6cee89f6df..e53a4e54444 100644 --- a/tests/baselines/reference/negateOperatorWithNumberType.types +++ b/tests/baselines/reference/negateOperatorWithNumberType.types @@ -6,9 +6,12 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] >[1, 2] : number[] +>1 : number +>2 : number function foo(): number { return 1; } >foo : () => number +>1 : number class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return 1; } >foo : () => number +>1 : number } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsNumber2 = -NUMBER1; var ResultIsNumber3 = -1; >ResultIsNumber3 : number >-1 : number +>1 : number var ResultIsNumber4 = -{ x: 1, y: 2}; >ResultIsNumber4 : number >-{ x: 1, y: 2} : number >{ x: 1, y: 2} : { x: number; y: number; } >x : number +>1 : number >y : number +>2 : number var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } }; >ResultIsNumber5 : number >-{ x: 1, y: (n: number) => { return n; } } : number >{ x: 1, y: (n: number) => { return n; } } : { x: number; y: (n: number) => number; } >x : number +>1 : number >y : (n: number) => number >(n: number) => { return n; } : (n: number) => number >n : number @@ -84,6 +92,7 @@ var ResultIsNumber8 = -NUMBER1[0]; >-NUMBER1[0] : number >NUMBER1[0] : number >NUMBER1 : number[] +>0 : number var ResultIsNumber9 = -foo(); >ResultIsNumber9 : number @@ -110,6 +119,7 @@ var ResultIsNumber11 = -(NUMBER - NUMBER); // miss assignment operators -1; >-1 : number +>1 : number -NUMBER; >-NUMBER : number diff --git a/tests/baselines/reference/negateOperatorWithStringType.symbols b/tests/baselines/reference/negateOperatorWithStringType.symbols new file mode 100644 index 00000000000..00a90bdf743 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithStringType.symbols @@ -0,0 +1,113 @@ +=== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts === +// - operator on string type +var STRING: string; +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) + +var STRING1: string[] = ["", "abc"]; +>STRING1 : Symbol(STRING1, Decl(negateOperatorWithStringType.ts, 2, 3)) + +function foo(): string { return "abc"; } +>foo : Symbol(foo, Decl(negateOperatorWithStringType.ts, 2, 36)) + +class A { +>A : Symbol(A, Decl(negateOperatorWithStringType.ts, 4, 40)) + + public a: string; +>a : Symbol(a, Decl(negateOperatorWithStringType.ts, 6, 9)) + + static foo() { return ""; } +>foo : Symbol(A.foo, Decl(negateOperatorWithStringType.ts, 7, 21)) +} +module M { +>M : Symbol(M, Decl(negateOperatorWithStringType.ts, 9, 1)) + + export var n: string; +>n : Symbol(n, Decl(negateOperatorWithStringType.ts, 11, 14)) +} + +var objA = new A(); +>objA : Symbol(objA, Decl(negateOperatorWithStringType.ts, 14, 3)) +>A : Symbol(A, Decl(negateOperatorWithStringType.ts, 4, 40)) + +// string type var +var ResultIsNumber1 = -STRING; +>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(negateOperatorWithStringType.ts, 17, 3)) +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) + +var ResultIsNumber2 = -STRING1; +>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(negateOperatorWithStringType.ts, 18, 3)) +>STRING1 : Symbol(STRING1, Decl(negateOperatorWithStringType.ts, 2, 3)) + +// string type literal +var ResultIsNumber3 = -""; +>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(negateOperatorWithStringType.ts, 21, 3)) + +var ResultIsNumber4 = -{ x: "", y: "" }; +>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(negateOperatorWithStringType.ts, 22, 3)) +>x : Symbol(x, Decl(negateOperatorWithStringType.ts, 22, 24)) +>y : Symbol(y, Decl(negateOperatorWithStringType.ts, 22, 31)) + +var ResultIsNumber5 = -{ x: "", y: (s: string) => { return s; } }; +>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(negateOperatorWithStringType.ts, 23, 3)) +>x : Symbol(x, Decl(negateOperatorWithStringType.ts, 23, 24)) +>y : Symbol(y, Decl(negateOperatorWithStringType.ts, 23, 31)) +>s : Symbol(s, Decl(negateOperatorWithStringType.ts, 23, 36)) +>s : Symbol(s, Decl(negateOperatorWithStringType.ts, 23, 36)) + +// string type expressions +var ResultIsNumber6 = -objA.a; +>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(negateOperatorWithStringType.ts, 26, 3)) +>objA.a : Symbol(A.a, Decl(negateOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithStringType.ts, 6, 9)) + +var ResultIsNumber7 = -M.n; +>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(negateOperatorWithStringType.ts, 27, 3)) +>M.n : Symbol(M.n, Decl(negateOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(negateOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithStringType.ts, 11, 14)) + +var ResultIsNumber8 = -STRING1[0]; +>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(negateOperatorWithStringType.ts, 28, 3)) +>STRING1 : Symbol(STRING1, Decl(negateOperatorWithStringType.ts, 2, 3)) + +var ResultIsNumber9 = -foo(); +>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(negateOperatorWithStringType.ts, 29, 3)) +>foo : Symbol(foo, Decl(negateOperatorWithStringType.ts, 2, 36)) + +var ResultIsNumber10 = -A.foo(); +>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(negateOperatorWithStringType.ts, 30, 3)) +>A.foo : Symbol(A.foo, Decl(negateOperatorWithStringType.ts, 7, 21)) +>A : Symbol(A, Decl(negateOperatorWithStringType.ts, 4, 40)) +>foo : Symbol(A.foo, Decl(negateOperatorWithStringType.ts, 7, 21)) + +var ResultIsNumber11 = -(STRING + STRING); +>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(negateOperatorWithStringType.ts, 31, 3)) +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) + +var ResultIsNumber12 = -STRING.charAt(0); +>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(negateOperatorWithStringType.ts, 32, 3)) +>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) +>charAt : Symbol(String.charAt, Decl(lib.d.ts, 279, 23)) + +// miss assignment operators +-""; +-STRING; +>STRING : Symbol(STRING, Decl(negateOperatorWithStringType.ts, 1, 3)) + +-STRING1; +>STRING1 : Symbol(STRING1, Decl(negateOperatorWithStringType.ts, 2, 3)) + +-foo(); +>foo : Symbol(foo, Decl(negateOperatorWithStringType.ts, 2, 36)) + +-objA.a,M.n; +>objA.a : Symbol(A.a, Decl(negateOperatorWithStringType.ts, 6, 9)) +>objA : Symbol(objA, Decl(negateOperatorWithStringType.ts, 14, 3)) +>a : Symbol(A.a, Decl(negateOperatorWithStringType.ts, 6, 9)) +>M.n : Symbol(M.n, Decl(negateOperatorWithStringType.ts, 11, 14)) +>M : Symbol(M, Decl(negateOperatorWithStringType.ts, 9, 1)) +>n : Symbol(M.n, Decl(negateOperatorWithStringType.ts, 11, 14)) + diff --git a/tests/baselines/reference/negateOperatorWithStringType.types b/tests/baselines/reference/negateOperatorWithStringType.types index 43a9f05cc5b..6ef570557fe 100644 --- a/tests/baselines/reference/negateOperatorWithStringType.types +++ b/tests/baselines/reference/negateOperatorWithStringType.types @@ -6,9 +6,12 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] >["", "abc"] : string[] +>"" : string +>"abc" : string function foo(): string { return "abc"; } >foo : () => string +>"abc" : string class A { >A : A @@ -18,6 +21,7 @@ class A { static foo() { return ""; } >foo : () => string +>"" : string } module M { >M : typeof M @@ -46,19 +50,23 @@ var ResultIsNumber2 = -STRING1; var ResultIsNumber3 = -""; >ResultIsNumber3 : number >-"" : number +>"" : string var ResultIsNumber4 = -{ x: "", y: "" }; >ResultIsNumber4 : number >-{ x: "", y: "" } : number >{ x: "", y: "" } : { x: string; y: string; } >x : string +>"" : string >y : string +>"" : string var ResultIsNumber5 = -{ x: "", y: (s: string) => { return s; } }; >ResultIsNumber5 : number >-{ x: "", y: (s: string) => { return s; } } : number >{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; } >x : string +>"" : string >y : (s: string) => string >(s: string) => { return s; } : (s: string) => string >s : string @@ -84,6 +92,7 @@ var ResultIsNumber8 = -STRING1[0]; >-STRING1[0] : number >STRING1[0] : string >STRING1 : string[] +>0 : number var ResultIsNumber9 = -foo(); >ResultIsNumber9 : number @@ -114,10 +123,12 @@ var ResultIsNumber12 = -STRING.charAt(0); >STRING.charAt : (pos: number) => string >STRING : string >charAt : (pos: number) => string +>0 : number // miss assignment operators -""; >-"" : number +>"" : string -STRING; >-STRING : number diff --git a/tests/baselines/reference/negativeZero.symbols b/tests/baselines/reference/negativeZero.symbols new file mode 100644 index 00000000000..cdd6880a86f --- /dev/null +++ b/tests/baselines/reference/negativeZero.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/negativeZero.ts === +var x = -0 +>x : Symbol(x, Decl(negativeZero.ts, 0, 3)) + diff --git a/tests/baselines/reference/negativeZero.types b/tests/baselines/reference/negativeZero.types index 97ba45a741a..3468e22fdb2 100644 --- a/tests/baselines/reference/negativeZero.types +++ b/tests/baselines/reference/negativeZero.types @@ -2,4 +2,5 @@ var x = -0 >x : number >-0 : number +>0 : number diff --git a/tests/baselines/reference/nestedGenerics.symbols b/tests/baselines/reference/nestedGenerics.symbols new file mode 100644 index 00000000000..24b3e1eb89d --- /dev/null +++ b/tests/baselines/reference/nestedGenerics.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/nestedGenerics.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(nestedGenerics.ts, 0, 0)) +>T : Symbol(T, Decl(nestedGenerics.ts, 0, 14)) + + t: T; +>t : Symbol(t, Decl(nestedGenerics.ts, 0, 18)) +>T : Symbol(T, Decl(nestedGenerics.ts, 0, 14)) +} + +var f: Foo>; +>f : Symbol(f, Decl(nestedGenerics.ts, 4, 3)) +>Foo : Symbol(Foo, Decl(nestedGenerics.ts, 0, 0)) +>Foo : Symbol(Foo, Decl(nestedGenerics.ts, 0, 0)) + diff --git a/tests/baselines/reference/nestedIfStatement.symbols b/tests/baselines/reference/nestedIfStatement.symbols new file mode 100644 index 00000000000..4dddcd75925 --- /dev/null +++ b/tests/baselines/reference/nestedIfStatement.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/nestedIfStatement.ts === +if (0) { +No type information for this code.} else if (1) { +No type information for this code.} else if (2) { +No type information for this code.} else if (3) { +No type information for this code.} else { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/nestedIfStatement.types b/tests/baselines/reference/nestedIfStatement.types index 4dddcd75925..19799d25172 100644 --- a/tests/baselines/reference/nestedIfStatement.types +++ b/tests/baselines/reference/nestedIfStatement.types @@ -1,8 +1,15 @@ === tests/cases/compiler/nestedIfStatement.ts === if (0) { -No type information for this code.} else if (1) { -No type information for this code.} else if (2) { -No type information for this code.} else if (3) { -No type information for this code.} else { -No type information for this code.} -No type information for this code. \ No newline at end of file +>0 : number + +} else if (1) { +>1 : number + +} else if (2) { +>2 : number + +} else if (3) { +>3 : number + +} else { +} diff --git a/tests/baselines/reference/nestedIndexer.symbols b/tests/baselines/reference/nestedIndexer.symbols new file mode 100644 index 00000000000..cbe729277e0 --- /dev/null +++ b/tests/baselines/reference/nestedIndexer.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/nestedIndexer.ts === +function then(x) { +>then : Symbol(then, Decl(nestedIndexer.ts, 0, 0)) +>x : Symbol(x, Decl(nestedIndexer.ts, 0, 14)) + +var match: { [index: number]: string; } +>match : Symbol(match, Decl(nestedIndexer.ts, 2, 3)) +>index : Symbol(index, Decl(nestedIndexer.ts, 2, 14)) + +} + diff --git a/tests/baselines/reference/nestedInfinitelyExpandedRecursiveTypes.symbols b/tests/baselines/reference/nestedInfinitelyExpandedRecursiveTypes.symbols new file mode 100644 index 00000000000..28206f8dec2 --- /dev/null +++ b/tests/baselines/reference/nestedInfinitelyExpandedRecursiveTypes.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/nestedInfinitelyExpandedRecursiveTypes.ts === +interface F { +>F : Symbol(F, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 0)) +>T : Symbol(T, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 12)) + + t: G T>>; +>t : Symbol(t, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 16)) +>G : Symbol(G, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 2, 1)) +>F : Symbol(F, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 0)) +>T : Symbol(T, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 12)) +} +interface G { +>G : Symbol(G, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 2, 1)) +>U : Symbol(U, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 3, 12)) + + t: G U>>; +>t : Symbol(t, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 3, 16)) +>G : Symbol(G, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 2, 1)) +>G : Symbol(G, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 2, 1)) +>U : Symbol(U, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 3, 12)) +} + +var f: F; +>f : Symbol(f, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 7, 3)) +>F : Symbol(F, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 0, 0)) + +var g: G; +>g : Symbol(g, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 8, 3)) +>G : Symbol(G, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 2, 1)) + +f = g; +>f : Symbol(f, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 7, 3)) +>g : Symbol(g, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 8, 3)) + +g = f; +>g : Symbol(g, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 8, 3)) +>f : Symbol(f, Decl(nestedInfinitelyExpandedRecursiveTypes.ts, 7, 3)) + diff --git a/tests/baselines/reference/nestedModulePrivateAccess.symbols b/tests/baselines/reference/nestedModulePrivateAccess.symbols new file mode 100644 index 00000000000..23ae0b080e8 --- /dev/null +++ b/tests/baselines/reference/nestedModulePrivateAccess.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/nestedModulePrivateAccess.ts === +module a{ +>a : Symbol(a, Decl(nestedModulePrivateAccess.ts, 0, 0)) + + var x:number; +>x : Symbol(x, Decl(nestedModulePrivateAccess.ts, 1, 10)) + + module b{ +>b : Symbol(b, Decl(nestedModulePrivateAccess.ts, 1, 20)) + + var y = x; // should not be an error +>y : Symbol(y, Decl(nestedModulePrivateAccess.ts, 3, 18)) +>x : Symbol(x, Decl(nestedModulePrivateAccess.ts, 1, 10)) + } +} diff --git a/tests/baselines/reference/nestedModules.symbols b/tests/baselines/reference/nestedModules.symbols new file mode 100644 index 00000000000..7ff4efd30f6 --- /dev/null +++ b/tests/baselines/reference/nestedModules.symbols @@ -0,0 +1,82 @@ +=== tests/cases/conformance/internalModules/moduleDeclarations/nestedModules.ts === +module A.B.C { +>A : Symbol(A, Decl(nestedModules.ts, 0, 0), Decl(nestedModules.ts, 5, 1)) +>B : Symbol(B, Decl(nestedModules.ts, 0, 9), Decl(nestedModules.ts, 7, 10)) +>C : Symbol(C, Decl(nestedModules.ts, 0, 11)) + + export interface Point { +>Point : Symbol(Point, Decl(nestedModules.ts, 0, 14)) + + x: number; +>x : Symbol(x, Decl(nestedModules.ts, 1, 28)) + + y: number; +>y : Symbol(y, Decl(nestedModules.ts, 2, 18)) + } +} + +module A { +>A : Symbol(A, Decl(nestedModules.ts, 0, 0), Decl(nestedModules.ts, 5, 1)) + + export module B { +>B : Symbol(B, Decl(nestedModules.ts, 0, 9), Decl(nestedModules.ts, 7, 10)) + + var Point: C.Point = { x: 0, y: 0 }; // bug 832088: could not find module 'C' +>Point : Symbol(Point, Decl(nestedModules.ts, 9, 11)) +>C : Symbol(C, Decl(nestedModules.ts, 0, 11)) +>Point : Symbol(C.Point, Decl(nestedModules.ts, 0, 14)) +>x : Symbol(x, Decl(nestedModules.ts, 9, 30)) +>y : Symbol(y, Decl(nestedModules.ts, 9, 36)) + } +} + +module M2.X { +>M2 : Symbol(M2, Decl(nestedModules.ts, 11, 1), Decl(nestedModules.ts, 17, 1)) +>X : Symbol(X, Decl(nestedModules.ts, 13, 10), Decl(nestedModules.ts, 19, 11)) + + export interface Point { +>Point : Symbol(Point, Decl(nestedModules.ts, 13, 13), Decl(nestedModules.ts, 21, 18)) + + x: number; y: number; +>x : Symbol(x, Decl(nestedModules.ts, 14, 28)) +>y : Symbol(y, Decl(nestedModules.ts, 15, 18)) + } +} + +module M2 { +>M2 : Symbol(M2, Decl(nestedModules.ts, 11, 1), Decl(nestedModules.ts, 17, 1)) + + export module X { +>X : Symbol(X, Decl(nestedModules.ts, 13, 10), Decl(nestedModules.ts, 19, 11)) + + export var Point: number; +>Point : Symbol(Point, Decl(nestedModules.ts, 13, 13), Decl(nestedModules.ts, 21, 18)) + } +} + +var m = M2.X; +>m : Symbol(m, Decl(nestedModules.ts, 25, 3)) +>M2.X : Symbol(M2.X, Decl(nestedModules.ts, 13, 10), Decl(nestedModules.ts, 19, 11)) +>M2 : Symbol(M2, Decl(nestedModules.ts, 11, 1), Decl(nestedModules.ts, 17, 1)) +>X : Symbol(M2.X, Decl(nestedModules.ts, 13, 10), Decl(nestedModules.ts, 19, 11)) + +var point: number; +>point : Symbol(point, Decl(nestedModules.ts, 26, 3), Decl(nestedModules.ts, 27, 3)) + +var point = m.Point; +>point : Symbol(point, Decl(nestedModules.ts, 26, 3), Decl(nestedModules.ts, 27, 3)) +>m.Point : Symbol(M2.X.Point, Decl(nestedModules.ts, 13, 13), Decl(nestedModules.ts, 21, 18)) +>m : Symbol(m, Decl(nestedModules.ts, 25, 3)) +>Point : Symbol(M2.X.Point, Decl(nestedModules.ts, 13, 13), Decl(nestedModules.ts, 21, 18)) + +var p: { x: number; y: number; } +>p : Symbol(p, Decl(nestedModules.ts, 29, 3), Decl(nestedModules.ts, 30, 3)) +>x : Symbol(x, Decl(nestedModules.ts, 29, 8)) +>y : Symbol(y, Decl(nestedModules.ts, 29, 19)) + +var p: M2.X.Point; +>p : Symbol(p, Decl(nestedModules.ts, 29, 3), Decl(nestedModules.ts, 30, 3)) +>M2 : Symbol(M2, Decl(nestedModules.ts, 11, 1), Decl(nestedModules.ts, 17, 1)) +>X : Symbol(M2.X, Decl(nestedModules.ts, 13, 10), Decl(nestedModules.ts, 19, 11)) +>Point : Symbol(M2.X.Point, Decl(nestedModules.ts, 13, 13), Decl(nestedModules.ts, 21, 18)) + diff --git a/tests/baselines/reference/nestedModules.types b/tests/baselines/reference/nestedModules.types index 863e57ef859..eee3ee3968a 100644 --- a/tests/baselines/reference/nestedModules.types +++ b/tests/baselines/reference/nestedModules.types @@ -2,7 +2,7 @@ module A.B.C { >A : typeof A >B : typeof B ->C : unknown +>C : any export interface Point { >Point : Point @@ -23,11 +23,13 @@ module A { var Point: C.Point = { x: 0, y: 0 }; // bug 832088: could not find module 'C' >Point : C.Point ->C : unknown +>C : any >Point : C.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } } @@ -77,7 +79,7 @@ var p: { x: number; y: number; } var p: M2.X.Point; >p : { x: number; y: number; } ->M2 : unknown ->X : unknown +>M2 : any +>X : any >Point : M2.X.Point diff --git a/tests/baselines/reference/nestedRecursiveLambda.symbols b/tests/baselines/reference/nestedRecursiveLambda.symbols new file mode 100644 index 00000000000..b91c1d84ebb --- /dev/null +++ b/tests/baselines/reference/nestedRecursiveLambda.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/nestedRecursiveLambda.ts === +function f(a:any) { +>f : Symbol(f, Decl(nestedRecursiveLambda.ts, 0, 0)) +>a : Symbol(a, Decl(nestedRecursiveLambda.ts, 0, 11)) + +void (r =>(r => r)); +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 1, 6)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 1, 11)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 1, 11)) +} +f((r =>(r => r))); +>f : Symbol(f, Decl(nestedRecursiveLambda.ts, 0, 0)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 3, 3)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 3, 8)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 3, 8)) + +void(r =>(r => r)); +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 4, 5)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 4, 10)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 4, 10)) + +[(r =>(r => r))] +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 5, 2)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 5, 7)) +>r : Symbol(r, Decl(nestedRecursiveLambda.ts, 5, 7)) + diff --git a/tests/baselines/reference/nestedSelf.symbols b/tests/baselines/reference/nestedSelf.symbols new file mode 100644 index 00000000000..08f41f155d6 --- /dev/null +++ b/tests/baselines/reference/nestedSelf.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/nestedSelf.ts === +module M { +>M : Symbol(M, Decl(nestedSelf.ts, 0, 0)) + + export class C { +>C : Symbol(C, Decl(nestedSelf.ts, 0, 10)) + + public n = 42; +>n : Symbol(n, Decl(nestedSelf.ts, 1, 17)) + + public foo() { [1,2,3].map((x) => { return this.n * x; })} +>foo : Symbol(foo, Decl(nestedSelf.ts, 2, 17)) +>[1,2,3].map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>map : Symbol(Array.map, Decl(lib.d.ts, 1115, 92)) +>x : Symbol(x, Decl(nestedSelf.ts, 3, 31)) +>this.n : Symbol(n, Decl(nestedSelf.ts, 1, 17)) +>this : Symbol(C, Decl(nestedSelf.ts, 0, 10)) +>n : Symbol(n, Decl(nestedSelf.ts, 1, 17)) +>x : Symbol(x, Decl(nestedSelf.ts, 3, 31)) + } +} + + diff --git a/tests/baselines/reference/nestedSelf.types b/tests/baselines/reference/nestedSelf.types index 56280bffb2f..2c8f3f41dd6 100644 --- a/tests/baselines/reference/nestedSelf.types +++ b/tests/baselines/reference/nestedSelf.types @@ -7,12 +7,16 @@ module M { public n = 42; >n : number +>42 : number public foo() { [1,2,3].map((x) => { return this.n * x; })} >foo : () => void >[1,2,3].map((x) => { return this.n * x; }) : number[] >[1,2,3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >[1,2,3] : number[] +>1 : number +>2 : number +>3 : number >map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >(x) => { return this.n * x; } : (x: number) => number >x : number diff --git a/tests/baselines/reference/newArrays.symbols b/tests/baselines/reference/newArrays.symbols new file mode 100644 index 00000000000..fd30b2fe25e --- /dev/null +++ b/tests/baselines/reference/newArrays.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/newArrays.ts === +module M { +>M : Symbol(M, Decl(newArrays.ts, 0, 0)) + + class Foo {} +>Foo : Symbol(Foo, Decl(newArrays.ts, 0, 10)) + + class Gar { +>Gar : Symbol(Gar, Decl(newArrays.ts, 1, 13)) + + public fa: Foo[]; +>fa : Symbol(fa, Decl(newArrays.ts, 2, 12)) +>Foo : Symbol(Foo, Decl(newArrays.ts, 0, 10)) + + public x = 10; +>x : Symbol(x, Decl(newArrays.ts, 3, 19)) + + public y = 10; +>y : Symbol(y, Decl(newArrays.ts, 4, 16)) + + public m () { +>m : Symbol(m, Decl(newArrays.ts, 5, 16)) + + this.fa = new Array(this.x * this.y); +>this.fa : Symbol(fa, Decl(newArrays.ts, 2, 12)) +>this : Symbol(Gar, Decl(newArrays.ts, 1, 13)) +>fa : Symbol(fa, Decl(newArrays.ts, 2, 12)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>Foo : Symbol(Foo, Decl(newArrays.ts, 0, 10)) +>this.x : Symbol(x, Decl(newArrays.ts, 3, 19)) +>this : Symbol(Gar, Decl(newArrays.ts, 1, 13)) +>x : Symbol(x, Decl(newArrays.ts, 3, 19)) +>this.y : Symbol(y, Decl(newArrays.ts, 4, 16)) +>this : Symbol(Gar, Decl(newArrays.ts, 1, 13)) +>y : Symbol(y, Decl(newArrays.ts, 4, 16)) + } + } +} diff --git a/tests/baselines/reference/newArrays.types b/tests/baselines/reference/newArrays.types index 463525cb04c..4600f5efaf8 100644 --- a/tests/baselines/reference/newArrays.types +++ b/tests/baselines/reference/newArrays.types @@ -14,9 +14,11 @@ module M { public x = 10; >x : number +>10 : number public y = 10; >y : number +>10 : number public m () { >m : () => void diff --git a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols new file mode 100644 index 00000000000..4c22ec94c85 --- /dev/null +++ b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts === +interface I { +>I : Symbol(I, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 12)) + + new (u: U): U; +>U : Symbol(U, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 9)) +>T : Symbol(T, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 12)) +>u : Symbol(u, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 22)) +>U : Symbol(U, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 9)) +>U : Symbol(U, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 1, 9)) +} +var i: I; +>i : Symbol(i, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 3, 3)) +>I : Symbol(I, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 0, 0)) + +var y = new i(""); // y should be string +>y : Symbol(y, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 4, 3)) +>i : Symbol(i, Decl(newExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts, 3, 3)) + diff --git a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types index 8629c3cce0a..e07fa21fafe 100644 --- a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.types @@ -18,4 +18,5 @@ var y = new i(""); // y should be string >y : string >new i("") : string >i : I +>"" : string diff --git a/tests/baselines/reference/newOperatorConformance.symbols b/tests/baselines/reference/newOperatorConformance.symbols new file mode 100644 index 00000000000..8467e1741fc --- /dev/null +++ b/tests/baselines/reference/newOperatorConformance.symbols @@ -0,0 +1,135 @@ +=== tests/cases/conformance/expressions/newOperator/newOperatorConformance.ts === + +class C0 { +>C0 : Symbol(C0, Decl(newOperatorConformance.ts, 0, 0)) + +} +class C1 { +>C1 : Symbol(C1, Decl(newOperatorConformance.ts, 3, 1)) + + constructor(n: number, s: string) { } +>n : Symbol(n, Decl(newOperatorConformance.ts, 5, 16)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 5, 26)) +} + +class T { +>T : Symbol(T, Decl(newOperatorConformance.ts, 6, 1)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 8, 8)) + + constructor(n?: T) { } +>n : Symbol(n, Decl(newOperatorConformance.ts, 9, 16)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 8, 8)) +} + +var anyCtor: { +>anyCtor : Symbol(anyCtor, Decl(newOperatorConformance.ts, 12, 3)) + + new (): any; +}; + +var anyCtor1: { +>anyCtor1 : Symbol(anyCtor1, Decl(newOperatorConformance.ts, 16, 3)) + + new (n): any; +>n : Symbol(n, Decl(newOperatorConformance.ts, 17, 9)) + +}; + +interface nestedCtor { +>nestedCtor : Symbol(nestedCtor, Decl(newOperatorConformance.ts, 18, 2), Decl(newOperatorConformance.ts, 23, 3)) + + new (): nestedCtor; +>nestedCtor : Symbol(nestedCtor, Decl(newOperatorConformance.ts, 18, 2), Decl(newOperatorConformance.ts, 23, 3)) +} +var nestedCtor: nestedCtor; +>nestedCtor : Symbol(nestedCtor, Decl(newOperatorConformance.ts, 18, 2), Decl(newOperatorConformance.ts, 23, 3)) +>nestedCtor : Symbol(nestedCtor, Decl(newOperatorConformance.ts, 18, 2), Decl(newOperatorConformance.ts, 23, 3)) + +// Construct expression with no parentheses for construct signature with 0 parameters +var a = new C0; +>a : Symbol(a, Decl(newOperatorConformance.ts, 26, 3), Decl(newOperatorConformance.ts, 27, 3)) +>C0 : Symbol(C0, Decl(newOperatorConformance.ts, 0, 0)) + +var a: C0; +>a : Symbol(a, Decl(newOperatorConformance.ts, 26, 3), Decl(newOperatorConformance.ts, 27, 3)) +>C0 : Symbol(C0, Decl(newOperatorConformance.ts, 0, 0)) + + +// Generic construct expression with no parentheses +var c1 = new T; +>c1 : Symbol(c1, Decl(newOperatorConformance.ts, 31, 3), Decl(newOperatorConformance.ts, 32, 3)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 6, 1)) + +var c1: T<{}>; +>c1 : Symbol(c1, Decl(newOperatorConformance.ts, 31, 3), Decl(newOperatorConformance.ts, 32, 3)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 6, 1)) + +// Construct expression where constructor is of type 'any' with no parentheses +var d = new anyCtor; +>d : Symbol(d, Decl(newOperatorConformance.ts, 35, 3), Decl(newOperatorConformance.ts, 36, 3), Decl(newOperatorConformance.ts, 39, 3)) +>anyCtor : Symbol(anyCtor, Decl(newOperatorConformance.ts, 12, 3)) + +var d: any; +>d : Symbol(d, Decl(newOperatorConformance.ts, 35, 3), Decl(newOperatorConformance.ts, 36, 3), Decl(newOperatorConformance.ts, 39, 3)) + +// Construct expression where constructor is of type 'any' with > 1 arg +var d = new anyCtor1(undefined); +>d : Symbol(d, Decl(newOperatorConformance.ts, 35, 3), Decl(newOperatorConformance.ts, 36, 3), Decl(newOperatorConformance.ts, 39, 3)) +>anyCtor1 : Symbol(anyCtor1, Decl(newOperatorConformance.ts, 16, 3)) +>undefined : Symbol(undefined) + +// Construct expression of type where apparent type has a construct signature with 0 arguments +function newFn1(s: T) { +>newFn1 : Symbol(newFn1, Decl(newOperatorConformance.ts, 39, 32)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 42, 16)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 42, 46)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 42, 16)) + + var p = new s; +>p : Symbol(p, Decl(newOperatorConformance.ts, 43, 7), Decl(newOperatorConformance.ts, 44, 7)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 42, 46)) + + var p: number; +>p : Symbol(p, Decl(newOperatorConformance.ts, 43, 7), Decl(newOperatorConformance.ts, 44, 7)) +} + +// Construct expression of type where apparent type has a construct signature with 1 arguments +function newFn2(s: T) { +>newFn2 : Symbol(newFn2, Decl(newOperatorConformance.ts, 45, 1)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 48, 16)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 48, 33)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 48, 54)) +>T : Symbol(T, Decl(newOperatorConformance.ts, 48, 16)) + + var p = new s(32); +>p : Symbol(p, Decl(newOperatorConformance.ts, 49, 7), Decl(newOperatorConformance.ts, 50, 7)) +>s : Symbol(s, Decl(newOperatorConformance.ts, 48, 54)) + + var p: string; +>p : Symbol(p, Decl(newOperatorConformance.ts, 49, 7), Decl(newOperatorConformance.ts, 50, 7)) +} + +// Construct expression of void returning function +function fnVoid(): void { } +>fnVoid : Symbol(fnVoid, Decl(newOperatorConformance.ts, 51, 1)) + +var t = new fnVoid(); +>t : Symbol(t, Decl(newOperatorConformance.ts, 55, 3), Decl(newOperatorConformance.ts, 56, 3)) +>fnVoid : Symbol(fnVoid, Decl(newOperatorConformance.ts, 51, 1)) + +var t: any; +>t : Symbol(t, Decl(newOperatorConformance.ts, 55, 3), Decl(newOperatorConformance.ts, 56, 3)) + +// Chained new expressions +var nested = new (new (new nestedCtor())())(); +>nested : Symbol(nested, Decl(newOperatorConformance.ts, 59, 3)) +>nestedCtor : Symbol(nestedCtor, Decl(newOperatorConformance.ts, 18, 2), Decl(newOperatorConformance.ts, 23, 3)) + +var n = new nested(); +>n : Symbol(n, Decl(newOperatorConformance.ts, 60, 3), Decl(newOperatorConformance.ts, 61, 3)) +>nested : Symbol(nested, Decl(newOperatorConformance.ts, 59, 3)) + +var n = new nested(); +>n : Symbol(n, Decl(newOperatorConformance.ts, 60, 3), Decl(newOperatorConformance.ts, 61, 3)) +>nested : Symbol(nested, Decl(newOperatorConformance.ts, 59, 3)) + diff --git a/tests/baselines/reference/newOperatorConformance.types b/tests/baselines/reference/newOperatorConformance.types index 37205bd6177..912c0a5c81a 100644 --- a/tests/baselines/reference/newOperatorConformance.types +++ b/tests/baselines/reference/newOperatorConformance.types @@ -110,6 +110,7 @@ function newFn2(s: T) { >p : string >new s(32) : string >s : T +>32 : number var p: string; >p : string diff --git a/tests/baselines/reference/noCatchBlock.symbols b/tests/baselines/reference/noCatchBlock.symbols new file mode 100644 index 00000000000..cf7689660a3 --- /dev/null +++ b/tests/baselines/reference/noCatchBlock.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/noCatchBlock.ts === + +No type information for this code.try { +No type information for this code. // ... +No type information for this code.} finally { +No type information for this code. // N.B. No 'catch' block +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.symbols b/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.symbols new file mode 100644 index 00000000000..e288a42fae0 --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndClassInGlobal.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndClassInGlobal.ts === +class _this { +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndClassInGlobal.ts, 0, 0)) +} +var f = () => _this; +>f : Symbol(f, Decl(noCollisionThisExpressionAndClassInGlobal.ts, 2, 3)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndClassInGlobal.ts, 0, 0)) + diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.symbols new file mode 100644 index 00000000000..298e6f9acc1 --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInConstructor.ts === +class class1 { +>class1 : Symbol(class1, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 0, 0)) + + constructor() { + var x2 = { +>x2 : Symbol(x2, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 2, 11)) + + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 2, 18)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 3, 22)) + + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 4, 19)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 3, 22)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 4, 19)) + } + } + } +} + +class class2 { +>class2 : Symbol(class2, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 9, 1)) + + constructor() { + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 13, 11)) + + var x2 = { +>x2 : Symbol(x2, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 14, 11)) + + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 14, 18)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 15, 22)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 15, 22)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInConstructor.ts, 13, 11)) + } + } + } +} diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types index f9537974161..8c3cc633c10 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types @@ -15,6 +15,7 @@ class class1 { var _this = 2; >_this : number +>2 : number return callback(_this); >callback(_this) : any @@ -31,6 +32,7 @@ class class2 { constructor() { var _this = 2; >_this : number +>2 : number var x2 = { >x2 : { doStuff: (callback: any) => () => any; } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.symbols new file mode 100644 index 00000000000..09c99810fea --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInFunction.ts === +var console: { +>console : Symbol(console, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 0, 3)) + + log(val: any); +>log : Symbol(log, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 0, 14)) +>val : Symbol(val, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 1, 8)) +} +function x() { +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 2, 1)) + + var _this = 5; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 4, 7)) + + x => { console.log(_this); }; +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 4, 18)) +>console.log : Symbol(log, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 0, 14)) +>console : Symbol(console, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 0, 3)) +>log : Symbol(log, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 0, 14)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInFunction.ts, 4, 7)) +} diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types index 56f5701e912..3edf54a594f 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types @@ -11,6 +11,7 @@ function x() { var _this = 5; >_this : number +>5 : number x => { console.log(_this); }; >x => { console.log(_this); } : (x: any) => void diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.symbols new file mode 100644 index 00000000000..45115b278ad --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInLambda.ts === +declare function alert(message?: any): void; +>alert : Symbol(alert, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) +>message : Symbol(message, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 23)) + +var x = { +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 3)) + + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 9)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 2, 14)) + + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 3, 11)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 2, 14)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 3, 11)) + } +} +alert(x.doStuff(x => alert(x))); +>alert : Symbol(alert, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) +>x.doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 9)) +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 3)) +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 9)) +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 7, 16)) +>alert : Symbol(alert, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) +>x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 7, 16)) + diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types index 6cf4428bcc5..83732f9c350 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types @@ -15,6 +15,7 @@ var x = { var _this = 2; >_this : number +>2 : number return callback(_this); >callback(_this) : any diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.symbols new file mode 100644 index 00000000000..72e0d20a9b2 --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInMethod.ts === +var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 0, 3)) + +class a { +>a : Symbol(a, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 0, 14)) + + method1() { +>method1 : Symbol(method1, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 1, 9)) + + return { + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 3, 16)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 4, 22)) + + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 5, 19)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 4, 22)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 5, 19)) + } + } + } + method2() { +>method2 : Symbol(method2, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 9, 5)) + + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 11, 11)) + + return { + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 12, 16)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 13, 22)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 13, 22)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInMethod.ts, 11, 11)) + } + } + } +} diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types index cb543b33ad4..49d0e3ed93a 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types @@ -1,6 +1,7 @@ === tests/cases/compiler/noCollisionThisExpressionAndLocalVarInMethod.ts === var _this = 2; >_this : number +>2 : number class a { >a : a @@ -19,6 +20,7 @@ class a { var _this = 2; >_this : number +>2 : number return callback(_this); >callback(_this) : any @@ -32,6 +34,7 @@ class a { var _this = 2; >_this : number +>2 : number return { >{ doStuff: (callback) => () => { return callback(_this); } } : { doStuff: (callback: any) => () => any; } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.symbols new file mode 100644 index 00000000000..0dc4cf1d84e --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndLocalVarInProperty.ts === +class class1 { +>class1 : Symbol(class1, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 0, 0)) + + public prop1 = { +>prop1 : Symbol(prop1, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 0, 14)) + + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 1, 20)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 2, 18)) + + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 3, 15)) + + return callback(_this); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 2, 18)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 3, 15)) + } + } +} + +class class2 { +>class2 : Symbol(class2, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 7, 1)) + + constructor() { + var _this = 2; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 11, 11)) + } + public prop1 = { +>prop1 : Symbol(prop1, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 12, 5)) + + doStuff: (callback) => () => { +>doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 13, 20)) +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 14, 18)) + + return callback(10); +>callback : Symbol(callback, Decl(noCollisionThisExpressionAndLocalVarInProperty.ts, 14, 18)) + } + } +} diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types index df4ad5113f2..8918ccc825c 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types @@ -14,6 +14,7 @@ class class1 { var _this = 2; >_this : number +>2 : number return callback(_this); >callback(_this) : any @@ -29,6 +30,7 @@ class class2 { constructor() { var _this = 2; >_this : number +>2 : number } public prop1 = { >prop1 : { doStuff: (callback: any) => () => any; } @@ -43,6 +45,7 @@ class class2 { return callback(10); >callback(10) : any >callback : any +>10 : number } } } diff --git a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.symbols b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.symbols new file mode 100644 index 00000000000..c3746cbcb8f --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/noCollisionThisExpressionAndVarInGlobal.ts === +var _this = 1; +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndVarInGlobal.ts, 0, 3)) + +var f = () => _this; +>f : Symbol(f, Decl(noCollisionThisExpressionAndVarInGlobal.ts, 1, 3)) +>_this : Symbol(_this, Decl(noCollisionThisExpressionAndVarInGlobal.ts, 0, 3)) + diff --git a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types index 138062d58e5..c5943ef5c14 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndVarInGlobal.types @@ -1,6 +1,7 @@ === tests/cases/compiler/noCollisionThisExpressionAndVarInGlobal.ts === var _this = 1; >_this : number +>1 : number var f = () => _this; >f : () => number diff --git a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.symbols b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.symbols new file mode 100644 index 00000000000..b2f2adbbbb6 --- /dev/null +++ b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/noCollisionThisExpressionInFunctionAndVarInGlobal.ts === +var console: { +>console : Symbol(console, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 0, 3)) + + log(val: any); +>log : Symbol(log, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 0, 14)) +>val : Symbol(val, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 1, 8)) +} +var _this = 5; +>_this : Symbol(_this, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 3, 3)) + +function x() { +>x : Symbol(x, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 3, 14)) + + x => { console.log(this); }; +>x : Symbol(x, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 4, 14)) +>console.log : Symbol(log, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 0, 14)) +>console : Symbol(console, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 0, 3)) +>log : Symbol(log, Decl(noCollisionThisExpressionInFunctionAndVarInGlobal.ts, 0, 14)) +} diff --git a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types index 35a62c6f671..ba65e03ba59 100644 --- a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types +++ b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types @@ -8,6 +8,7 @@ var console: { } var _this = 5; >_this : number +>5 : number function x() { >x : () => void diff --git a/tests/baselines/reference/noConstraintInReturnType1.symbols b/tests/baselines/reference/noConstraintInReturnType1.symbols new file mode 100644 index 00000000000..86d9283ca37 --- /dev/null +++ b/tests/baselines/reference/noConstraintInReturnType1.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/noConstraintInReturnType1.ts === +class List { +>List : Symbol(List, Decl(noConstraintInReturnType1.ts, 0, 0)) +>T : Symbol(T, Decl(noConstraintInReturnType1.ts, 0, 11)) + + static empty(): List { return null; } +>empty : Symbol(List.empty, Decl(noConstraintInReturnType1.ts, 0, 26)) +>T : Symbol(T, Decl(noConstraintInReturnType1.ts, 1, 17)) +>List : Symbol(List, Decl(noConstraintInReturnType1.ts, 0, 0)) +>T : Symbol(T, Decl(noConstraintInReturnType1.ts, 1, 17)) +} + diff --git a/tests/baselines/reference/noConstraintInReturnType1.types b/tests/baselines/reference/noConstraintInReturnType1.types index 19a7529ac79..a4c754371eb 100644 --- a/tests/baselines/reference/noConstraintInReturnType1.types +++ b/tests/baselines/reference/noConstraintInReturnType1.types @@ -8,5 +8,6 @@ class List { >T : T >List : List >T : T +>null : null } diff --git a/tests/baselines/reference/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.symbols b/tests/baselines/reference/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.symbols new file mode 100644 index 00000000000..1673c50f69f --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/app.ts === +/// +var x = new Something(); +>x : Symbol(x, Decl(app.ts, 1, 3)) +>Something : Symbol(Something, Decl(test.d.ts, 0, 0)) + +=== tests/cases/compiler/test.d.ts === +declare class Something +>Something : Symbol(Something, Decl(test.d.ts, 0, 0)) +{ + private static someStaticVar; +>someStaticVar : Symbol(Something.someStaticVar, Decl(test.d.ts, 1, 1)) + + private someVar; +>someVar : Symbol(someVar, Decl(test.d.ts, 2, 33)) +} + diff --git a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.symbols b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.symbols new file mode 100644 index 00000000000..8e9a331a205 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.symbols @@ -0,0 +1,22 @@ +=== tests/cases/compiler/noImplicitAnyFunctionExpressionAssignment.ts === + +var x: (a: any) => void = function (x: T) { +>x : Symbol(x, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 1, 3)) +>a : Symbol(a, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 1, 8)) +>T : Symbol(T, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 1, 36)) +>x : Symbol(x, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 1, 39)) +>T : Symbol(T, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 1, 36)) + + return null; +}; + +var x2: (a: any) => void = function f(x: T) { +>x2 : Symbol(x2, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 3)) +>a : Symbol(a, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 9)) +>f : Symbol(f, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 26)) +>T : Symbol(T, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 38)) +>x : Symbol(x, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 41)) +>T : Symbol(T, Decl(noImplicitAnyFunctionExpressionAssignment.ts, 5, 38)) + + return null; +}; diff --git a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types index b07252dac6d..9d8e216b656 100644 --- a/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types +++ b/tests/baselines/reference/noImplicitAnyFunctionExpressionAssignment.types @@ -9,6 +9,8 @@ var x: (a: any) => void = function (x: T) { >T : T return null; +>null : null + }; var x2: (a: any) => void = function f(x: T) { @@ -21,4 +23,6 @@ var x2: (a: any) => void = function f(x: T) { >T : T return null; +>null : null + }; diff --git a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.symbols b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.symbols new file mode 100644 index 00000000000..4bddb6a1f71 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/noImplicitAnyInContextuallyTypesFunctionParamter.ts === + +var regexMatchList = ['', '']; +>regexMatchList : Symbol(regexMatchList, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 1, 3)) + +regexMatchList.forEach(match => ''.replace(match, '')); +>regexMatchList.forEach : Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95)) +>regexMatchList : Symbol(regexMatchList, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 1, 3)) +>forEach : Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95)) +>match : Symbol(match, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 2, 23)) +>''.replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63)) +>replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63)) +>match : Symbol(match, Decl(noImplicitAnyInContextuallyTypesFunctionParamter.ts, 2, 23)) + diff --git a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types index 9ac1bcbbe8d..81fd614cb0e 100644 --- a/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types +++ b/tests/baselines/reference/noImplicitAnyInContextuallyTypesFunctionParamter.types @@ -3,6 +3,8 @@ var regexMatchList = ['', '']; >regexMatchList : string[] >['', ''] : string[] +>'' : string +>'' : string regexMatchList.forEach(match => ''.replace(match, '')); >regexMatchList.forEach(match => ''.replace(match, '')) : void @@ -13,6 +15,8 @@ regexMatchList.forEach(match => ''.replace(match, '')); >match : string >''.replace(match, '') : string >''.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } +>'' : string >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } >match : string +>'' : string diff --git a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.symbols b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.symbols new file mode 100644 index 00000000000..7c8f57795b4 --- /dev/null +++ b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.symbols @@ -0,0 +1,101 @@ +=== tests/cases/compiler/noImplicitAnyIndexingSuppressed.ts === + +enum MyEmusEnum { +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) + + emu +>emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) +} + +// Should be okay; should be a string. +var strRepresentation1 = MyEmusEnum[0] +>strRepresentation1 : Symbol(strRepresentation1, Decl(noImplicitAnyIndexingSuppressed.ts, 6, 3)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) + +// Should be okay; should be a string. +var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu] +>strRepresentation2 : Symbol(strRepresentation2, Decl(noImplicitAnyIndexingSuppressed.ts, 9, 3)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>MyEmusEnum.emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) + +// Should be okay, as we suppress implicit 'any' property access checks +var strRepresentation3 = MyEmusEnum["monehh"]; +>strRepresentation3 : Symbol(strRepresentation3, Decl(noImplicitAnyIndexingSuppressed.ts, 12, 3)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) + +// Should be okay; should be a MyEmusEnum +var strRepresentation4 = MyEmusEnum["emu"]; +>strRepresentation4 : Symbol(strRepresentation4, Decl(noImplicitAnyIndexingSuppressed.ts, 15, 3)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>"emu" : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) + + +// Should be okay, as we suppress implicit 'any' property access checks +var x = {}["hi"]; +>x : Symbol(x, Decl(noImplicitAnyIndexingSuppressed.ts, 19, 3)) + +// Should be okay, as we suppress implicit 'any' property access checks +var y = {}[10]; +>y : Symbol(y, Decl(noImplicitAnyIndexingSuppressed.ts, 22, 3)) + +var hi: any = "hi"; +>hi : Symbol(hi, Decl(noImplicitAnyIndexingSuppressed.ts, 24, 3)) + +var emptyObj = {}; +>emptyObj : Symbol(emptyObj, Decl(noImplicitAnyIndexingSuppressed.ts, 26, 3)) + +// Should be okay, as we suppress implicit 'any' property access checks +var z1 = emptyObj[hi]; +>z1 : Symbol(z1, Decl(noImplicitAnyIndexingSuppressed.ts, 29, 3)) +>emptyObj : Symbol(emptyObj, Decl(noImplicitAnyIndexingSuppressed.ts, 26, 3)) +>hi : Symbol(hi, Decl(noImplicitAnyIndexingSuppressed.ts, 24, 3)) + +var z2 = (emptyObj)[hi]; +>z2 : Symbol(z2, Decl(noImplicitAnyIndexingSuppressed.ts, 30, 3)) +>emptyObj : Symbol(emptyObj, Decl(noImplicitAnyIndexingSuppressed.ts, 26, 3)) +>hi : Symbol(hi, Decl(noImplicitAnyIndexingSuppressed.ts, 24, 3)) + +interface MyMap { +>MyMap : Symbol(MyMap, Decl(noImplicitAnyIndexingSuppressed.ts, 30, 29)) +>T : Symbol(T, Decl(noImplicitAnyIndexingSuppressed.ts, 32, 16)) + + [key: string]: T; +>key : Symbol(key, Decl(noImplicitAnyIndexingSuppressed.ts, 33, 5)) +>T : Symbol(T, Decl(noImplicitAnyIndexingSuppressed.ts, 32, 16)) +} + +var m: MyMap = { +>m : Symbol(m, Decl(noImplicitAnyIndexingSuppressed.ts, 36, 3)) +>MyMap : Symbol(MyMap, Decl(noImplicitAnyIndexingSuppressed.ts, 30, 29)) + + "0": 0, + "1": 1, + "2": 2, + "Okay that's enough for today.": NaN +>NaN : Symbol(NaN, Decl(lib.d.ts, 21, 11)) + +}; + +var mResult1 = m[MyEmusEnum.emu]; +>mResult1 : Symbol(mResult1, Decl(noImplicitAnyIndexingSuppressed.ts, 43, 3)) +>m : Symbol(m, Decl(noImplicitAnyIndexingSuppressed.ts, 36, 3)) +>MyEmusEnum.emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) + +var mResult2 = m[MyEmusEnum[MyEmusEnum.emu]]; +>mResult2 : Symbol(mResult2, Decl(noImplicitAnyIndexingSuppressed.ts, 44, 3)) +>m : Symbol(m, Decl(noImplicitAnyIndexingSuppressed.ts, 36, 3)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>MyEmusEnum.emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) +>MyEmusEnum : Symbol(MyEmusEnum, Decl(noImplicitAnyIndexingSuppressed.ts, 0, 0)) +>emu : Symbol(MyEmusEnum.emu, Decl(noImplicitAnyIndexingSuppressed.ts, 1, 17)) + +var mResult3 = m[hi]; +>mResult3 : Symbol(mResult3, Decl(noImplicitAnyIndexingSuppressed.ts, 45, 3)) +>m : Symbol(m, Decl(noImplicitAnyIndexingSuppressed.ts, 36, 3)) +>hi : Symbol(hi, Decl(noImplicitAnyIndexingSuppressed.ts, 24, 3)) + + diff --git a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types index 20be75dc29e..b7b21bf8f92 100644 --- a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types +++ b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types @@ -12,6 +12,7 @@ var strRepresentation1 = MyEmusEnum[0] >strRepresentation1 : string >MyEmusEnum[0] : string >MyEmusEnum : typeof MyEmusEnum +>0 : number // Should be okay; should be a string. var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu] @@ -27,12 +28,14 @@ var strRepresentation3 = MyEmusEnum["monehh"]; >strRepresentation3 : any >MyEmusEnum["monehh"] : any >MyEmusEnum : typeof MyEmusEnum +>"monehh" : string // Should be okay; should be a MyEmusEnum var strRepresentation4 = MyEmusEnum["emu"]; >strRepresentation4 : MyEmusEnum >MyEmusEnum["emu"] : MyEmusEnum >MyEmusEnum : typeof MyEmusEnum +>"emu" : string // Should be okay, as we suppress implicit 'any' property access checks @@ -40,15 +43,18 @@ var x = {}["hi"]; >x : any >{}["hi"] : any >{} : {} +>"hi" : string // Should be okay, as we suppress implicit 'any' property access checks var y = {}[10]; >y : any >{}[10] : any >{} : {} +>10 : number var hi: any = "hi"; >hi : any +>"hi" : string var emptyObj = {}; >emptyObj : {} @@ -84,8 +90,14 @@ var m: MyMap = { >{ "0": 0, "1": 1, "2": 2, "Okay that's enough for today.": NaN} : { [x: string]: number; "0": number; "1": number; "2": number; "Okay that's enough for today.": number; } "0": 0, +>0 : number + "1": 1, +>1 : number + "2": 2, +>2 : number + "Okay that's enough for today.": NaN >NaN : number diff --git a/tests/baselines/reference/noSelfOnVars.symbols b/tests/baselines/reference/noSelfOnVars.symbols new file mode 100644 index 00000000000..dd01736436a --- /dev/null +++ b/tests/baselines/reference/noSelfOnVars.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/noSelfOnVars.ts === +function foo() { +>foo : Symbol(foo, Decl(noSelfOnVars.ts, 0, 0)) + + function bar() { } +>bar : Symbol(bar, Decl(noSelfOnVars.ts, 0, 16)) + + var x = bar; +>x : Symbol(x, Decl(noSelfOnVars.ts, 2, 7)) +>bar : Symbol(bar, Decl(noSelfOnVars.ts, 0, 16)) +} + + + diff --git a/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter.symbols b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter.symbols new file mode 100644 index 00000000000..f25acc772a6 --- /dev/null +++ b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter.symbols @@ -0,0 +1,61 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/nominalSubtypeCheckOfTypeParameter.ts === +interface Tuple { +>Tuple : Symbol(Tuple, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 16)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 18)) + + first: T +>first : Symbol(first, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 23)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 16)) + + second: S +>second : Symbol(second, Decl(nominalSubtypeCheckOfTypeParameter.ts, 1, 12)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 18)) +} + +interface Sequence { +>Sequence : Symbol(Sequence, Decl(nominalSubtypeCheckOfTypeParameter.ts, 3, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 5, 19)) + + hasNext(): boolean +>hasNext : Symbol(hasNext, Decl(nominalSubtypeCheckOfTypeParameter.ts, 5, 23)) + + pop(): T +>pop : Symbol(pop, Decl(nominalSubtypeCheckOfTypeParameter.ts, 6, 22)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 5, 19)) + + zip(seq: Sequence): Sequence> +>zip : Symbol(zip, Decl(nominalSubtypeCheckOfTypeParameter.ts, 7, 14)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 8, 10)) +>seq : Symbol(seq, Decl(nominalSubtypeCheckOfTypeParameter.ts, 8, 13)) +>Sequence : Symbol(Sequence, Decl(nominalSubtypeCheckOfTypeParameter.ts, 3, 1)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 8, 10)) +>Sequence : Symbol(Sequence, Decl(nominalSubtypeCheckOfTypeParameter.ts, 3, 1)) +>Tuple : Symbol(Tuple, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 5, 19)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 8, 10)) +} + +// error, despite the fact that the code explicitly says List extends Sequence, the current rules for infinitely expanding type references +// perform nominal subtyping checks that allow variance for type arguments, but not nominal subtyping for the generic type itself +interface List extends Sequence { +>List : Symbol(List, Decl(nominalSubtypeCheckOfTypeParameter.ts, 9, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 13, 15)) +>Sequence : Symbol(Sequence, Decl(nominalSubtypeCheckOfTypeParameter.ts, 3, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 13, 15)) + + getLength(): number +>getLength : Symbol(getLength, Decl(nominalSubtypeCheckOfTypeParameter.ts, 13, 39)) + + zip(seq: Sequence): List> +>zip : Symbol(zip, Decl(nominalSubtypeCheckOfTypeParameter.ts, 14, 23)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 15, 10)) +>seq : Symbol(seq, Decl(nominalSubtypeCheckOfTypeParameter.ts, 15, 13)) +>Sequence : Symbol(Sequence, Decl(nominalSubtypeCheckOfTypeParameter.ts, 3, 1)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 15, 10)) +>List : Symbol(List, Decl(nominalSubtypeCheckOfTypeParameter.ts, 9, 1)) +>Tuple : Symbol(Tuple, Decl(nominalSubtypeCheckOfTypeParameter.ts, 0, 0)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter.ts, 13, 15)) +>S : Symbol(S, Decl(nominalSubtypeCheckOfTypeParameter.ts, 15, 10)) +} + diff --git a/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter2.symbols b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter2.symbols new file mode 100644 index 00000000000..3249c465a98 --- /dev/null +++ b/tests/baselines/reference/nominalSubtypeCheckOfTypeParameter2.symbols @@ -0,0 +1,55 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/nominalSubtypeCheckOfTypeParameter2.ts === +interface B { +>B : Symbol(B, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 0)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 12)) + + bar: T; +>bar : Symbol(bar, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 16)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 12)) +} + +// ok +interface A extends B { +>A : Symbol(A, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 2, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 5, 12)) +>B : Symbol(B, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 0)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 5, 12)) + + foo: T; +>foo : Symbol(foo, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 5, 29)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 5, 12)) +} + +// ok +interface A2 extends B> { +>A2 : Symbol(A2, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 7, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 10, 13)) +>B : Symbol(B, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 0)) +>B : Symbol(B, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 0)) + + baz: T; +>baz : Symbol(baz, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 10, 38)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 10, 13)) +} + +interface C { +>C : Symbol(C, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 12, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 14, 12)) + + bam: T; +>bam : Symbol(bam, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 14, 16)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 14, 12)) +} + +// ok +interface A3 extends B> { +>A3 : Symbol(A3, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 16, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 19, 13)) +>B : Symbol(B, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 0, 0)) +>C : Symbol(C, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 12, 1)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 19, 13)) + + bing: T; +>bing : Symbol(bing, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 19, 33)) +>T : Symbol(T, Decl(nominalSubtypeCheckOfTypeParameter2.ts, 19, 13)) +} diff --git a/tests/baselines/reference/nonConflictingRecursiveBaseTypeMembers.symbols b/tests/baselines/reference/nonConflictingRecursiveBaseTypeMembers.symbols new file mode 100644 index 00000000000..f3ff334931c --- /dev/null +++ b/tests/baselines/reference/nonConflictingRecursiveBaseTypeMembers.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/nonConflictingRecursiveBaseTypeMembers.ts === +interface A { +>A : Symbol(A, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 0, 0)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 0, 12)) + + x: C +>x : Symbol(x, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 0, 16)) +>C : Symbol(C, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 6, 1)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 0, 12)) +} + +interface B { +>B : Symbol(B, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 2, 1)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 4, 12)) + + x: C +>x : Symbol(x, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 4, 16)) +>C : Symbol(C, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 6, 1)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 4, 12)) +} + +interface C extends A, B { } // Should not be an error +>C : Symbol(C, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 6, 1)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 8, 12)) +>A : Symbol(A, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 0, 0)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 8, 12)) +>B : Symbol(B, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 2, 1)) +>T : Symbol(T, Decl(nonConflictingRecursiveBaseTypeMembers.ts, 8, 12)) + diff --git a/tests/baselines/reference/nonContextuallyTypedLogicalOr.symbols b/tests/baselines/reference/nonContextuallyTypedLogicalOr.symbols new file mode 100644 index 00000000000..738f4fed916 --- /dev/null +++ b/tests/baselines/reference/nonContextuallyTypedLogicalOr.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/nonContextuallyTypedLogicalOr.ts === +interface Contextual { +>Contextual : Symbol(Contextual, Decl(nonContextuallyTypedLogicalOr.ts, 0, 0)) + + dummy; +>dummy : Symbol(dummy, Decl(nonContextuallyTypedLogicalOr.ts, 0, 22)) + + p?: number; +>p : Symbol(p, Decl(nonContextuallyTypedLogicalOr.ts, 1, 10)) +} + +interface Ellement { +>Ellement : Symbol(Ellement, Decl(nonContextuallyTypedLogicalOr.ts, 3, 1)) + + dummy; +>dummy : Symbol(dummy, Decl(nonContextuallyTypedLogicalOr.ts, 5, 20)) + + p: any; +>p : Symbol(p, Decl(nonContextuallyTypedLogicalOr.ts, 6, 10)) +} + +var c: Contextual; +>c : Symbol(c, Decl(nonContextuallyTypedLogicalOr.ts, 10, 3)) +>Contextual : Symbol(Contextual, Decl(nonContextuallyTypedLogicalOr.ts, 0, 0)) + +var e: Ellement; +>e : Symbol(e, Decl(nonContextuallyTypedLogicalOr.ts, 11, 3)) +>Ellement : Symbol(Ellement, Decl(nonContextuallyTypedLogicalOr.ts, 3, 1)) + +(c || e).dummy; +>(c || e).dummy : Symbol(dummy, Decl(nonContextuallyTypedLogicalOr.ts, 0, 22), Decl(nonContextuallyTypedLogicalOr.ts, 5, 20)) +>c : Symbol(c, Decl(nonContextuallyTypedLogicalOr.ts, 10, 3)) +>e : Symbol(e, Decl(nonContextuallyTypedLogicalOr.ts, 11, 3)) +>dummy : Symbol(dummy, Decl(nonContextuallyTypedLogicalOr.ts, 0, 22), Decl(nonContextuallyTypedLogicalOr.ts, 5, 20)) + diff --git a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.symbols b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.symbols new file mode 100644 index 00000000000..47daa69239a --- /dev/null +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/nonGenericClassExtendingGenericClassWithAny.ts === +class Foo { +>Foo : Symbol(Foo, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 0, 0)) +>T : Symbol(T, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 0, 10)) + + t: T; +>t : Symbol(t, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 0, 14)) +>T : Symbol(T, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 0, 10)) +} + +class Bar extends Foo { } // Valid +>Bar : Symbol(Bar, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(nonGenericClassExtendingGenericClassWithAny.ts, 0, 0)) + diff --git a/tests/baselines/reference/nonInstantiatedModule.symbols b/tests/baselines/reference/nonInstantiatedModule.symbols new file mode 100644 index 00000000000..0d67b0318f8 --- /dev/null +++ b/tests/baselines/reference/nonInstantiatedModule.symbols @@ -0,0 +1,111 @@ +=== tests/cases/conformance/internalModules/moduleDeclarations/nonInstantiatedModule.ts === +module M { +>M : Symbol(M, Decl(nonInstantiatedModule.ts, 0, 0)) + + export interface Point { x: number; y: number } +>Point : Symbol(Point, Decl(nonInstantiatedModule.ts, 0, 10)) +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 1, 28)) +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 1, 39)) + + export var a = 1; +>a : Symbol(a, Decl(nonInstantiatedModule.ts, 2, 14)) +} + +// primary expression +var m : typeof M; +>m : Symbol(m, Decl(nonInstantiatedModule.ts, 6, 3), Decl(nonInstantiatedModule.ts, 7, 3)) +>M : Symbol(M, Decl(nonInstantiatedModule.ts, 0, 0)) + +var m = M; +>m : Symbol(m, Decl(nonInstantiatedModule.ts, 6, 3), Decl(nonInstantiatedModule.ts, 7, 3)) +>M : Symbol(M, Decl(nonInstantiatedModule.ts, 0, 0)) + +var a1: number; +>a1 : Symbol(a1, Decl(nonInstantiatedModule.ts, 9, 3), Decl(nonInstantiatedModule.ts, 10, 3)) + +var a1 = M.a; +>a1 : Symbol(a1, Decl(nonInstantiatedModule.ts, 9, 3), Decl(nonInstantiatedModule.ts, 10, 3)) +>M.a : Symbol(M.a, Decl(nonInstantiatedModule.ts, 2, 14)) +>M : Symbol(M, Decl(nonInstantiatedModule.ts, 0, 0)) +>a : Symbol(M.a, Decl(nonInstantiatedModule.ts, 2, 14)) + +var a2: number; +>a2 : Symbol(a2, Decl(nonInstantiatedModule.ts, 12, 3), Decl(nonInstantiatedModule.ts, 13, 3)) + +var a2 = m.a; +>a2 : Symbol(a2, Decl(nonInstantiatedModule.ts, 12, 3), Decl(nonInstantiatedModule.ts, 13, 3)) +>m.a : Symbol(M.a, Decl(nonInstantiatedModule.ts, 2, 14)) +>m : Symbol(m, Decl(nonInstantiatedModule.ts, 6, 3), Decl(nonInstantiatedModule.ts, 7, 3)) +>a : Symbol(M.a, Decl(nonInstantiatedModule.ts, 2, 14)) + +module M2 { +>M2 : Symbol(M2, Decl(nonInstantiatedModule.ts, 13, 13)) + + export module Point { +>Point : Symbol(Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) + + export function Origin(): Point { +>Origin : Symbol(Origin, Decl(nonInstantiatedModule.ts, 16, 25)) +>Point : Symbol(Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) + + return { x: 0, y: 0 }; +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 18, 20)) +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 18, 26)) + } + } + + export interface Point { +>Point : Symbol(Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) + + x: number; +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 22, 28)) + + y: number; +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 23, 18)) + } +} + +var p: { x: number; y: number; }; +>p : Symbol(p, Decl(nonInstantiatedModule.ts, 28, 3), Decl(nonInstantiatedModule.ts, 29, 3)) +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 28, 8)) +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 28, 19)) + +var p: M2.Point; +>p : Symbol(p, Decl(nonInstantiatedModule.ts, 28, 3), Decl(nonInstantiatedModule.ts, 29, 3)) +>M2 : Symbol(M2, Decl(nonInstantiatedModule.ts, 13, 13)) +>Point : Symbol(M2.Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) + +var p2: { Origin() : { x: number; y: number; } }; +>p2 : Symbol(p2, Decl(nonInstantiatedModule.ts, 31, 3), Decl(nonInstantiatedModule.ts, 32, 3)) +>Origin : Symbol(Origin, Decl(nonInstantiatedModule.ts, 31, 9)) +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 31, 22)) +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 31, 33)) + +var p2: typeof M2.Point; +>p2 : Symbol(p2, Decl(nonInstantiatedModule.ts, 31, 3), Decl(nonInstantiatedModule.ts, 32, 3)) +>M2.Point : Symbol(M2.Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) +>M2 : Symbol(M2, Decl(nonInstantiatedModule.ts, 13, 13)) +>Point : Symbol(M2.Point, Decl(nonInstantiatedModule.ts, 15, 11), Decl(nonInstantiatedModule.ts, 20, 5)) + +module M3 { +>M3 : Symbol(M3, Decl(nonInstantiatedModule.ts, 32, 24)) + + export module Utils { +>Utils : Symbol(Utils, Decl(nonInstantiatedModule.ts, 34, 11), Decl(nonInstantiatedModule.ts, 39, 5)) + + export interface Point { +>Point : Symbol(Point, Decl(nonInstantiatedModule.ts, 35, 25)) + + x: number; y: number; +>x : Symbol(x, Decl(nonInstantiatedModule.ts, 36, 32)) +>y : Symbol(y, Decl(nonInstantiatedModule.ts, 37, 22)) + } + } + + export class Utils { +>Utils : Symbol(Utils, Decl(nonInstantiatedModule.ts, 34, 11), Decl(nonInstantiatedModule.ts, 39, 5)) + + name: string; +>name : Symbol(name, Decl(nonInstantiatedModule.ts, 41, 24)) + } +} diff --git a/tests/baselines/reference/nonInstantiatedModule.types b/tests/baselines/reference/nonInstantiatedModule.types index 1093fbd0653..c1aac2824dc 100644 --- a/tests/baselines/reference/nonInstantiatedModule.types +++ b/tests/baselines/reference/nonInstantiatedModule.types @@ -9,6 +9,7 @@ module M { export var a = 1; >a : number +>1 : number } // primary expression @@ -51,7 +52,9 @@ module M2 { return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } >x : number +>0 : number >y : number +>0 : number } } @@ -73,7 +76,7 @@ var p: { x: number; y: number; }; var p: M2.Point; >p : { x: number; y: number; } ->M2 : unknown +>M2 : any >Point : M2.Point var p2: { Origin() : { x: number; y: number; } }; @@ -84,6 +87,7 @@ var p2: { Origin() : { x: number; y: number; } }; var p2: typeof M2.Point; >p2 : { Origin(): { x: number; y: number; }; } +>M2.Point : typeof M2.Point >M2 : typeof M2 >Point : typeof M2.Point diff --git a/tests/baselines/reference/nonIterableRestElement1.js b/tests/baselines/reference/nonIterableRestElement1.js new file mode 100644 index 00000000000..6852ad503cf --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement1.js @@ -0,0 +1,7 @@ +//// [nonIterableRestElement1.ts] +var c = {}; +[...c] = ["", 0]; + +//// [nonIterableRestElement1.js] +var c = {}; +c = ["", 0].slice(0); diff --git a/tests/baselines/reference/nonIterableRestElement1.symbols b/tests/baselines/reference/nonIterableRestElement1.symbols new file mode 100644 index 00000000000..352d0c87da4 --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/destructuring/nonIterableRestElement1.ts === +var c = {}; +>c : Symbol(c, Decl(nonIterableRestElement1.ts, 0, 3)) + +[...c] = ["", 0]; +>c : Symbol(c, Decl(nonIterableRestElement1.ts, 0, 3)) + diff --git a/tests/baselines/reference/nonIterableRestElement1.types b/tests/baselines/reference/nonIterableRestElement1.types new file mode 100644 index 00000000000..4973b67d4ae --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement1.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/destructuring/nonIterableRestElement1.ts === +var c = {}; +>c : {} +>{} : {} + +[...c] = ["", 0]; +>[...c] = ["", 0] : (string | number)[] +>[...c] : {}[] +>...c : any +>c : {} +>["", 0] : (string | number)[] +>"" : string +>0 : number + diff --git a/tests/baselines/reference/nonIterableRestElement2.js b/tests/baselines/reference/nonIterableRestElement2.js new file mode 100644 index 00000000000..edeef32e188 --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement2.js @@ -0,0 +1,7 @@ +//// [nonIterableRestElement2.ts] +var c = {}; +[...c] = ["", 0]; + +//// [nonIterableRestElement2.js] +var c = {}; +[...c] = ["", 0]; diff --git a/tests/baselines/reference/nonIterableRestElement2.symbols b/tests/baselines/reference/nonIterableRestElement2.symbols new file mode 100644 index 00000000000..766524a408b --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/es6/destructuring/nonIterableRestElement2.ts === +var c = {}; +>c : Symbol(c, Decl(nonIterableRestElement2.ts, 0, 3)) + +[...c] = ["", 0]; +>c : Symbol(c, Decl(nonIterableRestElement2.ts, 0, 3)) + diff --git a/tests/baselines/reference/nonIterableRestElement2.types b/tests/baselines/reference/nonIterableRestElement2.types new file mode 100644 index 00000000000..e6d84d5297e --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement2.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/es6/destructuring/nonIterableRestElement2.ts === +var c = {}; +>c : {} +>{} : {} + +[...c] = ["", 0]; +>[...c] = ["", 0] : (string | number)[] +>[...c] : {}[] +>...c : any +>c : {} +>["", 0] : (string | number)[] +>"" : string +>0 : number + diff --git a/tests/baselines/reference/nonIterableRestElement3.errors.txt b/tests/baselines/reference/nonIterableRestElement3.errors.txt new file mode 100644 index 00000000000..2c44aba661e --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement3.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/es6/destructuring/nonIterableRestElement3.ts(2,5): error TS2322: Type '(string | number)[]' is not assignable to type '{ bogus: number; }'. + Property 'bogus' is missing in type '(string | number)[]'. + + +==== tests/cases/conformance/es6/destructuring/nonIterableRestElement3.ts (1 errors) ==== + var c = { bogus: 0 }; + [...c] = ["", 0]; + ~ +!!! error TS2322: Type '(string | number)[]' is not assignable to type '{ bogus: number; }'. +!!! error TS2322: Property 'bogus' is missing in type '(string | number)[]'. \ No newline at end of file diff --git a/tests/baselines/reference/nonIterableRestElement3.js b/tests/baselines/reference/nonIterableRestElement3.js new file mode 100644 index 00000000000..0f7edfe98f4 --- /dev/null +++ b/tests/baselines/reference/nonIterableRestElement3.js @@ -0,0 +1,7 @@ +//// [nonIterableRestElement3.ts] +var c = { bogus: 0 }; +[...c] = ["", 0]; + +//// [nonIterableRestElement3.js] +var c = { bogus: 0 }; +c = ["", 0].slice(0); diff --git a/tests/baselines/reference/null.symbols b/tests/baselines/reference/null.symbols new file mode 100644 index 00000000000..148cd1586b2 --- /dev/null +++ b/tests/baselines/reference/null.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/null.ts === +var x=null; +>x : Symbol(x, Decl(null.ts, 0, 3)) + +var y=3+x; +>y : Symbol(y, Decl(null.ts, 1, 3)) +>x : Symbol(x, Decl(null.ts, 0, 3)) + +var z=3+null; +>z : Symbol(z, Decl(null.ts, 2, 3)) + +class C { +>C : Symbol(C, Decl(null.ts, 2, 13)) +} +function f() { +>f : Symbol(f, Decl(null.ts, 4, 1)) + + return null; + return new C(); +>C : Symbol(C, Decl(null.ts, 2, 13)) +} +function g() { +>g : Symbol(g, Decl(null.ts, 8, 1)) + + return null; + return 3; +} +interface I { +>I : Symbol(I, Decl(null.ts, 12, 1)) + + x:any; +>x : Symbol(x, Decl(null.ts, 13, 13)) + + y:number; +>y : Symbol(y, Decl(null.ts, 14, 10)) +} +var w:I={x:null,y:3}; +>w : Symbol(w, Decl(null.ts, 17, 3)) +>I : Symbol(I, Decl(null.ts, 12, 1)) +>x : Symbol(x, Decl(null.ts, 17, 9)) +>y : Symbol(y, Decl(null.ts, 17, 16)) + + + diff --git a/tests/baselines/reference/null.types b/tests/baselines/reference/null.types index 7a5232efb0b..7df551b1bde 100644 --- a/tests/baselines/reference/null.types +++ b/tests/baselines/reference/null.types @@ -1,15 +1,19 @@ === tests/cases/compiler/null.ts === var x=null; >x : any +>null : null var y=3+x; >y : any >3+x : any +>3 : number >x : any var z=3+null; >z : number >3+null : number +>3 : number +>null : null class C { >C : C @@ -18,6 +22,8 @@ function f() { >f : () => C return null; +>null : null + return new C(); >new C() : C >C : typeof C @@ -26,7 +32,10 @@ function g() { >g : () => number return null; +>null : null + return 3; +>3 : number } interface I { >I : I @@ -42,7 +51,9 @@ var w:I={x:null,y:3}; >I : I >{x:null,y:3} : { x: null; y: number; } >x : null +>null : null >y : number +>3 : number diff --git a/tests/baselines/reference/nullAssignableToEveryType.symbols b/tests/baselines/reference/nullAssignableToEveryType.symbols new file mode 100644 index 00000000000..7179a02c0bc --- /dev/null +++ b/tests/baselines/reference/nullAssignableToEveryType.symbols @@ -0,0 +1,125 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/nullAssignableToEveryType.ts === +class C { +>C : Symbol(C, Decl(nullAssignableToEveryType.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(nullAssignableToEveryType.ts, 0, 9)) +} +var ac: C; +>ac : Symbol(ac, Decl(nullAssignableToEveryType.ts, 3, 3)) +>C : Symbol(C, Decl(nullAssignableToEveryType.ts, 0, 0)) + +interface I { +>I : Symbol(I, Decl(nullAssignableToEveryType.ts, 3, 10)) + + foo: string; +>foo : Symbol(foo, Decl(nullAssignableToEveryType.ts, 4, 13)) +} +var ai: I; +>ai : Symbol(ai, Decl(nullAssignableToEveryType.ts, 7, 3)) +>I : Symbol(I, Decl(nullAssignableToEveryType.ts, 3, 10)) + +enum E { A } +>E : Symbol(E, Decl(nullAssignableToEveryType.ts, 7, 10)) +>A : Symbol(E.A, Decl(nullAssignableToEveryType.ts, 9, 8)) + +var ae: E; +>ae : Symbol(ae, Decl(nullAssignableToEveryType.ts, 10, 3)) +>E : Symbol(E, Decl(nullAssignableToEveryType.ts, 7, 10)) + +var b: number = null; +>b : Symbol(b, Decl(nullAssignableToEveryType.ts, 12, 3)) + +var c: string = null; +>c : Symbol(c, Decl(nullAssignableToEveryType.ts, 13, 3)) + +var d: boolean = null; +>d : Symbol(d, Decl(nullAssignableToEveryType.ts, 14, 3)) + +var e: Date = null; +>e : Symbol(e, Decl(nullAssignableToEveryType.ts, 15, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var f: any = null; +>f : Symbol(f, Decl(nullAssignableToEveryType.ts, 16, 3)) + +var g: void = null; +>g : Symbol(g, Decl(nullAssignableToEveryType.ts, 17, 3)) + +var h: Object = null; +>h : Symbol(h, Decl(nullAssignableToEveryType.ts, 18, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var i: {} = null; +>i : Symbol(i, Decl(nullAssignableToEveryType.ts, 19, 3)) + +var j: () => {} = null; +>j : Symbol(j, Decl(nullAssignableToEveryType.ts, 20, 3)) + +var k: Function = null; +>k : Symbol(k, Decl(nullAssignableToEveryType.ts, 21, 3)) +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11)) + +var l: (x: number) => string = null; +>l : Symbol(l, Decl(nullAssignableToEveryType.ts, 22, 3)) +>x : Symbol(x, Decl(nullAssignableToEveryType.ts, 22, 8)) + +ac = null; +>ac : Symbol(ac, Decl(nullAssignableToEveryType.ts, 3, 3)) + +ai = null; +>ai : Symbol(ai, Decl(nullAssignableToEveryType.ts, 7, 3)) + +ae = null; +>ae : Symbol(ae, Decl(nullAssignableToEveryType.ts, 10, 3)) + +var m: number[] = null; +>m : Symbol(m, Decl(nullAssignableToEveryType.ts, 26, 3)) + +var n: { foo: string } = null; +>n : Symbol(n, Decl(nullAssignableToEveryType.ts, 27, 3)) +>foo : Symbol(foo, Decl(nullAssignableToEveryType.ts, 27, 8)) + +var o: (x: T) => T = null; +>o : Symbol(o, Decl(nullAssignableToEveryType.ts, 28, 3)) +>T : Symbol(T, Decl(nullAssignableToEveryType.ts, 28, 8)) +>x : Symbol(x, Decl(nullAssignableToEveryType.ts, 28, 11)) +>T : Symbol(T, Decl(nullAssignableToEveryType.ts, 28, 8)) +>T : Symbol(T, Decl(nullAssignableToEveryType.ts, 28, 8)) + +var p: Number = null; +>p : Symbol(p, Decl(nullAssignableToEveryType.ts, 29, 3)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +var q: String = null; +>q : Symbol(q, Decl(nullAssignableToEveryType.ts, 30, 3)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo(x: T, y: U, z: V) { +>foo : Symbol(foo, Decl(nullAssignableToEveryType.ts, 30, 21)) +>T : Symbol(T, Decl(nullAssignableToEveryType.ts, 32, 13)) +>U : Symbol(U, Decl(nullAssignableToEveryType.ts, 32, 15)) +>V : Symbol(V, Decl(nullAssignableToEveryType.ts, 32, 18)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(nullAssignableToEveryType.ts, 32, 35)) +>T : Symbol(T, Decl(nullAssignableToEveryType.ts, 32, 13)) +>y : Symbol(y, Decl(nullAssignableToEveryType.ts, 32, 40)) +>U : Symbol(U, Decl(nullAssignableToEveryType.ts, 32, 15)) +>z : Symbol(z, Decl(nullAssignableToEveryType.ts, 32, 46)) +>V : Symbol(V, Decl(nullAssignableToEveryType.ts, 32, 18)) + + x = null; +>x : Symbol(x, Decl(nullAssignableToEveryType.ts, 32, 35)) + + y = null; +>y : Symbol(y, Decl(nullAssignableToEveryType.ts, 32, 40)) + + z = null; +>z : Symbol(z, Decl(nullAssignableToEveryType.ts, 32, 46)) +} + +//function foo(x: T, y: U, z: V) { +// x = null; +// y = null; +// z = null; +//} diff --git a/tests/baselines/reference/nullAssignableToEveryType.types b/tests/baselines/reference/nullAssignableToEveryType.types index aaf3b3bd8c5..5120a48b896 100644 --- a/tests/baselines/reference/nullAssignableToEveryType.types +++ b/tests/baselines/reference/nullAssignableToEveryType.types @@ -29,59 +29,75 @@ var ae: E; var b: number = null; >b : number +>null : null var c: string = null; >c : string +>null : null var d: boolean = null; >d : boolean +>null : null var e: Date = null; >e : Date >Date : Date +>null : null var f: any = null; >f : any +>null : null var g: void = null; >g : void +>null : null var h: Object = null; >h : Object >Object : Object +>null : null var i: {} = null; >i : {} +>null : null var j: () => {} = null; >j : () => {} +>null : null var k: Function = null; >k : Function >Function : Function +>null : null var l: (x: number) => string = null; >l : (x: number) => string >x : number +>null : null ac = null; >ac = null : null >ac : C +>null : null ai = null; >ai = null : null >ai : I +>null : null ae = null; >ae = null : null >ae : E +>null : null var m: number[] = null; >m : number[] +>null : null var n: { foo: string } = null; >n : { foo: string; } >foo : string +>null : null var o: (x: T) => T = null; >o : (x: T) => T @@ -89,14 +105,17 @@ var o: (x: T) => T = null; >x : T >T : T >T : T +>null : null var p: Number = null; >p : Number >Number : Number +>null : null var q: String = null; >q : String >String : String +>null : null function foo(x: T, y: U, z: V) { >foo : (x: T, y: U, z: V) => void @@ -114,14 +133,17 @@ function foo(x: T, y: U, z: V) { x = null; >x = null : null >x : T +>null : null y = null; >y = null : null >y : U +>null : null z = null; >z = null : null >z : V +>null : null } //function foo(x: T, y: U, z: V) { diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.symbols b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.symbols new file mode 100644 index 00000000000..7f81995c9be --- /dev/null +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.symbols @@ -0,0 +1,247 @@ +=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/nullIsSubtypeOfEverythingButUndefined.ts === +// null is a subtype of any other types except undefined + +var r0 = true ? null : null; +>r0 : Symbol(r0, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 2, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 3, 3)) + +var r0 = true ? null : null; +>r0 : Symbol(r0, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 2, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 3, 3)) + +var u: typeof undefined; +>u : Symbol(u, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 5, 3)) +>undefined : Symbol(undefined) + +var r0b = true ? u : null; +>r0b : Symbol(r0b, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 6, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 7, 3)) +>u : Symbol(u, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 5, 3)) + +var r0b = true ? null : u; +>r0b : Symbol(r0b, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 6, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 7, 3)) +>u : Symbol(u, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 5, 3)) + +var r1 = true ? 1 : null; +>r1 : Symbol(r1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 9, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 10, 3)) + +var r1 = true ? null : 1; +>r1 : Symbol(r1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 9, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 10, 3)) + +var r2 = true ? '' : null; +>r2 : Symbol(r2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 12, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 13, 3)) + +var r2 = true ? null : ''; +>r2 : Symbol(r2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 12, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 13, 3)) + +var r3 = true ? true : null; +>r3 : Symbol(r3, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 15, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 16, 3)) + +var r3 = true ? null : true; +>r3 : Symbol(r3, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 15, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 16, 3)) + +var r4 = true ? new Date() : null; +>r4 : Symbol(r4, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 18, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 19, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r4 = true ? null : new Date(); +>r4 : Symbol(r4, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 18, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 19, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var r5 = true ? /1/ : null; +>r5 : Symbol(r5, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 21, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 22, 3)) + +var r5 = true ? null : /1/; +>r5 : Symbol(r5, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 21, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 22, 3)) + +var r6 = true ? { foo: 1 } : null; +>r6 : Symbol(r6, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 24, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 25, 3)) +>foo : Symbol(foo, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 24, 17)) + +var r6 = true ? null : { foo: 1 }; +>r6 : Symbol(r6, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 24, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 25, 3)) +>foo : Symbol(foo, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 25, 24)) + +var r7 = true ? () => { } : null; +>r7 : Symbol(r7, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 27, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 28, 3)) + +var r7 = true ? null : () => { }; +>r7 : Symbol(r7, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 27, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 28, 3)) + +var r8 = true ? (x: T) => { return x } : null; +>r8 : Symbol(r8, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 30, 3)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 30, 17)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 30, 20)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 30, 17)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 30, 20)) + +var r8b = true ? null : (x: T) => { return x }; // type parameters not identical across declarations +>r8b : Symbol(r8b, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 3)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 25)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 28)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 25)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 28)) + +interface I1 { foo: number; } +>I1 : Symbol(I1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 50)) +>foo : Symbol(foo, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 33, 14)) + +var i1: I1; +>i1 : Symbol(i1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 34, 3)) +>I1 : Symbol(I1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 31, 50)) + +var r9 = true ? i1 : null; +>r9 : Symbol(r9, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 35, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 36, 3)) +>i1 : Symbol(i1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 34, 3)) + +var r9 = true ? null : i1; +>r9 : Symbol(r9, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 35, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 36, 3)) +>i1 : Symbol(i1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 34, 3)) + +class C1 { foo: number; } +>C1 : Symbol(C1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 36, 26)) +>foo : Symbol(foo, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 38, 10)) + +var c1: C1; +>c1 : Symbol(c1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 39, 3)) +>C1 : Symbol(C1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 36, 26)) + +var r10 = true ? c1 : null; +>r10 : Symbol(r10, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 40, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 41, 3)) +>c1 : Symbol(c1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 39, 3)) + +var r10 = true ? null : c1; +>r10 : Symbol(r10, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 40, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 41, 3)) +>c1 : Symbol(c1, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 39, 3)) + +class C2 { foo: T; } +>C2 : Symbol(C2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 41, 27)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 43, 9)) +>foo : Symbol(foo, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 43, 13)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 43, 9)) + +var c2: C2; +>c2 : Symbol(c2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 44, 3)) +>C2 : Symbol(C2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 41, 27)) + +var r12 = true ? c2 : null; +>r12 : Symbol(r12, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 45, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 3)) +>c2 : Symbol(c2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 44, 3)) + +var r12 = true ? null : c2; +>r12 : Symbol(r12, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 45, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 3)) +>c2 : Symbol(c2, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 44, 3)) + +enum E { A } +>E : Symbol(E, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 27)) +>A : Symbol(E.A, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 48, 8)) + +var r13 = true ? E : null; +>r13 : Symbol(r13, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 49, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 50, 3)) +>E : Symbol(E, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 27)) + +var r13 = true ? null : E; +>r13 : Symbol(r13, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 49, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 50, 3)) +>E : Symbol(E, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 27)) + +var r14 = true ? E.A : null; +>r14 : Symbol(r14, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 52, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 53, 3)) +>E.A : Symbol(E.A, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 48, 8)) +>E : Symbol(E, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 27)) +>A : Symbol(E.A, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 48, 8)) + +var r14 = true ? null : E.A; +>r14 : Symbol(r14, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 52, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 53, 3)) +>E.A : Symbol(E.A, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 48, 8)) +>E : Symbol(E, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 46, 27)) +>A : Symbol(E.A, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 48, 8)) + +function f() { } +>f : Symbol(f, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 53, 28), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 55, 16)) + +module f { +>f : Symbol(f, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 53, 28), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 55, 16)) + + export var bar = 1; +>bar : Symbol(bar, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 57, 14)) +} +var af: typeof f; +>af : Symbol(af, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 59, 3)) +>f : Symbol(f, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 53, 28), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 55, 16)) + +var r15 = true ? af : null; +>r15 : Symbol(r15, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 60, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 61, 3)) +>af : Symbol(af, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 59, 3)) + +var r15 = true ? null : af; +>r15 : Symbol(r15, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 60, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 61, 3)) +>af : Symbol(af, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 59, 3)) + +class c { baz: string } +>c : Symbol(c, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 61, 27), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 63, 23)) +>baz : Symbol(baz, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 63, 9)) + +module c { +>c : Symbol(c, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 61, 27), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 63, 23)) + + export var bar = 1; +>bar : Symbol(bar, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 65, 14)) +} +var ac: typeof c; +>ac : Symbol(ac, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 67, 3)) +>c : Symbol(c, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 61, 27), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 63, 23)) + +var r16 = true ? ac : null; +>r16 : Symbol(r16, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 68, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 69, 3)) +>ac : Symbol(ac, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 67, 3)) + +var r16 = true ? null : ac; +>r16 : Symbol(r16, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 68, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 69, 3)) +>ac : Symbol(ac, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 67, 3)) + +function f17(x: T) { +>f17 : Symbol(f17, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 69, 27)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 71, 13)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 71, 16)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 71, 13)) + + var r17 = true ? x : null; +>r17 : Symbol(r17, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 72, 7), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 73, 7)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 71, 16)) + + var r17 = true ? null : x; +>r17 : Symbol(r17, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 72, 7), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 73, 7)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 71, 16)) +} + +function f18(x: U) { +>f18 : Symbol(f18, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 74, 1)) +>T : Symbol(T, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 13)) +>U : Symbol(U, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 15)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 19)) +>U : Symbol(U, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 15)) + + var r18 = true ? x : null; +>r18 : Symbol(r18, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 77, 7), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 78, 7)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 19)) + + var r18 = true ? null : x; +>r18 : Symbol(r18, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 77, 7), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 78, 7)) +>x : Symbol(x, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 76, 19)) +} +//function f18(x: U) { +// var r18 = true ? x : null; +// var r18 = true ? null : x; +//} + +var r19 = true ? new Object() : null; +>r19 : Symbol(r19, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 85, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 86, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var r19 = true ? null : new Object(); +>r19 : Symbol(r19, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 85, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 86, 3)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + +var r20 = true ? {} : null; +>r20 : Symbol(r20, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 88, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 89, 3)) + +var r20 = true ? null : {}; +>r20 : Symbol(r20, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 88, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 89, 3)) + diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types index 066f5eadef4..42243076e9f 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types @@ -4,10 +4,16 @@ var r0 = true ? null : null; >r0 : any >true ? null : null : null +>true : boolean +>null : null +>null : null var r0 = true ? null : null; >r0 : any >true ? null : null : null +>true : boolean +>null : null +>null : null var u: typeof undefined; >u : any @@ -16,91 +22,137 @@ var u: typeof undefined; var r0b = true ? u : null; >r0b : any >true ? u : null : any +>true : boolean >u : any +>null : null var r0b = true ? null : u; >r0b : any >true ? null : u : any +>true : boolean +>null : null >u : any var r1 = true ? 1 : null; >r1 : number >true ? 1 : null : number +>true : boolean +>1 : number +>null : null var r1 = true ? null : 1; >r1 : number >true ? null : 1 : number +>true : boolean +>null : null +>1 : number var r2 = true ? '' : null; >r2 : string >true ? '' : null : string +>true : boolean +>'' : string +>null : null var r2 = true ? null : ''; >r2 : string >true ? null : '' : string +>true : boolean +>null : null +>'' : string var r3 = true ? true : null; >r3 : boolean >true ? true : null : boolean +>true : boolean +>true : boolean +>null : null var r3 = true ? null : true; >r3 : boolean >true ? null : true : boolean +>true : boolean +>null : null +>true : boolean var r4 = true ? new Date() : null; >r4 : Date >true ? new Date() : null : Date +>true : boolean >new Date() : Date >Date : DateConstructor +>null : null var r4 = true ? null : new Date(); >r4 : Date >true ? null : new Date() : Date +>true : boolean +>null : null >new Date() : Date >Date : DateConstructor var r5 = true ? /1/ : null; >r5 : RegExp >true ? /1/ : null : RegExp +>true : boolean +>/1/ : RegExp +>null : null var r5 = true ? null : /1/; >r5 : RegExp >true ? null : /1/ : RegExp +>true : boolean +>null : null +>/1/ : RegExp var r6 = true ? { foo: 1 } : null; >r6 : { foo: number; } >true ? { foo: 1 } : null : { foo: number; } +>true : boolean >{ foo: 1 } : { foo: number; } >foo : number +>1 : number +>null : null var r6 = true ? null : { foo: 1 }; >r6 : { foo: number; } >true ? null : { foo: 1 } : { foo: number; } +>true : boolean +>null : null >{ foo: 1 } : { foo: number; } >foo : number +>1 : number var r7 = true ? () => { } : null; >r7 : () => void >true ? () => { } : null : () => void +>true : boolean >() => { } : () => void +>null : null var r7 = true ? null : () => { }; >r7 : () => void >true ? null : () => { } : () => void +>true : boolean +>null : null >() => { } : () => void var r8 = true ? (x: T) => { return x } : null; >r8 : (x: T) => T >true ? (x: T) => { return x } : null : (x: T) => T +>true : boolean >(x: T) => { return x } : (x: T) => T >T : T >x : T >T : T >x : T +>null : null var r8b = true ? null : (x: T) => { return x }; // type parameters not identical across declarations >r8b : (x: T) => T >true ? null : (x: T) => { return x } : (x: T) => T +>true : boolean +>null : null >(x: T) => { return x } : (x: T) => T >T : T >x : T @@ -118,11 +170,15 @@ var i1: I1; var r9 = true ? i1 : null; >r9 : I1 >true ? i1 : null : I1 +>true : boolean >i1 : I1 +>null : null var r9 = true ? null : i1; >r9 : I1 >true ? null : i1 : I1 +>true : boolean +>null : null >i1 : I1 class C1 { foo: number; } @@ -136,11 +192,15 @@ var c1: C1; var r10 = true ? c1 : null; >r10 : C1 >true ? c1 : null : C1 +>true : boolean >c1 : C1 +>null : null var r10 = true ? null : c1; >r10 : C1 >true ? null : c1 : C1 +>true : boolean +>null : null >c1 : C1 class C2 { foo: T; } @@ -156,11 +216,15 @@ var c2: C2; var r12 = true ? c2 : null; >r12 : C2 >true ? c2 : null : C2 +>true : boolean >c2 : C2 +>null : null var r12 = true ? null : c2; >r12 : C2 >true ? null : c2 : C2 +>true : boolean +>null : null >c2 : C2 enum E { A } @@ -170,23 +234,31 @@ enum E { A } var r13 = true ? E : null; >r13 : typeof E >true ? E : null : typeof E +>true : boolean >E : typeof E +>null : null var r13 = true ? null : E; >r13 : typeof E >true ? null : E : typeof E +>true : boolean +>null : null >E : typeof E var r14 = true ? E.A : null; >r14 : E >true ? E.A : null : E +>true : boolean >E.A : E >E : typeof E >A : E +>null : null var r14 = true ? null : E.A; >r14 : E >true ? null : E.A : E +>true : boolean +>null : null >E.A : E >E : typeof E >A : E @@ -199,6 +271,7 @@ module f { export var bar = 1; >bar : number +>1 : number } var af: typeof f; >af : typeof f @@ -207,11 +280,15 @@ var af: typeof f; var r15 = true ? af : null; >r15 : typeof f >true ? af : null : typeof f +>true : boolean >af : typeof f +>null : null var r15 = true ? null : af; >r15 : typeof f >true ? null : af : typeof f +>true : boolean +>null : null >af : typeof f class c { baz: string } @@ -223,6 +300,7 @@ module c { export var bar = 1; >bar : number +>1 : number } var ac: typeof c; >ac : typeof c @@ -231,11 +309,15 @@ var ac: typeof c; var r16 = true ? ac : null; >r16 : typeof c >true ? ac : null : typeof c +>true : boolean >ac : typeof c +>null : null var r16 = true ? null : ac; >r16 : typeof c >true ? null : ac : typeof c +>true : boolean +>null : null >ac : typeof c function f17(x: T) { @@ -247,11 +329,15 @@ function f17(x: T) { var r17 = true ? x : null; >r17 : T >true ? x : null : T +>true : boolean >x : T +>null : null var r17 = true ? null : x; >r17 : T >true ? null : x : T +>true : boolean +>null : null >x : T } @@ -265,11 +351,15 @@ function f18(x: U) { var r18 = true ? x : null; >r18 : U >true ? x : null : U +>true : boolean >x : U +>null : null var r18 = true ? null : x; >r18 : U >true ? null : x : U +>true : boolean +>null : null >x : U } //function f18(x: U) { @@ -280,22 +370,30 @@ function f18(x: U) { var r19 = true ? new Object() : null; >r19 : Object >true ? new Object() : null : Object +>true : boolean >new Object() : Object >Object : ObjectConstructor +>null : null var r19 = true ? null : new Object(); >r19 : Object >true ? null : new Object() : Object +>true : boolean +>null : null >new Object() : Object >Object : ObjectConstructor var r20 = true ? {} : null; >r20 : {} >true ? {} : null : {} +>true : boolean >{} : {} +>null : null var r20 = true ? null : {}; >r20 : {} >true ? null : {} : {} +>true : boolean +>null : null >{} : {} diff --git a/tests/baselines/reference/numberAsInLHS.symbols b/tests/baselines/reference/numberAsInLHS.symbols new file mode 100644 index 00000000000..4e9f68545cd --- /dev/null +++ b/tests/baselines/reference/numberAsInLHS.symbols @@ -0,0 +1,3 @@ +=== tests/cases/compiler/numberAsInLHS.ts === +3 in [0, 1] +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/numberAsInLHS.types b/tests/baselines/reference/numberAsInLHS.types index 823e3e0354d..848f937c618 100644 --- a/tests/baselines/reference/numberAsInLHS.types +++ b/tests/baselines/reference/numberAsInLHS.types @@ -1,5 +1,8 @@ === tests/cases/compiler/numberAsInLHS.ts === 3 in [0, 1] >3 in [0, 1] : boolean +>3 : number >[0, 1] : number[] +>0 : number +>1 : number diff --git a/tests/baselines/reference/numberAssignableToEnum.symbols b/tests/baselines/reference/numberAssignableToEnum.symbols new file mode 100644 index 00000000000..294ccccb9a2 --- /dev/null +++ b/tests/baselines/reference/numberAssignableToEnum.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/numberAssignableToEnum.ts === +enum E { A } +>E : Symbol(E, Decl(numberAssignableToEnum.ts, 0, 0)) +>A : Symbol(E.A, Decl(numberAssignableToEnum.ts, 0, 8)) + +var n: number; +>n : Symbol(n, Decl(numberAssignableToEnum.ts, 1, 3)) + +var e: E; +>e : Symbol(e, Decl(numberAssignableToEnum.ts, 2, 3)) +>E : Symbol(E, Decl(numberAssignableToEnum.ts, 0, 0)) + +e = n; +>e : Symbol(e, Decl(numberAssignableToEnum.ts, 2, 3)) +>n : Symbol(n, Decl(numberAssignableToEnum.ts, 1, 3)) + +n = e; +>n : Symbol(n, Decl(numberAssignableToEnum.ts, 1, 3)) +>e : Symbol(e, Decl(numberAssignableToEnum.ts, 2, 3)) + diff --git a/tests/baselines/reference/numberOnLeftSideOfInExpression.symbols b/tests/baselines/reference/numberOnLeftSideOfInExpression.symbols new file mode 100644 index 00000000000..8f3e997acd8 --- /dev/null +++ b/tests/baselines/reference/numberOnLeftSideOfInExpression.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/numberOnLeftSideOfInExpression.ts === +var left: number; +>left : Symbol(left, Decl(numberOnLeftSideOfInExpression.ts, 0, 3)) + +var right: any; +>right : Symbol(right, Decl(numberOnLeftSideOfInExpression.ts, 1, 3)) + +left in right; +>left : Symbol(left, Decl(numberOnLeftSideOfInExpression.ts, 0, 3)) +>right : Symbol(right, Decl(numberOnLeftSideOfInExpression.ts, 1, 3)) + diff --git a/tests/baselines/reference/numberPropertyAccess.symbols b/tests/baselines/reference/numberPropertyAccess.symbols new file mode 100644 index 00000000000..fdfd4c404de --- /dev/null +++ b/tests/baselines/reference/numberPropertyAccess.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/types/primitives/number/numberPropertyAccess.ts === +var x = 1; +>x : Symbol(x, Decl(numberPropertyAccess.ts, 0, 3)) + +var a = x.toExponential(); +>a : Symbol(a, Decl(numberPropertyAccess.ts, 1, 3)) +>x.toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) +>x : Symbol(x, Decl(numberPropertyAccess.ts, 0, 3)) +>toExponential : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) + +var b = x.hasOwnProperty('toFixed'); +>b : Symbol(b, Decl(numberPropertyAccess.ts, 2, 3)) +>x.hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) +>x : Symbol(x, Decl(numberPropertyAccess.ts, 0, 3)) +>hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) + +var c = x['toExponential'](); +>c : Symbol(c, Decl(numberPropertyAccess.ts, 4, 3)) +>x : Symbol(x, Decl(numberPropertyAccess.ts, 0, 3)) +>'toExponential' : Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45)) + +var d = x['hasOwnProperty']('toFixed'); +>d : Symbol(d, Decl(numberPropertyAccess.ts, 5, 3)) +>x : Symbol(x, Decl(numberPropertyAccess.ts, 0, 3)) +>'hasOwnProperty' : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, 105, 22)) + diff --git a/tests/baselines/reference/numberPropertyAccess.types b/tests/baselines/reference/numberPropertyAccess.types index fd554e95ace..b7f5479ed79 100644 --- a/tests/baselines/reference/numberPropertyAccess.types +++ b/tests/baselines/reference/numberPropertyAccess.types @@ -1,6 +1,7 @@ === tests/cases/conformance/types/primitives/number/numberPropertyAccess.ts === var x = 1; >x : number +>1 : number var a = x.toExponential(); >a : string @@ -15,16 +16,20 @@ var b = x.hasOwnProperty('toFixed'); >x.hasOwnProperty : (v: string) => boolean >x : number >hasOwnProperty : (v: string) => boolean +>'toFixed' : string var c = x['toExponential'](); >c : string >x['toExponential']() : string >x['toExponential'] : (fractionDigits?: number) => string >x : number +>'toExponential' : string var d = x['hasOwnProperty']('toFixed'); >d : boolean >x['hasOwnProperty']('toFixed') : boolean >x['hasOwnProperty'] : (v: string) => boolean >x : number +>'hasOwnProperty' : string +>'toFixed' : string diff --git a/tests/baselines/reference/numericIndexerConstraint3.symbols b/tests/baselines/reference/numericIndexerConstraint3.symbols new file mode 100644 index 00000000000..bdf58cb1372 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint3.symbols @@ -0,0 +1,26 @@ +=== tests/cases/compiler/numericIndexerConstraint3.ts === +class A { +>A : Symbol(A, Decl(numericIndexerConstraint3.ts, 0, 0)) + + foo: number; +>foo : Symbol(foo, Decl(numericIndexerConstraint3.ts, 0, 9)) +} + +class B extends A { +>B : Symbol(B, Decl(numericIndexerConstraint3.ts, 2, 1)) +>A : Symbol(A, Decl(numericIndexerConstraint3.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(numericIndexerConstraint3.ts, 4, 19)) +} + +class C { +>C : Symbol(C, Decl(numericIndexerConstraint3.ts, 6, 1)) + + 0: B; +>B : Symbol(B, Decl(numericIndexerConstraint3.ts, 2, 1)) + + [x: number]: A; +>x : Symbol(x, Decl(numericIndexerConstraint3.ts, 10, 5)) +>A : Symbol(A, Decl(numericIndexerConstraint3.ts, 0, 0)) +} diff --git a/tests/baselines/reference/numericIndexerConstraint4.symbols b/tests/baselines/reference/numericIndexerConstraint4.symbols new file mode 100644 index 00000000000..63d976ea1b1 --- /dev/null +++ b/tests/baselines/reference/numericIndexerConstraint4.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/numericIndexerConstraint4.ts === +class A { +>A : Symbol(A, Decl(numericIndexerConstraint4.ts, 0, 0)) + + foo: number; +>foo : Symbol(foo, Decl(numericIndexerConstraint4.ts, 0, 9)) +} + +class B extends A { +>B : Symbol(B, Decl(numericIndexerConstraint4.ts, 2, 1)) +>A : Symbol(A, Decl(numericIndexerConstraint4.ts, 0, 0)) + + bar: string; +>bar : Symbol(bar, Decl(numericIndexerConstraint4.ts, 4, 19)) +} + +var x: { +>x : Symbol(x, Decl(numericIndexerConstraint4.ts, 8, 3)) + + [idx: number]: A; +>idx : Symbol(idx, Decl(numericIndexerConstraint4.ts, 9, 5)) +>A : Symbol(A, Decl(numericIndexerConstraint4.ts, 0, 0)) + +} = { data: new B() } +>data : Symbol(data, Decl(numericIndexerConstraint4.ts, 10, 5)) +>B : Symbol(B, Decl(numericIndexerConstraint4.ts, 2, 1)) + diff --git a/tests/baselines/reference/numericIndexingResults.symbols b/tests/baselines/reference/numericIndexingResults.symbols new file mode 100644 index 00000000000..16a6e9386da --- /dev/null +++ b/tests/baselines/reference/numericIndexingResults.symbols @@ -0,0 +1,183 @@ +=== tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexingResults.ts === +class C { +>C : Symbol(C, Decl(numericIndexingResults.ts, 0, 0)) + + [x: number]: string; +>x : Symbol(x, Decl(numericIndexingResults.ts, 1, 5)) + + 1 = ''; + "2" = '' +} + +var c: C; +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) +>C : Symbol(C, Decl(numericIndexingResults.ts, 0, 0)) + +var r1 = c['1']; +>r1 : Symbol(r1, Decl(numericIndexingResults.ts, 7, 3), Decl(numericIndexingResults.ts, 21, 3), Decl(numericIndexingResults.ts, 34, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) +>'1' : Symbol(C.1, Decl(numericIndexingResults.ts, 1, 24)) + +var r2 = c['2']; +>r2 : Symbol(r2, Decl(numericIndexingResults.ts, 8, 3), Decl(numericIndexingResults.ts, 22, 3), Decl(numericIndexingResults.ts, 35, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) +>'2' : Symbol(C."2", Decl(numericIndexingResults.ts, 2, 11)) + +var r3 = c['3']; +>r3 : Symbol(r3, Decl(numericIndexingResults.ts, 9, 3), Decl(numericIndexingResults.ts, 23, 3), Decl(numericIndexingResults.ts, 36, 3), Decl(numericIndexingResults.ts, 44, 3), Decl(numericIndexingResults.ts, 52, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) + +var r4 = c[1]; +>r4 : Symbol(r4, Decl(numericIndexingResults.ts, 10, 3), Decl(numericIndexingResults.ts, 24, 3), Decl(numericIndexingResults.ts, 37, 3), Decl(numericIndexingResults.ts, 45, 3), Decl(numericIndexingResults.ts, 53, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) +>1 : Symbol(C.1, Decl(numericIndexingResults.ts, 1, 24)) + +var r5 = c[2]; +>r5 : Symbol(r5, Decl(numericIndexingResults.ts, 11, 3), Decl(numericIndexingResults.ts, 25, 3), Decl(numericIndexingResults.ts, 38, 3), Decl(numericIndexingResults.ts, 46, 3), Decl(numericIndexingResults.ts, 54, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) +>2 : Symbol(C."2", Decl(numericIndexingResults.ts, 2, 11)) + +var r6 = c[3]; +>r6 : Symbol(r6, Decl(numericIndexingResults.ts, 12, 3), Decl(numericIndexingResults.ts, 26, 3), Decl(numericIndexingResults.ts, 39, 3), Decl(numericIndexingResults.ts, 47, 3), Decl(numericIndexingResults.ts, 55, 3)) +>c : Symbol(c, Decl(numericIndexingResults.ts, 6, 3)) + +interface I { +>I : Symbol(I, Decl(numericIndexingResults.ts, 12, 14)) + + [x: number]: string; +>x : Symbol(x, Decl(numericIndexingResults.ts, 15, 5)) + + 1: string; + "2": string; +} + +var i: I +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) +>I : Symbol(I, Decl(numericIndexingResults.ts, 12, 14)) + +var r1 = i['1']; +>r1 : Symbol(r1, Decl(numericIndexingResults.ts, 7, 3), Decl(numericIndexingResults.ts, 21, 3), Decl(numericIndexingResults.ts, 34, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) +>'1' : Symbol(I.1, Decl(numericIndexingResults.ts, 15, 24)) + +var r2 = i['2']; +>r2 : Symbol(r2, Decl(numericIndexingResults.ts, 8, 3), Decl(numericIndexingResults.ts, 22, 3), Decl(numericIndexingResults.ts, 35, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) +>'2' : Symbol(I."2", Decl(numericIndexingResults.ts, 16, 14)) + +var r3 = i['3']; +>r3 : Symbol(r3, Decl(numericIndexingResults.ts, 9, 3), Decl(numericIndexingResults.ts, 23, 3), Decl(numericIndexingResults.ts, 36, 3), Decl(numericIndexingResults.ts, 44, 3), Decl(numericIndexingResults.ts, 52, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) + +var r4 = i[1]; +>r4 : Symbol(r4, Decl(numericIndexingResults.ts, 10, 3), Decl(numericIndexingResults.ts, 24, 3), Decl(numericIndexingResults.ts, 37, 3), Decl(numericIndexingResults.ts, 45, 3), Decl(numericIndexingResults.ts, 53, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) +>1 : Symbol(I.1, Decl(numericIndexingResults.ts, 15, 24)) + +var r5 = i[2]; +>r5 : Symbol(r5, Decl(numericIndexingResults.ts, 11, 3), Decl(numericIndexingResults.ts, 25, 3), Decl(numericIndexingResults.ts, 38, 3), Decl(numericIndexingResults.ts, 46, 3), Decl(numericIndexingResults.ts, 54, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) +>2 : Symbol(I."2", Decl(numericIndexingResults.ts, 16, 14)) + +var r6 = i[3]; +>r6 : Symbol(r6, Decl(numericIndexingResults.ts, 12, 3), Decl(numericIndexingResults.ts, 26, 3), Decl(numericIndexingResults.ts, 39, 3), Decl(numericIndexingResults.ts, 47, 3), Decl(numericIndexingResults.ts, 55, 3)) +>i : Symbol(i, Decl(numericIndexingResults.ts, 20, 3)) + +var a: { +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) + + [x: number]: string; +>x : Symbol(x, Decl(numericIndexingResults.ts, 29, 5)) + + 1: string; + "2": string; +} + +var r1 = a['1']; +>r1 : Symbol(r1, Decl(numericIndexingResults.ts, 7, 3), Decl(numericIndexingResults.ts, 21, 3), Decl(numericIndexingResults.ts, 34, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) +>'1' : Symbol(1, Decl(numericIndexingResults.ts, 29, 24)) + +var r2 = a['2']; +>r2 : Symbol(r2, Decl(numericIndexingResults.ts, 8, 3), Decl(numericIndexingResults.ts, 22, 3), Decl(numericIndexingResults.ts, 35, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) +>'2' : Symbol("2", Decl(numericIndexingResults.ts, 30, 14)) + +var r3 = a['3']; +>r3 : Symbol(r3, Decl(numericIndexingResults.ts, 9, 3), Decl(numericIndexingResults.ts, 23, 3), Decl(numericIndexingResults.ts, 36, 3), Decl(numericIndexingResults.ts, 44, 3), Decl(numericIndexingResults.ts, 52, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) + +var r4 = a[1]; +>r4 : Symbol(r4, Decl(numericIndexingResults.ts, 10, 3), Decl(numericIndexingResults.ts, 24, 3), Decl(numericIndexingResults.ts, 37, 3), Decl(numericIndexingResults.ts, 45, 3), Decl(numericIndexingResults.ts, 53, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) +>1 : Symbol(1, Decl(numericIndexingResults.ts, 29, 24)) + +var r5 = a[2]; +>r5 : Symbol(r5, Decl(numericIndexingResults.ts, 11, 3), Decl(numericIndexingResults.ts, 25, 3), Decl(numericIndexingResults.ts, 38, 3), Decl(numericIndexingResults.ts, 46, 3), Decl(numericIndexingResults.ts, 54, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) +>2 : Symbol("2", Decl(numericIndexingResults.ts, 30, 14)) + +var r6 = a[3]; +>r6 : Symbol(r6, Decl(numericIndexingResults.ts, 12, 3), Decl(numericIndexingResults.ts, 26, 3), Decl(numericIndexingResults.ts, 39, 3), Decl(numericIndexingResults.ts, 47, 3), Decl(numericIndexingResults.ts, 55, 3)) +>a : Symbol(a, Decl(numericIndexingResults.ts, 28, 3)) + +var b: { [x: number]: string } = { 1: '', "2": '' } +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) +>x : Symbol(x, Decl(numericIndexingResults.ts, 41, 10)) + +var r1a = b['1']; +>r1a : Symbol(r1a, Decl(numericIndexingResults.ts, 42, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var r2a = b['2']; +>r2a : Symbol(r2a, Decl(numericIndexingResults.ts, 43, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var r3 = b['3']; +>r3 : Symbol(r3, Decl(numericIndexingResults.ts, 9, 3), Decl(numericIndexingResults.ts, 23, 3), Decl(numericIndexingResults.ts, 36, 3), Decl(numericIndexingResults.ts, 44, 3), Decl(numericIndexingResults.ts, 52, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var r4 = b[1]; +>r4 : Symbol(r4, Decl(numericIndexingResults.ts, 10, 3), Decl(numericIndexingResults.ts, 24, 3), Decl(numericIndexingResults.ts, 37, 3), Decl(numericIndexingResults.ts, 45, 3), Decl(numericIndexingResults.ts, 53, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var r5 = b[2]; +>r5 : Symbol(r5, Decl(numericIndexingResults.ts, 11, 3), Decl(numericIndexingResults.ts, 25, 3), Decl(numericIndexingResults.ts, 38, 3), Decl(numericIndexingResults.ts, 46, 3), Decl(numericIndexingResults.ts, 54, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var r6 = b[3]; +>r6 : Symbol(r6, Decl(numericIndexingResults.ts, 12, 3), Decl(numericIndexingResults.ts, 26, 3), Decl(numericIndexingResults.ts, 39, 3), Decl(numericIndexingResults.ts, 47, 3), Decl(numericIndexingResults.ts, 55, 3)) +>b : Symbol(b, Decl(numericIndexingResults.ts, 41, 3)) + +var b2: { [x: number]: string; 1: string; "2": string; } = { 1: '', "2": '' } +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) +>x : Symbol(x, Decl(numericIndexingResults.ts, 49, 11)) + +var r1b = b2['1']; +>r1b : Symbol(r1b, Decl(numericIndexingResults.ts, 50, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) +>'1' : Symbol(1, Decl(numericIndexingResults.ts, 49, 30)) + +var r2b = b2['2']; +>r2b : Symbol(r2b, Decl(numericIndexingResults.ts, 51, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) +>'2' : Symbol("2", Decl(numericIndexingResults.ts, 49, 41)) + +var r3 = b2['3']; +>r3 : Symbol(r3, Decl(numericIndexingResults.ts, 9, 3), Decl(numericIndexingResults.ts, 23, 3), Decl(numericIndexingResults.ts, 36, 3), Decl(numericIndexingResults.ts, 44, 3), Decl(numericIndexingResults.ts, 52, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) + +var r4 = b2[1]; +>r4 : Symbol(r4, Decl(numericIndexingResults.ts, 10, 3), Decl(numericIndexingResults.ts, 24, 3), Decl(numericIndexingResults.ts, 37, 3), Decl(numericIndexingResults.ts, 45, 3), Decl(numericIndexingResults.ts, 53, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) +>1 : Symbol(1, Decl(numericIndexingResults.ts, 49, 30)) + +var r5 = b2[2]; +>r5 : Symbol(r5, Decl(numericIndexingResults.ts, 11, 3), Decl(numericIndexingResults.ts, 25, 3), Decl(numericIndexingResults.ts, 38, 3), Decl(numericIndexingResults.ts, 46, 3), Decl(numericIndexingResults.ts, 54, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) +>2 : Symbol("2", Decl(numericIndexingResults.ts, 49, 41)) + +var r6 = b2[3]; +>r6 : Symbol(r6, Decl(numericIndexingResults.ts, 12, 3), Decl(numericIndexingResults.ts, 26, 3), Decl(numericIndexingResults.ts, 39, 3), Decl(numericIndexingResults.ts, 47, 3), Decl(numericIndexingResults.ts, 55, 3)) +>b2 : Symbol(b2, Decl(numericIndexingResults.ts, 49, 3)) + diff --git a/tests/baselines/reference/numericIndexingResults.types b/tests/baselines/reference/numericIndexingResults.types index e68a083bb74..560bbdc74a8 100644 --- a/tests/baselines/reference/numericIndexingResults.types +++ b/tests/baselines/reference/numericIndexingResults.types @@ -6,7 +6,10 @@ class C { >x : number 1 = ''; +>'' : string + "2" = '' +>'' : string } var c: C; @@ -17,31 +20,37 @@ var r1 = c['1']; >r1 : string >c['1'] : string >c : C +>'1' : string var r2 = c['2']; >r2 : string >c['2'] : string >c : C +>'2' : string var r3 = c['3']; >r3 : any >c['3'] : any >c : C +>'3' : string var r4 = c[1]; >r4 : string >c[1] : string >c : C +>1 : number var r5 = c[2]; >r5 : string >c[2] : string >c : C +>2 : number var r6 = c[3]; >r6 : string >c[3] : string >c : C +>3 : number interface I { >I : I @@ -61,31 +70,37 @@ var r1 = i['1']; >r1 : string >i['1'] : string >i : I +>'1' : string var r2 = i['2']; >r2 : string >i['2'] : string >i : I +>'2' : string var r3 = i['3']; >r3 : any >i['3'] : any >i : I +>'3' : string var r4 = i[1]; >r4 : string >i[1] : string >i : I +>1 : number var r5 = i[2]; >r5 : string >i[2] : string >i : I +>2 : number var r6 = i[3]; >r6 : string >i[3] : string >i : I +>3 : number var a: { >a : { [x: number]: string; 1: string; "2": string; } @@ -101,99 +116,121 @@ var r1 = a['1']; >r1 : string >a['1'] : string >a : { [x: number]: string; 1: string; "2": string; } +>'1' : string var r2 = a['2']; >r2 : string >a['2'] : string >a : { [x: number]: string; 1: string; "2": string; } +>'2' : string var r3 = a['3']; >r3 : any >a['3'] : any >a : { [x: number]: string; 1: string; "2": string; } +>'3' : string var r4 = a[1]; >r4 : string >a[1] : string >a : { [x: number]: string; 1: string; "2": string; } +>1 : number var r5 = a[2]; >r5 : string >a[2] : string >a : { [x: number]: string; 1: string; "2": string; } +>2 : number var r6 = a[3]; >r6 : string >a[3] : string >a : { [x: number]: string; 1: string; "2": string; } +>3 : number var b: { [x: number]: string } = { 1: '', "2": '' } >b : { [x: number]: string; } >x : number >{ 1: '', "2": '' } : { [x: number]: string; 1: string; "2": string; } +>'' : string +>'' : string var r1a = b['1']; >r1a : any >b['1'] : any >b : { [x: number]: string; } +>'1' : string var r2a = b['2']; >r2a : any >b['2'] : any >b : { [x: number]: string; } +>'2' : string var r3 = b['3']; >r3 : any >b['3'] : any >b : { [x: number]: string; } +>'3' : string var r4 = b[1]; >r4 : string >b[1] : string >b : { [x: number]: string; } +>1 : number var r5 = b[2]; >r5 : string >b[2] : string >b : { [x: number]: string; } +>2 : number var r6 = b[3]; >r6 : string >b[3] : string >b : { [x: number]: string; } +>3 : number var b2: { [x: number]: string; 1: string; "2": string; } = { 1: '', "2": '' } >b2 : { [x: number]: string; 1: string; "2": string; } >x : number >{ 1: '', "2": '' } : { [x: number]: string; 1: string; "2": string; } +>'' : string +>'' : string var r1b = b2['1']; >r1b : string >b2['1'] : string >b2 : { [x: number]: string; 1: string; "2": string; } +>'1' : string var r2b = b2['2']; >r2b : string >b2['2'] : string >b2 : { [x: number]: string; 1: string; "2": string; } +>'2' : string var r3 = b2['3']; >r3 : any >b2['3'] : any >b2 : { [x: number]: string; 1: string; "2": string; } +>'3' : string var r4 = b2[1]; >r4 : string >b2[1] : string >b2 : { [x: number]: string; 1: string; "2": string; } +>1 : number var r5 = b2[2]; >r5 : string >b2[2] : string >b2 : { [x: number]: string; 1: string; "2": string; } +>2 : number var r6 = b2[3]; >r6 : string >b2[3] : string >b2 : { [x: number]: string; 1: string; "2": string; } +>3 : number diff --git a/tests/baselines/reference/numericMethodName1.symbols b/tests/baselines/reference/numericMethodName1.symbols new file mode 100644 index 00000000000..a2ecd29e8e7 --- /dev/null +++ b/tests/baselines/reference/numericMethodName1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/numericMethodName1.ts === +class C { +>C : Symbol(C, Decl(numericMethodName1.ts, 0, 0)) + + 1 = 2; +} + diff --git a/tests/baselines/reference/numericMethodName1.types b/tests/baselines/reference/numericMethodName1.types index 09d63f04e13..e6e631fc705 100644 --- a/tests/baselines/reference/numericMethodName1.types +++ b/tests/baselines/reference/numericMethodName1.types @@ -3,5 +3,6 @@ class C { >C : C 1 = 2; +>2 : number } diff --git a/tests/baselines/reference/objectIndexer.symbols b/tests/baselines/reference/objectIndexer.symbols new file mode 100644 index 00000000000..33885a40e27 --- /dev/null +++ b/tests/baselines/reference/objectIndexer.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/objectIndexer.ts === +export interface Callback { +>Callback : Symbol(Callback, Decl(objectIndexer.ts, 0, 0)) + + (value: any): void; +>value : Symbol(value, Decl(objectIndexer.ts, 1, 5)) +} + +interface IMap { +>IMap : Symbol(IMap, Decl(objectIndexer.ts, 2, 1)) + + [s: string]: Callback; +>s : Symbol(s, Decl(objectIndexer.ts, 5, 5)) +>Callback : Symbol(Callback, Decl(objectIndexer.ts, 0, 0)) +} + +class Emitter { +>Emitter : Symbol(Emitter, Decl(objectIndexer.ts, 6, 1)) + + private listeners: IMap; +>listeners : Symbol(listeners, Decl(objectIndexer.ts, 8, 15)) +>IMap : Symbol(IMap, Decl(objectIndexer.ts, 2, 1)) + + constructor () { + this.listeners = {}; +>this.listeners : Symbol(listeners, Decl(objectIndexer.ts, 8, 15)) +>this : Symbol(Emitter, Decl(objectIndexer.ts, 6, 1)) +>listeners : Symbol(listeners, Decl(objectIndexer.ts, 8, 15)) + } +} + diff --git a/tests/baselines/reference/objectLitGetterSetter.symbols b/tests/baselines/reference/objectLitGetterSetter.symbols new file mode 100644 index 00000000000..512e459c8c0 --- /dev/null +++ b/tests/baselines/reference/objectLitGetterSetter.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/objectLitGetterSetter.ts === + var obj = {}; +>obj : Symbol(obj, Decl(objectLitGetterSetter.ts, 0, 15)) + + Object.defineProperty(obj, "accProperty", ({ +>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.d.ts, 160, 60)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.d.ts, 160, 60)) +>obj : Symbol(obj, Decl(objectLitGetterSetter.ts, 0, 15)) +>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(lib.d.ts, 79, 66)) + + get: function () { +>get : Symbol(get, Decl(objectLitGetterSetter.ts, 1, 76)) + + eval("public = 1;"); +>eval : Symbol(eval, Decl(lib.d.ts, 22, 29)) + + return 11; + }, + set: function (v) { +>set : Symbol(set, Decl(objectLitGetterSetter.ts, 5, 18)) +>v : Symbol(v, Decl(objectLitGetterSetter.ts, 6, 31)) + } + })) + diff --git a/tests/baselines/reference/objectLitGetterSetter.types b/tests/baselines/reference/objectLitGetterSetter.types index 92decfd4068..4f7865374e2 100644 --- a/tests/baselines/reference/objectLitGetterSetter.types +++ b/tests/baselines/reference/objectLitGetterSetter.types @@ -9,6 +9,7 @@ >Object : ObjectConstructor >defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >obj : {} +>"accProperty" : string >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : { get: () => number; set: (v: any) => void; } @@ -21,8 +22,11 @@ eval("public = 1;"); >eval("public = 1;") : any >eval : (x: string) => any +>"public = 1;" : string return 11; +>11 : number + }, set: function (v) { >set : (v: any) => void diff --git a/tests/baselines/reference/objectLiteral1.symbols b/tests/baselines/reference/objectLiteral1.symbols new file mode 100644 index 00000000000..76acb6623bc --- /dev/null +++ b/tests/baselines/reference/objectLiteral1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/objectLiteral1.ts === +var v30 = {a:1, b:2}; +>v30 : Symbol(v30, Decl(objectLiteral1.ts, 0, 3)) +>a : Symbol(a, Decl(objectLiteral1.ts, 0, 11)) +>b : Symbol(b, Decl(objectLiteral1.ts, 0, 15)) + diff --git a/tests/baselines/reference/objectLiteral1.types b/tests/baselines/reference/objectLiteral1.types index 6371d285f63..491b4ce365b 100644 --- a/tests/baselines/reference/objectLiteral1.types +++ b/tests/baselines/reference/objectLiteral1.types @@ -3,5 +3,7 @@ var v30 = {a:1, b:2}; >v30 : { a: number; b: number; } >{a:1, b:2} : { a: number; b: number; } >a : number +>1 : number >b : number +>2 : number diff --git a/tests/baselines/reference/objectLiteral2.symbols b/tests/baselines/reference/objectLiteral2.symbols new file mode 100644 index 00000000000..6e953fa2c12 --- /dev/null +++ b/tests/baselines/reference/objectLiteral2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/objectLiteral2.ts === +var v30 = {a:1, b:2}, v31; +>v30 : Symbol(v30, Decl(objectLiteral2.ts, 0, 3)) +>a : Symbol(a, Decl(objectLiteral2.ts, 0, 11)) +>b : Symbol(b, Decl(objectLiteral2.ts, 0, 15)) +>v31 : Symbol(v31, Decl(objectLiteral2.ts, 0, 21)) + diff --git a/tests/baselines/reference/objectLiteral2.types b/tests/baselines/reference/objectLiteral2.types index c6853bdbd88..387bd0ba90f 100644 --- a/tests/baselines/reference/objectLiteral2.types +++ b/tests/baselines/reference/objectLiteral2.types @@ -3,6 +3,8 @@ var v30 = {a:1, b:2}, v31; >v30 : { a: number; b: number; } >{a:1, b:2} : { a: number; b: number; } >a : number +>1 : number >b : number +>2 : number >v31 : any diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.symbols b/tests/baselines/reference/objectLiteralArraySpecialization.symbols new file mode 100644 index 00000000000..4cc1188dcc4 --- /dev/null +++ b/tests/baselines/reference/objectLiteralArraySpecialization.symbols @@ -0,0 +1,44 @@ +=== tests/cases/compiler/objectLiteralArraySpecialization.ts === +declare function create(initialValues?: T[]): MyArrayWrapper; +>create : Symbol(create, Decl(objectLiteralArraySpecialization.ts, 0, 0)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 0, 24)) +>initialValues : Symbol(initialValues, Decl(objectLiteralArraySpecialization.ts, 0, 27)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 0, 24)) +>MyArrayWrapper : Symbol(MyArrayWrapper, Decl(objectLiteralArraySpecialization.ts, 0, 67)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 0, 24)) + +interface MyArrayWrapper { +>MyArrayWrapper : Symbol(MyArrayWrapper, Decl(objectLiteralArraySpecialization.ts, 0, 67)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 1, 25)) + + constructor(initialItems?: T[]); +>constructor : Symbol(constructor, Decl(objectLiteralArraySpecialization.ts, 1, 29)) +>initialItems : Symbol(initialItems, Decl(objectLiteralArraySpecialization.ts, 2, 13)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 1, 25)) + + doSomething(predicate: (x: T, y: T) => boolean): void; +>doSomething : Symbol(doSomething, Decl(objectLiteralArraySpecialization.ts, 2, 33)) +>predicate : Symbol(predicate, Decl(objectLiteralArraySpecialization.ts, 3, 13)) +>x : Symbol(x, Decl(objectLiteralArraySpecialization.ts, 3, 25)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 1, 25)) +>y : Symbol(y, Decl(objectLiteralArraySpecialization.ts, 3, 30)) +>T : Symbol(T, Decl(objectLiteralArraySpecialization.ts, 1, 25)) +} +var thing = create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]); // should not error +>thing : Symbol(thing, Decl(objectLiteralArraySpecialization.ts, 5, 3)) +>create : Symbol(create, Decl(objectLiteralArraySpecialization.ts, 0, 0)) +>name : Symbol(name, Decl(objectLiteralArraySpecialization.ts, 5, 22)) +>id : Symbol(id, Decl(objectLiteralArraySpecialization.ts, 5, 35)) +>name : Symbol(name, Decl(objectLiteralArraySpecialization.ts, 5, 47)) +>id : Symbol(id, Decl(objectLiteralArraySpecialization.ts, 5, 61)) + +thing.doSomething((x, y) => x.name === "bob"); // should not error +>thing.doSomething : Symbol(MyArrayWrapper.doSomething, Decl(objectLiteralArraySpecialization.ts, 2, 33)) +>thing : Symbol(thing, Decl(objectLiteralArraySpecialization.ts, 5, 3)) +>doSomething : Symbol(MyArrayWrapper.doSomething, Decl(objectLiteralArraySpecialization.ts, 2, 33)) +>x : Symbol(x, Decl(objectLiteralArraySpecialization.ts, 6, 19)) +>y : Symbol(y, Decl(objectLiteralArraySpecialization.ts, 6, 21)) +>x.name : Symbol(name, Decl(objectLiteralArraySpecialization.ts, 5, 22)) +>x : Symbol(x, Decl(objectLiteralArraySpecialization.ts, 6, 19)) +>name : Symbol(name, Decl(objectLiteralArraySpecialization.ts, 5, 22)) + diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.types b/tests/baselines/reference/objectLiteralArraySpecialization.types index d077354728b..b32eaa0441e 100644 --- a/tests/baselines/reference/objectLiteralArraySpecialization.types +++ b/tests/baselines/reference/objectLiteralArraySpecialization.types @@ -31,10 +31,14 @@ var thing = create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]); // sh >[ { name: "bob", id: 24 }, { name: "doug", id: 32 } ] : { name: string; id: number; }[] >{ name: "bob", id: 24 } : { name: string; id: number; } >name : string +>"bob" : string >id : number +>24 : number >{ name: "doug", id: 32 } : { name: string; id: number; } >name : string +>"doug" : string >id : number +>32 : number thing.doSomething((x, y) => x.name === "bob"); // should not error >thing.doSomething((x, y) => x.name === "bob") : void @@ -48,4 +52,5 @@ thing.doSomething((x, y) => x.name === "bob"); // should not error >x.name : string >x : { name: string; id: number; } >name : string +>"bob" : string diff --git a/tests/baselines/reference/objectLiteralContextualTyping.symbols b/tests/baselines/reference/objectLiteralContextualTyping.symbols new file mode 100644 index 00000000000..6e8f2e5f333 --- /dev/null +++ b/tests/baselines/reference/objectLiteralContextualTyping.symbols @@ -0,0 +1,71 @@ +=== tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts === +// Tests related to #1774 + +interface Item { +>Item : Symbol(Item, Decl(objectLiteralContextualTyping.ts, 0, 0)) + + name: string; +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 2, 16)) + + description?: string; +>description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 3, 17)) +} + +declare function foo(item: Item): string; +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>item : Symbol(item, Decl(objectLiteralContextualTyping.ts, 7, 21)) +>Item : Symbol(Item, Decl(objectLiteralContextualTyping.ts, 0, 0)) + +declare function foo(item: any): number; +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>item : Symbol(item, Decl(objectLiteralContextualTyping.ts, 8, 21)) + +var x = foo({ name: "Sprocket" }); +>x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 10, 3), Decl(objectLiteralContextualTyping.ts, 11, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 10, 13)) + +var x: string; +>x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 10, 3), Decl(objectLiteralContextualTyping.ts, 11, 3)) + +var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); +>y : Symbol(y, Decl(objectLiteralContextualTyping.ts, 13, 3), Decl(objectLiteralContextualTyping.ts, 14, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 13, 13)) +>description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 13, 31)) + +var y: string; +>y : Symbol(y, Decl(objectLiteralContextualTyping.ts, 13, 3), Decl(objectLiteralContextualTyping.ts, 14, 3)) + +var z = foo({ name: "Sprocket", description: false }); +>z : Symbol(z, Decl(objectLiteralContextualTyping.ts, 16, 3), Decl(objectLiteralContextualTyping.ts, 17, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>name : Symbol(name, Decl(objectLiteralContextualTyping.ts, 16, 13)) +>description : Symbol(description, Decl(objectLiteralContextualTyping.ts, 16, 31)) + +var z: number; +>z : Symbol(z, Decl(objectLiteralContextualTyping.ts, 16, 3), Decl(objectLiteralContextualTyping.ts, 17, 3)) + +var w = foo({ a: 10 }); +>w : Symbol(w, Decl(objectLiteralContextualTyping.ts, 19, 3), Decl(objectLiteralContextualTyping.ts, 20, 3)) +>foo : Symbol(foo, Decl(objectLiteralContextualTyping.ts, 5, 1), Decl(objectLiteralContextualTyping.ts, 7, 41)) +>a : Symbol(a, Decl(objectLiteralContextualTyping.ts, 19, 13)) + +var w: number; +>w : Symbol(w, Decl(objectLiteralContextualTyping.ts, 19, 3), Decl(objectLiteralContextualTyping.ts, 20, 3)) + +declare function bar(param: { x?: T }): T; +>bar : Symbol(bar, Decl(objectLiteralContextualTyping.ts, 20, 14)) +>T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 22, 21)) +>param : Symbol(param, Decl(objectLiteralContextualTyping.ts, 22, 24)) +>x : Symbol(x, Decl(objectLiteralContextualTyping.ts, 22, 32)) +>T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 22, 21)) +>T : Symbol(T, Decl(objectLiteralContextualTyping.ts, 22, 21)) + +var b = bar({}); +>b : Symbol(b, Decl(objectLiteralContextualTyping.ts, 24, 3), Decl(objectLiteralContextualTyping.ts, 25, 3)) +>bar : Symbol(bar, Decl(objectLiteralContextualTyping.ts, 20, 14)) + +var b: {}; +>b : Symbol(b, Decl(objectLiteralContextualTyping.ts, 24, 3), Decl(objectLiteralContextualTyping.ts, 25, 3)) + diff --git a/tests/baselines/reference/objectLiteralContextualTyping.types b/tests/baselines/reference/objectLiteralContextualTyping.types index 32c9e91b2c7..7668b01d32c 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.types +++ b/tests/baselines/reference/objectLiteralContextualTyping.types @@ -26,6 +26,7 @@ var x = foo({ name: "Sprocket" }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket" } : { name: string; } >name : string +>"Sprocket" : string var x: string; >x : string @@ -36,7 +37,9 @@ var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket", description: "Bumpy wheel" } : { name: string; description: string; } >name : string +>"Sprocket" : string >description : string +>"Bumpy wheel" : string var y: string; >y : string @@ -47,7 +50,9 @@ var z = foo({ name: "Sprocket", description: false }); >foo : { (item: Item): string; (item: any): number; } >{ name: "Sprocket", description: false } : { name: string; description: boolean; } >name : string +>"Sprocket" : string >description : boolean +>false : boolean var z: number; >z : number @@ -58,6 +63,7 @@ var w = foo({ a: 10 }); >foo : { (item: Item): string; (item: any): number; } >{ a: 10 } : { a: number; } >a : number +>10 : number var w: number; >w : number diff --git a/tests/baselines/reference/objectLiteralDeclarationGeneration1.symbols b/tests/baselines/reference/objectLiteralDeclarationGeneration1.symbols new file mode 100644 index 00000000000..fb03260183c --- /dev/null +++ b/tests/baselines/reference/objectLiteralDeclarationGeneration1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/objectLiteralDeclarationGeneration1.ts === +class y{ } +>y : Symbol(y, Decl(objectLiteralDeclarationGeneration1.ts, 0, 0)) +>T : Symbol(T, Decl(objectLiteralDeclarationGeneration1.ts, 0, 8)) + diff --git a/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.symbols b/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.symbols new file mode 100644 index 00000000000..2a5545f2264 --- /dev/null +++ b/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/objectLiteralIndexerNoImplicitAny.ts === +interface I { +>I : Symbol(I, Decl(objectLiteralIndexerNoImplicitAny.ts, 0, 0)) + + [s: string]: any; +>s : Symbol(s, Decl(objectLiteralIndexerNoImplicitAny.ts, 1, 5)) +} + +var x: I = { +>x : Symbol(x, Decl(objectLiteralIndexerNoImplicitAny.ts, 4, 3)) +>I : Symbol(I, Decl(objectLiteralIndexerNoImplicitAny.ts, 0, 0)) + + p: null +>p : Symbol(p, Decl(objectLiteralIndexerNoImplicitAny.ts, 4, 12)) +} diff --git a/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.types b/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.types index 14bcc6f5b62..a49f76d02e9 100644 --- a/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.types +++ b/tests/baselines/reference/objectLiteralIndexerNoImplicitAny.types @@ -13,4 +13,5 @@ var x: I = { p: null >p : null +>null : null } diff --git a/tests/baselines/reference/objectLiteralIndexers.symbols b/tests/baselines/reference/objectLiteralIndexers.symbols new file mode 100644 index 00000000000..424e95be0fa --- /dev/null +++ b/tests/baselines/reference/objectLiteralIndexers.symbols @@ -0,0 +1,49 @@ +=== tests/cases/compiler/objectLiteralIndexers.ts === +interface A { +>A : Symbol(A, Decl(objectLiteralIndexers.ts, 0, 0)) + + x: number; +>x : Symbol(x, Decl(objectLiteralIndexers.ts, 0, 13)) +} + +interface B extends A { +>B : Symbol(B, Decl(objectLiteralIndexers.ts, 2, 1)) +>A : Symbol(A, Decl(objectLiteralIndexers.ts, 0, 0)) + + y: string; +>y : Symbol(y, Decl(objectLiteralIndexers.ts, 4, 23)) +} + +var a: A; +>a : Symbol(a, Decl(objectLiteralIndexers.ts, 8, 3)) +>A : Symbol(A, Decl(objectLiteralIndexers.ts, 0, 0)) + +var b: B; +>b : Symbol(b, Decl(objectLiteralIndexers.ts, 9, 3)) +>B : Symbol(B, Decl(objectLiteralIndexers.ts, 2, 1)) + +var c: any; +>c : Symbol(c, Decl(objectLiteralIndexers.ts, 10, 3)) + +var o1: { [s: string]: A;[n: number]: B; } = { x: a, 0: b }; // string indexer is A, number indexer is B +>o1 : Symbol(o1, Decl(objectLiteralIndexers.ts, 12, 3)) +>s : Symbol(s, Decl(objectLiteralIndexers.ts, 12, 11)) +>A : Symbol(A, Decl(objectLiteralIndexers.ts, 0, 0)) +>n : Symbol(n, Decl(objectLiteralIndexers.ts, 12, 26)) +>B : Symbol(B, Decl(objectLiteralIndexers.ts, 2, 1)) +>x : Symbol(x, Decl(objectLiteralIndexers.ts, 12, 46)) +>a : Symbol(a, Decl(objectLiteralIndexers.ts, 8, 3)) +>b : Symbol(b, Decl(objectLiteralIndexers.ts, 9, 3)) + +o1 = { x: b, 0: c }; // both indexers are any +>o1 : Symbol(o1, Decl(objectLiteralIndexers.ts, 12, 3)) +>x : Symbol(x, Decl(objectLiteralIndexers.ts, 13, 6)) +>b : Symbol(b, Decl(objectLiteralIndexers.ts, 9, 3)) +>c : Symbol(c, Decl(objectLiteralIndexers.ts, 10, 3)) + +o1 = { x: c, 0: b }; // string indexer is any, number indexer is B +>o1 : Symbol(o1, Decl(objectLiteralIndexers.ts, 12, 3)) +>x : Symbol(x, Decl(objectLiteralIndexers.ts, 14, 6)) +>c : Symbol(c, Decl(objectLiteralIndexers.ts, 10, 3)) +>b : Symbol(b, Decl(objectLiteralIndexers.ts, 9, 3)) + diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.symbols b/tests/baselines/reference/objectLiteralShorthandProperties.symbols new file mode 100644 index 00000000000..e75b1d70a11 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandProperties.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandProperties.ts === +var a, b, c; +>a : Symbol(a, Decl(objectLiteralShorthandProperties.ts, 0, 3)) +>b : Symbol(b, Decl(objectLiteralShorthandProperties.ts, 0, 6)) +>c : Symbol(c, Decl(objectLiteralShorthandProperties.ts, 0, 9)) + +var x1 = { +>x1 : Symbol(x1, Decl(objectLiteralShorthandProperties.ts, 2, 3)) + + a +>a : Symbol(a, Decl(objectLiteralShorthandProperties.ts, 2, 10)) + +}; + +var x2 = { +>x2 : Symbol(x2, Decl(objectLiteralShorthandProperties.ts, 6, 3)) + + a, +>a : Symbol(a, Decl(objectLiteralShorthandProperties.ts, 6, 10)) +} + +var x3 = { +>x3 : Symbol(x3, Decl(objectLiteralShorthandProperties.ts, 10, 3)) + + a: 0, +>a : Symbol(a, Decl(objectLiteralShorthandProperties.ts, 10, 10)) + + b, +>b : Symbol(b, Decl(objectLiteralShorthandProperties.ts, 11, 9)) + + c, +>c : Symbol(c, Decl(objectLiteralShorthandProperties.ts, 12, 6)) + + d() { }, +>d : Symbol(d, Decl(objectLiteralShorthandProperties.ts, 13, 6)) + + x3, +>x3 : Symbol(x3, Decl(objectLiteralShorthandProperties.ts, 14, 12)) + + parent: x3 +>parent : Symbol(parent, Decl(objectLiteralShorthandProperties.ts, 15, 7)) +>x3 : Symbol(x3, Decl(objectLiteralShorthandProperties.ts, 10, 3)) + +}; + + diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.types b/tests/baselines/reference/objectLiteralShorthandProperties.types index c34b2ab79b7..9d537173d49 100644 --- a/tests/baselines/reference/objectLiteralShorthandProperties.types +++ b/tests/baselines/reference/objectLiteralShorthandProperties.types @@ -27,6 +27,7 @@ var x3 = { a: 0, >a : number +>0 : number b, >b : any diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.symbols new file mode 100644 index 00000000000..6afb48aac49 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.symbols @@ -0,0 +1,60 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts === +var id: number = 10000; +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 0, 3)) + +var name: string = "my name"; +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 1, 3)) + +var person: { name: string; id: number } = { name, id }; +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 27)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 44)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 50)) + +function foo( obj:{ name: string }): void { }; +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 56)) +>obj : Symbol(obj, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 13)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 19)) + +function bar(name: string, id: number) { return { name, id }; } +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 46)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 5, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 5, 26)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 5, 49)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 5, 55)) + +function bar1(name: string, id: number) { return { name }; } +>bar1 : Symbol(bar1, Decl(objectLiteralShorthandPropertiesAssignment.ts, 5, 63)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 6, 14)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 6, 27)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 6, 50)) + +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } +>baz : Symbol(baz, Decl(objectLiteralShorthandPropertiesAssignment.ts, 6, 60)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 26)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 41)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 55)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 79)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 7, 85)) + +foo(person); +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 56)) +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesAssignment.ts, 3, 3)) + +var person1 = bar("Hello", 5); +>person1 : Symbol(person1, Decl(objectLiteralShorthandPropertiesAssignment.ts, 10, 3)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 46)) + +var person2: { name: string } = bar("Hello", 5); +>person2 : Symbol(person2, Decl(objectLiteralShorthandPropertiesAssignment.ts, 11, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 11, 14)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 46)) + +var person3: { name: string; id:number } = bar("Hello", 5); +>person3 : Symbol(person3, Decl(objectLiteralShorthandPropertiesAssignment.ts, 12, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignment.ts, 12, 14)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignment.ts, 12, 28)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignment.ts, 4, 46)) + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types index 91d9e528d63..869a67fb22f 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignment.types @@ -1,9 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts === var id: number = 10000; >id : number +>10000 : number var name: string = "my name"; >name : string +>"my name" : string var person: { name: string; id: number } = { name, id }; >person : { name: string; id: number; } @@ -52,12 +54,16 @@ var person1 = bar("Hello", 5); >person1 : { name: string; id: number; } >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number var person2: { name: string } = bar("Hello", 5); >person2 : { name: string; } >name : string >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number var person3: { name: string; id:number } = bar("Hello", 5); >person3 : { name: string; id: number; } @@ -65,4 +71,6 @@ var person3: { name: string; id:number } = bar("Hello", 5); >id : number >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.symbols new file mode 100644 index 00000000000..e444d177a79 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.symbols @@ -0,0 +1,60 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts === +var id: number = 10000; +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 0, 3)) + +var name: string = "my name"; +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 1, 3)) + +var person: { name: string; id: number } = { name, id }; +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 27)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 44)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 50)) + +function foo(obj: { name: string }): void { }; +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 56)) +>obj : Symbol(obj, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 13)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 19)) + +function bar(name: string, id: number) { return { name, id }; } +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 46)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 5, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 5, 26)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 5, 49)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 5, 55)) + +function bar1(name: string, id: number) { return { name }; } +>bar1 : Symbol(bar1, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 5, 63)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 6, 14)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 6, 27)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 6, 50)) + +function baz(name: string, id: number): { name: string; id: number } { return { name, id }; } +>baz : Symbol(baz, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 6, 60)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 13)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 26)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 41)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 55)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 79)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 7, 85)) + +foo(person); +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 56)) +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 3, 3)) + +var person1 = bar("Hello", 5); +>person1 : Symbol(person1, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 10, 3)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 46)) + +var person2: { name: string } = bar("Hello", 5); +>person2 : Symbol(person2, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 11, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 11, 14)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 46)) + +var person3: { name: string; id: number } = bar("Hello", 5); +>person3 : Symbol(person3, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 12, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 12, 14)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 12, 28)) +>bar : Symbol(bar, Decl(objectLiteralShorthandPropertiesAssignmentES6.ts, 4, 46)) + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types index 38791fc1beb..710fc430339 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesAssignmentES6.types @@ -1,9 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts === var id: number = 10000; >id : number +>10000 : number var name: string = "my name"; >name : string +>"my name" : string var person: { name: string; id: number } = { name, id }; >person : { name: string; id: number; } @@ -52,12 +54,16 @@ var person1 = bar("Hello", 5); >person1 : { name: string; id: number; } >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number var person2: { name: string } = bar("Hello", 5); >person2 : { name: string; } >name : string >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number var person3: { name: string; id: number } = bar("Hello", 5); >person3 : { name: string; id: number; } @@ -65,4 +71,6 @@ var person3: { name: string; id: number } = bar("Hello", 5); >id : number >bar("Hello", 5) : { name: string; id: number; } >bar : (name: string, id: number) => { name: string; id: number; } +>"Hello" : string +>5 : number diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.symbols new file mode 100644 index 00000000000..2f9b50168c1 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.symbols @@ -0,0 +1,46 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesES6.ts === +var a, b, c; +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesES6.ts, 0, 3)) +>b : Symbol(b, Decl(objectLiteralShorthandPropertiesES6.ts, 0, 6)) +>c : Symbol(c, Decl(objectLiteralShorthandPropertiesES6.ts, 0, 9)) + +var x1 = { +>x1 : Symbol(x1, Decl(objectLiteralShorthandPropertiesES6.ts, 2, 3)) + + a +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesES6.ts, 2, 10)) + +}; + +var x2 = { +>x2 : Symbol(x2, Decl(objectLiteralShorthandPropertiesES6.ts, 6, 3)) + + a, +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesES6.ts, 6, 10)) +} + +var x3 = { +>x3 : Symbol(x3, Decl(objectLiteralShorthandPropertiesES6.ts, 10, 3)) + + a: 0, +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesES6.ts, 10, 10)) + + b, +>b : Symbol(b, Decl(objectLiteralShorthandPropertiesES6.ts, 11, 9)) + + c, +>c : Symbol(c, Decl(objectLiteralShorthandPropertiesES6.ts, 12, 6)) + + d() { }, +>d : Symbol(d, Decl(objectLiteralShorthandPropertiesES6.ts, 13, 6)) + + x3, +>x3 : Symbol(x3, Decl(objectLiteralShorthandPropertiesES6.ts, 14, 12)) + + parent: x3 +>parent : Symbol(parent, Decl(objectLiteralShorthandPropertiesES6.ts, 15, 7)) +>x3 : Symbol(x3, Decl(objectLiteralShorthandPropertiesES6.ts, 10, 3)) + +}; + + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types index 5d5acc279a5..5c36262f695 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types @@ -27,6 +27,7 @@ var x3 = { a: 0, >a : number +>0 : number b, >b : any diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.symbols new file mode 100644 index 00000000000..ba8b0eeb6a9 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts === +var id: number = 10000; +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 0, 3)) + +var name: string = "my name"; +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 1, 3)) + +var person = { name, id }; +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 14)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 20)) + +function foo(p: { name: string; id: number }) { } +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 26)) +>p : Symbol(p, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 5, 13)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 5, 17)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 5, 31)) + +foo(person); +>foo : Symbol(foo, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 26)) +>person : Symbol(person, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 3)) + + +var obj = { name: name, id: id }; +>obj : Symbol(obj, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 9, 3)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 9, 11)) +>name : Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 1, 3)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 9, 23)) +>id : Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 0, 3)) + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types index 9b4261a74be..083d4118128 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types @@ -1,9 +1,11 @@ === tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts === var id: number = 10000; >id : number +>10000 : number var name: string = "my name"; >name : string +>"my name" : string var person = { name, id }; >person : { name: string; id: number; } diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.symbols new file mode 100644 index 00000000000..681036e2aef --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModule.symbols @@ -0,0 +1,30 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModule.ts === +// module export + +module m { +>m : Symbol(m, Decl(objectLiteralShorthandPropertiesWithModule.ts, 0, 0), Decl(objectLiteralShorthandPropertiesWithModule.ts, 4, 1)) + + export var x; +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModule.ts, 3, 14)) +} + +module m { +>m : Symbol(m, Decl(objectLiteralShorthandPropertiesWithModule.ts, 0, 0), Decl(objectLiteralShorthandPropertiesWithModule.ts, 4, 1)) + + var z = x; +>z : Symbol(z, Decl(objectLiteralShorthandPropertiesWithModule.ts, 7, 7)) +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModule.ts, 3, 14)) + + var y = { +>y : Symbol(y, Decl(objectLiteralShorthandPropertiesWithModule.ts, 8, 7)) + + a: x, +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesWithModule.ts, 8, 13)) +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModule.ts, 3, 14)) + + x +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModule.ts, 9, 13)) + + }; +} + diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.symbols b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.symbols new file mode 100644 index 00000000000..bcb69cc9a97 --- /dev/null +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesWithModuleES6.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModuleES6.ts === + +module m { +>m : Symbol(m, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 0, 0), Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 3, 1)) + + export var x; +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 2, 14)) +} + +module m { +>m : Symbol(m, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 0, 0), Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 3, 1)) + + var z = x; +>z : Symbol(z, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 6, 7)) +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 2, 14)) + + var y = { +>y : Symbol(y, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 7, 7)) + + a: x, +>a : Symbol(a, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 7, 13)) +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 2, 14)) + + x +>x : Symbol(x, Decl(objectLiteralShorthandPropertiesWithModuleES6.ts, 8, 13)) + + }; +} + diff --git a/tests/baselines/reference/objectLiteralWidened.symbols b/tests/baselines/reference/objectLiteralWidened.symbols new file mode 100644 index 00000000000..0bf077cd9d8 --- /dev/null +++ b/tests/baselines/reference/objectLiteralWidened.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/types/typeRelationships/widenedTypes/objectLiteralWidened.ts === +// object literal properties are widened to any + +var x = { +>x : Symbol(x, Decl(objectLiteralWidened.ts, 2, 3)) + + foo: null, +>foo : Symbol(foo, Decl(objectLiteralWidened.ts, 2, 9)) + + bar: undefined +>bar : Symbol(bar, Decl(objectLiteralWidened.ts, 3, 14)) +>undefined : Symbol(undefined) +} + +var y = { +>y : Symbol(y, Decl(objectLiteralWidened.ts, 7, 3)) + + foo: null, +>foo : Symbol(foo, Decl(objectLiteralWidened.ts, 7, 9)) + + bar: { +>bar : Symbol(bar, Decl(objectLiteralWidened.ts, 8, 14)) + + baz: null, +>baz : Symbol(baz, Decl(objectLiteralWidened.ts, 9, 10)) + + boo: undefined +>boo : Symbol(boo, Decl(objectLiteralWidened.ts, 10, 18)) +>undefined : Symbol(undefined) + } +} diff --git a/tests/baselines/reference/objectLiteralWidened.types b/tests/baselines/reference/objectLiteralWidened.types index 3f9163e77ef..9f47e47795d 100644 --- a/tests/baselines/reference/objectLiteralWidened.types +++ b/tests/baselines/reference/objectLiteralWidened.types @@ -7,6 +7,7 @@ var x = { foo: null, >foo : null +>null : null bar: undefined >bar : undefined @@ -19,6 +20,7 @@ var y = { foo: null, >foo : null +>null : null bar: { >bar : { baz: null; boo: undefined; } @@ -26,6 +28,7 @@ var y = { baz: null, >baz : null +>null : null boo: undefined >boo : undefined diff --git a/tests/baselines/reference/objectMembersOnTypes.symbols b/tests/baselines/reference/objectMembersOnTypes.symbols new file mode 100644 index 00000000000..12cc909dcd9 --- /dev/null +++ b/tests/baselines/reference/objectMembersOnTypes.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/objectMembersOnTypes.ts === +interface I {} +>I : Symbol(I, Decl(objectMembersOnTypes.ts, 0, 0)) + +class AAA implements I { } +>AAA : Symbol(AAA, Decl(objectMembersOnTypes.ts, 0, 14)) +>I : Symbol(I, Decl(objectMembersOnTypes.ts, 0, 0)) + +var x: number; +>x : Symbol(x, Decl(objectMembersOnTypes.ts, 2, 3)) + +x.toString(); +>x.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) +>x : Symbol(x, Decl(objectMembersOnTypes.ts, 2, 3)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) + +var i: I; +>i : Symbol(i, Decl(objectMembersOnTypes.ts, 4, 3)) +>I : Symbol(I, Decl(objectMembersOnTypes.ts, 0, 0)) + +i.toString(); // used to be an error +>i.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>i : Symbol(i, Decl(objectMembersOnTypes.ts, 4, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var c: AAA; +>c : Symbol(c, Decl(objectMembersOnTypes.ts, 6, 3)) +>AAA : Symbol(AAA, Decl(objectMembersOnTypes.ts, 0, 14)) + +c.toString(); // used to be an error +>c.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>c : Symbol(c, Decl(objectMembersOnTypes.ts, 6, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObject.symbols b/tests/baselines/reference/objectTypeHidingMembersOfObject.symbols new file mode 100644 index 00000000000..5c88d538fdb --- /dev/null +++ b/tests/baselines/reference/objectTypeHidingMembersOfObject.symbols @@ -0,0 +1,63 @@ +=== tests/cases/conformance/types/members/objectTypeHidingMembersOfObject.ts === +// all of these valueOf calls should return the type shown in the overriding signatures here + +class C { +>C : Symbol(C, Decl(objectTypeHidingMembersOfObject.ts, 0, 0)) + + valueOf() { } +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 2, 9)) +} + +var c: C; +>c : Symbol(c, Decl(objectTypeHidingMembersOfObject.ts, 6, 3)) +>C : Symbol(C, Decl(objectTypeHidingMembersOfObject.ts, 0, 0)) + +var r1: void = c.valueOf(); +>r1 : Symbol(r1, Decl(objectTypeHidingMembersOfObject.ts, 7, 3)) +>c.valueOf : Symbol(C.valueOf, Decl(objectTypeHidingMembersOfObject.ts, 2, 9)) +>c : Symbol(c, Decl(objectTypeHidingMembersOfObject.ts, 6, 3)) +>valueOf : Symbol(C.valueOf, Decl(objectTypeHidingMembersOfObject.ts, 2, 9)) + +interface I { +>I : Symbol(I, Decl(objectTypeHidingMembersOfObject.ts, 7, 27)) + + valueOf(): void; +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 9, 13)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeHidingMembersOfObject.ts, 13, 3)) +>I : Symbol(I, Decl(objectTypeHidingMembersOfObject.ts, 7, 27)) + +var r2: void = i.valueOf(); +>r2 : Symbol(r2, Decl(objectTypeHidingMembersOfObject.ts, 14, 3)) +>i.valueOf : Symbol(I.valueOf, Decl(objectTypeHidingMembersOfObject.ts, 9, 13)) +>i : Symbol(i, Decl(objectTypeHidingMembersOfObject.ts, 13, 3)) +>valueOf : Symbol(I.valueOf, Decl(objectTypeHidingMembersOfObject.ts, 9, 13)) + +var a = { +>a : Symbol(a, Decl(objectTypeHidingMembersOfObject.ts, 16, 3)) + + valueOf: () => { } +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 16, 9)) +} + +var r3: void = a.valueOf(); +>r3 : Symbol(r3, Decl(objectTypeHidingMembersOfObject.ts, 20, 3)) +>a.valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 16, 9)) +>a : Symbol(a, Decl(objectTypeHidingMembersOfObject.ts, 16, 3)) +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 16, 9)) + +var b: { +>b : Symbol(b, Decl(objectTypeHidingMembersOfObject.ts, 22, 3)) + + valueOf(): void; +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 22, 8)) +} + +var r4: void = b.valueOf(); +>r4 : Symbol(r4, Decl(objectTypeHidingMembersOfObject.ts, 26, 3)) +>b.valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 22, 8)) +>b : Symbol(b, Decl(objectTypeHidingMembersOfObject.ts, 22, 3)) +>valueOf : Symbol(valueOf, Decl(objectTypeHidingMembersOfObject.ts, 22, 8)) + diff --git a/tests/baselines/reference/objectTypeLiteralSyntax.symbols b/tests/baselines/reference/objectTypeLiteralSyntax.symbols new file mode 100644 index 00000000000..da49cb22fd0 --- /dev/null +++ b/tests/baselines/reference/objectTypeLiteralSyntax.symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/types/objectTypeLiteral/objectTypeLiteralSyntax.ts === +var x: { +>x : Symbol(x, Decl(objectTypeLiteralSyntax.ts, 0, 3)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypeLiteralSyntax.ts, 0, 8)) + + bar: string; +>bar : Symbol(bar, Decl(objectTypeLiteralSyntax.ts, 1, 16)) +} + +var y: { +>y : Symbol(y, Decl(objectTypeLiteralSyntax.ts, 5, 3)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypeLiteralSyntax.ts, 5, 8)) + + bar: string +>bar : Symbol(bar, Decl(objectTypeLiteralSyntax.ts, 6, 16)) +} diff --git a/tests/baselines/reference/objectTypePropertyAccess.symbols b/tests/baselines/reference/objectTypePropertyAccess.symbols new file mode 100644 index 00000000000..519bf589260 --- /dev/null +++ b/tests/baselines/reference/objectTypePropertyAccess.symbols @@ -0,0 +1,96 @@ +=== tests/cases/conformance/types/members/objectTypePropertyAccess.ts === +// Index notation should resolve to the type of a declared property with that same name +class C { +>C : Symbol(C, Decl(objectTypePropertyAccess.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypePropertyAccess.ts, 1, 9)) +} + +var c: C; +>c : Symbol(c, Decl(objectTypePropertyAccess.ts, 5, 3)) +>C : Symbol(C, Decl(objectTypePropertyAccess.ts, 0, 0)) + +var r1 = c.toString(); +>r1 : Symbol(r1, Decl(objectTypePropertyAccess.ts, 6, 3)) +>c.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>c : Symbol(c, Decl(objectTypePropertyAccess.ts, 5, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r2 = c['toString'](); +>r2 : Symbol(r2, Decl(objectTypePropertyAccess.ts, 7, 3)) +>c : Symbol(c, Decl(objectTypePropertyAccess.ts, 5, 3)) +>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r3 = c.foo; +>r3 : Symbol(r3, Decl(objectTypePropertyAccess.ts, 8, 3)) +>c.foo : Symbol(C.foo, Decl(objectTypePropertyAccess.ts, 1, 9)) +>c : Symbol(c, Decl(objectTypePropertyAccess.ts, 5, 3)) +>foo : Symbol(C.foo, Decl(objectTypePropertyAccess.ts, 1, 9)) + +var r4 = c['foo']; +>r4 : Symbol(r4, Decl(objectTypePropertyAccess.ts, 9, 3), Decl(objectTypePropertyAccess.ts, 15, 3)) +>c : Symbol(c, Decl(objectTypePropertyAccess.ts, 5, 3)) +>'foo' : Symbol(C.foo, Decl(objectTypePropertyAccess.ts, 1, 9)) + +interface I { +>I : Symbol(I, Decl(objectTypePropertyAccess.ts, 9, 18)) + + bar: string; +>bar : Symbol(bar, Decl(objectTypePropertyAccess.ts, 11, 13)) +} +var i: I; +>i : Symbol(i, Decl(objectTypePropertyAccess.ts, 14, 3)) +>I : Symbol(I, Decl(objectTypePropertyAccess.ts, 9, 18)) + +var r4 = i.toString(); +>r4 : Symbol(r4, Decl(objectTypePropertyAccess.ts, 9, 3), Decl(objectTypePropertyAccess.ts, 15, 3)) +>i.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>i : Symbol(i, Decl(objectTypePropertyAccess.ts, 14, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r5 = i['toString'](); +>r5 : Symbol(r5, Decl(objectTypePropertyAccess.ts, 16, 3)) +>i : Symbol(i, Decl(objectTypePropertyAccess.ts, 14, 3)) +>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r6 = i.bar; +>r6 : Symbol(r6, Decl(objectTypePropertyAccess.ts, 17, 3)) +>i.bar : Symbol(I.bar, Decl(objectTypePropertyAccess.ts, 11, 13)) +>i : Symbol(i, Decl(objectTypePropertyAccess.ts, 14, 3)) +>bar : Symbol(I.bar, Decl(objectTypePropertyAccess.ts, 11, 13)) + +var r7 = i['bar']; +>r7 : Symbol(r7, Decl(objectTypePropertyAccess.ts, 18, 3)) +>i : Symbol(i, Decl(objectTypePropertyAccess.ts, 14, 3)) +>'bar' : Symbol(I.bar, Decl(objectTypePropertyAccess.ts, 11, 13)) + +var a = { +>a : Symbol(a, Decl(objectTypePropertyAccess.ts, 20, 3)) + + foo: '' +>foo : Symbol(foo, Decl(objectTypePropertyAccess.ts, 20, 9)) +} + +var r8 = a.toString(); +>r8 : Symbol(r8, Decl(objectTypePropertyAccess.ts, 24, 3)) +>a.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) +>a : Symbol(a, Decl(objectTypePropertyAccess.ts, 20, 3)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r9 = a['toString'](); +>r9 : Symbol(r9, Decl(objectTypePropertyAccess.ts, 25, 3)) +>a : Symbol(a, Decl(objectTypePropertyAccess.ts, 20, 3)) +>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26)) + +var r10 = a.foo; +>r10 : Symbol(r10, Decl(objectTypePropertyAccess.ts, 26, 3)) +>a.foo : Symbol(foo, Decl(objectTypePropertyAccess.ts, 20, 9)) +>a : Symbol(a, Decl(objectTypePropertyAccess.ts, 20, 3)) +>foo : Symbol(foo, Decl(objectTypePropertyAccess.ts, 20, 9)) + +var r11 = a['foo']; +>r11 : Symbol(r11, Decl(objectTypePropertyAccess.ts, 27, 3)) +>a : Symbol(a, Decl(objectTypePropertyAccess.ts, 20, 3)) +>'foo' : Symbol(foo, Decl(objectTypePropertyAccess.ts, 20, 9)) + diff --git a/tests/baselines/reference/objectTypePropertyAccess.types b/tests/baselines/reference/objectTypePropertyAccess.types index 56e45f1bae0..5fc03bd86ed 100644 --- a/tests/baselines/reference/objectTypePropertyAccess.types +++ b/tests/baselines/reference/objectTypePropertyAccess.types @@ -23,6 +23,7 @@ var r2 = c['toString'](); >c['toString']() : string >c['toString'] : () => string >c : C +>'toString' : string var r3 = c.foo; >r3 : string @@ -34,6 +35,7 @@ var r4 = c['foo']; >r4 : string >c['foo'] : string >c : C +>'foo' : string interface I { >I : I @@ -57,6 +59,7 @@ var r5 = i['toString'](); >i['toString']() : string >i['toString'] : () => string >i : I +>'toString' : string var r6 = i.bar; >r6 : string @@ -68,6 +71,7 @@ var r7 = i['bar']; >r7 : string >i['bar'] : string >i : I +>'bar' : string var a = { >a : { foo: string; } @@ -75,6 +79,7 @@ var a = { foo: '' >foo : string +>'' : string } var r8 = a.toString(); @@ -89,6 +94,7 @@ var r9 = a['toString'](); >a['toString']() : string >a['toString'] : () => string >a : { foo: string; } +>'toString' : string var r10 = a.foo; >r10 : string @@ -100,4 +106,5 @@ var r11 = a['foo']; >r11 : string >a['foo'] : string >a : { foo: string; } +>'foo' : string diff --git a/tests/baselines/reference/objectTypeWithCallSignatureAppearsToBeFunctionType.symbols b/tests/baselines/reference/objectTypeWithCallSignatureAppearsToBeFunctionType.symbols new file mode 100644 index 00000000000..36127117f43 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureAppearsToBeFunctionType.symbols @@ -0,0 +1,44 @@ +=== tests/cases/conformance/types/members/objectTypeWithCallSignatureAppearsToBeFunctionType.ts === +// objects with call signatures should be permitted where function types are expected +// no errors expected below + +interface I { +>I : Symbol(I, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 0, 0)) + + (): void; +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 7, 3)) +>I : Symbol(I, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 0, 0)) + +var r2: void = i(); +>r2 : Symbol(r2, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 8, 3)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 7, 3)) + +var r2b: (x: any, y?: any) => any = i.apply; +>r2b : Symbol(r2b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 3)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 10)) +>y : Symbol(y, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 17)) +>i.apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 7, 3)) +>apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) + +var b: { +>b : Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3)) + + (): void; +} + +var r4: void = b(); +>r4 : Symbol(r4, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 15, 3)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3)) + +var rb4: (x: any, y?: any) => any = b.apply; +>rb4 : Symbol(rb4, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 3)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 10)) +>y : Symbol(y, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 17)) +>b.apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3)) +>apply : Symbol(Function.apply, Decl(lib.d.ts, 228, 20)) + diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.symbols b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.symbols new file mode 100644 index 00000000000..de1f2abc5aa --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.symbols @@ -0,0 +1,113 @@ +=== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts === +// object types with call signatures can override members of Function +// no errors expected below + +interface Function { +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 0, 0)) + + data: number; +>data : Symbol(data, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 3, 20)) + + [x: string]: Object; +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 5, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +interface I { +>I : Symbol(I, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 6, 1)) + + (): void; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 9, 13)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 10, 10)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 10, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 10, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 11, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 11, 25)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>I : Symbol(I, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 6, 1)) + +var r1: (a: any, b?: any) => void = i.apply; +>r1 : Symbol(r1, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 15, 3)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 15, 9)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 15, 16)) +>i.apply : Symbol(I.apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 9, 13)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>apply : Symbol(I.apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 9, 13)) + +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +>r1b : Symbol(r1b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 16, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 16, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 16, 26)) +>i.call : Symbol(I.call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 10, 33)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>call : Symbol(I.call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 10, 33)) + +var r1c = i.arguments; +>r1c : Symbol(r1c, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 17, 3)) +>i.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var r1d = i.data; +>r1d : Symbol(r1d, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) +>i.data : Symbol(Function.data, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 3, 20)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>data : Symbol(Function.data, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 3, 20)) + +var r1e = i['hm']; // should be Object +>r1e : Symbol(r1e, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 19, 3)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) + +var x: { +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) + + (): void; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 22, 13)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 23, 10)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 23, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 23, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 24, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 24, 25)) +} + +var r2: (a: any, b?: any) => void = x.apply; +>r2 : Symbol(r2, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 27, 3)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 27, 9)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 27, 16)) +>x.apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 22, 13)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 22, 13)) + +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +>r2b : Symbol(r2b, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 28, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 28, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 28, 26)) +>x.call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 23, 33)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 23, 33)) + +var r2c = x.arguments; +>r2c : Symbol(r2c, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 29, 3)) +>x.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var r2d = x.data; +>r2d : Symbol(r2d, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 30, 3)) +>x.data : Symbol(Function.data, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 3, 20)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) +>data : Symbol(Function.data, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 3, 20)) + +var r2e = x['hm']; // should be Object +>r2e : Symbol(r2e, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 31, 3)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts, 21, 3)) + diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types index 56635a8e399..93caca61bfa 100644 --- a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.types @@ -64,6 +64,7 @@ var r1e = i['hm']; // should be Object >r1e : any >i['hm'] : any >i : I +>'hm' : string var x: { >x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } @@ -112,4 +113,5 @@ var r2e = x['hm']; // should be Object >r2e : any >x['hm'] : any >x : { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } +>'hm' : string diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunction.symbols b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunction.symbols new file mode 100644 index 00000000000..0ddebe0e68c --- /dev/null +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfFunction.symbols @@ -0,0 +1,82 @@ +=== tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfFunction.ts === +// object types with call signatures can override members of Function +// no errors expected below + +interface I { +>I : Symbol(I, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 0, 0)) + + (): void; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 4, 13)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 5, 10)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 5, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 5, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 6, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 6, 25)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 9, 3)) +>I : Symbol(I, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 0, 0)) + +var r1: (a: any, b?: any) => void = i.apply; +>r1 : Symbol(r1, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 10, 3)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 10, 9)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 10, 16)) +>i.apply : Symbol(I.apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 4, 13)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 9, 3)) +>apply : Symbol(I.apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 4, 13)) + +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +>r1b : Symbol(r1b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 11, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 11, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 11, 26)) +>i.call : Symbol(I.call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 5, 33)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 9, 3)) +>call : Symbol(I.call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 5, 33)) + +var r1c = i.arguments; +>r1c : Symbol(r1c, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 12, 3)) +>i.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>i : Symbol(i, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 9, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var x: { +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 14, 3)) + + (): void; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 15, 13)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 16, 10)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 16, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 16, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 17, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 17, 25)) +} + +var r2: (a: any, b?: any) => void = x.apply; +>r2 : Symbol(r2, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 20, 3)) +>a : Symbol(a, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 20, 9)) +>b : Symbol(b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 20, 16)) +>x.apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 15, 13)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 14, 3)) +>apply : Symbol(apply, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 15, 13)) + +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +>r2b : Symbol(r2b, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 21, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 21, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 21, 26)) +>x.call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 16, 33)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 14, 3)) +>call : Symbol(call, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 16, 33)) + +var r2c = x.arguments; +>r2c : Symbol(r2c, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 22, 3)) +>x.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>x : Symbol(x, Decl(objectTypeWithCallSignatureHidingMembersOfFunction.ts, 14, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.symbols b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.symbols new file mode 100644 index 00000000000..57479c548ee --- /dev/null +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.symbols @@ -0,0 +1,110 @@ +=== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts === +interface Function { +>Function : Symbol(Function, Decl(lib.d.ts, 223, 38), Decl(lib.d.ts, 269, 11), Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 0)) + + data: number; +>data : Symbol(data, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 20)) + + [x: string]: Object; +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 2, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) +} + +interface I { +>I : Symbol(I, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 3, 1)) + + new(): number; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 6, 18)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 7, 10)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 7, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 7, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 8, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 8, 25)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) +>I : Symbol(I, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 3, 1)) + +var r1: (a: any, b?: any) => void = i.apply; +>r1 : Symbol(r1, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 12, 3)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 12, 9)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 12, 16)) +>i.apply : Symbol(I.apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 6, 18)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) +>apply : Symbol(I.apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 6, 18)) + +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +>r1b : Symbol(r1b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 13, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 13, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 13, 26)) +>i.call : Symbol(I.call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 7, 33)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) +>call : Symbol(I.call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 7, 33)) + +var r1c = i.arguments; +>r1c : Symbol(r1c, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 14, 3)) +>i.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var r1d = i.data; +>r1d : Symbol(r1d, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 15, 3)) +>i.data : Symbol(Function.data, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 20)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) +>data : Symbol(Function.data, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 20)) + +var r1e = i['hm']; // should be Object +>r1e : Symbol(r1e, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 16, 3)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 11, 3)) + +var x: { +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) + + new(): number; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 19, 18)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 20, 10)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 20, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 20, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 21, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 21, 25)) +} + +var r2: (a: any, b?: any) => void = x.apply; +>r2 : Symbol(r2, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 24, 3)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 24, 9)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 24, 16)) +>x.apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 19, 18)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 19, 18)) + +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +>r2b : Symbol(r2b, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 25, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 25, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 25, 26)) +>x.call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 20, 33)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 20, 33)) + +var r2c = x.arguments; +>r2c : Symbol(r2c, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 26, 3)) +>x.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var r2d = x.data; +>r2d : Symbol(r2d, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 27, 3)) +>x.data : Symbol(Function.data, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 20)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) +>data : Symbol(Function.data, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 0, 20)) + +var r2e = x['hm']; // should be Object +>r2e : Symbol(r2e, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 28, 3)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts, 18, 3)) + diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types index b7d8294dd96..427b700fb59 100644 --- a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.types @@ -61,6 +61,7 @@ var r1e = i['hm']; // should be Object >r1e : any >i['hm'] : any >i : I +>'hm' : string var x: { >x : { new (): number; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } @@ -109,4 +110,5 @@ var r2e = x['hm']; // should be Object >r2e : any >x['hm'] : any >x : { new (): number; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } +>'hm' : string diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunction.symbols b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunction.symbols new file mode 100644 index 00000000000..8478fd1d37c --- /dev/null +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfFunction.symbols @@ -0,0 +1,79 @@ +=== tests/cases/conformance/types/members/objectTypeWithConstructSignatureHidingMembersOfFunction.ts === +interface I { +>I : Symbol(I, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 0, 0)) + + new(): number; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 1, 18)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 2, 10)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 2, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 2, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 3, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 3, 25)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 6, 3)) +>I : Symbol(I, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 0, 0)) + +var r1: (a: any, b?: any) => void = i.apply; +>r1 : Symbol(r1, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 7, 3)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 7, 9)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 7, 16)) +>i.apply : Symbol(I.apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 1, 18)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 6, 3)) +>apply : Symbol(I.apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 1, 18)) + +var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; +>r1b : Symbol(r1b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 8, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 8, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 8, 26)) +>i.call : Symbol(I.call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 2, 33)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 6, 3)) +>call : Symbol(I.call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 2, 33)) + +var r1c = i.arguments; +>r1c : Symbol(r1c, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 9, 3)) +>i.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>i : Symbol(i, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 6, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + +var x: { +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 11, 3)) + + new(): number; + apply(a: any, b?: any): void; +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 12, 18)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 13, 10)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 13, 17)) + + call(thisArg: number, ...argArray: number[]): any; +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 13, 33)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 14, 9)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 14, 25)) +} + +var r2: (a: any, b?: any) => void = x.apply; +>r2 : Symbol(r2, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 17, 3)) +>a : Symbol(a, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 17, 9)) +>b : Symbol(b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 17, 16)) +>x.apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 12, 18)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 11, 3)) +>apply : Symbol(apply, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 12, 18)) + +var r2b: (thisArg: number, ...argArray: number[]) => void = x.call; +>r2b : Symbol(r2b, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 18, 3)) +>thisArg : Symbol(thisArg, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 18, 10)) +>argArray : Symbol(argArray, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 18, 26)) +>x.call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 13, 33)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 11, 3)) +>call : Symbol(call, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 13, 33)) + +var r2c = x.arguments; +>r2c : Symbol(r2c, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 19, 3)) +>x.arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) +>x : Symbol(x, Decl(objectTypeWithConstructSignatureHidingMembersOfFunction.ts, 11, 3)) +>arguments : Symbol(Function.arguments, Decl(lib.d.ts, 252, 19)) + diff --git a/tests/baselines/reference/objectTypeWithNumericProperty.symbols b/tests/baselines/reference/objectTypeWithNumericProperty.symbols new file mode 100644 index 00000000000..20e54fe1c64 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithNumericProperty.symbols @@ -0,0 +1,119 @@ +=== tests/cases/conformance/types/members/objectTypeWithNumericProperty.ts === +// no errors here + +class C { +>C : Symbol(C, Decl(objectTypeWithNumericProperty.ts, 0, 0)) + + 1: number; + 1.1: string; +} + +var c: C; +>c : Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3)) +>C : Symbol(C, Decl(objectTypeWithNumericProperty.ts, 0, 0)) + +var r1 = c[1]; +>r1 : Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3)) +>c : Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3)) +>1 : Symbol(C.1, Decl(objectTypeWithNumericProperty.ts, 2, 9)) + +var r2 = c[1.1]; +>r2 : Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3)) +>c : Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3)) +>1.1 : Symbol(C.1.1, Decl(objectTypeWithNumericProperty.ts, 3, 14)) + +var r3 = c['1']; +>r3 : Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3)) +>c : Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3)) +>'1' : Symbol(C.1, Decl(objectTypeWithNumericProperty.ts, 2, 9)) + +var r4 = c['1.1']; +>r4 : Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3)) +>c : Symbol(c, Decl(objectTypeWithNumericProperty.ts, 7, 3)) +>'1.1' : Symbol(C.1.1, Decl(objectTypeWithNumericProperty.ts, 3, 14)) + +interface I { +>I : Symbol(I, Decl(objectTypeWithNumericProperty.ts, 11, 18)) + + 1: number; + 1.1: string; +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3)) +>I : Symbol(I, Decl(objectTypeWithNumericProperty.ts, 11, 18)) + +var r1 = i[1]; +>r1 : Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3)) +>i : Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3)) +>1 : Symbol(I.1, Decl(objectTypeWithNumericProperty.ts, 13, 13)) + +var r2 = i[1.1]; +>r2 : Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3)) +>i : Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3)) +>1.1 : Symbol(I.1.1, Decl(objectTypeWithNumericProperty.ts, 14, 14)) + +var r3 = i['1']; +>r3 : Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3)) +>i : Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3)) +>'1' : Symbol(I.1, Decl(objectTypeWithNumericProperty.ts, 13, 13)) + +var r4 = i['1.1']; +>r4 : Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3)) +>i : Symbol(i, Decl(objectTypeWithNumericProperty.ts, 18, 3)) +>'1.1' : Symbol(I.1.1, Decl(objectTypeWithNumericProperty.ts, 14, 14)) + +var a: { +>a : Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3)) + + 1: number; + 1.1: string; +} + +var r1 = a[1]; +>r1 : Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3)) +>a : Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3)) +>1 : Symbol(1, Decl(objectTypeWithNumericProperty.ts, 24, 8)) + +var r2 = a[1.1]; +>r2 : Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3)) +>a : Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3)) +>1.1 : Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 25, 14)) + +var r3 = a['1']; +>r3 : Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3)) +>a : Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3)) +>'1' : Symbol(1, Decl(objectTypeWithNumericProperty.ts, 24, 8)) + +var r4 = a['1.1']; +>r4 : Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3)) +>a : Symbol(a, Decl(objectTypeWithNumericProperty.ts, 24, 3)) +>'1.1' : Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 25, 14)) + +var b = { +>b : Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3)) + + 1: 1, + 1.1: "" +} + +var r1 = b[1]; +>r1 : Symbol(r1, Decl(objectTypeWithNumericProperty.ts, 8, 3), Decl(objectTypeWithNumericProperty.ts, 19, 3), Decl(objectTypeWithNumericProperty.ts, 29, 3), Decl(objectTypeWithNumericProperty.ts, 39, 3)) +>b : Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3)) +>1 : Symbol(1, Decl(objectTypeWithNumericProperty.ts, 34, 9)) + +var r2 = b[1.1]; +>r2 : Symbol(r2, Decl(objectTypeWithNumericProperty.ts, 9, 3), Decl(objectTypeWithNumericProperty.ts, 20, 3), Decl(objectTypeWithNumericProperty.ts, 30, 3), Decl(objectTypeWithNumericProperty.ts, 40, 3)) +>b : Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3)) +>1.1 : Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 35, 9)) + +var r3 = b['1']; +>r3 : Symbol(r3, Decl(objectTypeWithNumericProperty.ts, 10, 3), Decl(objectTypeWithNumericProperty.ts, 21, 3), Decl(objectTypeWithNumericProperty.ts, 31, 3), Decl(objectTypeWithNumericProperty.ts, 41, 3)) +>b : Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3)) +>'1' : Symbol(1, Decl(objectTypeWithNumericProperty.ts, 34, 9)) + +var r4 = b['1.1']; +>r4 : Symbol(r4, Decl(objectTypeWithNumericProperty.ts, 11, 3), Decl(objectTypeWithNumericProperty.ts, 22, 3), Decl(objectTypeWithNumericProperty.ts, 32, 3), Decl(objectTypeWithNumericProperty.ts, 42, 3)) +>b : Symbol(b, Decl(objectTypeWithNumericProperty.ts, 34, 3)) +>'1.1' : Symbol(1.1, Decl(objectTypeWithNumericProperty.ts, 35, 9)) + diff --git a/tests/baselines/reference/objectTypeWithNumericProperty.types b/tests/baselines/reference/objectTypeWithNumericProperty.types index 7c507cd4f64..32efd3398fb 100644 --- a/tests/baselines/reference/objectTypeWithNumericProperty.types +++ b/tests/baselines/reference/objectTypeWithNumericProperty.types @@ -16,21 +16,25 @@ var r1 = c[1]; >r1 : number >c[1] : number >c : C +>1 : number var r2 = c[1.1]; >r2 : string >c[1.1] : string >c : C +>1.1 : number var r3 = c['1']; >r3 : number >c['1'] : number >c : C +>'1' : string var r4 = c['1.1']; >r4 : string >c['1.1'] : string >c : C +>'1.1' : string interface I { >I : I @@ -47,21 +51,25 @@ var r1 = i[1]; >r1 : number >i[1] : number >i : I +>1 : number var r2 = i[1.1]; >r2 : string >i[1.1] : string >i : I +>1.1 : number var r3 = i['1']; >r3 : number >i['1'] : number >i : I +>'1' : string var r4 = i['1.1']; >r4 : string >i['1.1'] : string >i : I +>'1.1' : string var a: { >a : { 1: number; 1.1: string; } @@ -74,47 +82,58 @@ var r1 = a[1]; >r1 : number >a[1] : number >a : { 1: number; 1.1: string; } +>1 : number var r2 = a[1.1]; >r2 : string >a[1.1] : string >a : { 1: number; 1.1: string; } +>1.1 : number var r3 = a['1']; >r3 : number >a['1'] : number >a : { 1: number; 1.1: string; } +>'1' : string var r4 = a['1.1']; >r4 : string >a['1.1'] : string >a : { 1: number; 1.1: string; } +>'1.1' : string var b = { >b : { 1: number; 1.1: string; } >{ 1: 1, 1.1: ""} : { 1: number; 1.1: string; } 1: 1, +>1 : number + 1.1: "" +>"" : string } var r1 = b[1]; >r1 : number >b[1] : number >b : { 1: number; 1.1: string; } +>1 : number var r2 = b[1.1]; >r2 : string >b[1.1] : string >b : { 1: number; 1.1: string; } +>1.1 : number var r3 = b['1']; >r3 : number >b['1'] : number >b : { 1: number; 1.1: string; } +>'1' : string var r4 = b['1.1']; >r4 : string >b['1.1'] : string >b : { 1: number; 1.1: string; } +>'1.1' : string diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols new file mode 100644 index 00000000000..c95105a8626 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols @@ -0,0 +1,421 @@ +=== tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts === + +// string named numeric properties are legal and distinct when indexed by string values +// indexed numerically the value is converted to a number +// no errors expected below + +class C { +>C : Symbol(C, Decl(objectTypeWithStringNamedNumericProperty.ts, 0, 0)) + + "0.1": void; + ".1": Object; +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + "-1.0": RegExp; +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + + "-1": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var c: C; +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>C : Symbol(C, Decl(objectTypeWithStringNamedNumericProperty.ts, 0, 0)) + +var r1 = c['0.1']; +>r1 : Symbol(r1, Decl(objectTypeWithStringNamedNumericProperty.ts, 17, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 48, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 78, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 108, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'0.1' : Symbol(C."0.1", Decl(objectTypeWithStringNamedNumericProperty.ts, 5, 9)) + +var r2 = c['.1']; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedNumericProperty.ts, 18, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 49, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 79, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 109, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'.1' : Symbol(C.".1", Decl(objectTypeWithStringNamedNumericProperty.ts, 6, 16)) + +var r3 = c['1']; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'1' : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r3 = c[1]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r4 = c['1.']; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedNumericProperty.ts, 21, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 52, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 82, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 112, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'1.' : Symbol(C."1.", Decl(objectTypeWithStringNamedNumericProperty.ts, 8, 16)) + +var r3 = c[1.]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1. : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r5 = c['1..']; +>r5 : Symbol(r5, Decl(objectTypeWithStringNamedNumericProperty.ts, 23, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 54, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 84, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 114, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'1..' : Symbol(C."1..", Decl(objectTypeWithStringNamedNumericProperty.ts, 9, 17)) + +var r6 = c['1.0']; +>r6 : Symbol(r6, Decl(objectTypeWithStringNamedNumericProperty.ts, 24, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 55, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 85, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 115, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>'1.0' : Symbol(C."1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 10, 19)) + +var r3 = c[1.0]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1.0 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +// BUG 823822 +var r7 = i[-1]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r7 = i[-1.0]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r8 = i["-1.0"]; +>r8 : Symbol(r8, Decl(objectTypeWithStringNamedNumericProperty.ts, 29, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 60, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 90, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 120, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1.0" : Symbol(I."-1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 42, 16)) + +var r9 = i["-1"]; +>r9 : Symbol(r9, Decl(objectTypeWithStringNamedNumericProperty.ts, 30, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 61, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 91, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 121, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1" : Symbol(I."-1", Decl(objectTypeWithStringNamedNumericProperty.ts, 43, 19)) + +var r10 = i[0x1] +>r10 : Symbol(r10, Decl(objectTypeWithStringNamedNumericProperty.ts, 31, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 62, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 92, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 122, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>0x1 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r11 = i[-0x1] +>r11 : Symbol(r11, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r12 = i[01] +>r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>01 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r13 = i[-01] +>r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 65, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 95, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 125, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +interface I { +>I : Symbol(I, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 16)) + + "0.1": void; + ".1": Object; +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + "-1.0": RegExp; +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + + "-1": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>I : Symbol(I, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 16)) + +var r1 = i['0.1']; +>r1 : Symbol(r1, Decl(objectTypeWithStringNamedNumericProperty.ts, 17, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 48, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 78, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 108, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'0.1' : Symbol(I."0.1", Decl(objectTypeWithStringNamedNumericProperty.ts, 36, 13)) + +var r2 = i['.1']; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedNumericProperty.ts, 18, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 49, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 79, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 109, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'.1' : Symbol(I.".1", Decl(objectTypeWithStringNamedNumericProperty.ts, 37, 16)) + +var r3 = i['1']; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'1' : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r3 = c[1]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r4 = i['1.']; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedNumericProperty.ts, 21, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 52, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 82, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 112, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'1.' : Symbol(I."1.", Decl(objectTypeWithStringNamedNumericProperty.ts, 39, 16)) + +var r3 = c[1.]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1. : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r5 = i['1..']; +>r5 : Symbol(r5, Decl(objectTypeWithStringNamedNumericProperty.ts, 23, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 54, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 84, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 114, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'1..' : Symbol(I."1..", Decl(objectTypeWithStringNamedNumericProperty.ts, 40, 17)) + +var r6 = i['1.0']; +>r6 : Symbol(r6, Decl(objectTypeWithStringNamedNumericProperty.ts, 24, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 55, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 85, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 115, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>'1.0' : Symbol(I."1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 41, 19)) + +var r3 = c[1.0]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1.0 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +// BUG 823822 +var r7 = i[-1]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r7 = i[-1.0]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r8 = i["-1.0"]; +>r8 : Symbol(r8, Decl(objectTypeWithStringNamedNumericProperty.ts, 29, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 60, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 90, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 120, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1.0" : Symbol(I."-1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 42, 16)) + +var r9 = i["-1"]; +>r9 : Symbol(r9, Decl(objectTypeWithStringNamedNumericProperty.ts, 30, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 61, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 91, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 121, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1" : Symbol(I."-1", Decl(objectTypeWithStringNamedNumericProperty.ts, 43, 19)) + +var r10 = i[0x1] +>r10 : Symbol(r10, Decl(objectTypeWithStringNamedNumericProperty.ts, 31, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 62, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 92, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 122, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>0x1 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r11 = i[-0x1] +>r11 : Symbol(r11, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r12 = i[01] +>r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>01 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r13 = i[-01] +>r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 65, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 95, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 125, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var a: { +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) + + "0.1": void; + ".1": Object; +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + "1": number; + "1.": string; + "1..": boolean; + "1.0": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + "-1.0": RegExp; +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + + "-1": Date; +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var r1 = a['0.1']; +>r1 : Symbol(r1, Decl(objectTypeWithStringNamedNumericProperty.ts, 17, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 48, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 78, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 108, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'0.1' : Symbol("0.1", Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 8)) + +var r2 = a['.1']; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedNumericProperty.ts, 18, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 49, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 79, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 109, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'.1' : Symbol(".1", Decl(objectTypeWithStringNamedNumericProperty.ts, 68, 16)) + +var r3 = a['1']; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'1' : Symbol("1", Decl(objectTypeWithStringNamedNumericProperty.ts, 69, 17)) + +var r3 = c[1]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r4 = a['1.']; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedNumericProperty.ts, 21, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 52, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 82, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 112, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'1.' : Symbol("1.", Decl(objectTypeWithStringNamedNumericProperty.ts, 70, 16)) + +var r3 = c[1.]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1. : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r5 = a['1..']; +>r5 : Symbol(r5, Decl(objectTypeWithStringNamedNumericProperty.ts, 23, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 54, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 84, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 114, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'1..' : Symbol("1..", Decl(objectTypeWithStringNamedNumericProperty.ts, 71, 17)) + +var r6 = a['1.0']; +>r6 : Symbol(r6, Decl(objectTypeWithStringNamedNumericProperty.ts, 24, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 55, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 85, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 115, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedNumericProperty.ts, 67, 3)) +>'1.0' : Symbol("1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 72, 19)) + +var r3 = c[1.0]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1.0 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +// BUG 823822 +var r7 = i[-1]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r7 = i[-1.0]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r8 = i["-1.0"]; +>r8 : Symbol(r8, Decl(objectTypeWithStringNamedNumericProperty.ts, 29, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 60, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 90, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 120, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1.0" : Symbol(I."-1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 42, 16)) + +var r9 = i["-1"]; +>r9 : Symbol(r9, Decl(objectTypeWithStringNamedNumericProperty.ts, 30, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 61, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 91, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 121, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1" : Symbol(I."-1", Decl(objectTypeWithStringNamedNumericProperty.ts, 43, 19)) + +var r10 = i[0x1] +>r10 : Symbol(r10, Decl(objectTypeWithStringNamedNumericProperty.ts, 31, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 62, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 92, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 122, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>0x1 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r11 = i[-0x1] +>r11 : Symbol(r11, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r12 = i[01] +>r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>01 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r13 = i[-01] +>r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 65, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 95, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 125, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var b = { +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) + + "0.1": null, + ".1": new Object(), +>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11)) + + "1": 1, + "1.": "", + "1..": true, + "1.0": new Date(), +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + "-1.0": /123/, + "-1": Date +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +}; + +var r1 = b['0.1']; +>r1 : Symbol(r1, Decl(objectTypeWithStringNamedNumericProperty.ts, 17, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 48, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 78, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 108, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'0.1' : Symbol("0.1", Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 9)) + +var r2 = b['.1']; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedNumericProperty.ts, 18, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 49, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 79, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 109, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'.1' : Symbol(".1", Decl(objectTypeWithStringNamedNumericProperty.ts, 98, 22)) + +var r3 = b['1']; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'1' : Symbol("1", Decl(objectTypeWithStringNamedNumericProperty.ts, 99, 23)) + +var r3 = c[1]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r4 = b['1.']; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedNumericProperty.ts, 21, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 52, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 82, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 112, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'1.' : Symbol("1.", Decl(objectTypeWithStringNamedNumericProperty.ts, 100, 11)) + +var r3 = c[1.]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1. : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +var r5 = b['1..']; +>r5 : Symbol(r5, Decl(objectTypeWithStringNamedNumericProperty.ts, 23, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 54, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 84, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 114, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'1..' : Symbol("1..", Decl(objectTypeWithStringNamedNumericProperty.ts, 101, 13)) + +var r6 = b['1.0']; +>r6 : Symbol(r6, Decl(objectTypeWithStringNamedNumericProperty.ts, 24, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 55, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 85, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 115, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedNumericProperty.ts, 97, 3)) +>'1.0' : Symbol("1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 102, 16)) + +var r3 = c[1.0]; // same as indexing by 1 when done numerically +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedNumericProperty.ts, 19, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 20, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 22, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 25, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 50, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 51, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 53, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 56, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 80, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 81, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 83, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 86, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 110, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 111, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 113, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 116, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedNumericProperty.ts, 16, 3)) +>1.0 : Symbol(C."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 7, 17)) + +// BUG 823822 +var r7 = i[-1]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r7 = i[-1.0]; +>r7 : Symbol(r7, Decl(objectTypeWithStringNamedNumericProperty.ts, 27, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 28, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 58, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 59, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 88, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 89, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 118, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 119, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r8 = i["-1.0"]; +>r8 : Symbol(r8, Decl(objectTypeWithStringNamedNumericProperty.ts, 29, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 60, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 90, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 120, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1.0" : Symbol(I."-1.0", Decl(objectTypeWithStringNamedNumericProperty.ts, 42, 16)) + +var r9 = i["-1"]; +>r9 : Symbol(r9, Decl(objectTypeWithStringNamedNumericProperty.ts, 30, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 61, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 91, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 121, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>"-1" : Symbol(I."-1", Decl(objectTypeWithStringNamedNumericProperty.ts, 43, 19)) + +var r10 = i[0x1] +>r10 : Symbol(r10, Decl(objectTypeWithStringNamedNumericProperty.ts, 31, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 62, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 92, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 122, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>0x1 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r11 = i[-0x1] +>r11 : Symbol(r11, Decl(objectTypeWithStringNamedNumericProperty.ts, 32, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 63, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 93, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 123, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + +var r12 = i[01] +>r12 : Symbol(r12, Decl(objectTypeWithStringNamedNumericProperty.ts, 33, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 64, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 94, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 124, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) +>01 : Symbol(I."1", Decl(objectTypeWithStringNamedNumericProperty.ts, 38, 17)) + +var r13 = i[-01] +>r13 : Symbol(r13, Decl(objectTypeWithStringNamedNumericProperty.ts, 34, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 65, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 95, 3), Decl(objectTypeWithStringNamedNumericProperty.ts, 125, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedNumericProperty.ts, 47, 3)) + diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types index 74b5550fecb..490f3101751 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types @@ -32,46 +32,55 @@ var r1 = c['0.1']; >r1 : void >c['0.1'] : void >c : C +>'0.1' : string var r2 = c['.1']; >r2 : Object >c['.1'] : Object >c : C +>'.1' : string var r3 = c['1']; >r3 : number >c['1'] : number >c : C +>'1' : string var r3 = c[1]; >r3 : number >c[1] : number >c : C +>1 : number var r4 = c['1.']; >r4 : string >c['1.'] : string >c : C +>'1.' : string var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C +>1. : number var r5 = c['1..']; >r5 : boolean >c['1..'] : boolean >c : C +>'1..' : string var r6 = c['1.0']; >r6 : Date >c['1.0'] : Date >c : C +>'1.0' : string var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C +>1.0 : number // BUG 823822 var r7 = i[-1]; @@ -79,44 +88,52 @@ var r7 = i[-1]; >i[-1] : any >i : I >-1 : number +>1 : number var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I >-1.0 : number +>1.0 : number var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I +>"-1.0" : string var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I +>"-1" : string var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I +>0x1 : number var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I >-0x1 : number +>0x1 : number var r12 = i[01] >r12 : number >i[01] : number >i : I +>01 : number var r13 = i[-01] >r13 : any >i[-01] : any >i : I >-01 : number +>01 : number interface I { >I : I @@ -146,46 +163,55 @@ var r1 = i['0.1']; >r1 : void >i['0.1'] : void >i : I +>'0.1' : string var r2 = i['.1']; >r2 : Object >i['.1'] : Object >i : I +>'.1' : string var r3 = i['1']; >r3 : number >i['1'] : number >i : I +>'1' : string var r3 = c[1]; >r3 : number >c[1] : number >c : C +>1 : number var r4 = i['1.']; >r4 : string >i['1.'] : string >i : I +>'1.' : string var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C +>1. : number var r5 = i['1..']; >r5 : boolean >i['1..'] : boolean >i : I +>'1..' : string var r6 = i['1.0']; >r6 : Date >i['1.0'] : Date >i : I +>'1.0' : string var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C +>1.0 : number // BUG 823822 var r7 = i[-1]; @@ -193,44 +219,52 @@ var r7 = i[-1]; >i[-1] : any >i : I >-1 : number +>1 : number var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I >-1.0 : number +>1.0 : number var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I +>"-1.0" : string var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I +>"-1" : string var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I +>0x1 : number var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I >-0x1 : number +>0x1 : number var r12 = i[01] >r12 : number >i[01] : number >i : I +>01 : number var r13 = i[-01] >r13 : any >i[-01] : any >i : I >-01 : number +>01 : number var a: { >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } @@ -256,46 +290,55 @@ var r1 = a['0.1']; >r1 : void >a['0.1'] : void >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'0.1' : string var r2 = a['.1']; >r2 : Object >a['.1'] : Object >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'.1' : string var r3 = a['1']; >r3 : number >a['1'] : number >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'1' : string var r3 = c[1]; >r3 : number >c[1] : number >c : C +>1 : number var r4 = a['1.']; >r4 : string >a['1.'] : string >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'1.' : string var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C +>1. : number var r5 = a['1..']; >r5 : boolean >a['1..'] : boolean >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'1..' : string var r6 = a['1.0']; >r6 : Date >a['1.0'] : Date >a : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": Date; } +>'1.0' : string var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C +>1.0 : number // BUG 823822 var r7 = i[-1]; @@ -303,44 +346,52 @@ var r7 = i[-1]; >i[-1] : any >i : I >-1 : number +>1 : number var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I >-1.0 : number +>1.0 : number var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I +>"-1.0" : string var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I +>"-1" : string var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I +>0x1 : number var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I >-0x1 : number +>0x1 : number var r12 = i[01] >r12 : number >i[01] : number >i : I +>01 : number var r13 = i[-01] >r13 : any >i[-01] : any >i : I >-01 : number +>01 : number var b = { >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } @@ -348,19 +399,28 @@ var b = { "0.1": null, >null : void +>null : null ".1": new Object(), >new Object() : Object >Object : ObjectConstructor "1": 1, +>1 : number + "1.": "", +>"" : string + "1..": true, +>true : boolean + "1.0": new Date(), >new Date() : Date >Date : DateConstructor "-1.0": /123/, +>/123/ : RegExp + "-1": Date >Date : DateConstructor @@ -370,46 +430,55 @@ var r1 = b['0.1']; >r1 : void >b['0.1'] : void >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'0.1' : string var r2 = b['.1']; >r2 : Object >b['.1'] : Object >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'.1' : string var r3 = b['1']; >r3 : number >b['1'] : number >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'1' : string var r3 = c[1]; >r3 : number >c[1] : number >c : C +>1 : number var r4 = b['1.']; >r4 : string >b['1.'] : string >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'1.' : string var r3 = c[1.]; // same as indexing by 1 when done numerically >r3 : number >c[1.] : number >c : C +>1. : number var r5 = b['1..']; >r5 : boolean >b['1..'] : boolean >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'1..' : string var r6 = b['1.0']; >r6 : Date >b['1.0'] : Date >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": DateConstructor; } +>'1.0' : string var r3 = c[1.0]; // same as indexing by 1 when done numerically >r3 : number >c[1.0] : number >c : C +>1.0 : number // BUG 823822 var r7 = i[-1]; @@ -417,42 +486,50 @@ var r7 = i[-1]; >i[-1] : any >i : I >-1 : number +>1 : number var r7 = i[-1.0]; >r7 : any >i[-1.0] : any >i : I >-1.0 : number +>1.0 : number var r8 = i["-1.0"]; >r8 : RegExp >i["-1.0"] : RegExp >i : I +>"-1.0" : string var r9 = i["-1"]; >r9 : Date >i["-1"] : Date >i : I +>"-1" : string var r10 = i[0x1] >r10 : number >i[0x1] : number >i : I +>0x1 : number var r11 = i[-0x1] >r11 : any >i[-0x1] : any >i : I >-0x1 : number +>0x1 : number var r12 = i[01] >r12 : number >i[01] : number >i : I +>01 : number var r13 = i[-01] >r13 : any >i[-01] : any >i : I >-01 : number +>01 : number diff --git a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.symbols b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.symbols new file mode 100644 index 00000000000..aa76e7e92c8 --- /dev/null +++ b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.symbols @@ -0,0 +1,124 @@ +=== tests/cases/conformance/types/members/objectTypeWithStringNamedPropertyOfIllegalCharacters.ts === +class C { +>C : Symbol(C, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 0, 0)) + + " ": number; + "a b": string; + "~!@#$%^&*()_+{}|:'<>?\/.,`": number; + "a\a": number; + static "a ": number +} + +var c: C; +>c : Symbol(c, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 8, 3)) +>C : Symbol(C, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 0, 0)) + +var r = c[" "]; +>r : Symbol(r, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 9, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 22, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 35, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 47, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 8, 3)) +>" " : Symbol(C." ", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 0, 9)) + +var r2 = c[" "]; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 10, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 23, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 36, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 48, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 8, 3)) + +var r3 = c["a b"]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 11, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 24, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 37, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 49, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 8, 3)) +>"a b" : Symbol(C."a b", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 1, 18)) + +// BUG 817263 +var r4 = c["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 26, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 39, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 51, 3)) +>c : Symbol(c, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 8, 3)) +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : Symbol(C."~!@#$%^&*()_+{}|:'<>?\/.,`", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 2, 20)) + +interface I { +>I : Symbol(I, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 41)) + + " ": number; + "a b": string; + "~!@#$%^&*()_+{}|:'<>?\/.,`": number; +} + +var i: I; +>i : Symbol(i, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 21, 3)) +>I : Symbol(I, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 41)) + +var r = i[" "]; +>r : Symbol(r, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 9, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 22, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 35, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 47, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 21, 3)) +>" " : Symbol(I." ", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 15, 13)) + +var r2 = i[" "]; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 10, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 23, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 36, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 48, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 21, 3)) + +var r3 = i["a b"]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 11, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 24, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 37, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 49, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 21, 3)) +>"a b" : Symbol(I."a b", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 16, 18)) + +// BUG 817263 +var r4 = i["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 26, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 39, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 51, 3)) +>i : Symbol(i, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 21, 3)) +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : Symbol(I."~!@#$%^&*()_+{}|:'<>?\/.,`", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 17, 20)) + + +var a: { +>a : Symbol(a, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 3)) + + " ": number; + "a b": string; + "~!@#$%^&*()_+{}|:'<>?\/.,`": number; +} + +var r = a[" "]; +>r : Symbol(r, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 9, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 22, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 35, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 47, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 3)) +>" " : Symbol(" ", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 8)) + +var r2 = a[" "]; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 10, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 23, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 36, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 48, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 3)) + +var r3 = a["a b"]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 11, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 24, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 37, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 49, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 3)) +>"a b" : Symbol("a b", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 30, 18)) + +// BUG 817263 +var r4 = a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 26, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 39, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 51, 3)) +>a : Symbol(a, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 29, 3)) +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : Symbol("~!@#$%^&*()_+{}|:'<>?\/.,`", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 31, 20)) + +var b = { +>b : Symbol(b, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 3)) + + " ": 1, + "a b": "", + "~!@#$%^&*()_+{}|:'<>?\/.,`": 1, +} + +var r = b[" "]; +>r : Symbol(r, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 9, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 22, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 35, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 47, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 3)) +>" " : Symbol(" ", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 9)) + +var r2 = b[" "]; +>r2 : Symbol(r2, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 10, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 23, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 36, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 48, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 3)) + +var r3 = b["a b"]; +>r3 : Symbol(r3, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 11, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 24, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 37, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 49, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 3)) +>"a b" : Symbol("a b", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 42, 13)) + +// BUG 817263 +var r4 = b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; +>r4 : Symbol(r4, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 13, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 26, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 39, 3), Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 51, 3)) +>b : Symbol(b, Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 41, 3)) +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : Symbol("~!@#$%^&*()_+{}|:'<>?\/.,`", Decl(objectTypeWithStringNamedPropertyOfIllegalCharacters.ts, 43, 16)) + diff --git a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types index fce2b03f53f..b676d284e70 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types +++ b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types @@ -17,22 +17,26 @@ var r = c[" "]; >r : number >c[" "] : number >c : C +>" " : string var r2 = c[" "]; >r2 : any >c[" "] : any >c : C +>" " : string var r3 = c["a b"]; >r3 : string >c["a b"] : string >c : C +>"a b" : string // BUG 817263 var r4 = c["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >c["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >c : C +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : string interface I { >I : I @@ -50,22 +54,26 @@ var r = i[" "]; >r : number >i[" "] : number >i : I +>" " : string var r2 = i[" "]; >r2 : any >i[" "] : any >i : I +>" " : string var r3 = i["a b"]; >r3 : string >i["a b"] : string >i : I +>"a b" : string // BUG 817263 var r4 = i["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >i["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >i : I +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : string var a: { @@ -80,50 +88,63 @@ var r = a[" "]; >r : number >a[" "] : number >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>" " : string var r2 = a[" "]; >r2 : any >a[" "] : any >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>" " : string var r3 = a["a b"]; >r3 : string >a["a b"] : string >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>"a b" : string // BUG 817263 var r4 = a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >a["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >a : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : string var b = { >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } >{ " ": 1, "a b": "", "~!@#$%^&*()_+{}|:'<>?\/.,`": 1,} : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } " ": 1, +>1 : number + "a b": "", +>"" : string + "~!@#$%^&*()_+{}|:'<>?\/.,`": 1, +>1 : number } var r = b[" "]; >r : number >b[" "] : number >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>" " : string var r2 = b[" "]; >r2 : any >b[" "] : any >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>" " : string var r3 = b["a b"]; >r3 : string >b["a b"] : string >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>"a b" : string // BUG 817263 var r4 = b["~!@#$%^&*()_+{}|:'<>?\/.,`"]; >r4 : number >b["~!@#$%^&*()_+{}|:'<>?\/.,`"] : number >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>"~!@#$%^&*()_+{}|:'<>?\/.,`" : string diff --git a/tests/baselines/reference/objectTypesIdentity.symbols b/tests/baselines/reference/objectTypesIdentity.symbols new file mode 100644 index 00000000000..a39b47acf55 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentity.symbols @@ -0,0 +1,279 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 2, 9)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 6, 9)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentity.ts, 10, 8)) + + foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 10, 12)) +>T : Symbol(T, Decl(objectTypesIdentity.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 14, 13)) +} + +var a: { foo: string; } +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 18, 8)) + +var b = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentity.ts, 19, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentity.ts, 19, 9)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentity.ts, 19, 20), Decl(objectTypesIdentity.ts, 21, 20), Decl(objectTypesIdentity.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 21, 14)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentity.ts, 19, 20), Decl(objectTypesIdentity.ts, 21, 20), Decl(objectTypesIdentity.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 22, 14)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentity.ts, 19, 20), Decl(objectTypesIdentity.ts, 21, 20), Decl(objectTypesIdentity.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 23, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentity.ts, 23, 25), Decl(objectTypesIdentity.ts, 25, 21), Decl(objectTypesIdentity.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 25, 15)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentity.ts, 23, 25), Decl(objectTypesIdentity.ts, 25, 21), Decl(objectTypesIdentity.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 26, 15)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentity.ts, 23, 25), Decl(objectTypesIdentity.ts, 25, 21), Decl(objectTypesIdentity.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 27, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentity.ts, 27, 26), Decl(objectTypesIdentity.ts, 29, 29), Decl(objectTypesIdentity.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 29, 15)) +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentity.ts, 27, 26), Decl(objectTypesIdentity.ts, 29, 29), Decl(objectTypesIdentity.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 30, 15)) +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentity.ts, 27, 26), Decl(objectTypesIdentity.ts, 29, 29), Decl(objectTypesIdentity.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 31, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentity.ts, 31, 26), Decl(objectTypesIdentity.ts, 33, 20), Decl(objectTypesIdentity.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 33, 14)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentity.ts, 31, 26), Decl(objectTypesIdentity.ts, 33, 20), Decl(objectTypesIdentity.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 34, 14)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentity.ts, 31, 26), Decl(objectTypesIdentity.ts, 33, 20), Decl(objectTypesIdentity.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 35, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentity.ts, 35, 25), Decl(objectTypesIdentity.ts, 37, 27), Decl(objectTypesIdentity.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 37, 14)) +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentity.ts, 35, 25), Decl(objectTypesIdentity.ts, 37, 27), Decl(objectTypesIdentity.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 38, 14)) +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentity.ts, 35, 25), Decl(objectTypesIdentity.ts, 37, 27), Decl(objectTypesIdentity.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 39, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentity.ts, 39, 25), Decl(objectTypesIdentity.ts, 41, 27), Decl(objectTypesIdentity.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 41, 14)) +>b : Symbol(b, Decl(objectTypesIdentity.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentity.ts, 39, 25), Decl(objectTypesIdentity.ts, 41, 27), Decl(objectTypesIdentity.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 42, 14)) +>b : Symbol(b, Decl(objectTypesIdentity.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentity.ts, 39, 25), Decl(objectTypesIdentity.ts, 41, 27), Decl(objectTypesIdentity.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 43, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentity.ts, 43, 25), Decl(objectTypesIdentity.ts, 45, 20), Decl(objectTypesIdentity.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 45, 14)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentity.ts, 43, 25), Decl(objectTypesIdentity.ts, 45, 20), Decl(objectTypesIdentity.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 46, 14)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentity.ts, 43, 25), Decl(objectTypesIdentity.ts, 45, 20), Decl(objectTypesIdentity.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 47, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity.ts, 47, 25), Decl(objectTypesIdentity.ts, 49, 21), Decl(objectTypesIdentity.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 49, 15)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity.ts, 47, 25), Decl(objectTypesIdentity.ts, 49, 21), Decl(objectTypesIdentity.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 50, 15)) +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity.ts, 47, 25), Decl(objectTypesIdentity.ts, 49, 21), Decl(objectTypesIdentity.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 51, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentity.ts, 51, 26), Decl(objectTypesIdentity.ts, 53, 20), Decl(objectTypesIdentity.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 53, 14)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentity.ts, 51, 26), Decl(objectTypesIdentity.ts, 53, 20), Decl(objectTypesIdentity.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 54, 14)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentity.ts, 51, 26), Decl(objectTypesIdentity.ts, 53, 20), Decl(objectTypesIdentity.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 55, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentity.ts, 55, 25), Decl(objectTypesIdentity.ts, 57, 20), Decl(objectTypesIdentity.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentity.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentity.ts, 55, 25), Decl(objectTypesIdentity.ts, 57, 20), Decl(objectTypesIdentity.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 58, 14)) +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentity.ts, 55, 25), Decl(objectTypesIdentity.ts, 57, 20), Decl(objectTypesIdentity.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 59, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentity.ts, 59, 25), Decl(objectTypesIdentity.ts, 61, 20), Decl(objectTypesIdentity.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 61, 14)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentity.ts, 59, 25), Decl(objectTypesIdentity.ts, 61, 20), Decl(objectTypesIdentity.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 62, 14)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentity.ts, 59, 25), Decl(objectTypesIdentity.ts, 61, 20), Decl(objectTypesIdentity.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 63, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentity.ts, 63, 25), Decl(objectTypesIdentity.ts, 65, 20), Decl(objectTypesIdentity.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentity.ts, 63, 25), Decl(objectTypesIdentity.ts, 65, 20), Decl(objectTypesIdentity.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 66, 14)) +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentity.ts, 63, 25), Decl(objectTypesIdentity.ts, 65, 20), Decl(objectTypesIdentity.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 67, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentity.ts, 67, 25), Decl(objectTypesIdentity.ts, 69, 21), Decl(objectTypesIdentity.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 69, 15)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentity.ts, 67, 25), Decl(objectTypesIdentity.ts, 69, 21), Decl(objectTypesIdentity.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 70, 15)) +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentity.ts, 67, 25), Decl(objectTypesIdentity.ts, 69, 21), Decl(objectTypesIdentity.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 71, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentity.ts, 71, 26), Decl(objectTypesIdentity.ts, 73, 21), Decl(objectTypesIdentity.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentity.ts, 4, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentity.ts, 71, 26), Decl(objectTypesIdentity.ts, 73, 21), Decl(objectTypesIdentity.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 74, 15)) +>b : Symbol(b, Decl(objectTypesIdentity.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentity.ts, 71, 26), Decl(objectTypesIdentity.ts, 73, 21), Decl(objectTypesIdentity.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 75, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentity.ts, 75, 26), Decl(objectTypesIdentity.ts, 77, 21), Decl(objectTypesIdentity.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 77, 15)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentity.ts, 75, 26), Decl(objectTypesIdentity.ts, 77, 21), Decl(objectTypesIdentity.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 78, 15)) +>C : Symbol(C, Decl(objectTypesIdentity.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentity.ts, 75, 26), Decl(objectTypesIdentity.ts, 77, 21), Decl(objectTypesIdentity.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 79, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentity.ts, 79, 26), Decl(objectTypesIdentity.ts, 81, 21), Decl(objectTypesIdentity.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentity.ts, 79, 26), Decl(objectTypesIdentity.ts, 81, 21), Decl(objectTypesIdentity.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 82, 15)) +>a : Symbol(a, Decl(objectTypesIdentity.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentity.ts, 79, 26), Decl(objectTypesIdentity.ts, 81, 21), Decl(objectTypesIdentity.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 83, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentity.ts, 83, 26), Decl(objectTypesIdentity.ts, 85, 21), Decl(objectTypesIdentity.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 85, 15)) +>I : Symbol(I, Decl(objectTypesIdentity.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentity.ts, 83, 26), Decl(objectTypesIdentity.ts, 85, 21), Decl(objectTypesIdentity.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 86, 15)) +>b : Symbol(b, Decl(objectTypesIdentity.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentity.ts, 83, 26), Decl(objectTypesIdentity.ts, 85, 21), Decl(objectTypesIdentity.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentity.ts, 87, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentity.types b/tests/baselines/reference/objectTypesIdentity.types index c148c4223ed..3491682954a 100644 --- a/tests/baselines/reference/objectTypesIdentity.types +++ b/tests/baselines/reference/objectTypesIdentity.types @@ -39,6 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentity2.symbols b/tests/baselines/reference/objectTypesIdentity2.symbols new file mode 100644 index 00000000000..e78def5ca00 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentity2.symbols @@ -0,0 +1,204 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity2.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentity2.ts, 0, 0)) + + foo: number; +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 2, 9)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + + foo: boolean; +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 6, 9)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentity2.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentity2.ts, 10, 8)) + + foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 10, 12)) +>T : Symbol(T, Decl(objectTypesIdentity2.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + + foo: Date; +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 14, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +var a: { foo: RegExp; } +>a : Symbol(a, Decl(objectTypesIdentity2.ts, 18, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 18, 8)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +enum E { A } +>E : Symbol(E, Decl(objectTypesIdentity2.ts, 18, 23)) +>A : Symbol(E.A, Decl(objectTypesIdentity2.ts, 19, 8)) + +var b = { foo: E.A }; +>b : Symbol(b, Decl(objectTypesIdentity2.ts, 20, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentity2.ts, 20, 9)) +>E.A : Symbol(E.A, Decl(objectTypesIdentity2.ts, 19, 8)) +>E : Symbol(E, Decl(objectTypesIdentity2.ts, 18, 23)) +>A : Symbol(E.A, Decl(objectTypesIdentity2.ts, 19, 8)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentity2.ts, 20, 21), Decl(objectTypesIdentity2.ts, 22, 20), Decl(objectTypesIdentity2.ts, 23, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 22, 14)) +>A : Symbol(A, Decl(objectTypesIdentity2.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentity2.ts, 20, 21), Decl(objectTypesIdentity2.ts, 22, 20), Decl(objectTypesIdentity2.ts, 23, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 23, 14)) +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentity2.ts, 20, 21), Decl(objectTypesIdentity2.ts, 22, 20), Decl(objectTypesIdentity2.ts, 23, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 24, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity2.ts, 24, 25), Decl(objectTypesIdentity2.ts, 26, 21), Decl(objectTypesIdentity2.ts, 27, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 26, 15)) +>A : Symbol(A, Decl(objectTypesIdentity2.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity2.ts, 24, 25), Decl(objectTypesIdentity2.ts, 26, 21), Decl(objectTypesIdentity2.ts, 27, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentity2.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentity2.ts, 24, 25), Decl(objectTypesIdentity2.ts, 26, 21), Decl(objectTypesIdentity2.ts, 27, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 28, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentity2.ts, 28, 26), Decl(objectTypesIdentity2.ts, 30, 20), Decl(objectTypesIdentity2.ts, 31, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 30, 14)) +>A : Symbol(A, Decl(objectTypesIdentity2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentity2.ts, 28, 26), Decl(objectTypesIdentity2.ts, 30, 20), Decl(objectTypesIdentity2.ts, 31, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentity2.ts, 28, 26), Decl(objectTypesIdentity2.ts, 30, 20), Decl(objectTypesIdentity2.ts, 31, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 32, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentity2.ts, 32, 25), Decl(objectTypesIdentity2.ts, 34, 20), Decl(objectTypesIdentity2.ts, 35, 27)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 34, 14)) +>A : Symbol(A, Decl(objectTypesIdentity2.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentity2.ts, 32, 25), Decl(objectTypesIdentity2.ts, 34, 20), Decl(objectTypesIdentity2.ts, 35, 27)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentity2.ts, 18, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentity2.ts, 32, 25), Decl(objectTypesIdentity2.ts, 34, 20), Decl(objectTypesIdentity2.ts, 35, 27)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 36, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentity2.ts, 36, 25), Decl(objectTypesIdentity2.ts, 38, 20), Decl(objectTypesIdentity2.ts, 39, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 38, 14)) +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentity2.ts, 36, 25), Decl(objectTypesIdentity2.ts, 38, 20), Decl(objectTypesIdentity2.ts, 39, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentity2.ts, 36, 25), Decl(objectTypesIdentity2.ts, 38, 20), Decl(objectTypesIdentity2.ts, 39, 20)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 40, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentity2.ts, 40, 25), Decl(objectTypesIdentity2.ts, 42, 20), Decl(objectTypesIdentity2.ts, 43, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 42, 14)) +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentity2.ts, 40, 25), Decl(objectTypesIdentity2.ts, 42, 20), Decl(objectTypesIdentity2.ts, 43, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 43, 14)) +>C : Symbol(C, Decl(objectTypesIdentity2.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentity2.ts, 40, 25), Decl(objectTypesIdentity2.ts, 42, 20), Decl(objectTypesIdentity2.ts, 43, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 44, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentity2.ts, 44, 25), Decl(objectTypesIdentity2.ts, 46, 21), Decl(objectTypesIdentity2.ts, 47, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 46, 15)) +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentity2.ts, 44, 25), Decl(objectTypesIdentity2.ts, 46, 21), Decl(objectTypesIdentity2.ts, 47, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 47, 15)) +>a : Symbol(a, Decl(objectTypesIdentity2.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentity2.ts, 44, 25), Decl(objectTypesIdentity2.ts, 46, 21), Decl(objectTypesIdentity2.ts, 47, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 48, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentity2.ts, 48, 26), Decl(objectTypesIdentity2.ts, 50, 21), Decl(objectTypesIdentity2.ts, 51, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 50, 15)) +>B : Symbol(B, Decl(objectTypesIdentity2.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentity2.ts, 48, 26), Decl(objectTypesIdentity2.ts, 50, 21), Decl(objectTypesIdentity2.ts, 51, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 51, 15)) +>b : Symbol(b, Decl(objectTypesIdentity2.ts, 20, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentity2.ts, 48, 26), Decl(objectTypesIdentity2.ts, 50, 21), Decl(objectTypesIdentity2.ts, 51, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 52, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentity2.ts, 52, 26), Decl(objectTypesIdentity2.ts, 54, 21), Decl(objectTypesIdentity2.ts, 55, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 54, 15)) +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentity2.ts, 52, 26), Decl(objectTypesIdentity2.ts, 54, 21), Decl(objectTypesIdentity2.ts, 55, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 55, 15)) +>C : Symbol(C, Decl(objectTypesIdentity2.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentity2.ts, 52, 26), Decl(objectTypesIdentity2.ts, 54, 21), Decl(objectTypesIdentity2.ts, 55, 29)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 56, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentity2.ts, 56, 26), Decl(objectTypesIdentity2.ts, 58, 21), Decl(objectTypesIdentity2.ts, 59, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 58, 15)) +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentity2.ts, 56, 26), Decl(objectTypesIdentity2.ts, 58, 21), Decl(objectTypesIdentity2.ts, 59, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 59, 15)) +>a : Symbol(a, Decl(objectTypesIdentity2.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentity2.ts, 56, 26), Decl(objectTypesIdentity2.ts, 58, 21), Decl(objectTypesIdentity2.ts, 59, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 60, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentity2.ts, 60, 26), Decl(objectTypesIdentity2.ts, 62, 21), Decl(objectTypesIdentity2.ts, 63, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 62, 15)) +>I : Symbol(I, Decl(objectTypesIdentity2.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentity2.ts, 60, 26), Decl(objectTypesIdentity2.ts, 62, 21), Decl(objectTypesIdentity2.ts, 63, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 63, 15)) +>b : Symbol(b, Decl(objectTypesIdentity2.ts, 20, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentity2.ts, 60, 26), Decl(objectTypesIdentity2.ts, 62, 21), Decl(objectTypesIdentity2.ts, 63, 28)) +>x : Symbol(x, Decl(objectTypesIdentity2.ts, 64, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.symbols new file mode 100644 index 00000000000..e1131a019c0 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.symbols @@ -0,0 +1,325 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 2, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 6, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 7, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 10, 8)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 10, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 11, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 10, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 14, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 15, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures.ts, 16, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 18, 13)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 18, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 19, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 18, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures.ts, 18, 13)) +} + +var a: { foo(x: string): string } +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 13)) + +var b = { foo(x: string) { return ''; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 14)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures.ts, 4, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures.ts, 16, 1)) + +function foo12b(x: C); // error +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types index efe7e32f5d7..545e2376bb3 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types @@ -7,6 +7,7 @@ class A { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class B { @@ -15,6 +16,7 @@ class B { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class C { @@ -26,6 +28,7 @@ class C { >x : T >T : T >T : T +>null : null } interface I { @@ -57,6 +60,7 @@ var b = { foo(x: string) { return ''; } }; >{ foo(x: string) { return ''; } } : { foo(x: string): string; } >foo : (x: string) => string >x : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.symbols new file mode 100644 index 00000000000..85c138a8c34 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.symbols @@ -0,0 +1,327 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures2.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 2, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + + foo(x: number): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 6, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 7, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 10, 8)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 10, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 11, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 10, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + + foo(x: boolean): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 14, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 15, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures2.ts, 16, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 18, 13)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 18, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 19, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 18, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignatures2.ts, 18, 13)) +} + +var a: { foo(x: Date): string } +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var b = { foo(x: RegExp) { return ''; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 14)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 42), Decl(objectTypesIdentityWithCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 29, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures2.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures2.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 33, 29), Decl(objectTypesIdentityWithCallSignatures2.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 37, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignatures2.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 65, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 69, 20), Decl(objectTypesIdentityWithCallSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithCallSignatures2.ts, 73, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignatures2.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 77, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 81, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures2.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures2.ts, 16, 1)) + +function foo12b(x: C); // error +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures2.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 85, 31), Decl(objectTypesIdentityWithCallSignatures2.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithCallSignatures2.ts, 89, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignatures2.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 93, 21), Decl(objectTypesIdentityWithCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures2.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignatures2.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures2.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignatures2.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithCallSignatures2.ts, 97, 30), Decl(objectTypesIdentityWithCallSignatures2.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types index 9004a267691..378c5c4fa0c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types @@ -7,6 +7,7 @@ class A { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class B { @@ -15,6 +16,7 @@ class B { foo(x: number): string { return null; } >foo : (x: number) => string >x : number +>null : null } class C { @@ -26,6 +28,7 @@ class C { >x : T >T : T >T : T +>null : null } interface I { @@ -59,6 +62,7 @@ var b = { foo(x: RegExp) { return ''; } }; >foo : (x: RegExp) => string >x : RegExp >RegExp : RegExp +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.symbols new file mode 100644 index 00000000000..9341ba35c42 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.symbols @@ -0,0 +1,329 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + + foo(x: string): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 2, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + + foo(x: string, y: string): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 6, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 7, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 7, 18)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 10, 8)) + + foo(x: T, y: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 10, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 11, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 10, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 11, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 10, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 14, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 15, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 16, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 18, 13)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 18, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 19, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 18, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 18, 13)) +} + +var a: { foo(x: string, y: string): string } +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 23)) + +var b = { foo(x: string) { return ''; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 14)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 42), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 25, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 42), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 25, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 42), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 25, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 27, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 29, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 27, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 29, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 27, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 29, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 30, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 31, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 33, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 31, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 33, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 31, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 33, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 35, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 37, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 35, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 37, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 35, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 37, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 41, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 41, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 41, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 45, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 45, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 45, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 49, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 49, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 49, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 50, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 51, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 51, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 51, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 57, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 57, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 57, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 58, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 61, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 61, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 61, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 69, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 69, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 69, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 71, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 73, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 71, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 73, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 71, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 73, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 75, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 77, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 75, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 77, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 75, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 77, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 79, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 81, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 79, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 81, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 79, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 81, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 83, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 85, 31), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 83, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 85, 31), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 83, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 85, 31), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 87, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 87, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 87, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 97, 30), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 97, 30), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 97, 30), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types index 2f97c721637..62426cb0333 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types @@ -7,6 +7,7 @@ class A { foo(x: string): string { return null; } >foo : (x: string) => string >x : string +>null : null } class B { @@ -16,6 +17,7 @@ class B { >foo : (x: string, y: string) => string >x : string >y : string +>null : null } class C { @@ -29,6 +31,7 @@ class C { >y : T >T : T >T : T +>null : null } interface I { @@ -61,6 +64,7 @@ var b = { foo(x: string) { return ''; } }; >{ foo(x: string) { return ''; } } : { foo(x: string): string; } >foo : (x: string) => string >x : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.symbols new file mode 100644 index 00000000000..6f37ae8eef9 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.symbols @@ -0,0 +1,137 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts === +// object types are identical structurally + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + + (x: string): string; +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 3, 5)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 6, 13)) + + (x: T): T; +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 7, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 6, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 6, 13)) +} + +var a: { (x: string, y: string): string } +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 10)) +>y : Symbol(y, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 20)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 41), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 12, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 13, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 12, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 41), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 12, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 13, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 13, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 41), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 12, 20), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 13, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 14, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 14, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 17, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 16, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 14, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 17, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 17, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 14, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 17, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 18, 14)) + +function foo4(x: I2); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 18, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 20, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 21, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 20, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo4(x: I2); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 18, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 20, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 21, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 21, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 18, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 20, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 21, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 22, 14)) + +function foo5(x: I2); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 22, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 24, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 25, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 24, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo5(x: I2); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 22, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 24, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 25, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 25, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 22, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 24, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 25, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 26, 14)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 26, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 28, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 29, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 28, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 26, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 28, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 29, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 29, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 26, 25), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 28, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 29, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 30, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 30, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 32, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 33, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 32, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + +function foo14(x: I2); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 30, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 32, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 33, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 33, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 30, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 32, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 33, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 34, 15)) + +function foo14b(x: typeof a); +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 34, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 36, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 37, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 36, 16)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 10, 3)) + +function foo14b(x: I2); // ok +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 34, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 36, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 37, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 37, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo14b(x: any) { } +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 34, 26), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 36, 29), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 37, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 38, 16)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 38, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 40, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 41, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 40, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 0, 0)) + +function foo15(x: I2); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 38, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 40, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 41, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 41, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 4, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 38, 27), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 40, 21), Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 41, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts, 42, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.symbols new file mode 100644 index 00000000000..6575c6787fd --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.symbols @@ -0,0 +1,376 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesWithOverloads.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + + foo(x: number): number; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 2, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 3, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 4, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 3, 8)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 2, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 3, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 4, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 4, 8)) + + foo(x: any): any { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 2, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 3, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 4, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + + foo(x: number): number; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 8, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 9, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 10, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 9, 8)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 8, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 9, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 10, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 10, 8)) + + foo(x: any): any { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 8, 9), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 9, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 10, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 11, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 8)) + + foo(x: number): number; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 12), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 15, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 17, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 15, 8)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 12), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 15, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 17, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 16, 8)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 12), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 15, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 17, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 8)) + + foo(x: any): any { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 14, 12), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 15, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 16, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 17, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 18, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + + foo(x: number): number; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 21, 13), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 22, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 22, 8)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 21, 13), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 22, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 23, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 24, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 13)) + + foo(x: number): number; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 17), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 27, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 27, 8)) + + foo(x: string): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 17), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 27, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 28, 8)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 17), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 27, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 29, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 26, 13)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + + foo(x: number): number +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 8), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 33, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 33, 8)) + + foo(x: string): string +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 8), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 33, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 34, 8)) +} + +var b = { +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 3)) + + foo(x: any) { return ''; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 38, 8)) + +}; + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 39, 2), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 41, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 41, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 39, 2), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 41, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 42, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 39, 2), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 41, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 43, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 45, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 46, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 45, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 45, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 46, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 46, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 43, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 45, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 46, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 47, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 47, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 49, 29), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 49, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 47, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 49, 29), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 50, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 47, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 49, 29), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 51, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 51, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 53, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 53, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 51, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 53, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 54, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 51, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 53, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 55, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 55, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 57, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 57, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 55, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 57, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 58, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 55, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 57, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 59, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 61, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 61, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 61, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 62, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 59, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 61, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 63, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 65, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 66, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 63, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 65, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 66, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 67, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 69, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 70, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 69, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 69, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 70, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 70, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 67, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 69, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 70, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 71, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 71, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 73, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 74, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 73, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo6(x: I); // BUG 831930 +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 71, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 73, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 74, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 74, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 71, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 73, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 74, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 75, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 75, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 77, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 78, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 77, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 0, 0)) + +function foo7(x: typeof a); // BUG 831930 +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 75, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 77, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 78, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 78, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 75, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 77, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 78, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 79, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 79, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 81, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 82, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 81, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo8(x: I); // BUG 831930 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 79, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 81, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 82, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 82, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 79, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 81, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 82, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 83, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 83, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 85, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 85, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 83, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 85, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 86, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 83, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 85, 20), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 87, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 87, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 89, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo10(x: typeof a); // BUG 831930 +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 87, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 87, 25), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 89, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 91, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 93, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 6, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 91, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 93, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 95, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 97, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 97, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 97, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 95, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 97, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 99, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 99, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 101, 31), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 102, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 101, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 24, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 99, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 101, 31), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 102, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 102, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 99, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 101, 31), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 102, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 103, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 103, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 105, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 105, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 103, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 105, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 106, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 32, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 103, 27), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 105, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 107, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 107, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 109, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 109, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 19, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 107, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 109, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 110, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 37, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 107, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 109, 21), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 111, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 111, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 113, 30), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 114, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 113, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 24, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 111, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 113, 30), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 114, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 114, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 12, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 111, 26), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 113, 30), Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 114, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithCallSignaturesWithOverloads.ts, 115, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types index c3ab4ffb837..edaad51b32e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types @@ -15,6 +15,7 @@ class A { foo(x: any): any { return null; } >foo : { (x: number): number; (x: string): string; } >x : any +>null : null } class B { @@ -31,6 +32,7 @@ class B { foo(x: any): any { return null; } >foo : { (x: number): number; (x: string): string; } >x : any +>null : null } class C { @@ -54,6 +56,7 @@ class C { foo(x: any): any { return null; } >foo : { (x: number): number; (x: string): string; (x: T): T; } >x : any +>null : null } interface I { @@ -107,6 +110,7 @@ var b = { >foo : (x: any) => any >x : any >'' : any +>'' : string }; diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.symbols b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.symbols new file mode 100644 index 00000000000..4441100b7ac --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.symbols @@ -0,0 +1,271 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + + constructor(x: string) { } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 3, 16)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + + constructor(x: string) { } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 7, 16)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures.ts, 10, 8)) + + constructor(x: T) { } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 11, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + + new(x: string); +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 15, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures.ts, 16, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures.ts, 18, 13)) + + new(x: T): T; +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 19, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures.ts, 18, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures.ts, 18, 13)) +} + +var a: { new(x: string) } +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 13)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 24, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 25, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 24, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 24, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 25, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 24, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 25, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 26, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures.ts, 26, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 28, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 29, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 28, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures.ts, 26, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 28, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 29, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures.ts, 26, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 28, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 29, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 30, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures.ts, 30, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 32, 29), Decl(objectTypesIdentityWithConstructSignatures.ts, 33, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 32, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures.ts, 30, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 32, 29), Decl(objectTypesIdentityWithConstructSignatures.ts, 33, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures.ts, 30, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 32, 29), Decl(objectTypesIdentityWithConstructSignatures.ts, 33, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 34, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures.ts, 34, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 36, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 37, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 36, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures.ts, 34, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 36, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 37, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures.ts, 34, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 36, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 37, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 38, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures.ts, 38, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 40, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 41, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 40, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures.ts, 38, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 40, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 41, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures.ts, 38, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 40, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 41, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 42, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithConstructSignatures.ts, 42, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 44, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 44, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithConstructSignatures.ts, 42, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 44, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 45, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithConstructSignatures.ts, 42, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 44, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 46, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithConstructSignatures.ts, 46, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 48, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 49, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 48, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithConstructSignatures.ts, 46, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 48, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 49, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 49, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithConstructSignatures.ts, 46, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 48, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 49, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 50, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithConstructSignatures.ts, 50, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 52, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 53, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 52, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithConstructSignatures.ts, 50, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 52, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 53, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 53, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithConstructSignatures.ts, 50, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 52, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 53, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 54, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithConstructSignatures.ts, 54, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 56, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 57, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 56, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithConstructSignatures.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithConstructSignatures.ts, 54, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 56, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 57, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 57, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithConstructSignatures.ts, 54, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 56, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 57, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 58, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures.ts, 58, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 60, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 61, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 60, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures.ts, 58, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 60, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 61, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 61, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures.ts, 58, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 60, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 61, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 62, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures.ts, 62, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 64, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 65, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 64, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures.ts, 62, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 64, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 65, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 65, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures.ts, 62, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 64, 20), Decl(objectTypesIdentityWithConstructSignatures.ts, 65, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 66, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures.ts, 66, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 68, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 69, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 68, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures.ts, 66, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 68, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 69, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 69, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures.ts, 66, 25), Decl(objectTypesIdentityWithConstructSignatures.ts, 68, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 69, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 70, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures.ts, 70, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 72, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 73, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 72, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures.ts, 70, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 72, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 73, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 73, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures.ts, 70, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 72, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 73, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 74, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures.ts, 74, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 76, 31), Decl(objectTypesIdentityWithConstructSignatures.ts, 77, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 76, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures.ts, 74, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 76, 31), Decl(objectTypesIdentityWithConstructSignatures.ts, 77, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 77, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures.ts, 74, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 76, 31), Decl(objectTypesIdentityWithConstructSignatures.ts, 77, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 78, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures.ts, 78, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 80, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 81, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 80, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures.ts, 78, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 80, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 81, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 81, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures.ts, 78, 27), Decl(objectTypesIdentityWithConstructSignatures.ts, 80, 21), Decl(objectTypesIdentityWithConstructSignatures.ts, 81, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 82, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures.ts, 82, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 84, 30), Decl(objectTypesIdentityWithConstructSignatures.ts, 85, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 84, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures.ts, 82, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 84, 30), Decl(objectTypesIdentityWithConstructSignatures.ts, 85, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 85, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures.ts, 82, 26), Decl(objectTypesIdentityWithConstructSignatures.ts, 84, 30), Decl(objectTypesIdentityWithConstructSignatures.ts, 85, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures.ts, 86, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.symbols b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.symbols new file mode 100644 index 00000000000..0d37d7fc97b --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.symbols @@ -0,0 +1,243 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures2.ts === +// object types are identical structurally + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + + constructor(x: number) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 3, 16)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures2.ts, 6, 8)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 7, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures2.ts, 6, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + + new(x: boolean): string; +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 11, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 12, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures2.ts, 14, 13)) + + new(x: T): T; +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 15, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures2.ts, 14, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignatures2.ts, 14, 13)) +} + +var a: { new(x: Date): string } +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +var b = { new(x: RegExp) { return ''; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 14)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignatures2.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 21, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignatures2.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 22, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignatures2.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 23, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures2.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignatures2.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 25, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures2.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignatures2.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 26, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignatures2.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignatures2.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 27, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 29, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 30, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 31, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures2.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 33, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures2.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 34, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignatures2.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 35, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignatures2.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 37, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignatures2.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 38, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignatures2.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 39, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 41, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 43, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 45, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo9(x: C); // error, types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 46, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignatures2.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 47, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 49, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 50, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignatures2.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 51, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignatures2.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 53, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignatures2.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignatures2.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 54, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignatures2.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 55, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 57, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 59, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignatures2.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 61, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 12, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignatures2.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 62, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignatures2.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 63, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures2.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 65, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures2.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 66, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignatures2.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignatures2.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 67, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignatures2.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 69, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignatures2.ts, 8, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignatures2.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 70, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignatures2.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignatures2.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 71, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures2.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignatures2.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 73, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignatures2.ts, 12, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures2.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignatures2.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 74, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignatures2.ts, 4, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignatures2.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignatures2.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignatures2.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 75, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types index 769682c826a..2e5e7231721 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types @@ -6,6 +6,7 @@ class B { constructor(x: number) { return null; } >x : number +>null : null } class C { @@ -15,6 +16,7 @@ class C { constructor(x: T) { return null; } >x : T >T : T +>null : null } interface I { @@ -45,6 +47,7 @@ var b = { new(x: RegExp) { return ''; } }; // not a construct signature, functio >new : (x: RegExp) => string >x : RegExp >RegExp : RegExp +>'' : string function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.symbols b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.symbols new file mode 100644 index 00000000000..0563fe7a2fc --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.symbols @@ -0,0 +1,245 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts === +// object types are identical structurally + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + + constructor(x: string, y: string) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 3, 16)) +>y : Symbol(y, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 3, 26)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 6, 8)) + + constructor(x: T, y: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 7, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 6, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 7, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 6, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + + new(x: string): string; +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 11, 8)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 12, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 14, 13)) + + new(x: T): T; +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 15, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 14, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 14, 13)) +} + +var a: { new(x: string, y: string): string } +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 23)) + +var b = { new(x: string) { return ''; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 9)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 21, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 22, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 42), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 21, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 22, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 23, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 25, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 26, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 23, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 25, 29), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 27, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 29, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 30, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 27, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 29, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 31, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 33, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 34, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 31, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 33, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 35, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 37, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 38, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 35, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 37, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 39, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 41, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 39, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 41, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 43, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 45, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo9(x: C); // error, types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 46, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 43, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 45, 20), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 47, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 49, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 50, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 47, 25), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 49, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 51, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 53, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 54, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 51, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 53, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 55, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 57, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 55, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 57, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 59, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 61, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 62, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 59, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 61, 31), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 63, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 65, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 66, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 63, 27), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 65, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 67, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 69, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 8, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 70, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 67, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 69, 21), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 71, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 73, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 12, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 74, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 4, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 71, 26), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 73, 30), Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 74, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts, 75, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types index a2779e3bd35..b7f59953959 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types @@ -7,6 +7,7 @@ class B { constructor(x: string, y: string) { return null; } >x : string >y : string +>null : null } class C { @@ -18,6 +19,7 @@ class C { >T : T >y : T >T : T +>null : null } interface I { @@ -47,6 +49,7 @@ var b = { new(x: string) { return ''; } }; // not a construct signature, functio >{ new(x: string) { return ''; } } : { new(x: string): string; } >new : (x: string) => string >x : string +>'' : string function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.symbols new file mode 100644 index 00000000000..8fdebdcccbe --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.symbols @@ -0,0 +1,340 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 2, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 3, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 3, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 3, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 6, 8)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 6, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 7, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 6, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 6, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 10, 8)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 10, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 11, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 10, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 14, 12)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 14, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 15, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 14, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 14, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 16, 1)) + + foo(x: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 18, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 19, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 19, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 19, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 19, 8)) +} + +var a: { foo(x: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 13)) + +var b = { foo(x: T) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 17)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 17)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types index d3cf9bc0063..d871c3c4cb5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types @@ -10,6 +10,7 @@ class A { >x : T >T : T >T : T +>null : null } class B { @@ -21,6 +22,7 @@ class B { >x : T >T : T >T : T +>null : null } class C { @@ -32,6 +34,7 @@ class C { >x : T >T : T >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.symbols new file mode 100644 index 00000000000..2ca97948a99 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.symbols @@ -0,0 +1,361 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures2.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + + foo(x: T, y: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 2, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 10)) + + foo(x: T, y: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 7, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 7, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 6, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 10)) + + foo(x: T, y: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 11, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 11, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 14)) + + foo(x: T, y: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 19)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 15, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 15, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 14, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 16, 1)) + + foo(x: T, y: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 18, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 19, 8)) +} + +var a: { foo(x: T, y: U): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 19)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 15)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 13)) + +var b = { foo(x: T, y: U) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 20)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 48), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 48), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 48), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 33, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 34, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 33, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 34, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 33, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 34, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 37, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 38, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 37, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 38, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 37, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 38, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 54, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 54, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 54, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 58, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 58, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 58, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 0, 0)) + +function foo7(x: typeof a); // no error, bug? +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 66, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 66, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 66, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 70, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 70, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 70, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 73, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 73, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 73, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 77, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 77, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 77, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 81, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 82, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 81, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 82, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 81, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 82, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 86, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 86, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 86, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 89, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 89, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 89, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 93, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 93, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 93, 37), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 98, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 98, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 98, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignatures2.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types index 0c00e587b78..c7ca543aead 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types @@ -13,6 +13,7 @@ class A { >y : U >U : U >T : T +>null : null } class B { @@ -27,6 +28,7 @@ class B { >y : U >U : U >T : T +>null : null } class C { @@ -41,6 +43,7 @@ class C { >y : U >U : U >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.symbols new file mode 100644 index 00000000000..3b681c55c13 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.symbols @@ -0,0 +1,363 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + + foo(x: T): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 5, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 5, 24)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 5, 8)) +} + +class B> { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 8, 8)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + + foo(x: T): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 8, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 12, 8)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + + foo(x: T): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 12, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 16, 12)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + foo(x: T): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 16, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 16, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 18, 1)) + + foo(x: T): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 21, 8)) +>Boolean : Symbol(Boolean, Decl(lib.d.ts, 443, 38), Decl(lib.d.ts, 456, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 21, 27)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 21, 8)) +} + +var a: { foo>(x: T): string } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 13)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 38)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 13)) + +var b = { foo(x: T) { return ''; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 14)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 32)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 14)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 29, 14)) + +function foo1b(x: B>); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 31, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo1b(x: B>); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 31, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 31, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 52, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo5(x: B>); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 52, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 52, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 65, 14)) + +function foo8(x: B>); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 67, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 67, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 67, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 69, 14)) + +function foo9(x: B>); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 71, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 71, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 71, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 73, 14)) + +function foo10(x: B>); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 75, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 75, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 75, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 77, 15)) + +function foo11(x: B>); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 79, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 79, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 79, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types index 432a618c4e2..90ed7fd0945 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types @@ -12,6 +12,7 @@ class A { >Date : Date >x : T >T : T +>null : null } class B> { @@ -23,6 +24,7 @@ class B> { >foo : (x: T) => string >x : T >T : T +>null : null } class C { @@ -34,6 +36,7 @@ class C { >foo : (x: T) => string >x : T >T : T +>null : null } interface I { @@ -74,6 +77,7 @@ var b = { foo(x: T) { return ''; } }; >RegExp : RegExp >x : T >T : T +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.symbols new file mode 100644 index 00000000000..a9210b20f32 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.symbols @@ -0,0 +1,338 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + + foo(x: T): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 5, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 5, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 8, 8)) + + foo(x: T): number { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 8, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 12, 8)) + + foo(x: T): boolean { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 12, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 16, 12)) + + foo(x: T): Date; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 16, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 16, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 18, 1)) + + foo(x: T): RegExp; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 21, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 21, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 21, 8)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +} + +var a: { foo(x: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 13)) + +var b = { foo(x: T) { return null; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 17)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 14)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 42), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 42), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 42), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 65, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 69, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 73, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 77, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types index 8b5a042c1e2..ef6799b6ab9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types @@ -11,6 +11,7 @@ class A { >T : T >x : T >T : T +>null : null } class B { @@ -21,6 +22,7 @@ class B { >foo : (x: T) => number >x : T >T : T +>null : null } class C { @@ -31,6 +33,7 @@ class C { >foo : (x: T) => boolean >x : T >T : T +>null : null } interface I { @@ -70,6 +73,7 @@ var b = { foo(x: T) { return null; } }; >T : T >x : T >T : T +>null : null function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.symbols new file mode 100644 index 00000000000..e1c4e120370 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.symbols @@ -0,0 +1,366 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + + foo(x: T): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 5, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 5, 24)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 8, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + foo(x: T): number { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 8, 25)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 12, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + foo(x: T): boolean { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 12, 25)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 16, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + foo(x: T): Date; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 16, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 16, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 18, 1)) + + foo(x: T): RegExp; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 21, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 21, 24)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 21, 8)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +} + +var a: { foo(x: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 29)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 13)) + +var b = { foo(x: T) { return null; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 30)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 14)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 55), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 73, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 77, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types index 2863cafa885..c964cc46cad 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types @@ -12,6 +12,7 @@ class A { >Date : Date >x : T >T : T +>null : null } class B { @@ -23,6 +24,7 @@ class B { >foo : (x: T) => number >x : T >T : T +>null : null } class C { @@ -34,6 +36,7 @@ class C { >foo : (x: T) => boolean >x : T >T : T +>null : null } interface I { @@ -77,6 +80,7 @@ var b = { foo(x: T) { return null; } }; >Date : Date >x : T >T : T +>null : null function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.symbols new file mode 100644 index 00000000000..9b801aa2c6f --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.symbols @@ -0,0 +1,372 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 2, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 3, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 3, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 3, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 6, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 6, 10)) + + foo(x: U): U { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 6, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 7, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 6, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 6, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 8)) +>W : Symbol(W, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 10)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 13)) + + foo(x: V): V { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 18)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 11, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 12)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 14)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 17)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 20)) + + foo(x: X): X; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 25)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 15, 8)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 12)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 14, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 16, 1)) + + foo(x: Y): Y; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 18, 14)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 8)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 10)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 13)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 20)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 8)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 19, 8)) +} + +var a: { foo(x: Z): Z } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 8)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 13)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 18)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 21)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 24)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 28)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 13)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 13)) + +var b = { foo(x: A) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 9)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 19)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 22)) +>E : Symbol(E, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 25)) +>F : Symbol(F, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 32)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 32)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 54), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 54), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 54), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 29, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 30, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 33, 46), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 34, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 33, 46), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 34, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 33, 46), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 34, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 37, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 38, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 37, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 38, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 37, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 38, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 50, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 54, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 54, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 54, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo7(x: typeof a); // no error, bug? +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 70, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo9(x: C>); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 70, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 69, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 70, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 73, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 73, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 73, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 77, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 77, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 77, 38), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 79, 15)) + +function foo12(x: I, number, Date, string>); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 62), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: C, number, Date>); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 62), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 62), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 86, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 86, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 86, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 93, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 93, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 93, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 98, 67)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 16, 1)) + +function foo15(x: C, B>); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 98, 67)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 98, 67)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types index 125b82c9915..afc2e9ae6ce 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types @@ -10,6 +10,7 @@ class A { >x : T >T : T >T : T +>null : null } class B { @@ -22,6 +23,7 @@ class B { >x : U >U : U >U : U +>null : null } class C { @@ -35,6 +37,7 @@ class C { >x : V >V : V >V : V +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.symbols new file mode 100644 index 00000000000..7e9f1a97f69 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.symbols @@ -0,0 +1,142 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts === +// object types are identical structurally + + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 12)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 14)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 17)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 20)) + + (x: X): X; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 4, 5)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 12)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 3, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + + (x: Y): Y; +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 5)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 7)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 10)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 17)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 5)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 8, 5)) +} + +var a: { (x: Z): Z } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 3)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 10)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 12)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 18)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 25)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 10)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 10)) + +function foo1(x: I); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 13, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 14, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 13, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) + +function foo1(x: I); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 13, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 14, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 14, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 13, 53), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 14, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 15, 14)) + +function foo2(x: I2); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 15, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 17, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 18, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 17, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + +function foo2(x: I2); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 15, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 17, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 18, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 18, 14)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 15, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 17, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 18, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 19, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 19, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 21, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 22, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 21, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 19, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 21, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 22, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 22, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 19, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 21, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 22, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 23, 14)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 23, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 26, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 23, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 26, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 26, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 23, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 26, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 27, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 27, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 30, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo14(x: I2); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 27, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 30, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 30, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 27, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 30, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 31, 15)) + +function foo14b(x: typeof a); +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 34, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 33, 16)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 11, 3)) + +function foo14b(x: I2); // ok +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 34, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 34, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + +function foo14b(x: any) { } +>foo14b : Symbol(foo14b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 34, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 35, 16)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 38, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo15(x: I2); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 38, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 38, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 5, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 38, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 39, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.symbols new file mode 100644 index 00000000000..94e6aaf0139 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.symbols @@ -0,0 +1,340 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + + foo(x: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 2, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 3, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 3, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 3, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 3, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 6, 8)) + + foo(x: U): U { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 6, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 7, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 6, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 6, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 10, 8)) + + foo(x: V): V { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 10, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 11, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 10, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 14, 12)) + + foo(x: X): X; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 14, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 15, 8)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 14, 12)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 14, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 16, 1)) + + foo(x: Y): Y; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 18, 14)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 19, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 19, 11)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 19, 8)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 19, 8)) +} + +var a: { foo(x: Z): Z } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 8)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 16)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 13)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 13)) + +var b = { foo(x: A) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 9)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 17)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 17)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 25, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 26, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 39), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 25, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 26, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 27, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 29, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 30, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 27, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 29, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 31, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 33, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 34, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 31, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 33, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 34, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 35, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 37, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 35, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 37, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 38, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 39, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 41, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 42, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 41, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 43, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 45, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 46, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 45, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 47, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 49, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 50, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 49, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 51, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 53, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 54, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 51, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 53, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 54, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 55, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 58, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 58, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 59, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 61, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 62, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 59, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 61, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 62, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 63, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 66, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 65, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 67, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 69, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 70, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 67, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 69, 28), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 71, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 74, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 71, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 73, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 75, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 77, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 78, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 75, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 77, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 78, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 79, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 82, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 81, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 82, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 83, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 85, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 16, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 86, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 83, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 85, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 86, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 87, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 89, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 90, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 22, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 89, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 91, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 93, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 94, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 23, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 93, 29), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 94, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 95, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 97, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 16, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 98, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 95, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 97, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 98, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts, 99, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types index fd0b14a4f79..52acb56dfaf 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types @@ -10,6 +10,7 @@ class A { >x : T >T : T >T : T +>null : null } class B { @@ -21,6 +22,7 @@ class B { >x : U >U : U >U : U +>null : null } class C { @@ -32,6 +34,7 @@ class C { >x : V >V : V >V : V +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.symbols new file mode 100644 index 00000000000..0bb008d82be --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.symbols @@ -0,0 +1,356 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + + foo(x: T, y?: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 8, 8)) + + foo(x: T, y?: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 8, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 9, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 8, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 12, 8)) + + foo(x: T, y?: T): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 12, 12)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 12, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 13, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 12, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 16, 12)) + + foo(x: T, y?: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 16, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 16, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 17, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 16, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 16, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 18, 1)) + + foo(x: T, y?: T): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 21, 8)) +} + +var a: { foo(x: T, y?: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 13)) + +var b = { foo(x: T, y?: T) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 17)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 22)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 17)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 46), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 46), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 46), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 31, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 32, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 35, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 39, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 40, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 0, 0)) + +function foo7(x: typeof a); // no error, bug? +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 65, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 67, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 69, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 71, 28), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 73, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 75, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 77, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 6, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 79, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 83, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 84, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 88, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 91, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 14, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 95, 29), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 10, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types index 33fce5295a7..da6144b57e2 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types @@ -14,6 +14,7 @@ class A { >y : T >T : T >T : T +>null : null } class B { @@ -27,6 +28,7 @@ class B { >y : T >T : T >T : T +>null : null } class C { @@ -40,6 +42,7 @@ class C { >y : T >T : T >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.symbols new file mode 100644 index 00000000000..8878d73f576 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.symbols @@ -0,0 +1,363 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + + foo(x: T, y?: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 10)) + + foo(x: T, y?: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 9, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 10)) + + foo(x: T, y?: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 13, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 14)) + + foo(x: T, y?: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 19)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 17, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 16, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 18, 1)) + + foo(x: T, y?: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 21, 8)) +} + +var a: { foo(x: T, y?: U): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 19)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 15)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 13)) + +var b = { foo(x: T, y?: U) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 20)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 49), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 49), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 49), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 0, 0)) + +function foo7(x: typeof a); // no error, bug? +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 65, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 69, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 73, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 77, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 6, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 14, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 10, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types index 2d9eab7c540..09478fc5d35 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types @@ -15,6 +15,7 @@ class A { >y : U >U : U >T : T +>null : null } class B { @@ -29,6 +30,7 @@ class B { >y : U >U : U >T : T +>null : null } class C { @@ -43,6 +45,7 @@ class C { >y : U >U : U >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.symbols new file mode 100644 index 00000000000..b1cfab012bf --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.symbols @@ -0,0 +1,363 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + + foo(x: T, y?: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 5, 8)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 10)) + + foo(x: T, y: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 9, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 8, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 10)) + + foo(x: T, y?: U): T { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 13, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 12, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 14)) + + foo(x: T, y?: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 19)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 17, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 16, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 18, 1)) + + foo(x: T, y: U): T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 20, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 10)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 21, 8)) +} + +var a: { foo(x: T, y?: U): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 19)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 15)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 13)) + +var b = { foo(x: T, y: U) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 20)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 48), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 48), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 48), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 27, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 31, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 35, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 36, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 39, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 40, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 43, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 52, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 56, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 57, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 59, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 60, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 61, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 63, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 0, 0)) + +function foo7(x: typeof a); // no error, bug? +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 64, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 61, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 63, 20), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 64, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 65, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 67, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 67, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 68, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 69, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 71, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 72, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 71, 36), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 73, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 75, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 76, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 75, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 77, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 79, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 6, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 80, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 79, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 81, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 84, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 83, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 84, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 85, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 87, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 88, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 88, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 89, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 91, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 92, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 91, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 93, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 14, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 96, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 96, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 97, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 99, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 18, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 10, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 100, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts, 101, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types index 54ec438104e..d0356784ed6 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types @@ -15,6 +15,7 @@ class A { >y : U >U : U >T : T +>null : null } class B { @@ -29,6 +30,7 @@ class B { >y : U >U : U >T : T +>null : null } class C { @@ -43,6 +45,7 @@ class C { >y : U >U : U >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.symbols new file mode 100644 index 00000000000..6f53dcf17b2 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.symbols @@ -0,0 +1,259 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B> { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 4, 8)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 4, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 8, 8)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 8, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 12, 12)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + + new(x: T): string; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 12, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 14, 1)) + + new(x: T): string; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 17, 8)) +>Boolean : Symbol(Boolean, Decl(lib.d.ts, 443, 38), Decl(lib.d.ts, 456, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 17, 27)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 17, 8)) +} + +var a: { new>(x: T): string } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 13)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 38)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 13)) + +var b = { new(x: T) { return ''; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 14)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 32)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 14)) + +function foo1b(x: B>); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 23, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 24, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo1b(x: B>); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 23, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 24, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 23, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 24, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 41, 14)) + +function foo8(x: B>); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 44, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 43, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 44, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 44, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 45, 14)) + +function foo9(x: B>); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 47, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo9(x: C); // error, types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 47, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 48, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 47, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 49, 14)) + +function foo10(x: B>); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 51, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 51, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 51, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 52, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 51, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 53, 15)) + +function foo11(x: B>); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 55, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 55, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 56, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 55, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 57, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 59, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 61, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 63, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 14, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 64, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 65, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 67, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 68, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 69, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 72, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts, 73, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types index 7acc93db124..ef3ec91f479 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types @@ -11,6 +11,7 @@ class B> { constructor(x: T) { return null; } >x : T >T : T +>null : null } class C { @@ -21,6 +22,7 @@ class C { constructor(x: T) { return null; } >x : T >T : T +>null : null } interface I { @@ -58,6 +60,7 @@ var b = { new(x: T) { return ''; } }; // not a construct signa >RegExp : RegExp >x : T >T : T +>'' : string function foo1b(x: B>); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.symbols new file mode 100644 index 00000000000..703ee5d3cc4 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.symbols @@ -0,0 +1,268 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 4, 8)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 4, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 8, 8)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 8, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 12, 12)) + + new(x: T): Date; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 12, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 14, 1)) + + new(x: T): RegExp; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 17, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 17, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 17, 8)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +} + +var a: { new(x: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 13)) + +var b = { new(x: T): T { return null; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 17)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 45), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 45), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 45), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 41, 14)) + +function foo5(x: typeof a): number; +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 44, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) + +function foo5(x: typeof b): string; // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 44, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 44, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) + +function foo5(x: any): any { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 43, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 44, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 45, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 48, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 49, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 51, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 51, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo9(x: C); // error since types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 51, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 52, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 51, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 53, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 56, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 53, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 57, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 59, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 60, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 60, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 61, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 63, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 64, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 63, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 63, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 64, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 64, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 63, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 64, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 65, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 65, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 67, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 68, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 67, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 65, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 67, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 68, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 68, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 65, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 67, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 68, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 69, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 69, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 69, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 72, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 69, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 73, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 75, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 10, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 76, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 75, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 76, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 77, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 79, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 80, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 79, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 14, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 79, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 80, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 80, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 6, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 77, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 79, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 80, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 81, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types index 4b2e628ad5d..657c38aae9a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types @@ -10,6 +10,7 @@ class B { constructor(x: T) { return null; } >x : T >T : T +>null : null } class C { @@ -19,6 +20,7 @@ class C { constructor(x: T) { return null; } >x : T >T : T +>null : null } interface I { @@ -56,6 +58,7 @@ var b = { new(x: T): T { return null; } }; // not a construct signature, func >x : T >T : T >T : T +>null : null function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.symbols new file mode 100644 index 00000000000..faa0995c2dd --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.symbols @@ -0,0 +1,277 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 4, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 4, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 8, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + constructor(x: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 8, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 12, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + + new(x: T): Date; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 12, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 14, 1)) + + new(x: T): RegExp; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 17, 8)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 17, 24)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 17, 8)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +} + +var a: { new(x: T): T } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 29)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 13)) + +var b = { new(x: T) { return null; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 14)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 30)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo9(x: C); // error since types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 49, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 52, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 53, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 56, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 61, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 63, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 14, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 65, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 68, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 69, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 72, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 73, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 75, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 75, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 14, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 75, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 75, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 77, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types index a25fb5b876a..181acc2ce91 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types @@ -11,6 +11,7 @@ class B { constructor(x: T) { return null; } >x : T >T : T +>null : null } class C { @@ -21,6 +22,7 @@ class C { constructor(x: T) { return null; } >x : T >T : T +>null : null } interface I { @@ -61,6 +63,7 @@ var b = { new(x: T) { return null; } }; // not a construct signa >Date : Date >x : T >T : T +>null : null function foo1b(x: B); >foo1b : { (x: B): any; (x: B): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.symbols new file mode 100644 index 00000000000..d7797a833c9 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.symbols @@ -0,0 +1,275 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts === +// object types are identical structurally + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 2, 8)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 2, 10)) + + constructor(x: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 3, 16)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 2, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 6, 8)) +>W : Symbol(W, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 6, 10)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 6, 13)) + + constructor(x: V) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 7, 16)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 6, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 12)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 14)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 17)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 20)) + + new(x: X): B; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 11, 8)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 12)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 12)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 10, 14)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 12, 1)) + + new (x: Y): C; +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 9)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 11)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 17)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 21)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 9)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 9)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 11)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 15, 14)) +} + +var a: { new (x: Z): C; } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 3)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 19)) +>CC : Symbol(CC, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 22)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 30)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 19)) + +var b = { new(x: A) { return x; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 9)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 19)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 22)) +>E : Symbol(E, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 25)) +>F : Symbol(F, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 32)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 32)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 54), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 21, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 22, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 21, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 54), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 21, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 22, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 22, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 54), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 21, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 22, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 23, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 25, 46), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 26, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 25, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 25, 46), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 26, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 26, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 25, 46), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 26, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 27, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 29, 53), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 30, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 29, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 29, 53), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 30, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 30, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 29, 53), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 30, 53)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 31, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 33, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 34, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 35, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 37, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 38, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 39, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 41, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 41, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo8(x: I); // BUG 832086 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 41, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 41, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 43, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 45, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 46, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 45, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo9(x: C>); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 45, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 46, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 46, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 45, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 46, 55)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 47, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 49, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 49, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 49, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 50, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 49, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 51, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 53, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 53, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 53, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 54, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 53, 38), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 55, 15)) + +function foo12(x: I, number, Date, string>); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 62), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: C, number, Date>); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 62), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 62), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 54)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 59, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 62, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 61, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 12, 1)) + +function foo12b(x: C); // BUG 832086 +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 62, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 62, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 62, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 63, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 66, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 67, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 69, 52), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 69, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 69, 52), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 70, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 69, 52), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 71, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types index 683c3ace9f9..b8e7c15c9b5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types @@ -9,6 +9,7 @@ class B { constructor(x: U) { return null; } >x : U >U : U +>null : null } class C { @@ -20,6 +21,7 @@ class C { constructor(x: V) { return null; } >x : V >V : V +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.symbols new file mode 100644 index 00000000000..6e31b7fcc41 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.symbols @@ -0,0 +1,243 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts === +// object types are identical structurally + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 2, 8)) + + constructor(x: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 3, 16)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 2, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 6, 8)) + + constructor(x: V) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 7, 16)) +>V : Symbol(V, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 6, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 10, 12)) + + new(x: X): B; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 11, 8)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 10, 12)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) +>X : Symbol(X, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 10, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 12, 1)) + + new(x: Y): C; +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 15, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 15, 11)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 15, 8)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) +>Y : Symbol(Y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 15, 8)) +} + +var a: { new(x: Z): B } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 3)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 16)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 13)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) +>Z : Symbol(Z, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 13)) + +var b = { new(x: A) { return new C(x); } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 9)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 17)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 17)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 21, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 22, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 21, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 21, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 22, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 22, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 21, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 22, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 23, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 25, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 25, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 25, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 26, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 23, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 25, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 26, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 27, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 29, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 30, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 29, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 29, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 30, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 30, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 27, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 29, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 30, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 31, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 33, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 34, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 31, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 33, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 35, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 37, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 38, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 35, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 37, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 39, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 41, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 41, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo8(x: I); // BUG 832086 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 41, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 41, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 43, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 45, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 45, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 45, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 46, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 43, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 45, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 46, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 47, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 49, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 49, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo10(x: typeof a); // BUG 832086 +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 49, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 50, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 47, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 49, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 51, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 53, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 53, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 53, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 54, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 51, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 53, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 55, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 57, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 57, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 57, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 57, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 59, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 61, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 12, 1)) + +function foo12b(x: C); // BUG 832086 +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 62, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 4, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 59, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 61, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 62, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 63, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 65, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 65, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo13(x: typeof a); // BUG 832086 +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 65, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 66, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 65, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 67, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 69, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 69, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 8, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 69, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 70, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 69, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts, 71, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types index af65ca5b911..db188b1b358 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types @@ -8,6 +8,7 @@ class B { constructor(x: U) { return null; } >x : U >U : U +>null : null } class C { @@ -17,6 +18,7 @@ class C { constructor(x: V) { return null; } >x : V >V : V +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.symbols new file mode 100644 index 00000000000..c42a6ae4341 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.symbols @@ -0,0 +1,258 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 4, 8)) + + constructor(x: T, y?: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 4, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 5, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 4, 8)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 8, 8)) + + constructor(x: T, y?: T) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 9, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 8, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 12, 12)) + + new(x: T, y?: T): B; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 12, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 13, 13)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 12, 12)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 12, 12)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 14, 1)) + + new(x: T, y?: T): C; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 8)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 11)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 8)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 17, 8)) +} + +var a: { new(x: T, y?: T): B } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 13)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 13)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 13)) + +var b = { new(x: T, y?: T) { return new C(x, y); } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 17)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 22)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 14)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 17)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 22)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 59), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 59), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 59), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 23, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 24, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 27, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 28, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 31, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 32, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 41, 14)) + +function foo8(x: B): string; +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 43, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo8(x: I): number; // BUG 832086 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo8(x: any): any { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 45, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo9(x: C); // error, differ only by return type +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 48, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 45, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 47, 28), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 48, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 49, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 51, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 51, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo10(x: typeof a); // BUG 832086 +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 51, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 52, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 51, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 53, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 56, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 55, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 57, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 59, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 59, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 60, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 61, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 63, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 14, 1)) + +function foo12b(x: C); // BUG 832086 +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 64, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 6, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 64, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 65, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 67, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo13(x: typeof a); // BUG 832086 +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 68, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 67, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 69, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 10, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 72, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 71, 29), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts, 73, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types index a6dea7c2518..027fe3b0043 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types @@ -12,6 +12,7 @@ class B { >T : T >y : T >T : T +>null : null } class C { @@ -23,6 +24,7 @@ class C { >T : T >y : T >T : T +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.symbols new file mode 100644 index 00000000000..44bc153cd8f --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.symbols @@ -0,0 +1,268 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 4, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 4, 10)) + + constructor(x: T, y?: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 4, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 5, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 4, 10)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 8, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 8, 10)) + + constructor(x: T, y?: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 9, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 8, 10)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 14)) + + new (x: T, y?: U): B; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 13, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 13, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 12, 14)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 14, 1)) + + new (x: T, y?: U): C; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 9)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 11)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 15)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 9)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 11)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 9)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 17, 11)) +} + +var a: { new(x: T, y?: U): B } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 15)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 19)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 15)) + +var b = { new(x: T, y?: U) { return new C(x, y); } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 20)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 25)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 65), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 65), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 65), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 41, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 43, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo8(x: I); // BUG 832086 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 45, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 48, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 49, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 51, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo10(x: typeof a); // BUG 832086 +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 52, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 53, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 56, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 57, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 59, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo12(x: C); // BUG 832086 +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 61, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 63, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 14, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 64, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 6, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 65, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 67, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo13(x: typeof a); // BUG 832086 +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 68, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 69, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 10, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 72, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts, 73, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types index 3c0f09e61da..9a415f6cbf4 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types @@ -13,6 +13,7 @@ class B { >T : T >y : U >U : U +>null : null } class C { @@ -25,6 +26,7 @@ class C { >T : T >y : U >U : U +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.symbols new file mode 100644 index 00000000000..3eb24d1b400 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.symbols @@ -0,0 +1,268 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 4, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 4, 10)) + + constructor(x: T, y: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 4, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 5, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 4, 10)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 8, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 8, 10)) + + constructor(x: T, y?: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 9, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 8, 10)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 14)) + + new(x: T, y?: U): B; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 13, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 12, 14)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 14, 1)) + + new(x: T, y: U): C; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 10)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 19)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 10)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 17, 10)) +} + +var a: { new (x: T, y?: U): B }; +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 16)) + +var b = { new(x: T, y: U) { return new C(x, y); } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 20)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 16)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 20)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 25)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 64), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 23, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 64), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 24, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 64), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 23, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 24, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 25, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 27, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 28, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 27, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 28, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 29, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 31, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 32, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 31, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 32, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 33, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 35, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 36, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 33, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 35, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 36, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 37, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 39, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 40, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 41, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 43, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo8(x: I); // BUG 832086 +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 43, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 45, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 47, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo9(x: C); // error, differ only by return type +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 48, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 47, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 48, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 49, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 51, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo10(x: typeof a); // BUG 832086 +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 52, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 52, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 53, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 55, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 0, 0)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 56, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 55, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 56, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 57, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 59, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 59, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 61, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 63, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 14, 1)) + +function foo12b(x: C); // BUG 832086 +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 64, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 6, 1)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 64, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 65, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 67, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo13(x: typeof a); // BUG 832086 +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 68, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 20, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 67, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 69, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 10, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 72, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 21, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 72, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts, 73, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types index f21ccc15abb..c73d45260f9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types @@ -13,6 +13,7 @@ class B { >T : T >y : U >U : U +>null : null } class C { @@ -25,6 +26,7 @@ class C { >T : T >y : U >U : U +>null : null } interface I { diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.symbols b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.symbols new file mode 100644 index 00000000000..4a2eb1ab2a1 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.symbols @@ -0,0 +1,377 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithNumericIndexers1.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + + [x: number]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 3, 5)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + + [x: number]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 7, 5)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers1.ts, 10, 8)) + + [x: number]: T; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 11, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers1.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + + [x: number]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 15, 5)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers1.ts, 16, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers1.ts, 19, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + + [x: number]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 25, 5)) +} +var b: { [x: number]: string; } = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 10)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 35)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers1.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 29, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers1.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 30, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers1.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 31, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 33, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 34, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 35, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers1.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 37, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers1.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 38, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers1.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 39, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers1.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 41, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers1.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers1.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 43, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers1.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 45, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers1.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 46, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers1.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 47, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers1.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 49, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers1.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 50, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers1.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 51, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers1.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 53, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers1.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 54, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers1.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 55, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 57, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 59, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 61, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 62, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers1.ts, 16, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 63, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers1.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 65, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo5d(x: PB); // error +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers1.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 66, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers1.ts, 19, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers1.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 67, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers1.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 69, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers1.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 70, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers1.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 71, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers1.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 73, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers1.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers1.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 74, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers1.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 75, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers1.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 77, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers1.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 78, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers1.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 79, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers1.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 81, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers1.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 82, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers1.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers1.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 83, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers1.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 85, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers1.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 86, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers1.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers1.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 87, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers1.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 89, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers1.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 90, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers1.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 91, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 93, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo11b(x: PA); // error +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 94, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers1.ts, 16, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 95, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 97, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers1.ts, 4, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 98, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers1.ts, 19, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers1.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers1.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 99, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers1.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 101, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers1.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 102, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers1.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers1.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers1.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 103, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers1.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 105, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers1.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 106, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers1.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers1.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 107, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers1.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 109, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers1.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 110, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers1.ts, 27, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers1.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 111, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers1.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 113, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo15(x: PA); // error +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers1.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 114, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers1.ts, 16, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers1.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 115, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers1.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 117, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers1.ts, 12, 1)) + +function foo16(x: PB); // error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers1.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 118, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers1.ts, 19, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers1.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers1.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers1.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers1.ts, 119, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types index a0603ae0777..2284d06ffbd 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types @@ -52,6 +52,7 @@ var b: { [x: number]: string; } = { foo: '' }; >x : number >{ foo: '' } : { [x: number]: undefined; foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.symbols b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.symbols new file mode 100644 index 00000000000..375fff858fb --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.symbols @@ -0,0 +1,395 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithNumericIndexers2.ts === +// object types are identical structurally + +class Base { foo: string; } +>Base : Symbol(Base, Decl(objectTypesIdentityWithNumericIndexers2.ts, 0, 0)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithNumericIndexers2.ts, 0, 0)) +>bar : Symbol(bar, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 28)) + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + + [x: number]: Base; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 6, 5)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithNumericIndexers2.ts, 0, 0)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + + [x: number]: Derived; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 10, 5)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers2.ts, 13, 8)) + + [x: number]: T; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 14, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers2.ts, 13, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + + [x: number]: Derived; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 18, 5)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers2.ts, 19, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers2.ts, 22, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + + [x: number]: Base; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 28, 5)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithNumericIndexers2.ts, 0, 0)) +} +var b: { [x: number]: Derived; } = { foo: null }; +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 10)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 36)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithNumericIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 32, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithNumericIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 33, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithNumericIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 34, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 36, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 37, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 38, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithNumericIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 40, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithNumericIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 41, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithNumericIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 42, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 45, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 46, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 48, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 49, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 50, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 52, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 53, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 54, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 56, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 57, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 58, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 60, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 61, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 62, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 64, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 65, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers2.ts, 19, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 66, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 68, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo5d(x: PB); // ok +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 69, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers2.ts, 22, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 70, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 72, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 73, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 74, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 76, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers2.ts, 3, 43)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 77, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 78, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 80, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 81, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 82, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 84, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 85, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithNumericIndexers2.ts, 0, 0)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithNumericIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 86, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 88, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 89, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithNumericIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 90, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 92, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 93, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 94, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 96, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo11b(x: PA); // ok +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 97, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers2.ts, 19, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 98, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 100, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers2.ts, 7, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 101, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers2.ts, 22, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithNumericIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 102, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 104, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 105, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers2.ts, 11, 1)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithNumericIndexers2.ts, 2, 27)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithNumericIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 106, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 108, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 109, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers2.ts, 27, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 110, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 112, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 113, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers2.ts, 30, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 114, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 116, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo15(x: PA); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 117, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers2.ts, 19, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 118, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 120, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers2.ts, 15, 1)) + +function foo16(x: PB); // error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 121, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers2.ts, 22, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithNumericIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithNumericIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers2.ts, 122, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types index 9e4ccb5c43b..1a580297b1b 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types @@ -68,6 +68,7 @@ var b: { [x: number]: Derived; } = { foo: null }; >foo : Derived >null : Derived >Derived : Derived +>null : null function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.symbols b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.symbols new file mode 100644 index 00000000000..c0bc1b5cf60 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.symbols @@ -0,0 +1,377 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithNumericIndexers3.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + + [x: number]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 3, 5)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 7, 5)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers3.ts, 10, 8)) + + [x: number]: T; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 11, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithNumericIndexers3.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 15, 5)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers3.ts, 16, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers3.ts, 19, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 25, 5)) +} +var b: { [x: number]: string; } = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 10)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 35)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers3.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 29, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers3.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 30, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 46), Decl(objectTypesIdentityWithNumericIndexers3.ts, 29, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 31, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 33, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 34, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 31, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 33, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 35, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers3.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 37, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers3.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 38, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 35, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 37, 29), Decl(objectTypesIdentityWithNumericIndexers3.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 39, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers3.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 41, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers3.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithNumericIndexers3.ts, 39, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 41, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 43, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers3.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 45, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers3.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 46, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithNumericIndexers3.ts, 43, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 45, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 47, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers3.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 49, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers3.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 50, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithNumericIndexers3.ts, 47, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 49, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 51, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers3.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 53, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers3.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 54, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithNumericIndexers3.ts, 51, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 53, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 55, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 57, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 55, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 57, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 59, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 61, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 62, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers3.ts, 16, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 59, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 61, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 63, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers3.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 65, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo5d(x: PB); // ok +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers3.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 66, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers3.ts, 19, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithNumericIndexers3.ts, 63, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 65, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 67, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers3.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 69, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers3.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 70, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithNumericIndexers3.ts, 67, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 69, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 71, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers3.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 73, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithNumericIndexers3.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers3.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 74, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithNumericIndexers3.ts, 71, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 73, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 75, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers3.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 77, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers3.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 78, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithNumericIndexers3.ts, 75, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 77, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 79, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers3.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 81, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers3.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 82, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithNumericIndexers3.ts, 79, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 81, 20), Decl(objectTypesIdentityWithNumericIndexers3.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 83, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers3.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 85, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers3.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 86, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithNumericIndexers3.ts, 83, 25), Decl(objectTypesIdentityWithNumericIndexers3.ts, 85, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 87, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers3.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 89, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers3.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 90, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithNumericIndexers3.ts, 87, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 89, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 91, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 93, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo11b(x: PA); // ok +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 94, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers3.ts, 16, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 91, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 93, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 95, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 97, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithNumericIndexers3.ts, 4, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 98, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers3.ts, 19, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithNumericIndexers3.ts, 95, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 97, 22), Decl(objectTypesIdentityWithNumericIndexers3.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 99, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers3.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 101, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers3.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 102, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithNumericIndexers3.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithNumericIndexers3.ts, 99, 27), Decl(objectTypesIdentityWithNumericIndexers3.ts, 101, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 103, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers3.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 105, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers3.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 106, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithNumericIndexers3.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithNumericIndexers3.ts, 103, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 105, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 107, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers3.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 109, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers3.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 110, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithNumericIndexers3.ts, 27, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithNumericIndexers3.ts, 107, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 109, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 111, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers3.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 113, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo15(x: PA); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers3.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 114, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithNumericIndexers3.ts, 16, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithNumericIndexers3.ts, 111, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 113, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 115, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers3.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 117, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithNumericIndexers3.ts, 12, 1)) + +function foo16(x: PB); // error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers3.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 118, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithNumericIndexers3.ts, 19, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithNumericIndexers3.ts, 115, 26), Decl(objectTypesIdentityWithNumericIndexers3.ts, 117, 21), Decl(objectTypesIdentityWithNumericIndexers3.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithNumericIndexers3.ts, 119, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types index 3553f5f7252..ae384bbb4db 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types @@ -52,6 +52,7 @@ var b: { [x: number]: string; } = { foo: '' }; >x : number >{ foo: '' } : { [x: number]: undefined; foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithOptionality.symbols b/tests/baselines/reference/objectTypesIdentityWithOptionality.symbols new file mode 100644 index 00000000000..595295418f5 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithOptionality.symbols @@ -0,0 +1,167 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithOptionality.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithOptionality.ts, 0, 0)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 2, 9)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithOptionality.ts, 4, 1)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 6, 9)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithOptionality.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithOptionality.ts, 10, 8)) + + foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 10, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithOptionality.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + + foo?: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 14, 13)) +} + +var a: { foo?: string; } +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 18, 8)) + +var b = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithOptionality.ts, 19, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithOptionality.ts, 19, 9)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithOptionality.ts, 19, 20), Decl(objectTypesIdentityWithOptionality.ts, 21, 20), Decl(objectTypesIdentityWithOptionality.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 21, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithOptionality.ts, 19, 20), Decl(objectTypesIdentityWithOptionality.ts, 21, 20), Decl(objectTypesIdentityWithOptionality.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 22, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithOptionality.ts, 19, 20), Decl(objectTypesIdentityWithOptionality.ts, 21, 20), Decl(objectTypesIdentityWithOptionality.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 23, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithOptionality.ts, 23, 25), Decl(objectTypesIdentityWithOptionality.ts, 25, 27), Decl(objectTypesIdentityWithOptionality.ts, 26, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 25, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithOptionality.ts, 23, 25), Decl(objectTypesIdentityWithOptionality.ts, 25, 27), Decl(objectTypesIdentityWithOptionality.ts, 26, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 26, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithOptionality.ts, 23, 25), Decl(objectTypesIdentityWithOptionality.ts, 25, 27), Decl(objectTypesIdentityWithOptionality.ts, 26, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 27, 14)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithOptionality.ts, 27, 25), Decl(objectTypesIdentityWithOptionality.ts, 29, 20), Decl(objectTypesIdentityWithOptionality.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 29, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithOptionality.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithOptionality.ts, 27, 25), Decl(objectTypesIdentityWithOptionality.ts, 29, 20), Decl(objectTypesIdentityWithOptionality.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 30, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithOptionality.ts, 27, 25), Decl(objectTypesIdentityWithOptionality.ts, 29, 20), Decl(objectTypesIdentityWithOptionality.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 31, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithOptionality.ts, 31, 25), Decl(objectTypesIdentityWithOptionality.ts, 33, 20), Decl(objectTypesIdentityWithOptionality.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 33, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithOptionality.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithOptionality.ts, 31, 25), Decl(objectTypesIdentityWithOptionality.ts, 33, 20), Decl(objectTypesIdentityWithOptionality.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 34, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithOptionality.ts, 31, 25), Decl(objectTypesIdentityWithOptionality.ts, 33, 20), Decl(objectTypesIdentityWithOptionality.ts, 34, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 35, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithOptionality.ts, 35, 25), Decl(objectTypesIdentityWithOptionality.ts, 37, 20), Decl(objectTypesIdentityWithOptionality.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 37, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithOptionality.ts, 4, 1)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithOptionality.ts, 35, 25), Decl(objectTypesIdentityWithOptionality.ts, 37, 20), Decl(objectTypesIdentityWithOptionality.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 38, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithOptionality.ts, 35, 25), Decl(objectTypesIdentityWithOptionality.ts, 37, 20), Decl(objectTypesIdentityWithOptionality.ts, 38, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 39, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithOptionality.ts, 39, 25), Decl(objectTypesIdentityWithOptionality.ts, 41, 21), Decl(objectTypesIdentityWithOptionality.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 41, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithOptionality.ts, 4, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithOptionality.ts, 39, 25), Decl(objectTypesIdentityWithOptionality.ts, 41, 21), Decl(objectTypesIdentityWithOptionality.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 42, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithOptionality.ts, 39, 25), Decl(objectTypesIdentityWithOptionality.ts, 41, 21), Decl(objectTypesIdentityWithOptionality.ts, 42, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 43, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithOptionality.ts, 43, 26), Decl(objectTypesIdentityWithOptionality.ts, 45, 21), Decl(objectTypesIdentityWithOptionality.ts, 46, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 45, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithOptionality.ts, 43, 26), Decl(objectTypesIdentityWithOptionality.ts, 45, 21), Decl(objectTypesIdentityWithOptionality.ts, 46, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 46, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithOptionality.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithOptionality.ts, 43, 26), Decl(objectTypesIdentityWithOptionality.ts, 45, 21), Decl(objectTypesIdentityWithOptionality.ts, 46, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 47, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithOptionality.ts, 47, 26), Decl(objectTypesIdentityWithOptionality.ts, 49, 21), Decl(objectTypesIdentityWithOptionality.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 49, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithOptionality.ts, 47, 26), Decl(objectTypesIdentityWithOptionality.ts, 49, 21), Decl(objectTypesIdentityWithOptionality.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 50, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithOptionality.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithOptionality.ts, 47, 26), Decl(objectTypesIdentityWithOptionality.ts, 49, 21), Decl(objectTypesIdentityWithOptionality.ts, 50, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 51, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithOptionality.ts, 51, 26), Decl(objectTypesIdentityWithOptionality.ts, 53, 21), Decl(objectTypesIdentityWithOptionality.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 53, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithOptionality.ts, 12, 1)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithOptionality.ts, 51, 26), Decl(objectTypesIdentityWithOptionality.ts, 53, 21), Decl(objectTypesIdentityWithOptionality.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 54, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithOptionality.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithOptionality.ts, 51, 26), Decl(objectTypesIdentityWithOptionality.ts, 53, 21), Decl(objectTypesIdentityWithOptionality.ts, 54, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithOptionality.ts, 55, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithOptionality.types b/tests/baselines/reference/objectTypesIdentityWithOptionality.types index 0ca5b552bf5..bab319f3598 100644 --- a/tests/baselines/reference/objectTypesIdentityWithOptionality.types +++ b/tests/baselines/reference/objectTypesIdentityWithOptionality.types @@ -39,6 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string function foo2(x: I); >foo2 : { (x: I): any; (x: I): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.symbols b/tests/baselines/reference/objectTypesIdentityWithPrivates.symbols new file mode 100644 index 00000000000..d7680f7fb91 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.symbols @@ -0,0 +1,374 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + + private foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 2, 9)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + + private foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 6, 9)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates.ts, 10, 8)) + + private foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 10, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 14, 13)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithPrivates.ts, 16, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithPrivates.ts, 19, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) +} + +var a: { foo: string; } +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 24, 8)) + +var b = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithPrivates.ts, 25, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates.ts, 25, 9)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates.ts, 25, 20), Decl(objectTypesIdentityWithPrivates.ts, 27, 20), Decl(objectTypesIdentityWithPrivates.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 27, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates.ts, 25, 20), Decl(objectTypesIdentityWithPrivates.ts, 27, 20), Decl(objectTypesIdentityWithPrivates.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 28, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates.ts, 25, 20), Decl(objectTypesIdentityWithPrivates.ts, 27, 20), Decl(objectTypesIdentityWithPrivates.ts, 28, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 29, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPrivates.ts, 29, 25), Decl(objectTypesIdentityWithPrivates.ts, 31, 21), Decl(objectTypesIdentityWithPrivates.ts, 32, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 31, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPrivates.ts, 29, 25), Decl(objectTypesIdentityWithPrivates.ts, 31, 21), Decl(objectTypesIdentityWithPrivates.ts, 32, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 32, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPrivates.ts, 29, 25), Decl(objectTypesIdentityWithPrivates.ts, 31, 21), Decl(objectTypesIdentityWithPrivates.ts, 32, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 33, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPrivates.ts, 33, 26), Decl(objectTypesIdentityWithPrivates.ts, 35, 29), Decl(objectTypesIdentityWithPrivates.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 35, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPrivates.ts, 33, 26), Decl(objectTypesIdentityWithPrivates.ts, 35, 29), Decl(objectTypesIdentityWithPrivates.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 36, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPrivates.ts, 33, 26), Decl(objectTypesIdentityWithPrivates.ts, 35, 29), Decl(objectTypesIdentityWithPrivates.ts, 36, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 37, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates.ts, 37, 26), Decl(objectTypesIdentityWithPrivates.ts, 39, 20), Decl(objectTypesIdentityWithPrivates.ts, 40, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 39, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates.ts, 37, 26), Decl(objectTypesIdentityWithPrivates.ts, 39, 20), Decl(objectTypesIdentityWithPrivates.ts, 40, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 40, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates.ts, 37, 26), Decl(objectTypesIdentityWithPrivates.ts, 39, 20), Decl(objectTypesIdentityWithPrivates.ts, 40, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 41, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates.ts, 41, 25), Decl(objectTypesIdentityWithPrivates.ts, 43, 27), Decl(objectTypesIdentityWithPrivates.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 43, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates.ts, 41, 25), Decl(objectTypesIdentityWithPrivates.ts, 43, 27), Decl(objectTypesIdentityWithPrivates.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 44, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates.ts, 41, 25), Decl(objectTypesIdentityWithPrivates.ts, 43, 27), Decl(objectTypesIdentityWithPrivates.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 45, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates.ts, 45, 25), Decl(objectTypesIdentityWithPrivates.ts, 47, 27), Decl(objectTypesIdentityWithPrivates.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 47, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithPrivates.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates.ts, 45, 25), Decl(objectTypesIdentityWithPrivates.ts, 47, 27), Decl(objectTypesIdentityWithPrivates.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 48, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithPrivates.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates.ts, 45, 25), Decl(objectTypesIdentityWithPrivates.ts, 47, 27), Decl(objectTypesIdentityWithPrivates.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 49, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates.ts, 49, 25), Decl(objectTypesIdentityWithPrivates.ts, 51, 20), Decl(objectTypesIdentityWithPrivates.ts, 52, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 51, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo5(x: B); // no error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates.ts, 49, 25), Decl(objectTypesIdentityWithPrivates.ts, 51, 20), Decl(objectTypesIdentityWithPrivates.ts, 52, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 52, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates.ts, 49, 25), Decl(objectTypesIdentityWithPrivates.ts, 51, 20), Decl(objectTypesIdentityWithPrivates.ts, 52, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 53, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPrivates.ts, 53, 25), Decl(objectTypesIdentityWithPrivates.ts, 55, 21), Decl(objectTypesIdentityWithPrivates.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 55, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo5b(x: C); // no error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPrivates.ts, 53, 25), Decl(objectTypesIdentityWithPrivates.ts, 55, 21), Decl(objectTypesIdentityWithPrivates.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPrivates.ts, 53, 25), Decl(objectTypesIdentityWithPrivates.ts, 55, 21), Decl(objectTypesIdentityWithPrivates.ts, 56, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 57, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithPrivates.ts, 57, 26), Decl(objectTypesIdentityWithPrivates.ts, 59, 21), Decl(objectTypesIdentityWithPrivates.ts, 60, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 59, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithPrivates.ts, 57, 26), Decl(objectTypesIdentityWithPrivates.ts, 59, 21), Decl(objectTypesIdentityWithPrivates.ts, 60, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 60, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithPrivates.ts, 16, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithPrivates.ts, 57, 26), Decl(objectTypesIdentityWithPrivates.ts, 59, 21), Decl(objectTypesIdentityWithPrivates.ts, 60, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 61, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithPrivates.ts, 61, 26), Decl(objectTypesIdentityWithPrivates.ts, 63, 21), Decl(objectTypesIdentityWithPrivates.ts, 64, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 63, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo5d(x: PB); // no error +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithPrivates.ts, 61, 26), Decl(objectTypesIdentityWithPrivates.ts, 63, 21), Decl(objectTypesIdentityWithPrivates.ts, 64, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 64, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithPrivates.ts, 19, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithPrivates.ts, 61, 26), Decl(objectTypesIdentityWithPrivates.ts, 63, 21), Decl(objectTypesIdentityWithPrivates.ts, 64, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 65, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates.ts, 65, 26), Decl(objectTypesIdentityWithPrivates.ts, 67, 20), Decl(objectTypesIdentityWithPrivates.ts, 68, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 67, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo6(x: I); // no error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates.ts, 65, 26), Decl(objectTypesIdentityWithPrivates.ts, 67, 20), Decl(objectTypesIdentityWithPrivates.ts, 68, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 68, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates.ts, 65, 26), Decl(objectTypesIdentityWithPrivates.ts, 67, 20), Decl(objectTypesIdentityWithPrivates.ts, 68, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 69, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPrivates.ts, 69, 25), Decl(objectTypesIdentityWithPrivates.ts, 71, 20), Decl(objectTypesIdentityWithPrivates.ts, 72, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 71, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPrivates.ts, 0, 0)) + +function foo7(x: typeof a); // no error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPrivates.ts, 69, 25), Decl(objectTypesIdentityWithPrivates.ts, 71, 20), Decl(objectTypesIdentityWithPrivates.ts, 72, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 72, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPrivates.ts, 69, 25), Decl(objectTypesIdentityWithPrivates.ts, 71, 20), Decl(objectTypesIdentityWithPrivates.ts, 72, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 73, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPrivates.ts, 73, 25), Decl(objectTypesIdentityWithPrivates.ts, 75, 20), Decl(objectTypesIdentityWithPrivates.ts, 76, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 75, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo8(x: I); // no error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPrivates.ts, 73, 25), Decl(objectTypesIdentityWithPrivates.ts, 75, 20), Decl(objectTypesIdentityWithPrivates.ts, 76, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 76, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPrivates.ts, 73, 25), Decl(objectTypesIdentityWithPrivates.ts, 75, 20), Decl(objectTypesIdentityWithPrivates.ts, 76, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 77, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPrivates.ts, 77, 25), Decl(objectTypesIdentityWithPrivates.ts, 79, 20), Decl(objectTypesIdentityWithPrivates.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 79, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo9(x: C); // no error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPrivates.ts, 77, 25), Decl(objectTypesIdentityWithPrivates.ts, 79, 20), Decl(objectTypesIdentityWithPrivates.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 80, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPrivates.ts, 77, 25), Decl(objectTypesIdentityWithPrivates.ts, 79, 20), Decl(objectTypesIdentityWithPrivates.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 81, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPrivates.ts, 81, 25), Decl(objectTypesIdentityWithPrivates.ts, 83, 21), Decl(objectTypesIdentityWithPrivates.ts, 84, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 83, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo10(x: typeof a); // no error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPrivates.ts, 81, 25), Decl(objectTypesIdentityWithPrivates.ts, 83, 21), Decl(objectTypesIdentityWithPrivates.ts, 84, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 84, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPrivates.ts, 81, 25), Decl(objectTypesIdentityWithPrivates.ts, 83, 21), Decl(objectTypesIdentityWithPrivates.ts, 84, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 85, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPrivates.ts, 85, 26), Decl(objectTypesIdentityWithPrivates.ts, 87, 21), Decl(objectTypesIdentityWithPrivates.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 87, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo11(x: typeof b); // no error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPrivates.ts, 85, 26), Decl(objectTypesIdentityWithPrivates.ts, 87, 21), Decl(objectTypesIdentityWithPrivates.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 88, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithPrivates.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPrivates.ts, 85, 26), Decl(objectTypesIdentityWithPrivates.ts, 87, 21), Decl(objectTypesIdentityWithPrivates.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 89, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithPrivates.ts, 89, 26), Decl(objectTypesIdentityWithPrivates.ts, 91, 22), Decl(objectTypesIdentityWithPrivates.ts, 92, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 91, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo11b(x: PA); // no error +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithPrivates.ts, 89, 26), Decl(objectTypesIdentityWithPrivates.ts, 91, 22), Decl(objectTypesIdentityWithPrivates.ts, 92, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 92, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithPrivates.ts, 16, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithPrivates.ts, 89, 26), Decl(objectTypesIdentityWithPrivates.ts, 91, 22), Decl(objectTypesIdentityWithPrivates.ts, 92, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 93, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithPrivates.ts, 93, 27), Decl(objectTypesIdentityWithPrivates.ts, 95, 22), Decl(objectTypesIdentityWithPrivates.ts, 96, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 95, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithPrivates.ts, 4, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithPrivates.ts, 93, 27), Decl(objectTypesIdentityWithPrivates.ts, 95, 22), Decl(objectTypesIdentityWithPrivates.ts, 96, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 96, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithPrivates.ts, 19, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithPrivates.ts, 93, 27), Decl(objectTypesIdentityWithPrivates.ts, 95, 22), Decl(objectTypesIdentityWithPrivates.ts, 96, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 97, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPrivates.ts, 97, 27), Decl(objectTypesIdentityWithPrivates.ts, 99, 21), Decl(objectTypesIdentityWithPrivates.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 99, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo12(x: C); // no error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPrivates.ts, 97, 27), Decl(objectTypesIdentityWithPrivates.ts, 99, 21), Decl(objectTypesIdentityWithPrivates.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 100, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPrivates.ts, 97, 27), Decl(objectTypesIdentityWithPrivates.ts, 99, 21), Decl(objectTypesIdentityWithPrivates.ts, 100, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 101, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPrivates.ts, 101, 26), Decl(objectTypesIdentityWithPrivates.ts, 103, 21), Decl(objectTypesIdentityWithPrivates.ts, 104, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 103, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPrivates.ts, 101, 26), Decl(objectTypesIdentityWithPrivates.ts, 103, 21), Decl(objectTypesIdentityWithPrivates.ts, 104, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 104, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithPrivates.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPrivates.ts, 101, 26), Decl(objectTypesIdentityWithPrivates.ts, 103, 21), Decl(objectTypesIdentityWithPrivates.ts, 104, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 105, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPrivates.ts, 105, 26), Decl(objectTypesIdentityWithPrivates.ts, 107, 21), Decl(objectTypesIdentityWithPrivates.ts, 108, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 107, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPrivates.ts, 105, 26), Decl(objectTypesIdentityWithPrivates.ts, 107, 21), Decl(objectTypesIdentityWithPrivates.ts, 108, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 108, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithPrivates.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPrivates.ts, 105, 26), Decl(objectTypesIdentityWithPrivates.ts, 107, 21), Decl(objectTypesIdentityWithPrivates.ts, 108, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 109, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithPrivates.ts, 109, 26), Decl(objectTypesIdentityWithPrivates.ts, 111, 21), Decl(objectTypesIdentityWithPrivates.ts, 112, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 111, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo15(x: PA); // no error +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithPrivates.ts, 109, 26), Decl(objectTypesIdentityWithPrivates.ts, 111, 21), Decl(objectTypesIdentityWithPrivates.ts, 112, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 112, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithPrivates.ts, 16, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithPrivates.ts, 109, 26), Decl(objectTypesIdentityWithPrivates.ts, 111, 21), Decl(objectTypesIdentityWithPrivates.ts, 112, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 113, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithPrivates.ts, 113, 26), Decl(objectTypesIdentityWithPrivates.ts, 115, 21), Decl(objectTypesIdentityWithPrivates.ts, 116, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 115, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPrivates.ts, 12, 1)) + +function foo16(x: PB); // no error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithPrivates.ts, 113, 26), Decl(objectTypesIdentityWithPrivates.ts, 115, 21), Decl(objectTypesIdentityWithPrivates.ts, 116, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 116, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithPrivates.ts, 19, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithPrivates.ts, 113, 26), Decl(objectTypesIdentityWithPrivates.ts, 115, 21), Decl(objectTypesIdentityWithPrivates.ts, 116, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates.ts, 117, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.types b/tests/baselines/reference/objectTypesIdentityWithPrivates.types index 391f6f1f200..c828f45ac5a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.types +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.types @@ -49,6 +49,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.symbols b/tests/baselines/reference/objectTypesIdentityWithPrivates2.symbols new file mode 100644 index 00000000000..1a33946229e --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.symbols @@ -0,0 +1,115 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates2.ts === +// object types are identical structurally + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 2, 8)) + + private foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPrivates2.ts, 2, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 2, 8)) +} + +class D extends C { +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 6, 8)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithPrivates2.ts, 6, 8)) +} + +function foo1(x: C); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates2.ts, 7, 1), Decl(objectTypesIdentityWithPrivates2.ts, 9, 28), Decl(objectTypesIdentityWithPrivates2.ts, 10, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 9, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo1(x: C); // ok +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates2.ts, 7, 1), Decl(objectTypesIdentityWithPrivates2.ts, 9, 28), Decl(objectTypesIdentityWithPrivates2.ts, 10, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 10, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPrivates2.ts, 7, 1), Decl(objectTypesIdentityWithPrivates2.ts, 9, 28), Decl(objectTypesIdentityWithPrivates2.ts, 10, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 11, 14)) + +function foo2(x: D); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates2.ts, 11, 25), Decl(objectTypesIdentityWithPrivates2.ts, 13, 28), Decl(objectTypesIdentityWithPrivates2.ts, 14, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 13, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo2(x: D); // ok +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates2.ts, 11, 25), Decl(objectTypesIdentityWithPrivates2.ts, 13, 28), Decl(objectTypesIdentityWithPrivates2.ts, 14, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 14, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPrivates2.ts, 11, 25), Decl(objectTypesIdentityWithPrivates2.ts, 13, 28), Decl(objectTypesIdentityWithPrivates2.ts, 14, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 15, 14)) + +function foo3(x: C); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates2.ts, 15, 25), Decl(objectTypesIdentityWithPrivates2.ts, 17, 28), Decl(objectTypesIdentityWithPrivates2.ts, 18, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 17, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo3(x: D); // ok +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates2.ts, 15, 25), Decl(objectTypesIdentityWithPrivates2.ts, 17, 28), Decl(objectTypesIdentityWithPrivates2.ts, 18, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 18, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPrivates2.ts, 15, 25), Decl(objectTypesIdentityWithPrivates2.ts, 17, 28), Decl(objectTypesIdentityWithPrivates2.ts, 18, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 19, 14)) + +function foo4(x: C): number; +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 21, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo4(x: D): string; // BUG 831926 +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 22, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo4(x: any): any { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 23, 14)) + +var r = foo4(new C()); +>r : Symbol(r, Decl(objectTypesIdentityWithPrivates2.ts, 25, 3), Decl(objectTypesIdentityWithPrivates2.ts, 26, 3)) +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +var r = foo4(new D()); +>r : Symbol(r, Decl(objectTypesIdentityWithPrivates2.ts, 25, 3), Decl(objectTypesIdentityWithPrivates2.ts, 26, 3)) +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPrivates2.ts, 19, 25), Decl(objectTypesIdentityWithPrivates2.ts, 21, 36), Decl(objectTypesIdentityWithPrivates2.ts, 22, 36)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo5(x: C): number; +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates2.ts, 26, 30), Decl(objectTypesIdentityWithPrivates2.ts, 28, 36), Decl(objectTypesIdentityWithPrivates2.ts, 29, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 28, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo5(x: C): string; // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates2.ts, 26, 30), Decl(objectTypesIdentityWithPrivates2.ts, 28, 36), Decl(objectTypesIdentityWithPrivates2.ts, 29, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 29, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPrivates2.ts, 0, 0)) + +function foo5(x: any): any { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPrivates2.ts, 26, 30), Decl(objectTypesIdentityWithPrivates2.ts, 28, 36), Decl(objectTypesIdentityWithPrivates2.ts, 29, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 30, 14)) + +function foo6(x: D): number; +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates2.ts, 30, 30), Decl(objectTypesIdentityWithPrivates2.ts, 32, 36), Decl(objectTypesIdentityWithPrivates2.ts, 33, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 32, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo6(x: D): string; // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates2.ts, 30, 30), Decl(objectTypesIdentityWithPrivates2.ts, 32, 36), Decl(objectTypesIdentityWithPrivates2.ts, 33, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 33, 14)) +>D : Symbol(D, Decl(objectTypesIdentityWithPrivates2.ts, 4, 1)) + +function foo6(x: any): any { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPrivates2.ts, 30, 30), Decl(objectTypesIdentityWithPrivates2.ts, 32, 36), Decl(objectTypesIdentityWithPrivates2.ts, 33, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithPrivates2.ts, 34, 14)) + + + diff --git a/tests/baselines/reference/objectTypesIdentityWithPublics.symbols b/tests/baselines/reference/objectTypesIdentityWithPublics.symbols new file mode 100644 index 00000000000..ebfb52e3d2e --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithPublics.symbols @@ -0,0 +1,279 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPublics.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + + public foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 2, 9)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + + public foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 6, 9)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithPublics.ts, 10, 8)) + + public foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 10, 12)) +>T : Symbol(T, Decl(objectTypesIdentityWithPublics.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + + foo: string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 14, 13)) +} + +var a: { foo: string; } +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 18, 8)) + +var b = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithPublics.ts, 19, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithPublics.ts, 19, 9)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPublics.ts, 19, 20), Decl(objectTypesIdentityWithPublics.ts, 21, 20), Decl(objectTypesIdentityWithPublics.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 21, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPublics.ts, 19, 20), Decl(objectTypesIdentityWithPublics.ts, 21, 20), Decl(objectTypesIdentityWithPublics.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 22, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithPublics.ts, 19, 20), Decl(objectTypesIdentityWithPublics.ts, 21, 20), Decl(objectTypesIdentityWithPublics.ts, 22, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 23, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPublics.ts, 23, 25), Decl(objectTypesIdentityWithPublics.ts, 25, 21), Decl(objectTypesIdentityWithPublics.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 25, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPublics.ts, 23, 25), Decl(objectTypesIdentityWithPublics.ts, 25, 21), Decl(objectTypesIdentityWithPublics.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 26, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithPublics.ts, 23, 25), Decl(objectTypesIdentityWithPublics.ts, 25, 21), Decl(objectTypesIdentityWithPublics.ts, 26, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 27, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPublics.ts, 27, 26), Decl(objectTypesIdentityWithPublics.ts, 29, 29), Decl(objectTypesIdentityWithPublics.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 29, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPublics.ts, 27, 26), Decl(objectTypesIdentityWithPublics.ts, 29, 29), Decl(objectTypesIdentityWithPublics.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 30, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithPublics.ts, 27, 26), Decl(objectTypesIdentityWithPublics.ts, 29, 29), Decl(objectTypesIdentityWithPublics.ts, 30, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 31, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPublics.ts, 31, 26), Decl(objectTypesIdentityWithPublics.ts, 33, 20), Decl(objectTypesIdentityWithPublics.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 33, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPublics.ts, 31, 26), Decl(objectTypesIdentityWithPublics.ts, 33, 20), Decl(objectTypesIdentityWithPublics.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 34, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithPublics.ts, 31, 26), Decl(objectTypesIdentityWithPublics.ts, 33, 20), Decl(objectTypesIdentityWithPublics.ts, 34, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 35, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPublics.ts, 35, 25), Decl(objectTypesIdentityWithPublics.ts, 37, 27), Decl(objectTypesIdentityWithPublics.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 37, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPublics.ts, 35, 25), Decl(objectTypesIdentityWithPublics.ts, 37, 27), Decl(objectTypesIdentityWithPublics.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 38, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithPublics.ts, 35, 25), Decl(objectTypesIdentityWithPublics.ts, 37, 27), Decl(objectTypesIdentityWithPublics.ts, 38, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 39, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPublics.ts, 39, 25), Decl(objectTypesIdentityWithPublics.ts, 41, 27), Decl(objectTypesIdentityWithPublics.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 41, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithPublics.ts, 19, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPublics.ts, 39, 25), Decl(objectTypesIdentityWithPublics.ts, 41, 27), Decl(objectTypesIdentityWithPublics.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 42, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithPublics.ts, 19, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithPublics.ts, 39, 25), Decl(objectTypesIdentityWithPublics.ts, 41, 27), Decl(objectTypesIdentityWithPublics.ts, 42, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 43, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPublics.ts, 43, 25), Decl(objectTypesIdentityWithPublics.ts, 45, 20), Decl(objectTypesIdentityWithPublics.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 45, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPublics.ts, 43, 25), Decl(objectTypesIdentityWithPublics.ts, 45, 20), Decl(objectTypesIdentityWithPublics.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 46, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithPublics.ts, 43, 25), Decl(objectTypesIdentityWithPublics.ts, 45, 20), Decl(objectTypesIdentityWithPublics.ts, 46, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 47, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPublics.ts, 47, 25), Decl(objectTypesIdentityWithPublics.ts, 49, 21), Decl(objectTypesIdentityWithPublics.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 49, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPublics.ts, 47, 25), Decl(objectTypesIdentityWithPublics.ts, 49, 21), Decl(objectTypesIdentityWithPublics.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 50, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithPublics.ts, 47, 25), Decl(objectTypesIdentityWithPublics.ts, 49, 21), Decl(objectTypesIdentityWithPublics.ts, 50, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 51, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPublics.ts, 51, 26), Decl(objectTypesIdentityWithPublics.ts, 53, 20), Decl(objectTypesIdentityWithPublics.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 53, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPublics.ts, 51, 26), Decl(objectTypesIdentityWithPublics.ts, 53, 20), Decl(objectTypesIdentityWithPublics.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 54, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithPublics.ts, 51, 26), Decl(objectTypesIdentityWithPublics.ts, 53, 20), Decl(objectTypesIdentityWithPublics.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 55, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPublics.ts, 55, 25), Decl(objectTypesIdentityWithPublics.ts, 57, 20), Decl(objectTypesIdentityWithPublics.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 57, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithPublics.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPublics.ts, 55, 25), Decl(objectTypesIdentityWithPublics.ts, 57, 20), Decl(objectTypesIdentityWithPublics.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 58, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithPublics.ts, 55, 25), Decl(objectTypesIdentityWithPublics.ts, 57, 20), Decl(objectTypesIdentityWithPublics.ts, 58, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 59, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPublics.ts, 59, 25), Decl(objectTypesIdentityWithPublics.ts, 61, 20), Decl(objectTypesIdentityWithPublics.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 61, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPublics.ts, 59, 25), Decl(objectTypesIdentityWithPublics.ts, 61, 20), Decl(objectTypesIdentityWithPublics.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 62, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithPublics.ts, 59, 25), Decl(objectTypesIdentityWithPublics.ts, 61, 20), Decl(objectTypesIdentityWithPublics.ts, 62, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 63, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPublics.ts, 63, 25), Decl(objectTypesIdentityWithPublics.ts, 65, 20), Decl(objectTypesIdentityWithPublics.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPublics.ts, 63, 25), Decl(objectTypesIdentityWithPublics.ts, 65, 20), Decl(objectTypesIdentityWithPublics.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 66, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithPublics.ts, 63, 25), Decl(objectTypesIdentityWithPublics.ts, 65, 20), Decl(objectTypesIdentityWithPublics.ts, 66, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 67, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPublics.ts, 67, 25), Decl(objectTypesIdentityWithPublics.ts, 69, 21), Decl(objectTypesIdentityWithPublics.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 69, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPublics.ts, 67, 25), Decl(objectTypesIdentityWithPublics.ts, 69, 21), Decl(objectTypesIdentityWithPublics.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 70, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithPublics.ts, 67, 25), Decl(objectTypesIdentityWithPublics.ts, 69, 21), Decl(objectTypesIdentityWithPublics.ts, 70, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 71, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPublics.ts, 71, 26), Decl(objectTypesIdentityWithPublics.ts, 73, 21), Decl(objectTypesIdentityWithPublics.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 73, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithPublics.ts, 4, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPublics.ts, 71, 26), Decl(objectTypesIdentityWithPublics.ts, 73, 21), Decl(objectTypesIdentityWithPublics.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 74, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithPublics.ts, 19, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithPublics.ts, 71, 26), Decl(objectTypesIdentityWithPublics.ts, 73, 21), Decl(objectTypesIdentityWithPublics.ts, 74, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 75, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPublics.ts, 75, 26), Decl(objectTypesIdentityWithPublics.ts, 77, 21), Decl(objectTypesIdentityWithPublics.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 77, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPublics.ts, 75, 26), Decl(objectTypesIdentityWithPublics.ts, 77, 21), Decl(objectTypesIdentityWithPublics.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 78, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithPublics.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithPublics.ts, 75, 26), Decl(objectTypesIdentityWithPublics.ts, 77, 21), Decl(objectTypesIdentityWithPublics.ts, 78, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 79, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPublics.ts, 79, 26), Decl(objectTypesIdentityWithPublics.ts, 81, 21), Decl(objectTypesIdentityWithPublics.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 81, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPublics.ts, 79, 26), Decl(objectTypesIdentityWithPublics.ts, 81, 21), Decl(objectTypesIdentityWithPublics.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 82, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithPublics.ts, 18, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithPublics.ts, 79, 26), Decl(objectTypesIdentityWithPublics.ts, 81, 21), Decl(objectTypesIdentityWithPublics.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 83, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPublics.ts, 83, 26), Decl(objectTypesIdentityWithPublics.ts, 85, 21), Decl(objectTypesIdentityWithPublics.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 85, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithPublics.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPublics.ts, 83, 26), Decl(objectTypesIdentityWithPublics.ts, 85, 21), Decl(objectTypesIdentityWithPublics.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 86, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithPublics.ts, 19, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithPublics.ts, 83, 26), Decl(objectTypesIdentityWithPublics.ts, 85, 21), Decl(objectTypesIdentityWithPublics.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithPublics.ts, 87, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithPublics.types b/tests/baselines/reference/objectTypesIdentityWithPublics.types index 411fe4fb88e..daae624a7d1 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPublics.types +++ b/tests/baselines/reference/objectTypesIdentityWithPublics.types @@ -39,6 +39,7 @@ var b = { foo: '' }; >b : { foo: string; } >{ foo: '' } : { foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.symbols b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.symbols new file mode 100644 index 00000000000..5a51f1bb0a6 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.symbols @@ -0,0 +1,377 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithStringIndexers.ts === +// object types are identical structurally + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 3, 5)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 7, 5)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithStringIndexers.ts, 10, 8)) + + [x: string]: T; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 11, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithStringIndexers.ts, 10, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 15, 5)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers.ts, 16, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers.ts, 19, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + + [x: string]: string; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 25, 5)) +} +var b: { [x: string]: string; } = { foo: '' }; +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 10)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 35)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 46), Decl(objectTypesIdentityWithStringIndexers.ts, 29, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 29, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 46), Decl(objectTypesIdentityWithStringIndexers.ts, 29, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 30, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 46), Decl(objectTypesIdentityWithStringIndexers.ts, 29, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 30, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 31, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers.ts, 31, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 33, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 33, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers.ts, 31, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 33, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 34, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers.ts, 31, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 33, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 34, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 35, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers.ts, 35, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 37, 29), Decl(objectTypesIdentityWithStringIndexers.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 37, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers.ts, 35, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 37, 29), Decl(objectTypesIdentityWithStringIndexers.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 38, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers.ts, 35, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 37, 29), Decl(objectTypesIdentityWithStringIndexers.ts, 38, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 39, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers.ts, 39, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 41, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 41, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers.ts, 39, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 41, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 42, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers.ts, 39, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 41, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 42, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 43, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers.ts, 43, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 45, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 45, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers.ts, 43, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 45, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 46, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers.ts, 43, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 45, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 46, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 47, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers.ts, 47, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 49, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 49, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers.ts, 47, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 49, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 50, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers.ts, 47, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 49, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 50, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 51, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers.ts, 51, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 53, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 53, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo5(x: B); // error +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers.ts, 51, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 53, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 54, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers.ts, 51, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 53, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 54, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 55, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers.ts, 55, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 57, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 57, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo5b(x: C); // error +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers.ts, 55, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 57, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 58, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers.ts, 55, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 57, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 58, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 59, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers.ts, 59, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 61, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 61, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers.ts, 59, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 61, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 62, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers.ts, 16, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers.ts, 59, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 61, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 62, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 63, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers.ts, 63, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 65, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 65, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo5d(x: PB); // error +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers.ts, 63, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 65, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 66, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers.ts, 19, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers.ts, 63, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 65, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 66, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 67, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers.ts, 67, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 69, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 69, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo6(x: I); // error +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers.ts, 67, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 69, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 70, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers.ts, 67, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 69, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 70, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 71, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers.ts, 71, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 73, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 73, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers.ts, 0, 0)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers.ts, 71, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 73, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 74, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers.ts, 71, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 73, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 74, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 75, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers.ts, 75, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 77, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 77, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers.ts, 75, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 77, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 78, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers.ts, 75, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 77, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 78, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 79, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers.ts, 79, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 81, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 81, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers.ts, 79, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 81, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 82, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers.ts, 79, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 81, 20), Decl(objectTypesIdentityWithStringIndexers.ts, 82, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 83, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers.ts, 83, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 85, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 85, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo10(x: typeof a); // error +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers.ts, 83, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 85, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 86, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers.ts, 83, 25), Decl(objectTypesIdentityWithStringIndexers.ts, 85, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 86, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 87, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers.ts, 87, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 89, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 89, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers.ts, 87, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 89, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 90, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers.ts, 87, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 89, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 90, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 91, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers.ts, 91, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 93, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 93, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo11b(x: PA); // error +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers.ts, 91, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 93, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 94, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers.ts, 16, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers.ts, 91, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 93, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 94, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 95, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers.ts, 95, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 97, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 97, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers.ts, 4, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers.ts, 95, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 97, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 98, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers.ts, 19, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers.ts, 95, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 97, 22), Decl(objectTypesIdentityWithStringIndexers.ts, 98, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 99, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers.ts, 99, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 101, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 101, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers.ts, 99, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 101, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 102, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers.ts, 8, 1)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers.ts, 99, 27), Decl(objectTypesIdentityWithStringIndexers.ts, 101, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 102, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 103, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers.ts, 103, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 105, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 105, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo13(x: typeof a); // error +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers.ts, 103, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 105, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 106, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers.ts, 103, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 105, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 106, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 107, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers.ts, 107, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 109, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 109, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers.ts, 107, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 109, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 110, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers.ts, 27, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers.ts, 107, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 109, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 110, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 111, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers.ts, 111, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 113, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 113, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo15(x: PA); // error +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers.ts, 111, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 113, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 114, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers.ts, 16, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers.ts, 111, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 113, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 114, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 115, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers.ts, 115, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 117, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 117, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers.ts, 12, 1)) + +function foo16(x: PB); // error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers.ts, 115, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 117, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 118, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers.ts, 19, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers.ts, 115, 26), Decl(objectTypesIdentityWithStringIndexers.ts, 117, 21), Decl(objectTypesIdentityWithStringIndexers.ts, 118, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers.ts, 119, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types index 83a73646874..a7eeb672504 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types @@ -52,6 +52,7 @@ var b: { [x: string]: string; } = { foo: '' }; >x : string >{ foo: '' } : { [x: string]: string; foo: string; } >foo : string +>'' : string function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.symbols b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.symbols new file mode 100644 index 00000000000..2df0bf01b1d --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.symbols @@ -0,0 +1,395 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithStringIndexers2.ts === +// object types are identical structurally + +class Base { foo: string; } +>Base : Symbol(Base, Decl(objectTypesIdentityWithStringIndexers2.ts, 0, 0)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithStringIndexers2.ts, 0, 0)) +>bar : Symbol(bar, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 28)) + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + + [x: string]: Base; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 6, 5)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithStringIndexers2.ts, 0, 0)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + + [x: string]: Derived; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 10, 5)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithStringIndexers2.ts, 13, 8)) + + [x: string]: T; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 14, 5)) +>T : Symbol(T, Decl(objectTypesIdentityWithStringIndexers2.ts, 13, 8)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + + [x: string]: Derived; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 18, 5)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) +} + +class PA extends A { +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers2.ts, 19, 1)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) +} + +class PB extends B { +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers2.ts, 22, 1)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) +} + +var a: { +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + + [x: string]: Base; +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 28, 5)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithStringIndexers2.ts, 0, 0)) +} +var b: { [x: string]: Derived; } = { foo: null }; +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 3)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 10)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 36)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithStringIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 32, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithStringIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 33, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 58), Decl(objectTypesIdentityWithStringIndexers2.ts, 32, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 33, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 34, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 36, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 37, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithStringIndexers2.ts, 34, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 36, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 37, 21)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 38, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithStringIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 40, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithStringIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 41, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithStringIndexers2.ts, 38, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 40, 29), Decl(objectTypesIdentityWithStringIndexers2.ts, 41, 29)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 42, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 45, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithStringIndexers2.ts, 42, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 44, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 45, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 46, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 48, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 49, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithStringIndexers2.ts, 46, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 48, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 50, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 52, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 53, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithStringIndexers2.ts, 50, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 52, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 54, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 56, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 57, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithStringIndexers2.ts, 54, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 56, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 57, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 58, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 60, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 61, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithStringIndexers2.ts, 58, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 60, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 61, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 62, 15)) + +function foo5c(x: A); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 64, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo5c(x: PA); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 65, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers2.ts, 19, 1)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithStringIndexers2.ts, 62, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 64, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 65, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 66, 15)) + +function foo5d(x: A); +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 68, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo5d(x: PB); // ok +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 69, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers2.ts, 22, 1)) + +function foo5d(x: any) { } +>foo5d : Symbol(foo5d, Decl(objectTypesIdentityWithStringIndexers2.ts, 66, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 68, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 69, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 70, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 72, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 73, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithStringIndexers2.ts, 70, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 72, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 73, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 74, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 76, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithStringIndexers2.ts, 3, 43)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 77, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithStringIndexers2.ts, 74, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 76, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 77, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 78, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 80, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo8(x: I); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 81, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithStringIndexers2.ts, 78, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 80, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 81, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 82, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 84, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 85, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) +>Base : Symbol(Base, Decl(objectTypesIdentityWithStringIndexers2.ts, 0, 0)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithStringIndexers2.ts, 82, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 84, 20), Decl(objectTypesIdentityWithStringIndexers2.ts, 85, 26)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 86, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 88, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 89, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithStringIndexers2.ts, 86, 25), Decl(objectTypesIdentityWithStringIndexers2.ts, 88, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 90, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 92, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo11(x: typeof b); // error +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 93, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithStringIndexers2.ts, 90, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 92, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 94, 15)) + +function foo11b(x: B); +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 96, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo11b(x: PA); // ok +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 97, 16)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers2.ts, 19, 1)) + +function foo11b(x: any) { } +>foo11b : Symbol(foo11b, Decl(objectTypesIdentityWithStringIndexers2.ts, 94, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 96, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 97, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 98, 16)) + +function foo11c(x: B); +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 100, 16)) +>B : Symbol(B, Decl(objectTypesIdentityWithStringIndexers2.ts, 7, 1)) + +function foo11c(x: PB); // error +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 101, 16)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers2.ts, 22, 1)) + +function foo11c(x: any) { } +>foo11c : Symbol(foo11c, Decl(objectTypesIdentityWithStringIndexers2.ts, 98, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 100, 22), Decl(objectTypesIdentityWithStringIndexers2.ts, 101, 23)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 102, 16)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 104, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 105, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithStringIndexers2.ts, 11, 1)) +>Derived : Symbol(Derived, Decl(objectTypesIdentityWithStringIndexers2.ts, 2, 27)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithStringIndexers2.ts, 102, 27), Decl(objectTypesIdentityWithStringIndexers2.ts, 104, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 105, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 106, 15)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 108, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 109, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithStringIndexers2.ts, 27, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithStringIndexers2.ts, 106, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 108, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 109, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 110, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 112, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo14(x: typeof b); // error +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 113, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithStringIndexers2.ts, 30, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithStringIndexers2.ts, 110, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 112, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 114, 15)) + +function foo15(x: I); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 116, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo15(x: PA); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 117, 15)) +>PA : Symbol(PA, Decl(objectTypesIdentityWithStringIndexers2.ts, 19, 1)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithStringIndexers2.ts, 114, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 116, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 117, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 118, 15)) + +function foo16(x: I); +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 120, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithStringIndexers2.ts, 15, 1)) + +function foo16(x: PB); // error +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 121, 15)) +>PB : Symbol(PB, Decl(objectTypesIdentityWithStringIndexers2.ts, 22, 1)) + +function foo16(x: any) { } +>foo16 : Symbol(foo16, Decl(objectTypesIdentityWithStringIndexers2.ts, 118, 26), Decl(objectTypesIdentityWithStringIndexers2.ts, 120, 21), Decl(objectTypesIdentityWithStringIndexers2.ts, 121, 22)) +>x : Symbol(x, Decl(objectTypesIdentityWithStringIndexers2.ts, 122, 15)) + + diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types index c621be1e26b..d1394252117 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types @@ -68,6 +68,7 @@ var b: { [x: string]: Derived; } = { foo: null }; >foo : Derived >null : Derived >Derived : Derived +>null : null function foo1(x: A); >foo1 : { (x: A): any; (x: A): any; } diff --git a/tests/baselines/reference/octalIntegerLiteral.symbols b/tests/baselines/reference/octalIntegerLiteral.symbols new file mode 100644 index 00000000000..6a4839839aa --- /dev/null +++ b/tests/baselines/reference/octalIntegerLiteral.symbols @@ -0,0 +1,116 @@ +=== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteral.ts === +var oct1 = 0o45436; +>oct1 : Symbol(oct1, Decl(octalIntegerLiteral.ts, 0, 3)) + +var oct2 = 0O45436; +>oct2 : Symbol(oct2, Decl(octalIntegerLiteral.ts, 1, 3)) + +var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; +>oct3 : Symbol(oct3, Decl(octalIntegerLiteral.ts, 2, 3)) + +var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; +>oct4 : Symbol(oct4, Decl(octalIntegerLiteral.ts, 3, 3)) + +var obj1 = { +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) + + 0o45436: "Hello", + a: 0o45436, +>a : Symbol(a, Decl(octalIntegerLiteral.ts, 6, 21)) + + b: oct1, +>b : Symbol(b, Decl(octalIntegerLiteral.ts, 7, 15)) +>oct1 : Symbol(oct1, Decl(octalIntegerLiteral.ts, 0, 3)) + + oct1, +>oct1 : Symbol(oct1, Decl(octalIntegerLiteral.ts, 8, 12)) + + 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) + + 0O45436: "hi", + a: 0O45436, +>a : Symbol(a, Decl(octalIntegerLiteral.ts, 14, 18)) + + b: oct2, +>b : Symbol(b, Decl(octalIntegerLiteral.ts, 15, 15)) +>oct2 : Symbol(oct2, Decl(octalIntegerLiteral.ts, 1, 3)) + + oct2, +>oct2 : Symbol(oct2, Decl(octalIntegerLiteral.ts, 16, 12)) + + 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, +} + +obj1[0o45436]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>0o45436 : Symbol(0o45436, Decl(octalIntegerLiteral.ts, 5, 12)) + +obj1["0o45436"]; // any +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) + +obj1["19230"]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>"19230" : Symbol(0o45436, Decl(octalIntegerLiteral.ts, 5, 12)) + +obj1[19230]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>19230 : Symbol(0o45436, Decl(octalIntegerLiteral.ts, 5, 12)) + +obj1["a"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>"a" : Symbol(a, Decl(octalIntegerLiteral.ts, 6, 21)) + +obj1["b"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>"b" : Symbol(b, Decl(octalIntegerLiteral.ts, 7, 15)) + +obj1["oct1"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>"oct1" : Symbol(oct1, Decl(octalIntegerLiteral.ts, 8, 12)) + +obj1["Infinity"]; // boolean +>obj1 : Symbol(obj1, Decl(octalIntegerLiteral.ts, 5, 3)) +>"Infinity" : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteral.ts, 9, 9)) + +obj2[0O45436]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>0O45436 : Symbol(0O45436, Decl(octalIntegerLiteral.ts, 13, 12)) + +obj2["0O45436"]; // any +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) + +obj2["19230"]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>"19230" : Symbol(0O45436, Decl(octalIntegerLiteral.ts, 13, 12)) + +obj2[19230]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>19230 : Symbol(0O45436, Decl(octalIntegerLiteral.ts, 13, 12)) + +obj2["a"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>"a" : Symbol(a, Decl(octalIntegerLiteral.ts, 14, 18)) + +obj2["b"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>"b" : Symbol(b, Decl(octalIntegerLiteral.ts, 15, 15)) + +obj2["oct2"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>"oct2" : Symbol(oct2, Decl(octalIntegerLiteral.ts, 16, 12)) + +obj2[5.462437423415177e+244]; // boolean +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>5.462437423415177e+244 : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteral.ts, 17, 9)) + +obj2["5.462437423415177e+244"]; // boolean +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) +>"5.462437423415177e+244" : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteral.ts, 17, 9)) + +obj2["Infinity"]; // any +>obj2 : Symbol(obj2, Decl(octalIntegerLiteral.ts, 13, 3)) + diff --git a/tests/baselines/reference/octalIntegerLiteral.types b/tests/baselines/reference/octalIntegerLiteral.types index 82f72cf625b..8352e5fac0c 100644 --- a/tests/baselines/reference/octalIntegerLiteral.types +++ b/tests/baselines/reference/octalIntegerLiteral.types @@ -1,23 +1,30 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteral.ts === var oct1 = 0o45436; >oct1 : number +>0o45436 : number var oct2 = 0O45436; >oct2 : number +>0O45436 : number var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct3 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct4 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number var obj1 = { >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } >{ 0o45436: "Hello", a: 0o45436, b: oct1, oct1, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true} : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0o45436: "Hello", +>"Hello" : string + a: 0o45436, >a : number +>0o45436 : number b: oct1, >b : number @@ -27,6 +34,7 @@ var obj1 = { >oct1 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true +>true : boolean } var obj2 = { @@ -34,8 +42,11 @@ var obj2 = { >{ 0O45436: "hi", a: 0O45436, b: oct2, oct2, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,} : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0O45436: "hi", +>"hi" : string + a: 0O45436, >a : number +>0O45436 : number b: oct2, >b : number @@ -45,77 +56,96 @@ var obj2 = { >oct2 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, +>false : boolean } obj1[0o45436]; // string >obj1[0o45436] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>0o45436 : number obj1["0o45436"]; // any >obj1["0o45436"] : any >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"0o45436" : string obj1["19230"]; // string >obj1["19230"] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"19230" : string obj1[19230]; // string >obj1[19230] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>19230 : number obj1["a"]; // number >obj1["a"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"a" : string obj1["b"]; // number >obj1["b"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"b" : string obj1["oct1"]; // number >obj1["oct1"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"oct1" : string obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"Infinity" : string obj2[0O45436]; // string >obj2[0O45436] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>0O45436 : number obj2["0O45436"]; // any >obj2["0O45436"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"0O45436" : string obj2["19230"]; // string >obj2["19230"] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"19230" : string obj2[19230]; // string >obj2[19230] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>19230 : number obj2["a"]; // number >obj2["a"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"a" : string obj2["b"]; // number >obj2["b"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"b" : string obj2["oct2"]; // number >obj2["oct2"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"oct2" : string obj2[5.462437423415177e+244]; // boolean >obj2[5.462437423415177e+244] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>5.462437423415177e+244 : number obj2["5.462437423415177e+244"]; // boolean >obj2["5.462437423415177e+244"] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"5.462437423415177e+244" : string obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"Infinity" : string diff --git a/tests/baselines/reference/octalIntegerLiteralES6.symbols b/tests/baselines/reference/octalIntegerLiteralES6.symbols new file mode 100644 index 00000000000..ff3f54936cd --- /dev/null +++ b/tests/baselines/reference/octalIntegerLiteralES6.symbols @@ -0,0 +1,116 @@ +=== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralES6.ts === +var oct1 = 0o45436; +>oct1 : Symbol(oct1, Decl(octalIntegerLiteralES6.ts, 0, 3)) + +var oct2 = 0O45436; +>oct2 : Symbol(oct2, Decl(octalIntegerLiteralES6.ts, 1, 3)) + +var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; +>oct3 : Symbol(oct3, Decl(octalIntegerLiteralES6.ts, 2, 3)) + +var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; +>oct4 : Symbol(oct4, Decl(octalIntegerLiteralES6.ts, 3, 3)) + +var obj1 = { +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) + + 0o45436: "Hello", + a: 0o45436, +>a : Symbol(a, Decl(octalIntegerLiteralES6.ts, 6, 21)) + + b: oct1, +>b : Symbol(b, Decl(octalIntegerLiteralES6.ts, 7, 15)) +>oct1 : Symbol(oct1, Decl(octalIntegerLiteralES6.ts, 0, 3)) + + oct1, +>oct1 : Symbol(oct1, Decl(octalIntegerLiteralES6.ts, 8, 12)) + + 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true +} + +var obj2 = { +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) + + 0O45436: "hi", + a: 0O45436, +>a : Symbol(a, Decl(octalIntegerLiteralES6.ts, 14, 18)) + + b: oct2, +>b : Symbol(b, Decl(octalIntegerLiteralES6.ts, 15, 15)) +>oct2 : Symbol(oct2, Decl(octalIntegerLiteralES6.ts, 1, 3)) + + oct2, +>oct2 : Symbol(oct2, Decl(octalIntegerLiteralES6.ts, 16, 12)) + + 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, +} + +obj1[0o45436]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>0o45436 : Symbol(0o45436, Decl(octalIntegerLiteralES6.ts, 5, 12)) + +obj1["0o45436"]; // any +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) + +obj1["19230"]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>"19230" : Symbol(0o45436, Decl(octalIntegerLiteralES6.ts, 5, 12)) + +obj1[19230]; // string +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>19230 : Symbol(0o45436, Decl(octalIntegerLiteralES6.ts, 5, 12)) + +obj1["a"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>"a" : Symbol(a, Decl(octalIntegerLiteralES6.ts, 6, 21)) + +obj1["b"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>"b" : Symbol(b, Decl(octalIntegerLiteralES6.ts, 7, 15)) + +obj1["oct1"]; // number +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>"oct1" : Symbol(oct1, Decl(octalIntegerLiteralES6.ts, 8, 12)) + +obj1["Infinity"]; // boolean +>obj1 : Symbol(obj1, Decl(octalIntegerLiteralES6.ts, 5, 3)) +>"Infinity" : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteralES6.ts, 9, 9)) + +obj2[0O45436]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>0O45436 : Symbol(0O45436, Decl(octalIntegerLiteralES6.ts, 13, 12)) + +obj2["0O45436"]; // any +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) + +obj2["19230"]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>"19230" : Symbol(0O45436, Decl(octalIntegerLiteralES6.ts, 13, 12)) + +obj2[19230]; // string +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>19230 : Symbol(0O45436, Decl(octalIntegerLiteralES6.ts, 13, 12)) + +obj2["a"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>"a" : Symbol(a, Decl(octalIntegerLiteralES6.ts, 14, 18)) + +obj2["b"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>"b" : Symbol(b, Decl(octalIntegerLiteralES6.ts, 15, 15)) + +obj2["oct2"]; // number +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>"oct2" : Symbol(oct2, Decl(octalIntegerLiteralES6.ts, 16, 12)) + +obj2[5.462437423415177e+244]; // boolean +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>5.462437423415177e+244 : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteralES6.ts, 17, 9)) + +obj2["5.462437423415177e+244"]; // boolean +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) +>"5.462437423415177e+244" : Symbol(0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777, Decl(octalIntegerLiteralES6.ts, 17, 9)) + +obj2["Infinity"]; // any +>obj2 : Symbol(obj2, Decl(octalIntegerLiteralES6.ts, 13, 3)) + diff --git a/tests/baselines/reference/octalIntegerLiteralES6.types b/tests/baselines/reference/octalIntegerLiteralES6.types index e0a64f160c3..7ef32b49289 100644 --- a/tests/baselines/reference/octalIntegerLiteralES6.types +++ b/tests/baselines/reference/octalIntegerLiteralES6.types @@ -1,23 +1,30 @@ === tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralES6.ts === var oct1 = 0o45436; >oct1 : number +>0o45436 : number var oct2 = 0O45436; >oct2 : number +>0O45436 : number var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct3 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777; >oct4 : number +>0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 : number var obj1 = { >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } >{ 0o45436: "Hello", a: 0o45436, b: oct1, oct1, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true} : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0o45436: "Hello", +>"Hello" : string + a: 0o45436, >a : number +>0o45436 : number b: oct1, >b : number @@ -27,6 +34,7 @@ var obj1 = { >oct1 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true +>true : boolean } var obj2 = { @@ -34,8 +42,11 @@ var obj2 = { >{ 0O45436: "hi", a: 0O45436, b: oct2, oct2, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,} : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } 0O45436: "hi", +>"hi" : string + a: 0O45436, >a : number +>0O45436 : number b: oct2, >b : number @@ -45,77 +56,96 @@ var obj2 = { >oct2 : number 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false, +>false : boolean } obj1[0o45436]; // string >obj1[0o45436] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>0o45436 : number obj1["0o45436"]; // any >obj1["0o45436"] : any >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"0o45436" : string obj1["19230"]; // string >obj1["19230"] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"19230" : string obj1[19230]; // string >obj1[19230] : string >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>19230 : number obj1["a"]; // number >obj1["a"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"a" : string obj1["b"]; // number >obj1["b"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"b" : string obj1["oct1"]; // number >obj1["oct1"] : number >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"oct1" : string obj1["Infinity"]; // boolean >obj1["Infinity"] : boolean >obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"Infinity" : string obj2[0O45436]; // string >obj2[0O45436] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>0O45436 : number obj2["0O45436"]; // any >obj2["0O45436"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"0O45436" : string obj2["19230"]; // string >obj2["19230"] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"19230" : string obj2[19230]; // string >obj2[19230] : string >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>19230 : number obj2["a"]; // number >obj2["a"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"a" : string obj2["b"]; // number >obj2["b"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"b" : string obj2["oct2"]; // number >obj2["oct2"] : number >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"oct2" : string obj2[5.462437423415177e+244]; // boolean >obj2[5.462437423415177e+244] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>5.462437423415177e+244 : number obj2["5.462437423415177e+244"]; // boolean >obj2["5.462437423415177e+244"] : boolean >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"5.462437423415177e+244" : string obj2["Infinity"]; // any >obj2["Infinity"] : any >obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; } +>"Infinity" : string diff --git a/tests/baselines/reference/optionalAccessorsInInterface1.symbols b/tests/baselines/reference/optionalAccessorsInInterface1.symbols new file mode 100644 index 00000000000..6c9c8ab1429 --- /dev/null +++ b/tests/baselines/reference/optionalAccessorsInInterface1.symbols @@ -0,0 +1,45 @@ +=== tests/cases/compiler/optionalAccessorsInInterface1.ts === +interface MyPropertyDescriptor { +>MyPropertyDescriptor : Symbol(MyPropertyDescriptor, Decl(optionalAccessorsInInterface1.ts, 0, 0)) + + get? (): any; +>get : Symbol(get, Decl(optionalAccessorsInInterface1.ts, 0, 32)) + + set? (v: any): void; +>set : Symbol(set, Decl(optionalAccessorsInInterface1.ts, 1, 17)) +>v : Symbol(v, Decl(optionalAccessorsInInterface1.ts, 2, 10)) +} + +declare function defineMyProperty(o: any, p: string, attributes: MyPropertyDescriptor): any; +>defineMyProperty : Symbol(defineMyProperty, Decl(optionalAccessorsInInterface1.ts, 3, 1)) +>o : Symbol(o, Decl(optionalAccessorsInInterface1.ts, 5, 34)) +>p : Symbol(p, Decl(optionalAccessorsInInterface1.ts, 5, 41)) +>attributes : Symbol(attributes, Decl(optionalAccessorsInInterface1.ts, 5, 52)) +>MyPropertyDescriptor : Symbol(MyPropertyDescriptor, Decl(optionalAccessorsInInterface1.ts, 0, 0)) + +defineMyProperty({}, "name", { get: function () { return 5; } }); +>defineMyProperty : Symbol(defineMyProperty, Decl(optionalAccessorsInInterface1.ts, 3, 1)) +>get : Symbol(get, Decl(optionalAccessorsInInterface1.ts, 6, 30)) + +interface MyPropertyDescriptor2 { +>MyPropertyDescriptor2 : Symbol(MyPropertyDescriptor2, Decl(optionalAccessorsInInterface1.ts, 6, 65)) + + get?: () => any; +>get : Symbol(get, Decl(optionalAccessorsInInterface1.ts, 8, 33)) + + set?: (v: any) => void; +>set : Symbol(set, Decl(optionalAccessorsInInterface1.ts, 9, 20)) +>v : Symbol(v, Decl(optionalAccessorsInInterface1.ts, 10, 11)) +} + +declare function defineMyProperty2(o: any, p: string, attributes: MyPropertyDescriptor2): any; +>defineMyProperty2 : Symbol(defineMyProperty2, Decl(optionalAccessorsInInterface1.ts, 11, 1)) +>o : Symbol(o, Decl(optionalAccessorsInInterface1.ts, 13, 35)) +>p : Symbol(p, Decl(optionalAccessorsInInterface1.ts, 13, 42)) +>attributes : Symbol(attributes, Decl(optionalAccessorsInInterface1.ts, 13, 53)) +>MyPropertyDescriptor2 : Symbol(MyPropertyDescriptor2, Decl(optionalAccessorsInInterface1.ts, 6, 65)) + +defineMyProperty2({}, "name", { get: function () { return 5; } }); +>defineMyProperty2 : Symbol(defineMyProperty2, Decl(optionalAccessorsInInterface1.ts, 11, 1)) +>get : Symbol(get, Decl(optionalAccessorsInInterface1.ts, 14, 31)) + diff --git a/tests/baselines/reference/optionalAccessorsInInterface1.types b/tests/baselines/reference/optionalAccessorsInInterface1.types index c426cdba178..d030849e554 100644 --- a/tests/baselines/reference/optionalAccessorsInInterface1.types +++ b/tests/baselines/reference/optionalAccessorsInInterface1.types @@ -21,9 +21,11 @@ defineMyProperty({}, "name", { get: function () { return 5; } }); >defineMyProperty({}, "name", { get: function () { return 5; } }) : any >defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any >{} : {} +>"name" : string >{ get: function () { return 5; } } : { get: () => number; } >get : () => number >function () { return 5; } : () => number +>5 : number interface MyPropertyDescriptor2 { >MyPropertyDescriptor2 : MyPropertyDescriptor2 @@ -47,7 +49,9 @@ defineMyProperty2({}, "name", { get: function () { return 5; } }); >defineMyProperty2({}, "name", { get: function () { return 5; } }) : any >defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any >{} : {} +>"name" : string >{ get: function () { return 5; } } : { get: () => number; } >get : () => number >function () { return 5; } : () => number +>5 : number diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.symbols b/tests/baselines/reference/optionalConstructorArgInSuper.symbols new file mode 100644 index 00000000000..a912d8f62e3 --- /dev/null +++ b/tests/baselines/reference/optionalConstructorArgInSuper.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/optionalConstructorArgInSuper.ts === +class Base { +>Base : Symbol(Base, Decl(optionalConstructorArgInSuper.ts, 0, 0)) + + constructor(opt?) { } +>opt : Symbol(opt, Decl(optionalConstructorArgInSuper.ts, 1, 16)) + + foo(other?) { } +>foo : Symbol(foo, Decl(optionalConstructorArgInSuper.ts, 1, 25)) +>other : Symbol(other, Decl(optionalConstructorArgInSuper.ts, 2, 8)) +} +class Derived extends Base { +>Derived : Symbol(Derived, Decl(optionalConstructorArgInSuper.ts, 3, 1)) +>Base : Symbol(Base, Decl(optionalConstructorArgInSuper.ts, 0, 0)) +} +var d = new Derived(); // bug caused an error here, couldn't select overload +>d : Symbol(d, Decl(optionalConstructorArgInSuper.ts, 6, 3)) +>Derived : Symbol(Derived, Decl(optionalConstructorArgInSuper.ts, 3, 1)) + +var d2: Derived; +>d2 : Symbol(d2, Decl(optionalConstructorArgInSuper.ts, 7, 3)) +>Derived : Symbol(Derived, Decl(optionalConstructorArgInSuper.ts, 3, 1)) + +d2.foo(); +>d2.foo : Symbol(Base.foo, Decl(optionalConstructorArgInSuper.ts, 1, 25)) +>d2 : Symbol(d2, Decl(optionalConstructorArgInSuper.ts, 7, 3)) +>foo : Symbol(Base.foo, Decl(optionalConstructorArgInSuper.ts, 1, 25)) + diff --git a/tests/baselines/reference/optionalParamInOverride.symbols b/tests/baselines/reference/optionalParamInOverride.symbols new file mode 100644 index 00000000000..b15802b7294 --- /dev/null +++ b/tests/baselines/reference/optionalParamInOverride.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/optionalParamInOverride.ts === +class Z { +>Z : Symbol(Z, Decl(optionalParamInOverride.ts, 0, 0)) + + public func(): void { } +>func : Symbol(func, Decl(optionalParamInOverride.ts, 0, 9)) +} +class Y extends Z { +>Y : Symbol(Y, Decl(optionalParamInOverride.ts, 2, 1)) +>Z : Symbol(Z, Decl(optionalParamInOverride.ts, 0, 0)) + + public func(value?: any): void { } +>func : Symbol(func, Decl(optionalParamInOverride.ts, 3, 19)) +>value : Symbol(value, Decl(optionalParamInOverride.ts, 4, 16)) +} + diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams1.symbols b/tests/baselines/reference/optionalParamReferencingOtherParams1.symbols new file mode 100644 index 00000000000..d6bb0955642 --- /dev/null +++ b/tests/baselines/reference/optionalParamReferencingOtherParams1.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/optionalParamReferencingOtherParams1.ts === +function strange(x: number, y = x * 1, z = x + y) { +>strange : Symbol(strange, Decl(optionalParamReferencingOtherParams1.ts, 0, 0)) +>x : Symbol(x, Decl(optionalParamReferencingOtherParams1.ts, 0, 17)) +>y : Symbol(y, Decl(optionalParamReferencingOtherParams1.ts, 0, 27)) +>x : Symbol(x, Decl(optionalParamReferencingOtherParams1.ts, 0, 17)) +>z : Symbol(z, Decl(optionalParamReferencingOtherParams1.ts, 0, 38)) +>x : Symbol(x, Decl(optionalParamReferencingOtherParams1.ts, 0, 17)) +>y : Symbol(y, Decl(optionalParamReferencingOtherParams1.ts, 0, 27)) + + return z; +>z : Symbol(z, Decl(optionalParamReferencingOtherParams1.ts, 0, 38)) +} diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams1.types b/tests/baselines/reference/optionalParamReferencingOtherParams1.types index 3a62d51759c..5a8963b8b33 100644 --- a/tests/baselines/reference/optionalParamReferencingOtherParams1.types +++ b/tests/baselines/reference/optionalParamReferencingOtherParams1.types @@ -5,6 +5,7 @@ function strange(x: number, y = x * 1, z = x + y) { >y : number >x * 1 : number >x : number +>1 : number >z : number >x + y : number >x : number diff --git a/tests/baselines/reference/out-flag.symbols b/tests/baselines/reference/out-flag.symbols new file mode 100644 index 00000000000..8f7e559b8fa --- /dev/null +++ b/tests/baselines/reference/out-flag.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/out-flag.ts === +//// @out: bin\ + +// my class comments +class MyClass +>MyClass : Symbol(MyClass, Decl(out-flag.ts, 0, 0)) +{ + // my function comments + public Count(): number +>Count : Symbol(Count, Decl(out-flag.ts, 4, 1)) + { + return 42; + } + + public SetCount(value: number) +>SetCount : Symbol(SetCount, Decl(out-flag.ts, 9, 5)) +>value : Symbol(value, Decl(out-flag.ts, 11, 20)) + { + // + } +} diff --git a/tests/baselines/reference/out-flag.types b/tests/baselines/reference/out-flag.types index ac1b38b4e2e..b182e4e53d9 100644 --- a/tests/baselines/reference/out-flag.types +++ b/tests/baselines/reference/out-flag.types @@ -10,6 +10,7 @@ class MyClass >Count : () => number { return 42; +>42 : number } public SetCount(value: number) diff --git a/tests/baselines/reference/overload2.symbols b/tests/baselines/reference/overload2.symbols new file mode 100644 index 00000000000..1352ddb2a86 --- /dev/null +++ b/tests/baselines/reference/overload2.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/overload2.ts === +enum A { } +>A : Symbol(A, Decl(overload2.ts, 0, 0)) + +enum B { } +>B : Symbol(B, Decl(overload2.ts, 0, 10)) + +function foo(a: A); +>foo : Symbol(foo, Decl(overload2.ts, 1, 10), Decl(overload2.ts, 3, 19), Decl(overload2.ts, 4, 19)) +>a : Symbol(a, Decl(overload2.ts, 3, 13)) +>A : Symbol(A, Decl(overload2.ts, 0, 0)) + +function foo(b: B); +>foo : Symbol(foo, Decl(overload2.ts, 1, 10), Decl(overload2.ts, 3, 19), Decl(overload2.ts, 4, 19)) +>b : Symbol(b, Decl(overload2.ts, 4, 13)) +>B : Symbol(B, Decl(overload2.ts, 0, 10)) + +// should be ok +function foo(x: number) { +>foo : Symbol(foo, Decl(overload2.ts, 1, 10), Decl(overload2.ts, 3, 19), Decl(overload2.ts, 4, 19)) +>x : Symbol(x, Decl(overload2.ts, 6, 13)) +} + +class C { } +>C : Symbol(C, Decl(overload2.ts, 7, 1)) + +function foo1(a: A); +>foo1 : Symbol(foo1, Decl(overload2.ts, 9, 11), Decl(overload2.ts, 10, 20), Decl(overload2.ts, 11, 20)) +>a : Symbol(a, Decl(overload2.ts, 10, 14)) +>A : Symbol(A, Decl(overload2.ts, 0, 0)) + +function foo1(c: C); +>foo1 : Symbol(foo1, Decl(overload2.ts, 9, 11), Decl(overload2.ts, 10, 20), Decl(overload2.ts, 11, 20)) +>c : Symbol(c, Decl(overload2.ts, 11, 14)) +>C : Symbol(C, Decl(overload2.ts, 7, 1)) + +// should be ok +function foo1(x: number) { +>foo1 : Symbol(foo1, Decl(overload2.ts, 9, 11), Decl(overload2.ts, 10, 20), Decl(overload2.ts, 11, 20)) +>x : Symbol(x, Decl(overload2.ts, 13, 14)) +} + diff --git a/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries.symbols b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries.symbols new file mode 100644 index 00000000000..65f64fa8915 --- /dev/null +++ b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries.symbols @@ -0,0 +1,115 @@ +=== tests/cases/compiler/overloadBindingAcrossDeclarationBoundaries.ts === +interface Opt1 { +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) + + p?: any; +>p : Symbol(p, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 16)) +} +interface Opt2 { +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) + + q?: any; +>q : Symbol(q, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 3, 16)) +} +interface Opt3 { +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) + + r?: any; +>r : Symbol(r, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 6, 16)) +} +interface Opt4 { +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) + + s?: any; +>s : Symbol(s, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 9, 16)) +} +interface A { +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 19, 1)) + + a(o: Opt1): Opt1; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 6)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) + + a(o: Opt2): Opt2; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 14, 6)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) + + (o: Opt1): Opt1; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 15, 5)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) + + (o: Opt2): Opt2; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 16, 5)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) + + new (o: Opt1): Opt1; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 17, 9)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 0, 0)) + + new (o: Opt2): Opt2; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 18, 9)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 2, 1)) +} +interface A { +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 19, 1)) + + a(o: Opt3): Opt3; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 6)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) + + a(o: Opt4): Opt4; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 22, 6)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) + + (o: Opt3): Opt3; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 23, 5)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) + + (o: Opt4): Opt4; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 24, 5)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) + + new (o: Opt3): Opt3; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 25, 9)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 5, 1)) + + new (o: Opt4): Opt4; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 26, 9)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 8, 1)) +} + +var a: A; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 29, 3)) +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 19, 1)) + +// These should all be Opt3 +var a1 = a.a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 31, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 32, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 33, 3)) +>a.a : Symbol(A.a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 29, 3)) +>a : Symbol(A.a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 12, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 13, 21), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 20, 13), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 21, 21)) + +var a1 = a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 31, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 32, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 33, 3)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 29, 3)) + +var a1 = new a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 31, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 32, 3), Decl(overloadBindingAcrossDeclarationBoundaries.ts, 33, 3)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries.ts, 29, 3)) + diff --git a/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries2.symbols b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries2.symbols new file mode 100644 index 00000000000..534475bcc30 --- /dev/null +++ b/tests/baselines/reference/overloadBindingAcrossDeclarationBoundaries2.symbols @@ -0,0 +1,118 @@ +=== tests/cases/compiler/overloadBindingAcrossDeclarationBoundaries_file0.ts === +interface Opt1 { +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) + + p?: any; +>p : Symbol(p, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 16)) +} +interface Opt2 { +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) + + q?: any; +>q : Symbol(q, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 3, 16)) +} +interface Opt3 { +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) + + r?: any; +>r : Symbol(r, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 6, 16)) +} +interface Opt4 { +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) + + s?: any; +>s : Symbol(s, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 9, 16)) +} + +interface A { +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 0)) + + a(o: Opt1): Opt1; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 6)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) + + a(o: Opt2): Opt2; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 15, 6)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) + + (o: Opt1): Opt1; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 16, 5)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) + + (o: Opt2): Opt2; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 17, 5)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) + + new (o: Opt1): Opt1; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 18, 9)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) +>Opt1 : Symbol(Opt1, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 0, 0)) + + new (o: Opt2): Opt2; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 19, 9)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) +>Opt2 : Symbol(Opt2, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 2, 1)) +} + +=== tests/cases/compiler/overloadBindingAcrossDeclarationBoundaries_file1.ts === +interface A { +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 0)) + + a(o: Opt3): Opt3; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 6)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) + + a(o: Opt4): Opt4; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 2, 6)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) + + (o: Opt3): Opt3; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 3, 5)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) + + (o: Opt4): Opt4; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 4, 5)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) + + new (o: Opt3): Opt3; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 5, 9)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) +>Opt3 : Symbol(Opt3, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 5, 1)) + + new (o: Opt4): Opt4; +>o : Symbol(o, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 6, 9)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) +>Opt4 : Symbol(Opt4, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 8, 1)) +} + +var a: A; +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 9, 3)) +>A : Symbol(A, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 11, 1), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 0)) + +// These should all be Opt3 +var a1 = a.a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 11, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 12, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 13, 3)) +>a.a : Symbol(A.a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 9, 3)) +>a : Symbol(A.a, Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 13, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file0.ts, 14, 21), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 0, 13), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 1, 21)) + +var a1 = a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 11, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 12, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 13, 3)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 9, 3)) + +var a1 = new a({}); +>a1 : Symbol(a1, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 11, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 12, 3), Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 13, 3)) +>a : Symbol(a, Decl(overloadBindingAcrossDeclarationBoundaries_file1.ts, 9, 3)) + diff --git a/tests/baselines/reference/overloadCallTest.symbols b/tests/baselines/reference/overloadCallTest.symbols new file mode 100644 index 00000000000..ae051e79855 --- /dev/null +++ b/tests/baselines/reference/overloadCallTest.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/overloadCallTest.ts === +class foo { +>foo : Symbol(foo, Decl(overloadCallTest.ts, 0, 0)) + + constructor() { + function bar(): string; +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) + + function bar(s:string); +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) +>s : Symbol(s, Decl(overloadCallTest.ts, 3, 21)) + + function bar(foo?: string) { return "foo" }; +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) +>foo : Symbol(foo, Decl(overloadCallTest.ts, 4, 21)) + + var test = bar("test"); +>test : Symbol(test, Decl(overloadCallTest.ts, 6, 11)) +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) + + var goo = bar(); +>goo : Symbol(goo, Decl(overloadCallTest.ts, 7, 11)) +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) + + goo = bar("test"); +>goo : Symbol(goo, Decl(overloadCallTest.ts, 7, 11)) +>bar : Symbol(bar, Decl(overloadCallTest.ts, 1, 19), Decl(overloadCallTest.ts, 2, 31), Decl(overloadCallTest.ts, 3, 31)) + } + +} + + diff --git a/tests/baselines/reference/overloadCallTest.types b/tests/baselines/reference/overloadCallTest.types index 0ed7ecccdbc..bd719311975 100644 --- a/tests/baselines/reference/overloadCallTest.types +++ b/tests/baselines/reference/overloadCallTest.types @@ -13,11 +13,13 @@ class foo { function bar(foo?: string) { return "foo" }; >bar : { (): string; (s: string): any; } >foo : string +>"foo" : string var test = bar("test"); >test : any >bar("test") : any >bar : { (): string; (s: string): any; } +>"test" : string var goo = bar(); >goo : string @@ -29,6 +31,7 @@ class foo { >goo : string >bar("test") : any >bar : { (): string; (s: string): any; } +>"test" : string } } diff --git a/tests/baselines/reference/overloadCrash.symbols b/tests/baselines/reference/overloadCrash.symbols new file mode 100644 index 00000000000..791411540b3 --- /dev/null +++ b/tests/baselines/reference/overloadCrash.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/overloadCrash.ts === +interface I1 {a:number; b:number;}; +>I1 : Symbol(I1, Decl(overloadCrash.ts, 0, 0)) +>a : Symbol(a, Decl(overloadCrash.ts, 0, 14)) +>b : Symbol(b, Decl(overloadCrash.ts, 0, 23)) + +interface I2 {c:number; d:number;}; +>I2 : Symbol(I2, Decl(overloadCrash.ts, 0, 35)) +>c : Symbol(c, Decl(overloadCrash.ts, 1, 14)) +>d : Symbol(d, Decl(overloadCrash.ts, 1, 23)) + +interface I3 {a:number; b:number; c:number; d:number;}; +>I3 : Symbol(I3, Decl(overloadCrash.ts, 1, 35)) +>a : Symbol(a, Decl(overloadCrash.ts, 2, 14)) +>b : Symbol(b, Decl(overloadCrash.ts, 2, 23)) +>c : Symbol(c, Decl(overloadCrash.ts, 2, 33)) +>d : Symbol(d, Decl(overloadCrash.ts, 2, 43)) + +declare function foo(...n:I1[]); +>foo : Symbol(foo, Decl(overloadCrash.ts, 2, 55), Decl(overloadCrash.ts, 4, 32)) +>n : Symbol(n, Decl(overloadCrash.ts, 4, 21)) +>I1 : Symbol(I1, Decl(overloadCrash.ts, 0, 0)) + +declare function foo(n1:I2, n3:I2); +>foo : Symbol(foo, Decl(overloadCrash.ts, 2, 55), Decl(overloadCrash.ts, 4, 32)) +>n1 : Symbol(n1, Decl(overloadCrash.ts, 5, 21)) +>I2 : Symbol(I2, Decl(overloadCrash.ts, 0, 35)) +>n3 : Symbol(n3, Decl(overloadCrash.ts, 5, 27)) +>I2 : Symbol(I2, Decl(overloadCrash.ts, 0, 35)) + +var i3:I3; +>i3 : Symbol(i3, Decl(overloadCrash.ts, 7, 3)) +>I3 : Symbol(I3, Decl(overloadCrash.ts, 1, 35)) + +foo(i3, i3); // should not crash the compiler :) +>foo : Symbol(foo, Decl(overloadCrash.ts, 2, 55), Decl(overloadCrash.ts, 4, 32)) +>i3 : Symbol(i3, Decl(overloadCrash.ts, 7, 3)) +>i3 : Symbol(i3, Decl(overloadCrash.ts, 7, 3)) + diff --git a/tests/baselines/reference/overloadEquivalenceWithStatics.symbols b/tests/baselines/reference/overloadEquivalenceWithStatics.symbols new file mode 100644 index 00000000000..dc2e5a717a6 --- /dev/null +++ b/tests/baselines/reference/overloadEquivalenceWithStatics.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/overloadEquivalenceWithStatics.ts === +class A1 { +>A1 : Symbol(A1, Decl(overloadEquivalenceWithStatics.ts, 0, 0)) +>T : Symbol(T, Decl(overloadEquivalenceWithStatics.ts, 0, 9)) + +static B(v: A1): A1; // 1 +>B : Symbol(A1.B, Decl(overloadEquivalenceWithStatics.ts, 0, 13), Decl(overloadEquivalenceWithStatics.ts, 1, 29), Decl(overloadEquivalenceWithStatics.ts, 2, 25)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 1, 9)) +>v : Symbol(v, Decl(overloadEquivalenceWithStatics.ts, 1, 12)) +>A1 : Symbol(A1, Decl(overloadEquivalenceWithStatics.ts, 0, 0)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 1, 9)) +>A1 : Symbol(A1, Decl(overloadEquivalenceWithStatics.ts, 0, 0)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 1, 9)) + +static B(v: S): A1; // 2 : Error Duplicate signature +>B : Symbol(A1.B, Decl(overloadEquivalenceWithStatics.ts, 0, 13), Decl(overloadEquivalenceWithStatics.ts, 1, 29), Decl(overloadEquivalenceWithStatics.ts, 2, 25)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 2, 9)) +>v : Symbol(v, Decl(overloadEquivalenceWithStatics.ts, 2, 12)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 2, 9)) +>A1 : Symbol(A1, Decl(overloadEquivalenceWithStatics.ts, 0, 0)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 2, 9)) + +static B(v: any): A1 { +>B : Symbol(A1.B, Decl(overloadEquivalenceWithStatics.ts, 0, 13), Decl(overloadEquivalenceWithStatics.ts, 1, 29), Decl(overloadEquivalenceWithStatics.ts, 2, 25)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 3, 9)) +>v : Symbol(v, Decl(overloadEquivalenceWithStatics.ts, 3, 12)) +>A1 : Symbol(A1, Decl(overloadEquivalenceWithStatics.ts, 0, 0)) +>S : Symbol(S, Decl(overloadEquivalenceWithStatics.ts, 3, 9)) + +return null; +} +} + diff --git a/tests/baselines/reference/overloadEquivalenceWithStatics.types b/tests/baselines/reference/overloadEquivalenceWithStatics.types index 96ad16ae19c..1f59b64572a 100644 --- a/tests/baselines/reference/overloadEquivalenceWithStatics.types +++ b/tests/baselines/reference/overloadEquivalenceWithStatics.types @@ -28,6 +28,7 @@ static B(v: any): A1 { >S : S return null; +>null : null } } diff --git a/tests/baselines/reference/overloadGenericFunctionWithRestArgs.symbols b/tests/baselines/reference/overloadGenericFunctionWithRestArgs.symbols new file mode 100644 index 00000000000..52ee82e5d3c --- /dev/null +++ b/tests/baselines/reference/overloadGenericFunctionWithRestArgs.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/overloadGenericFunctionWithRestArgs.ts === +class B{ +>B : Symbol(B, Decl(overloadGenericFunctionWithRestArgs.ts, 0, 0)) +>V : Symbol(V, Decl(overloadGenericFunctionWithRestArgs.ts, 0, 8)) + + private id: V; +>id : Symbol(id, Decl(overloadGenericFunctionWithRestArgs.ts, 0, 11)) +>V : Symbol(V, Decl(overloadGenericFunctionWithRestArgs.ts, 0, 8)) +} +class A{ +>A : Symbol(A, Decl(overloadGenericFunctionWithRestArgs.ts, 2, 1)) +>U : Symbol(U, Decl(overloadGenericFunctionWithRestArgs.ts, 3, 8)) + + GetEnumerator: () => B; +>GetEnumerator : Symbol(GetEnumerator, Decl(overloadGenericFunctionWithRestArgs.ts, 3, 11)) +>B : Symbol(B, Decl(overloadGenericFunctionWithRestArgs.ts, 0, 0)) +>U : Symbol(U, Decl(overloadGenericFunctionWithRestArgs.ts, 3, 8)) +} +function Choice(...v_args: T[]): A; +>Choice : Symbol(Choice, Decl(overloadGenericFunctionWithRestArgs.ts, 5, 1), Decl(overloadGenericFunctionWithRestArgs.ts, 6, 41)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 6, 16)) +>v_args : Symbol(v_args, Decl(overloadGenericFunctionWithRestArgs.ts, 6, 19)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 6, 16)) +>A : Symbol(A, Decl(overloadGenericFunctionWithRestArgs.ts, 2, 1)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 6, 16)) + +function Choice(...v_args: T[]): A { +>Choice : Symbol(Choice, Decl(overloadGenericFunctionWithRestArgs.ts, 5, 1), Decl(overloadGenericFunctionWithRestArgs.ts, 6, 41)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 7, 16)) +>v_args : Symbol(v_args, Decl(overloadGenericFunctionWithRestArgs.ts, 7, 19)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 7, 16)) +>A : Symbol(A, Decl(overloadGenericFunctionWithRestArgs.ts, 2, 1)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 7, 16)) + + return new A(); +>A : Symbol(A, Decl(overloadGenericFunctionWithRestArgs.ts, 2, 1)) +>T : Symbol(T, Decl(overloadGenericFunctionWithRestArgs.ts, 7, 16)) +} diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.symbols b/tests/baselines/reference/overloadOnConstConstraintChecks1.symbols new file mode 100644 index 00000000000..2eedf3254a2 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.symbols @@ -0,0 +1,78 @@ +=== tests/cases/compiler/overloadOnConstConstraintChecks1.ts === +class Base { foo() { } } +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks1.ts, 0, 12)) + +class Derived1 extends Base { bar() { } } +>Derived1 : Symbol(Derived1, Decl(overloadOnConstConstraintChecks1.ts, 0, 24)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) +>bar : Symbol(bar, Decl(overloadOnConstConstraintChecks1.ts, 1, 29)) + +class Derived2 extends Base { baz() { } } +>Derived2 : Symbol(Derived2, Decl(overloadOnConstConstraintChecks1.ts, 1, 41)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) +>baz : Symbol(baz, Decl(overloadOnConstConstraintChecks1.ts, 2, 29)) + +class Derived3 extends Base { biz() { } } +>Derived3 : Symbol(Derived3, Decl(overloadOnConstConstraintChecks1.ts, 2, 41)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) +>biz : Symbol(biz, Decl(overloadOnConstConstraintChecks1.ts, 3, 29)) + +interface MyDoc { // Document +>MyDoc : Symbol(MyDoc, Decl(overloadOnConstConstraintChecks1.ts, 3, 41)) + + createElement(tagName: string): Base; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 5, 17), Decl(overloadOnConstConstraintChecks1.ts, 6, 41), Decl(overloadOnConstConstraintChecks1.ts, 7, 47), Decl(overloadOnConstConstraintChecks1.ts, 8, 44)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 6, 18)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) + + createElement(tagName: 'canvas'): Derived1; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 5, 17), Decl(overloadOnConstConstraintChecks1.ts, 6, 41), Decl(overloadOnConstConstraintChecks1.ts, 7, 47), Decl(overloadOnConstConstraintChecks1.ts, 8, 44)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 7, 18)) +>Derived1 : Symbol(Derived1, Decl(overloadOnConstConstraintChecks1.ts, 0, 24)) + + createElement(tagName: 'div'): Derived2; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 5, 17), Decl(overloadOnConstConstraintChecks1.ts, 6, 41), Decl(overloadOnConstConstraintChecks1.ts, 7, 47), Decl(overloadOnConstConstraintChecks1.ts, 8, 44)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 8, 18)) +>Derived2 : Symbol(Derived2, Decl(overloadOnConstConstraintChecks1.ts, 1, 41)) + + createElement(tagName: 'span'): Derived3; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 5, 17), Decl(overloadOnConstConstraintChecks1.ts, 6, 41), Decl(overloadOnConstConstraintChecks1.ts, 7, 47), Decl(overloadOnConstConstraintChecks1.ts, 8, 44)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 9, 18)) +>Derived3 : Symbol(Derived3, Decl(overloadOnConstConstraintChecks1.ts, 2, 41)) + + // + 100 more +} + +class D implements MyDoc { +>D : Symbol(D, Decl(overloadOnConstConstraintChecks1.ts, 11, 1)) +>MyDoc : Symbol(MyDoc, Decl(overloadOnConstConstraintChecks1.ts, 3, 41)) + + createElement(tagName:string): Base; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 13, 26), Decl(overloadOnConstConstraintChecks1.ts, 14, 40), Decl(overloadOnConstConstraintChecks1.ts, 15, 47), Decl(overloadOnConstConstraintChecks1.ts, 16, 44), Decl(overloadOnConstConstraintChecks1.ts, 17, 45)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 14, 18)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) + + createElement(tagName: 'canvas'): Derived1; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 13, 26), Decl(overloadOnConstConstraintChecks1.ts, 14, 40), Decl(overloadOnConstConstraintChecks1.ts, 15, 47), Decl(overloadOnConstConstraintChecks1.ts, 16, 44), Decl(overloadOnConstConstraintChecks1.ts, 17, 45)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 15, 18)) +>Derived1 : Symbol(Derived1, Decl(overloadOnConstConstraintChecks1.ts, 0, 24)) + + createElement(tagName: 'div'): Derived2; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 13, 26), Decl(overloadOnConstConstraintChecks1.ts, 14, 40), Decl(overloadOnConstConstraintChecks1.ts, 15, 47), Decl(overloadOnConstConstraintChecks1.ts, 16, 44), Decl(overloadOnConstConstraintChecks1.ts, 17, 45)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 16, 18)) +>Derived2 : Symbol(Derived2, Decl(overloadOnConstConstraintChecks1.ts, 1, 41)) + + createElement(tagName: 'span'): Derived3; +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 13, 26), Decl(overloadOnConstConstraintChecks1.ts, 14, 40), Decl(overloadOnConstConstraintChecks1.ts, 15, 47), Decl(overloadOnConstConstraintChecks1.ts, 16, 44), Decl(overloadOnConstConstraintChecks1.ts, 17, 45)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 17, 18)) +>Derived3 : Symbol(Derived3, Decl(overloadOnConstConstraintChecks1.ts, 2, 41)) + + createElement(tagName:any): Base { +>createElement : Symbol(createElement, Decl(overloadOnConstConstraintChecks1.ts, 13, 26), Decl(overloadOnConstConstraintChecks1.ts, 14, 40), Decl(overloadOnConstConstraintChecks1.ts, 15, 47), Decl(overloadOnConstConstraintChecks1.ts, 16, 44), Decl(overloadOnConstConstraintChecks1.ts, 17, 45)) +>tagName : Symbol(tagName, Decl(overloadOnConstConstraintChecks1.ts, 18, 18)) +>Base : Symbol(Base, Decl(overloadOnConstConstraintChecks1.ts, 0, 0)) + + return null; + } +} diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.types b/tests/baselines/reference/overloadOnConstConstraintChecks1.types index 9f92e56c682..cc561eb6e21 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.types @@ -74,5 +74,6 @@ class D implements MyDoc { >Base : Base return null; +>null : null } } diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.symbols b/tests/baselines/reference/overloadOnConstConstraintChecks2.symbols new file mode 100644 index 00000000000..0c5bd49b4f3 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/overloadOnConstConstraintChecks2.ts === +class A {} +>A : Symbol(A, Decl(overloadOnConstConstraintChecks2.ts, 0, 0)) + +class B extends A {} +>B : Symbol(B, Decl(overloadOnConstConstraintChecks2.ts, 0, 10)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks2.ts, 0, 0)) + +class C extends A { +>C : Symbol(C, Decl(overloadOnConstConstraintChecks2.ts, 1, 20)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks2.ts, 0, 0)) + + public foo() { } +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks2.ts, 2, 19)) +} +function foo(name: 'hi'): B; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks2.ts, 4, 1), Decl(overloadOnConstConstraintChecks2.ts, 5, 28), Decl(overloadOnConstConstraintChecks2.ts, 6, 29), Decl(overloadOnConstConstraintChecks2.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks2.ts, 5, 13)) +>B : Symbol(B, Decl(overloadOnConstConstraintChecks2.ts, 0, 10)) + +function foo(name: 'bye'): C; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks2.ts, 4, 1), Decl(overloadOnConstConstraintChecks2.ts, 5, 28), Decl(overloadOnConstConstraintChecks2.ts, 6, 29), Decl(overloadOnConstConstraintChecks2.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks2.ts, 6, 13)) +>C : Symbol(C, Decl(overloadOnConstConstraintChecks2.ts, 1, 20)) + +function foo(name: string): A; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks2.ts, 4, 1), Decl(overloadOnConstConstraintChecks2.ts, 5, 28), Decl(overloadOnConstConstraintChecks2.ts, 6, 29), Decl(overloadOnConstConstraintChecks2.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks2.ts, 7, 13)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks2.ts, 0, 0)) + +function foo(name: any): A { +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks2.ts, 4, 1), Decl(overloadOnConstConstraintChecks2.ts, 5, 28), Decl(overloadOnConstConstraintChecks2.ts, 6, 29), Decl(overloadOnConstConstraintChecks2.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks2.ts, 8, 13)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks2.ts, 0, 0)) + + return null; +} diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.types b/tests/baselines/reference/overloadOnConstConstraintChecks2.types index c5af206c6da..36fa89dec4a 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.types @@ -34,4 +34,5 @@ function foo(name: any): A { >A : A return null; +>null : null } diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.symbols b/tests/baselines/reference/overloadOnConstConstraintChecks3.symbols new file mode 100644 index 00000000000..5748fd441a5 --- /dev/null +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.symbols @@ -0,0 +1,39 @@ +=== tests/cases/compiler/overloadOnConstConstraintChecks3.ts === +class A { private x = 1} +>A : Symbol(A, Decl(overloadOnConstConstraintChecks3.ts, 0, 0)) +>x : Symbol(x, Decl(overloadOnConstConstraintChecks3.ts, 0, 9)) + +class B extends A {} +>B : Symbol(B, Decl(overloadOnConstConstraintChecks3.ts, 0, 24)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks3.ts, 0, 0)) + +class C extends A { +>C : Symbol(C, Decl(overloadOnConstConstraintChecks3.ts, 1, 20)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks3.ts, 0, 0)) + + public foo() { } +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks3.ts, 2, 19)) +} +function foo(name: 'hi'): B; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks3.ts, 4, 1), Decl(overloadOnConstConstraintChecks3.ts, 5, 28), Decl(overloadOnConstConstraintChecks3.ts, 6, 29), Decl(overloadOnConstConstraintChecks3.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks3.ts, 5, 13)) +>B : Symbol(B, Decl(overloadOnConstConstraintChecks3.ts, 0, 24)) + +function foo(name: 'bye'): C; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks3.ts, 4, 1), Decl(overloadOnConstConstraintChecks3.ts, 5, 28), Decl(overloadOnConstConstraintChecks3.ts, 6, 29), Decl(overloadOnConstConstraintChecks3.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks3.ts, 6, 13)) +>C : Symbol(C, Decl(overloadOnConstConstraintChecks3.ts, 1, 20)) + +function foo(name: string): A; +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks3.ts, 4, 1), Decl(overloadOnConstConstraintChecks3.ts, 5, 28), Decl(overloadOnConstConstraintChecks3.ts, 6, 29), Decl(overloadOnConstConstraintChecks3.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks3.ts, 7, 13)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks3.ts, 0, 0)) + +function foo(name: any): A { +>foo : Symbol(foo, Decl(overloadOnConstConstraintChecks3.ts, 4, 1), Decl(overloadOnConstConstraintChecks3.ts, 5, 28), Decl(overloadOnConstConstraintChecks3.ts, 6, 29), Decl(overloadOnConstConstraintChecks3.ts, 7, 30)) +>name : Symbol(name, Decl(overloadOnConstConstraintChecks3.ts, 8, 13)) +>A : Symbol(A, Decl(overloadOnConstConstraintChecks3.ts, 0, 0)) + + return null; +} + diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.types b/tests/baselines/reference/overloadOnConstConstraintChecks3.types index adc41ff235c..94a03bb7680 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.types @@ -2,6 +2,7 @@ class A { private x = 1} >A : A >x : number +>1 : number class B extends A {} >B : B @@ -35,5 +36,6 @@ function foo(name: any): A { >A : A return null; +>null : null } diff --git a/tests/baselines/reference/overloadOnConstInheritance1.symbols b/tests/baselines/reference/overloadOnConstInheritance1.symbols new file mode 100644 index 00000000000..c5cc9b52abc --- /dev/null +++ b/tests/baselines/reference/overloadOnConstInheritance1.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/overloadOnConstInheritance1.ts === +interface Base { +>Base : Symbol(Base, Decl(overloadOnConstInheritance1.ts, 0, 0)) + + addEventListener(x: string): any; +>addEventListener : Symbol(addEventListener, Decl(overloadOnConstInheritance1.ts, 0, 16), Decl(overloadOnConstInheritance1.ts, 1, 37)) +>x : Symbol(x, Decl(overloadOnConstInheritance1.ts, 1, 21)) + + addEventListener(x: 'foo'): string; +>addEventListener : Symbol(addEventListener, Decl(overloadOnConstInheritance1.ts, 0, 16), Decl(overloadOnConstInheritance1.ts, 1, 37)) +>x : Symbol(x, Decl(overloadOnConstInheritance1.ts, 2, 21)) +} +interface Deriver extends Base { +>Deriver : Symbol(Deriver, Decl(overloadOnConstInheritance1.ts, 3, 1)) +>Base : Symbol(Base, Decl(overloadOnConstInheritance1.ts, 0, 0)) + + addEventListener(x: string): any; +>addEventListener : Symbol(addEventListener, Decl(overloadOnConstInheritance1.ts, 4, 32), Decl(overloadOnConstInheritance1.ts, 5, 37)) +>x : Symbol(x, Decl(overloadOnConstInheritance1.ts, 5, 21)) + + addEventListener(x: 'bar'): string; +>addEventListener : Symbol(addEventListener, Decl(overloadOnConstInheritance1.ts, 4, 32), Decl(overloadOnConstInheritance1.ts, 5, 37)) +>x : Symbol(x, Decl(overloadOnConstInheritance1.ts, 6, 21)) +} + diff --git a/tests/baselines/reference/overloadOnGenericArity.symbols b/tests/baselines/reference/overloadOnGenericArity.symbols new file mode 100644 index 00000000000..28f3c74fd2b --- /dev/null +++ b/tests/baselines/reference/overloadOnGenericArity.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/overloadOnGenericArity.ts === +interface Test { +>Test : Symbol(Test, Decl(overloadOnGenericArity.ts, 0, 0)) + + then(p: string): string; +>then : Symbol(then, Decl(overloadOnGenericArity.ts, 0, 16), Decl(overloadOnGenericArity.ts, 1, 31)) +>U : Symbol(U, Decl(overloadOnGenericArity.ts, 1, 9)) +>p : Symbol(p, Decl(overloadOnGenericArity.ts, 1, 12)) + + then(p: string): Date; // Error: Overloads cannot differ only by return type +>then : Symbol(then, Decl(overloadOnGenericArity.ts, 0, 16), Decl(overloadOnGenericArity.ts, 1, 31)) +>p : Symbol(p, Decl(overloadOnGenericArity.ts, 2, 9)) +>Date : Symbol(Date, Decl(lib.d.ts, 633, 23), Decl(lib.d.ts, 815, 11)) +} + + diff --git a/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.symbols b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.symbols new file mode 100644 index 00000000000..8c4b74f89a2 --- /dev/null +++ b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.symbols @@ -0,0 +1,59 @@ +=== tests/cases/compiler/overloadOnGenericClassAndNonGenericClass.ts === +class A { a; } +>A : Symbol(A, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 0)) +>a : Symbol(a, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 9)) + +class B { b; } +>B : Symbol(B, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 14)) +>b : Symbol(b, Decl(overloadOnGenericClassAndNonGenericClass.ts, 1, 9)) + +class C { c; } +>C : Symbol(C, Decl(overloadOnGenericClassAndNonGenericClass.ts, 1, 14)) +>c : Symbol(c, Decl(overloadOnGenericClassAndNonGenericClass.ts, 2, 9)) + +class X { x: T; } +>X : Symbol(X, Decl(overloadOnGenericClassAndNonGenericClass.ts, 2, 14)) +>T : Symbol(T, Decl(overloadOnGenericClassAndNonGenericClass.ts, 3, 8)) +>x : Symbol(x, Decl(overloadOnGenericClassAndNonGenericClass.ts, 3, 12)) +>T : Symbol(T, Decl(overloadOnGenericClassAndNonGenericClass.ts, 3, 8)) + +class X1 { x: string; } +>X1 : Symbol(X1, Decl(overloadOnGenericClassAndNonGenericClass.ts, 3, 20)) +>x : Symbol(x, Decl(overloadOnGenericClassAndNonGenericClass.ts, 4, 10)) + +class X2 { x: string; } +>X2 : Symbol(X2, Decl(overloadOnGenericClassAndNonGenericClass.ts, 4, 23)) +>x : Symbol(x, Decl(overloadOnGenericClassAndNonGenericClass.ts, 5, 10)) + +function f(a: X1): A; +>f : Symbol(f, Decl(overloadOnGenericClassAndNonGenericClass.ts, 5, 23), Decl(overloadOnGenericClassAndNonGenericClass.ts, 6, 21), Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 26)) +>a : Symbol(a, Decl(overloadOnGenericClassAndNonGenericClass.ts, 6, 11)) +>X1 : Symbol(X1, Decl(overloadOnGenericClassAndNonGenericClass.ts, 3, 20)) +>A : Symbol(A, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 0)) + +function f(a: X): B; +>f : Symbol(f, Decl(overloadOnGenericClassAndNonGenericClass.ts, 5, 23), Decl(overloadOnGenericClassAndNonGenericClass.ts, 6, 21), Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 26)) +>T : Symbol(T, Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 11)) +>a : Symbol(a, Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 14)) +>X : Symbol(X, Decl(overloadOnGenericClassAndNonGenericClass.ts, 2, 14)) +>T : Symbol(T, Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 11)) +>B : Symbol(B, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 14)) + +function f(a): any { +>f : Symbol(f, Decl(overloadOnGenericClassAndNonGenericClass.ts, 5, 23), Decl(overloadOnGenericClassAndNonGenericClass.ts, 6, 21), Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 26)) +>a : Symbol(a, Decl(overloadOnGenericClassAndNonGenericClass.ts, 8, 11)) +} + +var xs: X; +>xs : Symbol(xs, Decl(overloadOnGenericClassAndNonGenericClass.ts, 11, 3)) +>X : Symbol(X, Decl(overloadOnGenericClassAndNonGenericClass.ts, 2, 14)) + +var t3 = f(xs); +>t3 : Symbol(t3, Decl(overloadOnGenericClassAndNonGenericClass.ts, 13, 3), Decl(overloadOnGenericClassAndNonGenericClass.ts, 14, 3)) +>f : Symbol(f, Decl(overloadOnGenericClassAndNonGenericClass.ts, 5, 23), Decl(overloadOnGenericClassAndNonGenericClass.ts, 6, 21), Decl(overloadOnGenericClassAndNonGenericClass.ts, 7, 26)) +>xs : Symbol(xs, Decl(overloadOnGenericClassAndNonGenericClass.ts, 11, 3)) + +var t3: A; // should not error +>t3 : Symbol(t3, Decl(overloadOnGenericClassAndNonGenericClass.ts, 13, 3), Decl(overloadOnGenericClassAndNonGenericClass.ts, 14, 3)) +>A : Symbol(A, Decl(overloadOnGenericClassAndNonGenericClass.ts, 0, 0)) + diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.symbols b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.symbols new file mode 100644 index 00000000000..815f977d605 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/overloadResolutionOverNonCTLambdas.ts === +module Bugs { +>Bugs : Symbol(Bugs, Decl(overloadResolutionOverNonCTLambdas.ts, 0, 0)) + + class A { +>A : Symbol(A, Decl(overloadResolutionOverNonCTLambdas.ts, 0, 13)) + } + + // replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + function bug2(message:string, ...args:any[]):string { +>bug2 : Symbol(bug2, Decl(overloadResolutionOverNonCTLambdas.ts, 2, 3)) +>message : Symbol(message, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 16)) +>args : Symbol(args, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 31)) + + var result= message.replace(/\{(\d+)\}/g, function(match, ...rest) { +>result : Symbol(result, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 7)) +>message.replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63)) +>message : Symbol(message, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 16)) +>replace : Symbol(String.replace, Decl(lib.d.ts, 329, 44), Decl(lib.d.ts, 336, 63), Decl(lib.d.ts, 343, 102), Decl(lib.d.ts, 350, 63)) +>match : Symbol(match, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 55)) +>rest : Symbol(rest, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 61)) + + var index= rest[0]; +>index : Symbol(index, Decl(overloadResolutionOverNonCTLambdas.ts, 7, 9)) +>rest : Symbol(rest, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 61)) + + return typeof args[index] !== 'undefined' +>args : Symbol(args, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 31)) +>index : Symbol(index, Decl(overloadResolutionOverNonCTLambdas.ts, 7, 9)) + + ? args[index] +>args : Symbol(args, Decl(overloadResolutionOverNonCTLambdas.ts, 5, 31)) +>index : Symbol(index, Decl(overloadResolutionOverNonCTLambdas.ts, 7, 9)) + + : match; +>match : Symbol(match, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 55)) + + }); + return result; +>result : Symbol(result, Decl(overloadResolutionOverNonCTLambdas.ts, 6, 7)) + } +} + +function bug3(f:(x:string)=>string) { return f("s") } +>bug3 : Symbol(bug3, Decl(overloadResolutionOverNonCTLambdas.ts, 14, 1)) +>f : Symbol(f, Decl(overloadResolutionOverNonCTLambdas.ts, 16, 14)) +>x : Symbol(x, Decl(overloadResolutionOverNonCTLambdas.ts, 16, 17)) +>f : Symbol(f, Decl(overloadResolutionOverNonCTLambdas.ts, 16, 14)) + +function fprime(x:string):string { return x; } +>fprime : Symbol(fprime, Decl(overloadResolutionOverNonCTLambdas.ts, 16, 53)) +>x : Symbol(x, Decl(overloadResolutionOverNonCTLambdas.ts, 18, 16)) +>x : Symbol(x, Decl(overloadResolutionOverNonCTLambdas.ts, 18, 16)) + +bug3(fprime); +>bug3 : Symbol(bug3, Decl(overloadResolutionOverNonCTLambdas.ts, 14, 1)) +>fprime : Symbol(fprime, Decl(overloadResolutionOverNonCTLambdas.ts, 16, 53)) + +bug3(function(x:string):string { return x; }); +>bug3 : Symbol(bug3, Decl(overloadResolutionOverNonCTLambdas.ts, 14, 1)) +>x : Symbol(x, Decl(overloadResolutionOverNonCTLambdas.ts, 22, 14)) +>x : Symbol(x, Decl(overloadResolutionOverNonCTLambdas.ts, 22, 14)) + diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types index 6e129400736..f62bb4e8373 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types @@ -18,6 +18,7 @@ module Bugs { >message.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } >message : string >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } +>/\{(\d+)\}/g : RegExp >function(match, ...rest) { var index= rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; } : (match: string, ...rest: any[]) => any >match : string >rest : any[] @@ -26,6 +27,7 @@ module Bugs { >index : any >rest[0] : any >rest : any[] +>0 : number return typeof args[index] !== 'undefined' >typeof args[index] !== 'undefined' ? args[index] : match : any @@ -34,6 +36,7 @@ module Bugs { >args[index] : any >args : any[] >index : any +>'undefined' : string ? args[index] >args[index] : any @@ -55,6 +58,7 @@ function bug3(f:(x:string)=>string) { return f("s") } >x : string >f("s") : string >f : (x: string) => string +>"s" : string function fprime(x:string):string { return x; } >fprime : (x: string) => string diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.symbols b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.symbols new file mode 100644 index 00000000000..850f188a58b --- /dev/null +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.symbols @@ -0,0 +1,60 @@ +=== tests/cases/compiler/overloadResolutionOverNonCTObjectLit.ts === +module Bugs { +>Bugs : Symbol(Bugs, Decl(overloadResolutionOverNonCTObjectLit.ts, 0, 0)) + + export interface IToken { +>IToken : Symbol(IToken, Decl(overloadResolutionOverNonCTObjectLit.ts, 0, 13)) + + startIndex:number; +>startIndex : Symbol(startIndex, Decl(overloadResolutionOverNonCTObjectLit.ts, 1, 41)) + + type:string; +>type : Symbol(type, Decl(overloadResolutionOverNonCTObjectLit.ts, 2, 50)) + + bracket:number; +>bracket : Symbol(bracket, Decl(overloadResolutionOverNonCTObjectLit.ts, 3, 44)) + } + + export interface IState { +>IState : Symbol(IState, Decl(overloadResolutionOverNonCTObjectLit.ts, 5, 17)) + } + + export interface IStateToken extends IToken { +>IStateToken : Symbol(IStateToken, Decl(overloadResolutionOverNonCTObjectLit.ts, 8, 17)) +>IToken : Symbol(IToken, Decl(overloadResolutionOverNonCTObjectLit.ts, 0, 13)) + + state: IState; +>state : Symbol(state, Decl(overloadResolutionOverNonCTObjectLit.ts, 10, 61)) +>IState : Symbol(IState, Decl(overloadResolutionOverNonCTObjectLit.ts, 5, 17)) + + length: number; +>length : Symbol(length, Decl(overloadResolutionOverNonCTObjectLit.ts, 11, 46)) + } + + function bug3() { +>bug3 : Symbol(bug3, Decl(overloadResolutionOverNonCTObjectLit.ts, 13, 17)) + + var tokens:IToken[]= []; +>tokens : Symbol(tokens, Decl(overloadResolutionOverNonCTObjectLit.ts, 16, 35)) +>IToken : Symbol(IToken, Decl(overloadResolutionOverNonCTObjectLit.ts, 0, 13)) + + tokens.push({ startIndex: 1, type: '', bracket: 3 }); +>tokens.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>tokens : Symbol(tokens, Decl(overloadResolutionOverNonCTObjectLit.ts, 16, 35)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>startIndex : Symbol(startIndex, Decl(overloadResolutionOverNonCTObjectLit.ts, 17, 45)) +>type : Symbol(type, Decl(overloadResolutionOverNonCTObjectLit.ts, 17, 60)) +>bracket : Symbol(bracket, Decl(overloadResolutionOverNonCTObjectLit.ts, 17, 70)) + + tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })); +>tokens.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>tokens : Symbol(tokens, Decl(overloadResolutionOverNonCTObjectLit.ts, 16, 35)) +>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29)) +>IToken : Symbol(IToken, Decl(overloadResolutionOverNonCTObjectLit.ts, 0, 13)) +>startIndex : Symbol(startIndex, Decl(overloadResolutionOverNonCTObjectLit.ts, 18, 54)) +>type : Symbol(type, Decl(overloadResolutionOverNonCTObjectLit.ts, 18, 69)) +>bracket : Symbol(bracket, Decl(overloadResolutionOverNonCTObjectLit.ts, 18, 79)) +>state : Symbol(state, Decl(overloadResolutionOverNonCTObjectLit.ts, 18, 91)) +>length : Symbol(length, Decl(overloadResolutionOverNonCTObjectLit.ts, 18, 104)) + } +} diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types index 7ad68cefa4f..e6ff0cda468 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types @@ -46,8 +46,11 @@ module Bugs { >push : (...items: IToken[]) => number >{ startIndex: 1, type: '', bracket: 3 } : { startIndex: number; type: string; bracket: number; } >startIndex : number +>1 : number >type : string +>'' : string >bracket : number +>3 : number tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })); >tokens.push(({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 })) : number @@ -59,9 +62,14 @@ module Bugs { >({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 }) : { startIndex: number; type: string; bracket: number; state: null; length: number; } >{ startIndex: 1, type: '', bracket: 3, state: null, length: 10 } : { startIndex: number; type: string; bracket: number; state: null; length: number; } >startIndex : number +>1 : number >type : string +>'' : string >bracket : number +>3 : number >state : null +>null : null >length : number +>10 : number } } diff --git a/tests/baselines/reference/overloadResolutionWithAny.symbols b/tests/baselines/reference/overloadResolutionWithAny.symbols new file mode 100644 index 00000000000..af998b6b376 --- /dev/null +++ b/tests/baselines/reference/overloadResolutionWithAny.symbols @@ -0,0 +1,62 @@ +=== tests/cases/compiler/overloadResolutionWithAny.ts === +var func: { +>func : Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3)) + + (s: string): number; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 1, 5)) + + (s: any): string; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 2, 5)) + +}; + +func(""); // number +>func : Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3)) + +func(3); // string +>func : Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3)) + +var x: any; +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) + +func(x); // string +>func : Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3)) +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) + +var func2: { +>func2 : Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3)) + + (s: string, t: string): number; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 11, 5)) +>t : Symbol(t, Decl(overloadResolutionWithAny.ts, 11, 15)) + + (s: any, t: string): boolean; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 12, 5)) +>t : Symbol(t, Decl(overloadResolutionWithAny.ts, 12, 12)) + + (s: string, t: any): RegExp; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 13, 5)) +>t : Symbol(t, Decl(overloadResolutionWithAny.ts, 13, 15)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11)) + + (s: any, t: any): string; +>s : Symbol(s, Decl(overloadResolutionWithAny.ts, 14, 5)) +>t : Symbol(t, Decl(overloadResolutionWithAny.ts, 14, 12)) +} + +func2(x, x); // string +>func2 : Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3)) +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) + +func2("", ""); // number +>func2 : Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3)) + +func2(x, ""); // boolean +>func2 : Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3)) +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) + +func2("", x); // RegExp +>func2 : Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3)) +>x : Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3)) + diff --git a/tests/baselines/reference/overloadResolutionWithAny.types b/tests/baselines/reference/overloadResolutionWithAny.types index 14d378c9fac..e66368d3554 100644 --- a/tests/baselines/reference/overloadResolutionWithAny.types +++ b/tests/baselines/reference/overloadResolutionWithAny.types @@ -13,10 +13,12 @@ var func: { func(""); // number >func("") : number >func : { (s: string): number; (s: any): string; } +>"" : string func(3); // string >func(3) : string >func : { (s: string): number; (s: any): string; } +>3 : number var x: any; >x : any @@ -56,14 +58,18 @@ func2(x, x); // string func2("", ""); // number >func2("", "") : number >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } +>"" : string +>"" : string func2(x, ""); // boolean >func2(x, "") : boolean >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } >x : any +>"" : string func2("", x); // RegExp >func2("", x) : RegExp >func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; } +>"" : string >x : any diff --git a/tests/baselines/reference/overloadRet.symbols b/tests/baselines/reference/overloadRet.symbols new file mode 100644 index 00000000000..0c645b7c4b8 --- /dev/null +++ b/tests/baselines/reference/overloadRet.symbols @@ -0,0 +1,38 @@ +=== tests/cases/compiler/overloadRet.ts === +interface I { +>I : Symbol(I, Decl(overloadRet.ts, 0, 0)) + + f(s:string):number; +>f : Symbol(f, Decl(overloadRet.ts, 0, 13), Decl(overloadRet.ts, 1, 23)) +>s : Symbol(s, Decl(overloadRet.ts, 1, 6)) + + f(n:number):string; +>f : Symbol(f, Decl(overloadRet.ts, 0, 13), Decl(overloadRet.ts, 1, 23)) +>n : Symbol(n, Decl(overloadRet.ts, 2, 6)) + + g(n:number):any; +>g : Symbol(g, Decl(overloadRet.ts, 2, 23), Decl(overloadRet.ts, 3, 20)) +>n : Symbol(n, Decl(overloadRet.ts, 3, 6)) + + g(n:number,m:number):string; +>g : Symbol(g, Decl(overloadRet.ts, 2, 23), Decl(overloadRet.ts, 3, 20)) +>n : Symbol(n, Decl(overloadRet.ts, 4, 6)) +>m : Symbol(m, Decl(overloadRet.ts, 4, 15)) + + h(n:number):I; +>h : Symbol(h, Decl(overloadRet.ts, 4, 32), Decl(overloadRet.ts, 5, 18)) +>n : Symbol(n, Decl(overloadRet.ts, 5, 6)) +>I : Symbol(I, Decl(overloadRet.ts, 0, 0)) + + h(b:boolean):number; +>h : Symbol(h, Decl(overloadRet.ts, 4, 32), Decl(overloadRet.ts, 5, 18)) +>b : Symbol(b, Decl(overloadRet.ts, 6, 6)) + + i(b:boolean):number; +>i : Symbol(i, Decl(overloadRet.ts, 6, 24), Decl(overloadRet.ts, 7, 24)) +>b : Symbol(b, Decl(overloadRet.ts, 7, 6)) + + i(b:boolean):any; +>i : Symbol(i, Decl(overloadRet.ts, 6, 24), Decl(overloadRet.ts, 7, 24)) +>b : Symbol(b, Decl(overloadRet.ts, 8, 6)) +} diff --git a/tests/baselines/reference/overloadReturnTypes.symbols b/tests/baselines/reference/overloadReturnTypes.symbols new file mode 100644 index 00000000000..b76efb4a0d6 --- /dev/null +++ b/tests/baselines/reference/overloadReturnTypes.symbols @@ -0,0 +1,58 @@ +=== tests/cases/compiler/overloadReturnTypes.ts === +class Accessor {} +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) + +function attr(name: string): string; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 0, 17), Decl(overloadReturnTypes.ts, 2, 36), Decl(overloadReturnTypes.ts, 3, 53), Decl(overloadReturnTypes.ts, 4, 34)) +>name : Symbol(name, Decl(overloadReturnTypes.ts, 2, 14)) + +function attr(name: string, value: string): Accessor; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 0, 17), Decl(overloadReturnTypes.ts, 2, 36), Decl(overloadReturnTypes.ts, 3, 53), Decl(overloadReturnTypes.ts, 4, 34)) +>name : Symbol(name, Decl(overloadReturnTypes.ts, 3, 14)) +>value : Symbol(value, Decl(overloadReturnTypes.ts, 3, 27)) +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) + +function attr(map: any): Accessor; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 0, 17), Decl(overloadReturnTypes.ts, 2, 36), Decl(overloadReturnTypes.ts, 3, 53), Decl(overloadReturnTypes.ts, 4, 34)) +>map : Symbol(map, Decl(overloadReturnTypes.ts, 4, 14)) +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) + +function attr(nameOrMap: any, value?: string): any { +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 0, 17), Decl(overloadReturnTypes.ts, 2, 36), Decl(overloadReturnTypes.ts, 3, 53), Decl(overloadReturnTypes.ts, 4, 34)) +>nameOrMap : Symbol(nameOrMap, Decl(overloadReturnTypes.ts, 5, 14)) +>value : Symbol(value, Decl(overloadReturnTypes.ts, 5, 29)) + + if (nameOrMap && typeof nameOrMap === "object") { +>nameOrMap : Symbol(nameOrMap, Decl(overloadReturnTypes.ts, 5, 14)) +>nameOrMap : Symbol(nameOrMap, Decl(overloadReturnTypes.ts, 5, 14)) + + // handle map case + return new Accessor; +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) + } + else { + // handle string case + return "s"; + } +} + + +interface IFace { +>IFace : Symbol(IFace, Decl(overloadReturnTypes.ts, 14, 1)) + + attr(name:string):string; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 17, 17), Decl(overloadReturnTypes.ts, 18, 26), Decl(overloadReturnTypes.ts, 19, 45)) +>name : Symbol(name, Decl(overloadReturnTypes.ts, 18, 6)) + + attr(name: string, value: string): Accessor; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 17, 17), Decl(overloadReturnTypes.ts, 18, 26), Decl(overloadReturnTypes.ts, 19, 45)) +>name : Symbol(name, Decl(overloadReturnTypes.ts, 19, 6)) +>value : Symbol(value, Decl(overloadReturnTypes.ts, 19, 19)) +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) + + attr(map: any): Accessor; +>attr : Symbol(attr, Decl(overloadReturnTypes.ts, 17, 17), Decl(overloadReturnTypes.ts, 18, 26), Decl(overloadReturnTypes.ts, 19, 45)) +>map : Symbol(map, Decl(overloadReturnTypes.ts, 20, 6)) +>Accessor : Symbol(Accessor, Decl(overloadReturnTypes.ts, 0, 0)) +} + diff --git a/tests/baselines/reference/overloadReturnTypes.types b/tests/baselines/reference/overloadReturnTypes.types index 1823c752ae7..3de1aec1196 100644 --- a/tests/baselines/reference/overloadReturnTypes.types +++ b/tests/baselines/reference/overloadReturnTypes.types @@ -28,6 +28,7 @@ function attr(nameOrMap: any, value?: string): any { >typeof nameOrMap === "object" : boolean >typeof nameOrMap : string >nameOrMap : any +>"object" : string // handle map case return new Accessor; @@ -37,6 +38,7 @@ function attr(nameOrMap: any, value?: string): any { else { // handle string case return "s"; +>"s" : string } } diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.symbols b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.symbols new file mode 100644 index 00000000000..0ae3e488fac --- /dev/null +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/overloadWithCallbacksWithDifferingOptionalityOnArgs.ts === +function x2(callback: (x?: number) => number); +>x2 : Symbol(x2, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 0), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 46), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 45)) +>callback : Symbol(callback, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 12)) +>x : Symbol(x, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 23)) + +function x2(callback: (x: string) => number); +>x2 : Symbol(x2, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 0), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 46), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 45)) +>callback : Symbol(callback, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 12)) +>x : Symbol(x, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 23)) + +function x2(callback: (x: any) => number) { } +>x2 : Symbol(x2, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 0), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 46), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 45)) +>callback : Symbol(callback, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 2, 12)) +>x : Symbol(x, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 2, 23)) + +x2(() => 1); +>x2 : Symbol(x2, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 0), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 46), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 45)) + +x2((x) => 1 ); +>x2 : Symbol(x2, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 0), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 0, 46), Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 1, 45)) +>x : Symbol(x, Decl(overloadWithCallbacksWithDifferingOptionalityOnArgs.ts, 4, 4)) + diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types index 2ed804ad012..b9ea7d98270 100644 --- a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types @@ -18,10 +18,12 @@ x2(() => 1); >x2(() => 1) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } >() => 1 : () => number +>1 : number x2((x) => 1 ); >x2((x) => 1 ) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } >(x) => 1 : (x: number) => number >x : number +>1 : number diff --git a/tests/baselines/reference/overloadedStaticMethodSpecialization.symbols b/tests/baselines/reference/overloadedStaticMethodSpecialization.symbols new file mode 100644 index 00000000000..eddadc8ab03 --- /dev/null +++ b/tests/baselines/reference/overloadedStaticMethodSpecialization.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/overloadedStaticMethodSpecialization.ts === +class A { +>A : Symbol(A, Decl(overloadedStaticMethodSpecialization.ts, 0, 0)) +>T : Symbol(T, Decl(overloadedStaticMethodSpecialization.ts, 0, 8)) + + static B(v: A): A; +>B : Symbol(A.B, Decl(overloadedStaticMethodSpecialization.ts, 0, 12), Decl(overloadedStaticMethodSpecialization.ts, 1, 31), Decl(overloadedStaticMethodSpecialization.ts, 2, 28)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 1, 13)) +>v : Symbol(v, Decl(overloadedStaticMethodSpecialization.ts, 1, 16)) +>A : Symbol(A, Decl(overloadedStaticMethodSpecialization.ts, 0, 0)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 1, 13)) +>A : Symbol(A, Decl(overloadedStaticMethodSpecialization.ts, 0, 0)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 1, 13)) + + static B(v: S): A; +>B : Symbol(A.B, Decl(overloadedStaticMethodSpecialization.ts, 0, 12), Decl(overloadedStaticMethodSpecialization.ts, 1, 31), Decl(overloadedStaticMethodSpecialization.ts, 2, 28)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 2, 13)) +>v : Symbol(v, Decl(overloadedStaticMethodSpecialization.ts, 2, 16)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 2, 13)) +>A : Symbol(A, Decl(overloadedStaticMethodSpecialization.ts, 0, 0)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 2, 13)) + + static B(v: any): A { +>B : Symbol(A.B, Decl(overloadedStaticMethodSpecialization.ts, 0, 12), Decl(overloadedStaticMethodSpecialization.ts, 1, 31), Decl(overloadedStaticMethodSpecialization.ts, 2, 28)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 3, 13)) +>v : Symbol(v, Decl(overloadedStaticMethodSpecialization.ts, 3, 16)) +>A : Symbol(A, Decl(overloadedStaticMethodSpecialization.ts, 0, 0)) +>S : Symbol(S, Decl(overloadedStaticMethodSpecialization.ts, 3, 13)) + + return null; + } +} + diff --git a/tests/baselines/reference/overloadedStaticMethodSpecialization.types b/tests/baselines/reference/overloadedStaticMethodSpecialization.types index bd60fc16fe0..aac8f645687 100644 --- a/tests/baselines/reference/overloadedStaticMethodSpecialization.types +++ b/tests/baselines/reference/overloadedStaticMethodSpecialization.types @@ -28,6 +28,7 @@ class A { >S : S return null; +>null : null } } diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArity.symbols b/tests/baselines/reference/overloadsAndTypeArgumentArity.symbols new file mode 100644 index 00000000000..76e9ae7d701 --- /dev/null +++ b/tests/baselines/reference/overloadsAndTypeArgumentArity.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/overloadsAndTypeArgumentArity.ts === +declare function Callbacks(flags?: string): void; +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) +>flags : Symbol(flags, Decl(overloadsAndTypeArgumentArity.ts, 0, 27)) + +declare function Callbacks(flags?: string): void; +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) +>T : Symbol(T, Decl(overloadsAndTypeArgumentArity.ts, 1, 27)) +>flags : Symbol(flags, Decl(overloadsAndTypeArgumentArity.ts, 1, 30)) + +declare function Callbacks(flags?: string): void; +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) +>T1 : Symbol(T1, Decl(overloadsAndTypeArgumentArity.ts, 2, 27)) +>T2 : Symbol(T2, Decl(overloadsAndTypeArgumentArity.ts, 2, 30)) +>flags : Symbol(flags, Decl(overloadsAndTypeArgumentArity.ts, 2, 35)) + +declare function Callbacks(flags?: string): void; +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) +>T1 : Symbol(T1, Decl(overloadsAndTypeArgumentArity.ts, 3, 27)) +>T2 : Symbol(T2, Decl(overloadsAndTypeArgumentArity.ts, 3, 30)) +>T3 : Symbol(T3, Decl(overloadsAndTypeArgumentArity.ts, 3, 34)) +>flags : Symbol(flags, Decl(overloadsAndTypeArgumentArity.ts, 3, 39)) + +Callbacks('s'); // no error +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) + +new Callbacks('s'); // no error +>Callbacks : Symbol(Callbacks, Decl(overloadsAndTypeArgumentArity.ts, 0, 0), Decl(overloadsAndTypeArgumentArity.ts, 0, 49), Decl(overloadsAndTypeArgumentArity.ts, 1, 52), Decl(overloadsAndTypeArgumentArity.ts, 2, 57)) + diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArity.types b/tests/baselines/reference/overloadsAndTypeArgumentArity.types index 1b76b8e13fe..b69f394e83d 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArity.types +++ b/tests/baselines/reference/overloadsAndTypeArgumentArity.types @@ -24,8 +24,10 @@ declare function Callbacks(flags?: string): void; Callbacks('s'); // no error >Callbacks('s') : void >Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } +>'s' : string new Callbacks('s'); // no error >new Callbacks('s') : any >Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } +>'s' : string diff --git a/tests/baselines/reference/overloadsWithConstraints.symbols b/tests/baselines/reference/overloadsWithConstraints.symbols new file mode 100644 index 00000000000..68b675093bf --- /dev/null +++ b/tests/baselines/reference/overloadsWithConstraints.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/overloadsWithConstraints.ts === +declare function f(x: T): T; +>f : Symbol(f, Decl(overloadsWithConstraints.ts, 0, 0), Decl(overloadsWithConstraints.ts, 0, 46)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 0, 19)) +>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11)) +>x : Symbol(x, Decl(overloadsWithConstraints.ts, 0, 37)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 0, 19)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 0, 19)) + +declare function f(x: T): T +>f : Symbol(f, Decl(overloadsWithConstraints.ts, 0, 0), Decl(overloadsWithConstraints.ts, 0, 46)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 1, 19)) +>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11)) +>x : Symbol(x, Decl(overloadsWithConstraints.ts, 1, 37)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 1, 19)) +>T : Symbol(T, Decl(overloadsWithConstraints.ts, 1, 19)) + +var v = f(""); +>v : Symbol(v, Decl(overloadsWithConstraints.ts, 3, 3)) +>f : Symbol(f, Decl(overloadsWithConstraints.ts, 0, 0), Decl(overloadsWithConstraints.ts, 0, 46)) + diff --git a/tests/baselines/reference/overloadsWithConstraints.types b/tests/baselines/reference/overloadsWithConstraints.types index 1493a0e1a2a..b045904ece5 100644 --- a/tests/baselines/reference/overloadsWithConstraints.types +++ b/tests/baselines/reference/overloadsWithConstraints.types @@ -19,4 +19,5 @@ var v = f(""); >v : string >f("") : string >f : { (x: T): T; (x: T): T; } +>"" : string diff --git a/tests/baselines/reference/parameterPropertyInitializerInInitializers.symbols b/tests/baselines/reference/parameterPropertyInitializerInInitializers.symbols new file mode 100644 index 00000000000..c05adb9e8ca --- /dev/null +++ b/tests/baselines/reference/parameterPropertyInitializerInInitializers.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/parameterPropertyInitializerInInitializers.ts === +class Foo { +>Foo : Symbol(Foo, Decl(parameterPropertyInitializerInInitializers.ts, 0, 0)) + + constructor(public x: number, public y: number = x) { } +>x : Symbol(x, Decl(parameterPropertyInitializerInInitializers.ts, 1, 16)) +>y : Symbol(y, Decl(parameterPropertyInitializerInInitializers.ts, 1, 33)) +>x : Symbol(x, Decl(parameterPropertyInitializerInInitializers.ts, 1, 16)) +} diff --git a/tests/baselines/reference/parameterPropertyReferencingOtherParameter.symbols b/tests/baselines/reference/parameterPropertyReferencingOtherParameter.symbols new file mode 100644 index 00000000000..fb6d289f241 --- /dev/null +++ b/tests/baselines/reference/parameterPropertyReferencingOtherParameter.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/parameterPropertyReferencingOtherParameter.ts === +class Foo { +>Foo : Symbol(Foo, Decl(parameterPropertyReferencingOtherParameter.ts, 0, 0)) + + constructor(public x: number, public y: number = x) { } +>x : Symbol(x, Decl(parameterPropertyReferencingOtherParameter.ts, 1, 16)) +>y : Symbol(y, Decl(parameterPropertyReferencingOtherParameter.ts, 1, 33)) +>x : Symbol(x, Decl(parameterPropertyReferencingOtherParameter.ts, 1, 16)) +} + diff --git a/tests/baselines/reference/parameterReferencesOtherParameter1.symbols b/tests/baselines/reference/parameterReferencesOtherParameter1.symbols new file mode 100644 index 00000000000..7e7eec1a3cb --- /dev/null +++ b/tests/baselines/reference/parameterReferencesOtherParameter1.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/parameterReferencesOtherParameter1.ts === +class Model { +>Model : Symbol(Model, Decl(parameterReferencesOtherParameter1.ts, 0, 0)) + + public name: string; +>name : Symbol(name, Decl(parameterReferencesOtherParameter1.ts, 0, 13)) +} + +class UI { +>UI : Symbol(UI, Decl(parameterReferencesOtherParameter1.ts, 2, 1)) + + constructor(model: Model, foo:string = model.name) +>model : Symbol(model, Decl(parameterReferencesOtherParameter1.ts, 5, 16)) +>Model : Symbol(Model, Decl(parameterReferencesOtherParameter1.ts, 0, 0)) +>foo : Symbol(foo, Decl(parameterReferencesOtherParameter1.ts, 5, 29)) +>model.name : Symbol(Model.name, Decl(parameterReferencesOtherParameter1.ts, 0, 13)) +>model : Symbol(model, Decl(parameterReferencesOtherParameter1.ts, 5, 16)) +>name : Symbol(Model.name, Decl(parameterReferencesOtherParameter1.ts, 0, 13)) + { + } +} diff --git a/tests/baselines/reference/parameterReferencesOtherParameter2.symbols b/tests/baselines/reference/parameterReferencesOtherParameter2.symbols new file mode 100644 index 00000000000..2d63c7a3334 --- /dev/null +++ b/tests/baselines/reference/parameterReferencesOtherParameter2.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/parameterReferencesOtherParameter2.ts === +class Model { +>Model : Symbol(Model, Decl(parameterReferencesOtherParameter2.ts, 0, 0)) + + public name: string; +>name : Symbol(name, Decl(parameterReferencesOtherParameter2.ts, 0, 13)) +} + +class UI { +>UI : Symbol(UI, Decl(parameterReferencesOtherParameter2.ts, 2, 1)) + + constructor(model: Model, foo = model.name) +>model : Symbol(model, Decl(parameterReferencesOtherParameter2.ts, 5, 16)) +>Model : Symbol(Model, Decl(parameterReferencesOtherParameter2.ts, 0, 0)) +>foo : Symbol(foo, Decl(parameterReferencesOtherParameter2.ts, 5, 29)) +>model.name : Symbol(Model.name, Decl(parameterReferencesOtherParameter2.ts, 0, 13)) +>model : Symbol(model, Decl(parameterReferencesOtherParameter2.ts, 5, 16)) +>name : Symbol(Model.name, Decl(parameterReferencesOtherParameter2.ts, 0, 13)) + { + } +} diff --git a/tests/baselines/reference/parametersWithNoAnnotationAreAny.symbols b/tests/baselines/reference/parametersWithNoAnnotationAreAny.symbols new file mode 100644 index 00000000000..9771d7f05ca --- /dev/null +++ b/tests/baselines/reference/parametersWithNoAnnotationAreAny.symbols @@ -0,0 +1,81 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/parametersWithNoAnnotationAreAny.ts === +function foo(x) { return x; } +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 0, 0)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 0, 13)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 0, 13)) + +var f = function foo(x) { return x; } +>f : Symbol(f, Decl(parametersWithNoAnnotationAreAny.ts, 1, 3)) +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 1, 7)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 1, 21)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 1, 21)) + +var f2 = (x) => x; +>f2 : Symbol(f2, Decl(parametersWithNoAnnotationAreAny.ts, 2, 3)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 2, 10)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 2, 10)) + +var f3 = (x) => x; +>f3 : Symbol(f3, Decl(parametersWithNoAnnotationAreAny.ts, 3, 3)) +>T : Symbol(T, Decl(parametersWithNoAnnotationAreAny.ts, 3, 10)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 3, 13)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 3, 13)) + +class C { +>C : Symbol(C, Decl(parametersWithNoAnnotationAreAny.ts, 3, 21)) + + foo(x) { +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 5, 9)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 6, 8)) + + return x; +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 6, 8)) + } +} + +interface I { +>I : Symbol(I, Decl(parametersWithNoAnnotationAreAny.ts, 9, 1)) + + foo(x); +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 11, 13)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 12, 8)) + + foo2(x, y); +>foo2 : Symbol(foo2, Decl(parametersWithNoAnnotationAreAny.ts, 12, 11)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 13, 9)) +>y : Symbol(y, Decl(parametersWithNoAnnotationAreAny.ts, 13, 11)) +} + +var a: { +>a : Symbol(a, Decl(parametersWithNoAnnotationAreAny.ts, 16, 3)) + + foo(x); +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 16, 8)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 17, 8)) +} + +var b = { +>b : Symbol(b, Decl(parametersWithNoAnnotationAreAny.ts, 20, 3)) + + foo(x) { +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 20, 9)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 21, 8)) + + return x; +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 21, 8)) + + }, + a: function foo(x) { +>a : Symbol(a, Decl(parametersWithNoAnnotationAreAny.ts, 23, 6)) +>foo : Symbol(foo, Decl(parametersWithNoAnnotationAreAny.ts, 24, 6)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 24, 20)) + + return x; +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 24, 20)) + + }, + b: (x) => x +>b : Symbol(b, Decl(parametersWithNoAnnotationAreAny.ts, 26, 6)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 27, 8)) +>x : Symbol(x, Decl(parametersWithNoAnnotationAreAny.ts, 27, 8)) +} diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.symbols b/tests/baselines/reference/parenthesizedContexualTyping1.symbols new file mode 100644 index 00000000000..698e26734ad --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping1.symbols @@ -0,0 +1,192 @@ +=== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts === + +function fun(g: (x: T) => T, x: T): T; +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 1, 13)) +>g : Symbol(g, Decl(parenthesizedContexualTyping1.ts, 1, 16)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 1, 20)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 1, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 1, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 1, 31)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 1, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 1, 13)) + +function fun(g: (x: T) => T, h: (y: T) => T, x: T): T; +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>g : Symbol(g, Decl(parenthesizedContexualTyping1.ts, 2, 16)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 2, 20)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>h : Symbol(h, Decl(parenthesizedContexualTyping1.ts, 2, 31)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 2, 36)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 2, 47)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 2, 13)) + +function fun(g: (x: T) => T, x: T): T { +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 3, 13)) +>g : Symbol(g, Decl(parenthesizedContexualTyping1.ts, 3, 16)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 3, 20)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 3, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 3, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 3, 31)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 3, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping1.ts, 3, 13)) + + return g(x); +>g : Symbol(g, Decl(parenthesizedContexualTyping1.ts, 3, 16)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 3, 31)) +} + +var a = fun(x => x, 10); +>a : Symbol(a, Decl(parenthesizedContexualTyping1.ts, 7, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 7, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 7, 12)) + +var b = fun((x => x), 10); +>b : Symbol(b, Decl(parenthesizedContexualTyping1.ts, 8, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 8, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 8, 13)) + +var c = fun(((x => x)), 10); +>c : Symbol(c, Decl(parenthesizedContexualTyping1.ts, 9, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 9, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 9, 14)) + +var d = fun((((x => x))), 10); +>d : Symbol(d, Decl(parenthesizedContexualTyping1.ts, 10, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 10, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 10, 15)) + +var e = fun(x => x, x => x, 10); +>e : Symbol(e, Decl(parenthesizedContexualTyping1.ts, 12, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 12, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 12, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 12, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 12, 19)) + +var f = fun((x => x), (x => x), 10); +>f : Symbol(f, Decl(parenthesizedContexualTyping1.ts, 13, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 13, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 13, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 13, 23)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 13, 23)) + +var g = fun(((x => x)), ((x => x)), 10); +>g : Symbol(g, Decl(parenthesizedContexualTyping1.ts, 14, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 14, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 14, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 14, 26)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 14, 26)) + +var h = fun((((x => x))), ((x => x)), 10); +>h : Symbol(h, Decl(parenthesizedContexualTyping1.ts, 15, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 15, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 15, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 15, 28)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 15, 28)) + +// Ternaries in parens +var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); +>i : Symbol(i, Decl(parenthesizedContexualTyping1.ts, 18, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 18, 34)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 18, 34)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 18, 43)) +>undefined : Symbol(undefined) + +var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); +>j : Symbol(j, Decl(parenthesizedContexualTyping1.ts, 19, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 19, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 19, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 19, 47)) +>undefined : Symbol(undefined) + +var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); +>k : Symbol(k, Decl(parenthesizedContexualTyping1.ts, 20, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 20, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 20, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 20, 47)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 20, 64)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 20, 64)) + +var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x)), 10); +>l : Symbol(l, Decl(parenthesizedContexualTyping1.ts, 21, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping1.ts, 0, 0), Decl(parenthesizedContexualTyping1.ts, 1, 41), Decl(parenthesizedContexualTyping1.ts, 2, 57)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 21, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 21, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 21, 51)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 21, 73)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 21, 73)) + +var lambda1: (x: number) => number = x => x; +>lambda1 : Symbol(lambda1, Decl(parenthesizedContexualTyping1.ts, 23, 3)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 23, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 23, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 23, 36)) + +var lambda2: (x: number) => number = (x => x); +>lambda2 : Symbol(lambda2, Decl(parenthesizedContexualTyping1.ts, 24, 3)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 24, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 24, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 24, 38)) + +type ObjType = { x: (p: number) => string; y: (p: string) => number }; +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping1.ts, 24, 46)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 26, 16)) +>p : Symbol(p, Decl(parenthesizedContexualTyping1.ts, 26, 21)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 26, 42)) +>p : Symbol(p, Decl(parenthesizedContexualTyping1.ts, 26, 47)) + +var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; +>obj1 : Symbol(obj1, Decl(parenthesizedContexualTyping1.ts, 27, 3)) +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping1.ts, 24, 46)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 27, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 27, 24)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 27, 24)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 27, 45)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 27, 48)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 27, 48)) +>undefined : Symbol(undefined) + +var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); +>obj2 : Symbol(obj2, Decl(parenthesizedContexualTyping1.ts, 28, 3)) +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping1.ts, 24, 46)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 28, 22)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 28, 25)) +>x : Symbol(x, Decl(parenthesizedContexualTyping1.ts, 28, 25)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 28, 46)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 28, 49)) +>y : Symbol(y, Decl(parenthesizedContexualTyping1.ts, 28, 49)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.types b/tests/baselines/reference/parenthesizedContexualTyping1.types index 925347ed1b3..b7307eaf3e7 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping1.types +++ b/tests/baselines/reference/parenthesizedContexualTyping1.types @@ -50,6 +50,7 @@ var a = fun(x => x, 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var b = fun((x => x), 10); >b : number @@ -59,6 +60,7 @@ var b = fun((x => x), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var c = fun(((x => x)), 10); >c : number @@ -69,6 +71,7 @@ var c = fun(((x => x)), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var d = fun((((x => x))), 10); >d : number @@ -80,6 +83,7 @@ var d = fun((((x => x))), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var e = fun(x => x, x => x, 10); >e : number @@ -91,6 +95,7 @@ var e = fun(x => x, x => x, 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var f = fun((x => x), (x => x), 10); >f : number @@ -104,6 +109,7 @@ var f = fun((x => x), (x => x), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var g = fun(((x => x)), ((x => x)), 10); >g : number @@ -119,6 +125,7 @@ var g = fun(((x => x)), ((x => x)), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number var h = fun((((x => x))), ((x => x)), 10); >h : number @@ -135,6 +142,7 @@ var h = fun((((x => x))), ((x => x)), 10); >x => x : (x: number) => number >x : number >x : number +>10 : number // Ternaries in parens var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); @@ -148,12 +156,14 @@ var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >x => x : (x: number) => number >x : number >x : number >x => undefined : (x: number) => any >x : number >undefined : undefined +>10 : number var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >j : any @@ -166,6 +176,7 @@ var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -174,6 +185,7 @@ var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); >x => undefined : (x: number) => any >x : number >undefined : undefined +>10 : number var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >k : any @@ -186,6 +198,7 @@ var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -197,6 +210,7 @@ var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); >x => x : (x: any) => any >x : any >x : any +>10 : number var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x)), 10); >l : any @@ -210,6 +224,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x) >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >((x => x)) : (x: number) => number >(x => x) : (x: number) => number >x => x : (x: number) => number @@ -225,6 +240,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x) >x => x : (x: any) => any >x : any >x : any +>10 : number var lambda1: (x: number) => number = x => x; >lambda1 : (x: number) => number diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.symbols b/tests/baselines/reference/parenthesizedContexualTyping2.symbols new file mode 100644 index 00000000000..f7616f07710 --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping2.symbols @@ -0,0 +1,234 @@ +=== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts === +// These tests ensure that in cases where it may *appear* that a value has a type, +// they actually are properly being contextually typed. The way we test this is +// that we invoke contextually typed arguments with type arguments. +// Since 'any' cannot be invoked with type arguments, we should get errors +// back if contextual typing is not taking effect. + +type FuncType = (x: (p: T) => T) => typeof x; +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 6, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 6, 21)) +>p : Symbol(p, Decl(parenthesizedContexualTyping2.ts, 6, 24)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 6, 21)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 6, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 6, 17)) + +function fun(f: FuncType, x: T): T; +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 8, 13)) +>f : Symbol(f, Decl(parenthesizedContexualTyping2.ts, 8, 16)) +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 8, 28)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 8, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 8, 13)) + +function fun(f: FuncType, g: FuncType, x: T): T; +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 9, 13)) +>f : Symbol(f, Decl(parenthesizedContexualTyping2.ts, 9, 16)) +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>g : Symbol(g, Decl(parenthesizedContexualTyping2.ts, 9, 28)) +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 9, 41)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 9, 13)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 9, 13)) + +function fun(...rest: any[]): T { +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 10, 13)) +>rest : Symbol(rest, Decl(parenthesizedContexualTyping2.ts, 10, 16)) +>T : Symbol(T, Decl(parenthesizedContexualTyping2.ts, 10, 13)) + + return undefined; +>undefined : Symbol(undefined) +} + +var a = fun(x => { x(undefined); return x; }, 10); +>a : Symbol(a, Decl(parenthesizedContexualTyping2.ts, 14, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 14, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 14, 12)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 14, 12)) + +var b = fun((x => { x(undefined); return x; }), 10); +>b : Symbol(b, Decl(parenthesizedContexualTyping2.ts, 15, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 15, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 15, 13)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 15, 13)) + +var c = fun(((x => { x(undefined); return x; })), 10); +>c : Symbol(c, Decl(parenthesizedContexualTyping2.ts, 16, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 16, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 16, 14)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 16, 14)) + +var d = fun((((x => { x(undefined); return x; }))), 10); +>d : Symbol(d, Decl(parenthesizedContexualTyping2.ts, 17, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 17, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 17, 15)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 17, 15)) + +var e = fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10); +>e : Symbol(e, Decl(parenthesizedContexualTyping2.ts, 19, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 12)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 12)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 53)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 53)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 19, 53)) + +var f = fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10); +>f : Symbol(f, Decl(parenthesizedContexualTyping2.ts, 20, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 13)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 13)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 56)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 56)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 20, 56)) + +var g = fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10); +>g : Symbol(g, Decl(parenthesizedContexualTyping2.ts, 21, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 14)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 14)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 59)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 59)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 21, 59)) + +var h = fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10); +>h : Symbol(h, Decl(parenthesizedContexualTyping2.ts, 22, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 15)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 15)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 61)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 61)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 22, 61)) + +// Ternaries in parens +var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10); +>i : Symbol(i, Decl(parenthesizedContexualTyping2.ts, 25, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 25, 34)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 25, 34)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 25, 34)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 25, 77)) +>undefined : Symbol(undefined) + +var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10); +>j : Symbol(j, Decl(parenthesizedContexualTyping2.ts, 26, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 26, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 26, 36)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 26, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 26, 81)) +>undefined : Symbol(undefined) + +var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); +>k : Symbol(k, Decl(parenthesizedContexualTyping2.ts, 27, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 36)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 36)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 81)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 98)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 98)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 27, 98)) + +var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); +>l : Symbol(l, Decl(parenthesizedContexualTyping2.ts, 28, 3)) +>fun : Symbol(fun, Decl(parenthesizedContexualTyping2.ts, 6, 48), Decl(parenthesizedContexualTyping2.ts, 8, 38), Decl(parenthesizedContexualTyping2.ts, 9, 51)) +>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11)) +>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 38)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 38)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 85)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 106)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 106)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 28, 106)) + +var lambda1: FuncType = x => { x(undefined); return x; }; +>lambda1 : Symbol(lambda1, Decl(parenthesizedContexualTyping2.ts, 30, 3)) +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 30, 23)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 30, 23)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 30, 23)) + +var lambda2: FuncType = (x => { x(undefined); return x; }); +>lambda2 : Symbol(lambda2, Decl(parenthesizedContexualTyping2.ts, 31, 3)) +>FuncType : Symbol(FuncType, Decl(parenthesizedContexualTyping2.ts, 0, 0)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 31, 25)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 31, 25)) +>undefined : Symbol(undefined) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 31, 25)) + +type ObjType = { x: (p: number) => string; y: (p: string) => number }; +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping2.ts, 31, 67)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 33, 16)) +>p : Symbol(p, Decl(parenthesizedContexualTyping2.ts, 33, 21)) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 33, 42)) +>p : Symbol(p, Decl(parenthesizedContexualTyping2.ts, 33, 47)) + +var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; +>obj1 : Symbol(obj1, Decl(parenthesizedContexualTyping2.ts, 34, 3)) +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping2.ts, 31, 67)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 34, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 34, 24)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 34, 24)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 34, 45)) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 34, 48)) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 34, 48)) +>undefined : Symbol(undefined) + +var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); +>obj2 : Symbol(obj2, Decl(parenthesizedContexualTyping2.ts, 35, 3)) +>ObjType : Symbol(ObjType, Decl(parenthesizedContexualTyping2.ts, 31, 67)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 35, 22)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 35, 25)) +>x : Symbol(x, Decl(parenthesizedContexualTyping2.ts, 35, 25)) +>undefined : Symbol(undefined) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 35, 46)) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 35, 49)) +>y : Symbol(y, Decl(parenthesizedContexualTyping2.ts, 35, 49)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.types b/tests/baselines/reference/parenthesizedContexualTyping2.types index 6824cc0f6e9..a055f2f1bbd 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping2.types +++ b/tests/baselines/reference/parenthesizedContexualTyping2.types @@ -54,6 +54,7 @@ var a = fun(x => { x(undefined); return x; }, 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var b = fun((x => { x(undefined); return x; }), 10); >b : number @@ -66,6 +67,7 @@ var b = fun((x => { x(undefined); return x; }), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var c = fun(((x => { x(undefined); return x; })), 10); >c : number @@ -79,6 +81,7 @@ var c = fun(((x => { x(undefined); return x; })), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var d = fun((((x => { x(undefined); return x; }))), 10); >d : number @@ -93,6 +96,7 @@ var d = fun((((x => { x(undefined); return x; }))), 10); >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var e = fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10); >e : number @@ -110,6 +114,7 @@ var e = fun(x => { x(undefined); return x; }, x => { x(undefined >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var f = fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10); >f : number @@ -129,6 +134,7 @@ var f = fun((x => { x(undefined); return x; }),(x => { x(undefin >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var g = fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10); >g : number @@ -150,6 +156,7 @@ var g = fun(((x => { x(undefined); return x; })),((x => { x(unde >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var h = fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10); >h : number @@ -172,6 +179,7 @@ var h = fun((((x => { x(undefined); return x; }))),((x => { x(un >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number // Ternaries in parens var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10); @@ -185,6 +193,7 @@ var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >x(undefined) : number @@ -194,6 +203,7 @@ var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x >x => undefined : (x: (p: T) => T) => any >x : (p: T) => T >undefined : undefined +>10 : number var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10); >j : number @@ -206,6 +216,7 @@ var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -217,6 +228,7 @@ var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >x => undefined : (x: (p: T) => T) => any >x : (p: T) => T >undefined : undefined +>10 : number var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); >k : number @@ -229,6 +241,7 @@ var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T @@ -246,6 +259,7 @@ var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); >l : number @@ -259,6 +273,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) >Math.random : () => number >Math : Math >random : () => number +>0.5 : number >((x => { x(undefined); return x; })) : (x: (p: T) => T) => (p: T) => T >(x => { x(undefined); return x; }) : (x: (p: T) => T) => (p: T) => T >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T @@ -280,6 +295,7 @@ var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) >x : (p: T) => T >undefined : undefined >x : (p: T) => T +>10 : number var lambda1: FuncType = x => { x(undefined); return x; }; >lambda1 : (x: (p: T) => T) => (p: T) => T diff --git a/tests/baselines/reference/parenthesizedContexualTyping3.symbols b/tests/baselines/reference/parenthesizedContexualTyping3.symbols new file mode 100644 index 00000000000..b0d696e2d21 --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping3.symbols @@ -0,0 +1,114 @@ +=== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping3.ts === + +// Contextual typing for parenthesized substitution expressions in tagged templates. + +/** + * tempFun - Can't have fun for too long. + */ +function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) +>tempStrs : Symbol(tempStrs, Decl(parenthesizedContexualTyping3.ts, 6, 20)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, 518, 38)) +>g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 6, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 6, 56)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 6, 67)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) + +function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>tempStrs : Symbol(tempStrs, Decl(parenthesizedContexualTyping3.ts, 7, 20)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, 518, 38)) +>g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 7, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 7, 56)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>h : Symbol(h, Decl(parenthesizedContexualTyping3.ts, 7, 67)) +>y : Symbol(y, Decl(parenthesizedContexualTyping3.ts, 7, 72)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 7, 83)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) + +function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T { +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 8, 17)) +>tempStrs : Symbol(tempStrs, Decl(parenthesizedContexualTyping3.ts, 8, 20)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, 518, 38)) +>g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 8, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 8, 56)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 8, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 8, 17)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 8, 67)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 8, 17)) +>T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 8, 17)) + + return g(x); +>g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 8, 51)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 8, 67)) +} + +var a = tempFun `${ x => x } ${ 10 }` +>a : Symbol(a, Decl(parenthesizedContexualTyping3.ts, 12, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 12, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 12, 19)) + +var b = tempFun `${ (x => x) } ${ 10 }` +>b : Symbol(b, Decl(parenthesizedContexualTyping3.ts, 13, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 13, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 13, 21)) + +var c = tempFun `${ ((x => x)) } ${ 10 }` +>c : Symbol(c, Decl(parenthesizedContexualTyping3.ts, 14, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 14, 22)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 14, 22)) + +var d = tempFun `${ x => x } ${ x => x } ${ 10 }` +>d : Symbol(d, Decl(parenthesizedContexualTyping3.ts, 15, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 15, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 15, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 15, 31)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 15, 31)) + +var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` +>e : Symbol(e, Decl(parenthesizedContexualTyping3.ts, 16, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 16, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 16, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 16, 33)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 16, 33)) + +var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` +>f : Symbol(f, Decl(parenthesizedContexualTyping3.ts, 17, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 17, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 17, 19)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 17, 34)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 17, 34)) + +var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` +>g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 18, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 18, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 18, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 18, 37)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 18, 37)) + +var h = tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }` +>h : Symbol(h, Decl(parenthesizedContexualTyping3.ts, 19, 3)) +>tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 6, 77), Decl(parenthesizedContexualTyping3.ts, 7, 93)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 19, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 19, 21)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 19, 37)) +>x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 19, 37)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/parenthesizedContexualTyping3.types b/tests/baselines/reference/parenthesizedContexualTyping3.types index 26c0207e523..5d424e5a7b0 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping3.types +++ b/tests/baselines/reference/parenthesizedContexualTyping3.types @@ -56,41 +56,55 @@ function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T { var a = tempFun `${ x => x } ${ 10 }` >a : number +>tempFun `${ x => x } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ x => x } ${ 10 }` : string >x => x : (x: number) => number >x : number >x : number +>10 : number var b = tempFun `${ (x => x) } ${ 10 }` >b : number +>tempFun `${ (x => x) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ (x => x) } ${ 10 }` : string >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number >x : number +>10 : number var c = tempFun `${ ((x => x)) } ${ 10 }` >c : number +>tempFun `${ ((x => x)) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ ((x => x)) } ${ 10 }` : string >((x => x)) : (x: number) => number >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number >x : number +>10 : number var d = tempFun `${ x => x } ${ x => x } ${ 10 }` >d : number +>tempFun `${ x => x } ${ x => x } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ x => x } ${ x => x } ${ 10 }` : string >x => x : (x: number) => number >x : number >x : number >x => x : (x: number) => number >x : number >x : number +>10 : number var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` >e : number +>tempFun `${ x => x } ${ (x => x) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ x => x } ${ (x => x) } ${ 10 }` : string >x => x : (x: number) => number >x : number >x : number @@ -98,10 +112,13 @@ var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number +>10 : number var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` >f : number +>tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ x => x } ${ ((x => x)) } ${ 10 }` : string >x => x : (x: number) => number >x : number >x : number @@ -110,10 +127,13 @@ var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number +>10 : number var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` >g : number +>tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ (x => x) } ${ (((x => x))) } ${ 10 }` : string >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -124,10 +144,13 @@ var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` >x => x : (x: number) => number >x : number >x : number +>10 : number var h = tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }` >h : any +>tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }` : any >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } +>`${ (x => x) } ${ (((x => x))) } ${ undefined }` : string >(x => x) : (x: any) => any >x => x : (x: any) => any >x : any diff --git a/tests/baselines/reference/parenthesizedTypes.symbols b/tests/baselines/reference/parenthesizedTypes.symbols new file mode 100644 index 00000000000..ec0ec4e4c6f --- /dev/null +++ b/tests/baselines/reference/parenthesizedTypes.symbols @@ -0,0 +1,84 @@ +=== tests/cases/conformance/types/specifyingTypes/typeLiterals/parenthesizedTypes.ts === +var a: string; +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var a: (string); +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var a: ((string) | string | (((string)))); +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var a: ((((((((((((((((((((((((((((((((((((((((string)))))))))))))))))))))))))))))))))))))))); +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var b: (x: string) => string; +>b : Symbol(b, Decl(parenthesizedTypes.ts, 5, 3), Decl(parenthesizedTypes.ts, 6, 3)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 5, 8)) + +var b: ((x: (string)) => (string)); +>b : Symbol(b, Decl(parenthesizedTypes.ts, 5, 3), Decl(parenthesizedTypes.ts, 6, 3)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 6, 9)) + +var c: string[] | number[]; +>c : Symbol(c, Decl(parenthesizedTypes.ts, 8, 3), Decl(parenthesizedTypes.ts, 9, 3), Decl(parenthesizedTypes.ts, 10, 3)) + +var c: (string)[] | (number)[]; +>c : Symbol(c, Decl(parenthesizedTypes.ts, 8, 3), Decl(parenthesizedTypes.ts, 9, 3), Decl(parenthesizedTypes.ts, 10, 3)) + +var c: ((string)[]) | ((number)[]); +>c : Symbol(c, Decl(parenthesizedTypes.ts, 8, 3), Decl(parenthesizedTypes.ts, 9, 3), Decl(parenthesizedTypes.ts, 10, 3)) + +var d: (((x: string) => string) | ((x: number) => number))[]; +>d : Symbol(d, Decl(parenthesizedTypes.ts, 12, 3), Decl(parenthesizedTypes.ts, 13, 3), Decl(parenthesizedTypes.ts, 14, 3), Decl(parenthesizedTypes.ts, 15, 3), Decl(parenthesizedTypes.ts, 16, 3)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 12, 10)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 12, 36)) + +var d: ({ (x: string): string } | { (x: number): number })[]; +>d : Symbol(d, Decl(parenthesizedTypes.ts, 12, 3), Decl(parenthesizedTypes.ts, 13, 3), Decl(parenthesizedTypes.ts, 14, 3), Decl(parenthesizedTypes.ts, 15, 3), Decl(parenthesizedTypes.ts, 16, 3)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 13, 11)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 13, 37)) + +var d: Array<((x: string) => string) | ((x: number) => number)>; +>d : Symbol(d, Decl(parenthesizedTypes.ts, 12, 3), Decl(parenthesizedTypes.ts, 13, 3), Decl(parenthesizedTypes.ts, 14, 3), Decl(parenthesizedTypes.ts, 15, 3), Decl(parenthesizedTypes.ts, 16, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 14, 15)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 14, 41)) + +var d: Array<{ (x: string): string } | { (x: number): number }>; +>d : Symbol(d, Decl(parenthesizedTypes.ts, 12, 3), Decl(parenthesizedTypes.ts, 13, 3), Decl(parenthesizedTypes.ts, 14, 3), Decl(parenthesizedTypes.ts, 15, 3), Decl(parenthesizedTypes.ts, 16, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 15, 16)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 15, 42)) + +var d: (Array<{ (x: string): string } | { (x: number): number }>); +>d : Symbol(d, Decl(parenthesizedTypes.ts, 12, 3), Decl(parenthesizedTypes.ts, 13, 3), Decl(parenthesizedTypes.ts, 14, 3), Decl(parenthesizedTypes.ts, 15, 3), Decl(parenthesizedTypes.ts, 16, 3)) +>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 16, 17)) +>x : Symbol(x, Decl(parenthesizedTypes.ts, 16, 43)) + +var e: typeof a[]; +>e : Symbol(e, Decl(parenthesizedTypes.ts, 18, 3), Decl(parenthesizedTypes.ts, 19, 3)) +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var e: (typeof a)[]; +>e : Symbol(e, Decl(parenthesizedTypes.ts, 18, 3), Decl(parenthesizedTypes.ts, 19, 3)) +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + +var f: (string) => string; +>f : Symbol(f, Decl(parenthesizedTypes.ts, 21, 3), Decl(parenthesizedTypes.ts, 22, 3)) +>string : Symbol(string, Decl(parenthesizedTypes.ts, 21, 8)) + +var f: (string: any) => string; +>f : Symbol(f, Decl(parenthesizedTypes.ts, 21, 3), Decl(parenthesizedTypes.ts, 22, 3)) +>string : Symbol(string, Decl(parenthesizedTypes.ts, 22, 8)) + +var g: [string, string]; +>g : Symbol(g, Decl(parenthesizedTypes.ts, 24, 3), Decl(parenthesizedTypes.ts, 25, 3), Decl(parenthesizedTypes.ts, 26, 3)) + +var g: [(string), string]; +>g : Symbol(g, Decl(parenthesizedTypes.ts, 24, 3), Decl(parenthesizedTypes.ts, 25, 3), Decl(parenthesizedTypes.ts, 26, 3)) + +var g: [(string), (((typeof a)))]; +>g : Symbol(g, Decl(parenthesizedTypes.ts, 24, 3), Decl(parenthesizedTypes.ts, 25, 3), Decl(parenthesizedTypes.ts, 26, 3)) +>a : Symbol(a, Decl(parenthesizedTypes.ts, 0, 3), Decl(parenthesizedTypes.ts, 1, 3), Decl(parenthesizedTypes.ts, 2, 3), Decl(parenthesizedTypes.ts, 3, 3)) + diff --git a/tests/baselines/reference/parseShortform.symbols b/tests/baselines/reference/parseShortform.symbols new file mode 100644 index 00000000000..31310e7bbb7 --- /dev/null +++ b/tests/baselines/reference/parseShortform.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/parseShortform.ts === +interface I { +>I : Symbol(I, Decl(parseShortform.ts, 0, 0)) + + w: { +>w : Symbol(w, Decl(parseShortform.ts, 0, 13)) + + z: I; +>z : Symbol(z, Decl(parseShortform.ts, 1, 8)) +>I : Symbol(I, Decl(parseShortform.ts, 0, 0)) + + (): boolean; + [s: string]: { x: any; y: any; }; +>s : Symbol(s, Decl(parseShortform.ts, 4, 9)) +>x : Symbol(x, Decl(parseShortform.ts, 4, 22)) +>y : Symbol(y, Decl(parseShortform.ts, 4, 30)) + + [n: number]: { x: any; y: any; }; +>n : Symbol(n, Decl(parseShortform.ts, 5, 9)) +>x : Symbol(x, Decl(parseShortform.ts, 5, 22)) +>y : Symbol(y, Decl(parseShortform.ts, 5, 30)) + + }; + x: boolean; +>x : Symbol(x, Decl(parseShortform.ts, 6, 6)) + + y: (s: string) => boolean; +>y : Symbol(y, Decl(parseShortform.ts, 7, 15)) +>s : Symbol(s, Decl(parseShortform.ts, 8, 8)) + + z: I; +>z : Symbol(z, Decl(parseShortform.ts, 8, 30)) +>I : Symbol(I, Decl(parseShortform.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parser509677.symbols b/tests/baselines/reference/parser509677.symbols new file mode 100644 index 00000000000..6d5f81e5c42 --- /dev/null +++ b/tests/baselines/reference/parser509677.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509677.ts === +var n: { y: string }; +>n : Symbol(n, Decl(parser509677.ts, 0, 3)) +>y : Symbol(y, Decl(parser509677.ts, 0, 8)) + diff --git a/tests/baselines/reference/parser537152.symbols b/tests/baselines/reference/parser537152.symbols new file mode 100644 index 00000000000..5aaaadc652a --- /dev/null +++ b/tests/baselines/reference/parser537152.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser537152.ts === +var t; +>t : Symbol(t, Decl(parser537152.ts, 0, 3)) + +var y = t.e1; +>y : Symbol(y, Decl(parser537152.ts, 1, 3)) +>t : Symbol(t, Decl(parser537152.ts, 0, 3)) + diff --git a/tests/baselines/reference/parser579071.symbols b/tests/baselines/reference/parser579071.symbols new file mode 100644 index 00000000000..5c14f161641 --- /dev/null +++ b/tests/baselines/reference/parser579071.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser579071.ts === +var x = /fo(o/; +>x : Symbol(x, Decl(parser579071.ts, 0, 3)) + diff --git a/tests/baselines/reference/parser579071.types b/tests/baselines/reference/parser579071.types index 6ae9576c036..bfdece6f787 100644 --- a/tests/baselines/reference/parser579071.types +++ b/tests/baselines/reference/parser579071.types @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser579071.ts === var x = /fo(o/; >x : RegExp +>/fo(o/ : RegExp diff --git a/tests/baselines/reference/parser596700.symbols b/tests/baselines/reference/parser596700.symbols new file mode 100644 index 00000000000..3109d5e4bed --- /dev/null +++ b/tests/baselines/reference/parser596700.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser596700.ts === +var regex2 = /[a-z/]$/i; +>regex2 : Symbol(regex2, Decl(parser596700.ts, 0, 3)) + diff --git a/tests/baselines/reference/parser596700.types b/tests/baselines/reference/parser596700.types index d92d4b68ef5..b14e28be716 100644 --- a/tests/baselines/reference/parser596700.types +++ b/tests/baselines/reference/parser596700.types @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser596700.ts === var regex2 = /[a-z/]$/i; >regex2 : RegExp +>/[a-z/]$/i : RegExp diff --git a/tests/baselines/reference/parser630933.symbols b/tests/baselines/reference/parser630933.symbols new file mode 100644 index 00000000000..70a069c3581 --- /dev/null +++ b/tests/baselines/reference/parser630933.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser630933.ts === +var a = "Hello"; +>a : Symbol(a, Decl(parser630933.ts, 0, 3)) + +var b = a.match(/\/ver=([^/]+)/); +>b : Symbol(b, Decl(parser630933.ts, 1, 3)) +>a.match : Symbol(String.match, Decl(lib.d.ts, 317, 40), Decl(lib.d.ts, 323, 44)) +>a : Symbol(a, Decl(parser630933.ts, 0, 3)) +>match : Symbol(String.match, Decl(lib.d.ts, 317, 40), Decl(lib.d.ts, 323, 44)) + diff --git a/tests/baselines/reference/parser630933.types b/tests/baselines/reference/parser630933.types index 4b1686fcbf2..3f991f58d30 100644 --- a/tests/baselines/reference/parser630933.types +++ b/tests/baselines/reference/parser630933.types @@ -1,6 +1,7 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser630933.ts === var a = "Hello"; >a : string +>"Hello" : string var b = a.match(/\/ver=([^/]+)/); >b : RegExpMatchArray @@ -8,4 +9,5 @@ var b = a.match(/\/ver=([^/]+)/); >a.match : { (regexp: string): RegExpMatchArray; (regexp: RegExp): RegExpMatchArray; } >a : string >match : { (regexp: string): RegExpMatchArray; (regexp: RegExp): RegExpMatchArray; } +>/\/ver=([^/]+)/ : RegExp diff --git a/tests/baselines/reference/parser643728.symbols b/tests/baselines/reference/parser643728.symbols new file mode 100644 index 00000000000..705e4b1ba9d --- /dev/null +++ b/tests/baselines/reference/parser643728.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser643728.ts === +interface C { +>C : Symbol(C, Decl(parser643728.ts, 0, 0)) + + foo; +>foo : Symbol(foo, Decl(parser643728.ts, 0, 13)) + + new; +>new : Symbol(new, Decl(parser643728.ts, 1, 8)) +} + diff --git a/tests/baselines/reference/parser645086_3.symbols b/tests/baselines/reference/parser645086_3.symbols new file mode 100644 index 00000000000..dfde84a9714 --- /dev/null +++ b/tests/baselines/reference/parser645086_3.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_3.ts === +var v = /[\]/]/ +>v : Symbol(v, Decl(parser645086_3.ts, 0, 3)) + diff --git a/tests/baselines/reference/parser645086_3.types b/tests/baselines/reference/parser645086_3.types index 57ca07e1b2a..8cf6c0e73a5 100644 --- a/tests/baselines/reference/parser645086_3.types +++ b/tests/baselines/reference/parser645086_3.types @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_3.ts === var v = /[\]/]/ >v : RegExp +>/[\]/]/ : RegExp diff --git a/tests/baselines/reference/parser645086_4.symbols b/tests/baselines/reference/parser645086_4.symbols new file mode 100644 index 00000000000..3df8459dc38 --- /dev/null +++ b/tests/baselines/reference/parser645086_4.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_4.ts === +var v = /[^\]/]/ +>v : Symbol(v, Decl(parser645086_4.ts, 0, 3)) + diff --git a/tests/baselines/reference/parser645086_4.types b/tests/baselines/reference/parser645086_4.types index 01a702e2a06..a7c00b04fce 100644 --- a/tests/baselines/reference/parser645086_4.types +++ b/tests/baselines/reference/parser645086_4.types @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_4.ts === var v = /[^\]/]/ >v : RegExp +>/[^\]/]/ : RegExp diff --git a/tests/baselines/reference/parser645484.symbols b/tests/baselines/reference/parser645484.symbols new file mode 100644 index 00000000000..6c8b71d547e --- /dev/null +++ b/tests/baselines/reference/parser645484.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645484.ts === +var c : { +>c : Symbol(c, Decl(parser645484.ts, 0, 3)) + + new?(): any; +>new : Symbol(new, Decl(parser645484.ts, 0, 9)) +} diff --git a/tests/baselines/reference/parser768531.symbols b/tests/baselines/reference/parser768531.symbols new file mode 100644 index 00000000000..2da2298c8e2 --- /dev/null +++ b/tests/baselines/reference/parser768531.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts === +{a: 3} +No type information for this code./x/ +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parser768531.types b/tests/baselines/reference/parser768531.types index 2da2298c8e2..f1bcedefae9 100644 --- a/tests/baselines/reference/parser768531.types +++ b/tests/baselines/reference/parser768531.types @@ -1,4 +1,8 @@ === tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts === {a: 3} -No type information for this code./x/ -No type information for this code. \ No newline at end of file +>a : any +>3 : number + +/x/ +>/x/ : RegExp + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic11.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic11.symbols new file mode 100644 index 00000000000..602c5a01f37 --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic11.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic11.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic11.ts, 0, 0)) +{ +static public() {} +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic11.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic14.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic14.symbols new file mode 100644 index 00000000000..4a20a527ef1 --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic14.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic14.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic14.ts, 0, 0)) +{ +static public() {} +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic14.ts, 1, 1)) +>T : Symbol(T, Decl(parserAccessibilityAfterStatic14.ts, 2, 14)) +} + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic2.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic2.symbols new file mode 100644 index 00000000000..9611c7b4955 --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic2.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic2.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic2.ts, 0, 0)) +{ +static public; +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic2.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic3.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic3.symbols new file mode 100644 index 00000000000..9c2027b065f --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic3.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic3.ts, 0, 0)) +{ +static public = 1; +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic3.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic3.types b/tests/baselines/reference/parserAccessibilityAfterStatic3.types index b8eeb416c92..c85c5077392 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic3.types +++ b/tests/baselines/reference/parserAccessibilityAfterStatic3.types @@ -4,5 +4,6 @@ class Outer { static public = 1; >public : number +>1 : number } diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic4.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic4.symbols new file mode 100644 index 00000000000..fe872ea3fe3 --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic4.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic4.ts, 0, 0)) +{ +static public: number; +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic4.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic5.symbols b/tests/baselines/reference/parserAccessibilityAfterStatic5.symbols new file mode 100644 index 00000000000..d1d0fd0da9a --- /dev/null +++ b/tests/baselines/reference/parserAccessibilityAfterStatic5.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/AccessibilityAfterStatic/parserAccessibilityAfterStatic5.ts === +class Outer +>Outer : Symbol(Outer, Decl(parserAccessibilityAfterStatic5.ts, 0, 0)) +{ +static public +>public : Symbol(Outer.public, Decl(parserAccessibilityAfterStatic5.ts, 1, 1)) +} + diff --git a/tests/baselines/reference/parserAccessors2.symbols b/tests/baselines/reference/parserAccessors2.symbols new file mode 100644 index 00000000000..d4371695610 --- /dev/null +++ b/tests/baselines/reference/parserAccessors2.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors2.ts === +class C { +>C : Symbol(C, Decl(parserAccessors2.ts, 0, 0)) + + set Foo(a) { } +>Foo : Symbol(Foo, Decl(parserAccessors2.ts, 0, 9)) +>a : Symbol(a, Decl(parserAccessors2.ts, 1, 12)) +} diff --git a/tests/baselines/reference/parserAccessors4.symbols b/tests/baselines/reference/parserAccessors4.symbols new file mode 100644 index 00000000000..e5dc9f1ecc3 --- /dev/null +++ b/tests/baselines/reference/parserAccessors4.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors4.ts === +var v = { set Foo(a) { } }; +>v : Symbol(v, Decl(parserAccessors4.ts, 0, 3)) +>Foo : Symbol(Foo, Decl(parserAccessors4.ts, 0, 9)) +>a : Symbol(a, Decl(parserAccessors4.ts, 0, 18)) + diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.symbols b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.symbols new file mode 100644 index 00000000000..d5e039e3308 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator1.ts === +function f1() { +>f1 : Symbol(f1, Decl(parserAmbiguityWithBinaryOperator1.ts, 0, 0)) + + var a, b, c; +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 13)) + + if (a < b || b > (c + 1)) { } +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 10)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator1.ts, 1, 13)) +} diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types index 1a087485e26..bdeb5ab7bbc 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator1.types @@ -17,4 +17,5 @@ function f1() { >(c + 1) : any >c + 1 : any >c : any +>1 : number } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.symbols b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.symbols new file mode 100644 index 00000000000..4f5c7030dd3 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator2.ts === +function f() { +>f : Symbol(f, Decl(parserAmbiguityWithBinaryOperator2.ts, 0, 0)) + + var a, b, c; +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 13)) + + if (a < b && b > (c + 1)) { } +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 10)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator2.ts, 1, 13)) +} diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types index 05ac7172cff..79eb212163e 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator2.types @@ -17,4 +17,5 @@ function f() { >(c + 1) : any >c + 1 : any >c : any +>1 : number } diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.symbols b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.symbols new file mode 100644 index 00000000000..0304a217b70 --- /dev/null +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserAmbiguityWithBinaryOperator3.ts === +function f() { +>f : Symbol(f, Decl(parserAmbiguityWithBinaryOperator3.ts, 0, 0)) + + var a, b, c; +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 13)) + + if (a < b && b < (c + 1)) { } +>a : Symbol(a, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 7)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 10)) +>b : Symbol(b, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 10)) +>c : Symbol(c, Decl(parserAmbiguityWithBinaryOperator3.ts, 1, 13)) +} + diff --git a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types index 03283115bf9..aba5f4872d8 100644 --- a/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types +++ b/tests/baselines/reference/parserAmbiguityWithBinaryOperator3.types @@ -17,5 +17,6 @@ function f() { >(c + 1) : any >c + 1 : any >c : any +>1 : number } diff --git a/tests/baselines/reference/parserArrayLiteralExpression1.symbols b/tests/baselines/reference/parserArrayLiteralExpression1.symbols new file mode 100644 index 00000000000..f34a932be80 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression1.ts === +var v = []; +>v : Symbol(v, Decl(parserArrayLiteralExpression1.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression10.symbols b/tests/baselines/reference/parserArrayLiteralExpression10.symbols new file mode 100644 index 00000000000..1e29ca350fc --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression10.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression10.ts === +var v = [1,1,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression10.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression10.types b/tests/baselines/reference/parserArrayLiteralExpression10.types index d324d42aa46..370e9fb6c9d 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression10.types +++ b/tests/baselines/reference/parserArrayLiteralExpression10.types @@ -2,4 +2,6 @@ var v = [1,1,]; >v : number[] >[1,1,] : number[] +>1 : number +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression11.symbols b/tests/baselines/reference/parserArrayLiteralExpression11.symbols new file mode 100644 index 00000000000..eaa65c96295 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression11.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression11.ts === +var v = [1,,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression11.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression11.types b/tests/baselines/reference/parserArrayLiteralExpression11.types index 44ac1f6c5aa..aba6e30a291 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression11.types +++ b/tests/baselines/reference/parserArrayLiteralExpression11.types @@ -2,4 +2,7 @@ var v = [1,,1]; >v : number[] >[1,,1] : number[] +>1 : number +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression12.symbols b/tests/baselines/reference/parserArrayLiteralExpression12.symbols new file mode 100644 index 00000000000..76521e7d99e --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression12.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression12.ts === +var v = [1,,,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression12.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression12.types b/tests/baselines/reference/parserArrayLiteralExpression12.types index a2ea5f12404..7d9e4c38976 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression12.types +++ b/tests/baselines/reference/parserArrayLiteralExpression12.types @@ -2,4 +2,8 @@ var v = [1,,,1]; >v : number[] >[1,,,1] : number[] +>1 : number +> : undefined +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression13.symbols b/tests/baselines/reference/parserArrayLiteralExpression13.symbols new file mode 100644 index 00000000000..4adf81f0681 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression13.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression13.ts === +var v = [1,,1,,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression13.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression13.types b/tests/baselines/reference/parserArrayLiteralExpression13.types index bf8c15ac6b2..62fb9aea5f7 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression13.types +++ b/tests/baselines/reference/parserArrayLiteralExpression13.types @@ -2,4 +2,9 @@ var v = [1,,1,,1]; >v : number[] >[1,,1,,1] : number[] +>1 : number +> : undefined +>1 : number +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression14.symbols b/tests/baselines/reference/parserArrayLiteralExpression14.symbols new file mode 100644 index 00000000000..bf9a4216139 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression14.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression14.ts === +var v = [,,1,1,,1,,1,1,,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression14.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression14.types b/tests/baselines/reference/parserArrayLiteralExpression14.types index 4de3139c4b8..9d3a029aed2 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression14.types +++ b/tests/baselines/reference/parserArrayLiteralExpression14.types @@ -2,4 +2,15 @@ var v = [,,1,1,,1,,1,1,,1]; >v : number[] >[,,1,1,,1,,1,1,,1] : number[] +> : undefined +> : undefined +>1 : number +>1 : number +> : undefined +>1 : number +> : undefined +>1 : number +>1 : number +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression15.symbols b/tests/baselines/reference/parserArrayLiteralExpression15.symbols new file mode 100644 index 00000000000..db99c902e06 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression15.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression15.ts === +var v = [,,1,1,,1,,1,1,,1,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression15.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression15.types b/tests/baselines/reference/parserArrayLiteralExpression15.types index b484c537f70..75afab3731c 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression15.types +++ b/tests/baselines/reference/parserArrayLiteralExpression15.types @@ -2,4 +2,15 @@ var v = [,,1,1,,1,,1,1,,1,]; >v : number[] >[,,1,1,,1,,1,1,,1,] : number[] +> : undefined +> : undefined +>1 : number +>1 : number +> : undefined +>1 : number +> : undefined +>1 : number +>1 : number +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression2.symbols b/tests/baselines/reference/parserArrayLiteralExpression2.symbols new file mode 100644 index 00000000000..bdd45124e64 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression2.ts === +var v = [,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression2.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression2.types b/tests/baselines/reference/parserArrayLiteralExpression2.types index dd16681ab82..b810175ea13 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression2.types +++ b/tests/baselines/reference/parserArrayLiteralExpression2.types @@ -2,4 +2,5 @@ var v = [,]; >v : any[] >[,] : undefined[] +> : undefined diff --git a/tests/baselines/reference/parserArrayLiteralExpression3.symbols b/tests/baselines/reference/parserArrayLiteralExpression3.symbols new file mode 100644 index 00000000000..57c39445168 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression3.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression3.ts === +var v = [,,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression3.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression3.types b/tests/baselines/reference/parserArrayLiteralExpression3.types index d0fbaa9b67b..68e05498e13 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression3.types +++ b/tests/baselines/reference/parserArrayLiteralExpression3.types @@ -2,4 +2,6 @@ var v = [,,]; >v : any[] >[,,] : undefined[] +> : undefined +> : undefined diff --git a/tests/baselines/reference/parserArrayLiteralExpression4.symbols b/tests/baselines/reference/parserArrayLiteralExpression4.symbols new file mode 100644 index 00000000000..501ca155892 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression4.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression4.ts === +var v = [,,,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression4.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression4.types b/tests/baselines/reference/parserArrayLiteralExpression4.types index 0ceded3e62a..69f805ed5e2 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression4.types +++ b/tests/baselines/reference/parserArrayLiteralExpression4.types @@ -2,4 +2,7 @@ var v = [,,,]; >v : any[] >[,,,] : undefined[] +> : undefined +> : undefined +> : undefined diff --git a/tests/baselines/reference/parserArrayLiteralExpression5.symbols b/tests/baselines/reference/parserArrayLiteralExpression5.symbols new file mode 100644 index 00000000000..e01df8123ea --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression5.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression5.ts === +var v = [1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression5.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression5.types b/tests/baselines/reference/parserArrayLiteralExpression5.types index b729f7fed86..48fdaa024fc 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression5.types +++ b/tests/baselines/reference/parserArrayLiteralExpression5.types @@ -2,4 +2,5 @@ var v = [1]; >v : number[] >[1] : number[] +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression6.symbols b/tests/baselines/reference/parserArrayLiteralExpression6.symbols new file mode 100644 index 00000000000..07ab9430d94 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression6.ts === +var v = [,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression6.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression6.types b/tests/baselines/reference/parserArrayLiteralExpression6.types index a72a8eda339..66df1cda219 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression6.types +++ b/tests/baselines/reference/parserArrayLiteralExpression6.types @@ -2,4 +2,6 @@ var v = [,1]; >v : number[] >[,1] : number[] +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression7.symbols b/tests/baselines/reference/parserArrayLiteralExpression7.symbols new file mode 100644 index 00000000000..e8baf75f1f9 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression7.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression7.ts === +var v = [1,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression7.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression7.types b/tests/baselines/reference/parserArrayLiteralExpression7.types index ca8c5d6e890..65225500eb2 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression7.types +++ b/tests/baselines/reference/parserArrayLiteralExpression7.types @@ -2,4 +2,5 @@ var v = [1,]; >v : number[] >[1,] : number[] +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression8.symbols b/tests/baselines/reference/parserArrayLiteralExpression8.symbols new file mode 100644 index 00000000000..a389e4381e7 --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression8.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression8.ts === +var v = [,1,]; +>v : Symbol(v, Decl(parserArrayLiteralExpression8.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression8.types b/tests/baselines/reference/parserArrayLiteralExpression8.types index 06824d77a1a..e14c99f3b57 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression8.types +++ b/tests/baselines/reference/parserArrayLiteralExpression8.types @@ -2,4 +2,6 @@ var v = [,1,]; >v : number[] >[,1,] : number[] +> : undefined +>1 : number diff --git a/tests/baselines/reference/parserArrayLiteralExpression9.symbols b/tests/baselines/reference/parserArrayLiteralExpression9.symbols new file mode 100644 index 00000000000..c5f4d38258a --- /dev/null +++ b/tests/baselines/reference/parserArrayLiteralExpression9.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrayLiteralExpressions/parserArrayLiteralExpression9.ts === +var v = [1,1]; +>v : Symbol(v, Decl(parserArrayLiteralExpression9.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserArrayLiteralExpression9.types b/tests/baselines/reference/parserArrayLiteralExpression9.types index 7107f9e4090..96bb1595326 100644 --- a/tests/baselines/reference/parserArrayLiteralExpression9.types +++ b/tests/baselines/reference/parserArrayLiteralExpression9.types @@ -2,4 +2,6 @@ var v = [1,1]; >v : number[] >[1,1] : number[] +>1 : number +>1 : number diff --git a/tests/baselines/reference/parserClassDeclaration16.symbols b/tests/baselines/reference/parserClassDeclaration16.symbols new file mode 100644 index 00000000000..770793b8ff9 --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration16.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration16.ts === +class C { +>C : Symbol(C, Decl(parserClassDeclaration16.ts, 0, 0)) + + foo(); +>foo : Symbol(foo, Decl(parserClassDeclaration16.ts, 0, 9), Decl(parserClassDeclaration16.ts, 1, 9)) + + foo() { } +>foo : Symbol(foo, Decl(parserClassDeclaration16.ts, 0, 9), Decl(parserClassDeclaration16.ts, 1, 9)) +} diff --git a/tests/baselines/reference/parserClassDeclaration17.symbols b/tests/baselines/reference/parserClassDeclaration17.symbols new file mode 100644 index 00000000000..7d230821d8a --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration17.symbols @@ -0,0 +1,17 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration17.ts === +declare class Enumerator { +>Enumerator : Symbol(Enumerator, Decl(parserClassDeclaration17.ts, 0, 0)) + + public atEnd(): boolean; +>atEnd : Symbol(atEnd, Decl(parserClassDeclaration17.ts, 0, 26)) + + public moveNext(); +>moveNext : Symbol(moveNext, Decl(parserClassDeclaration17.ts, 1, 28)) + + public item(): any; +>item : Symbol(item, Decl(parserClassDeclaration17.ts, 2, 22)) + + constructor (o: any); +>o : Symbol(o, Decl(parserClassDeclaration17.ts, 4, 17)) +} + diff --git a/tests/baselines/reference/parserClassDeclaration19.symbols b/tests/baselines/reference/parserClassDeclaration19.symbols new file mode 100644 index 00000000000..e9ac1a666c7 --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration19.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration19.ts === +class C { +>C : Symbol(C, Decl(parserClassDeclaration19.ts, 0, 0)) + + foo(); +>foo : Symbol(foo, Decl(parserClassDeclaration19.ts, 0, 9), Decl(parserClassDeclaration19.ts, 1, 10)) + + "foo"() { } +} diff --git a/tests/baselines/reference/parserClassDeclaration20.symbols b/tests/baselines/reference/parserClassDeclaration20.symbols new file mode 100644 index 00000000000..52e83a3f10c --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration20.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration20.ts === +class C { +>C : Symbol(C, Decl(parserClassDeclaration20.ts, 0, 0)) + + 0(); + "0"() { } +} diff --git a/tests/baselines/reference/parserClassDeclaration23.symbols b/tests/baselines/reference/parserClassDeclaration23.symbols new file mode 100644 index 00000000000..17611f0ba1d --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration23.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration23.ts === +class C\u0032 { +>C\u0032 : Symbol(C\u0032, Decl(parserClassDeclaration23.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parserClassDeclaration26.symbols b/tests/baselines/reference/parserClassDeclaration26.symbols new file mode 100644 index 00000000000..09b9cbfd3a4 --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration26.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration26.ts === +class C { +>C : Symbol(C, Decl(parserClassDeclaration26.ts, 0, 0)) + + var +>var : Symbol(var, Decl(parserClassDeclaration26.ts, 0, 9)) + + public +>public : Symbol(public, Decl(parserClassDeclaration26.ts, 1, 6)) +} diff --git a/tests/baselines/reference/parserClassDeclaration7.d.symbols b/tests/baselines/reference/parserClassDeclaration7.d.symbols new file mode 100644 index 00000000000..33661b00743 --- /dev/null +++ b/tests/baselines/reference/parserClassDeclaration7.d.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration7.d.ts === +declare class C { +>C : Symbol(C, Decl(parserClassDeclaration7.d.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parserClassDeclarationIndexSignature1.symbols b/tests/baselines/reference/parserClassDeclarationIndexSignature1.symbols new file mode 100644 index 00000000000..bfa75f56ab5 --- /dev/null +++ b/tests/baselines/reference/parserClassDeclarationIndexSignature1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclarationIndexSignature1.ts === +class C { +>C : Symbol(C, Decl(parserClassDeclarationIndexSignature1.ts, 0, 0)) + + [index:number]:number +>index : Symbol(index, Decl(parserClassDeclarationIndexSignature1.ts, 1, 5)) +} diff --git a/tests/baselines/reference/parserCommaInTypeMemberList1.symbols b/tests/baselines/reference/parserCommaInTypeMemberList1.symbols new file mode 100644 index 00000000000..cbfeb6630e8 --- /dev/null +++ b/tests/baselines/reference/parserCommaInTypeMemberList1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserCommaInTypeMemberList1.ts === +var v: { workItem: any, width: string }; +>v : Symbol(v, Decl(parserCommaInTypeMemberList1.ts, 0, 3)) +>workItem : Symbol(workItem, Decl(parserCommaInTypeMemberList1.ts, 0, 8)) +>width : Symbol(width, Decl(parserCommaInTypeMemberList1.ts, 0, 23)) + diff --git a/tests/baselines/reference/parserConstructorDeclaration1.symbols b/tests/baselines/reference/parserConstructorDeclaration1.symbols new file mode 100644 index 00000000000..de3fee278a9 --- /dev/null +++ b/tests/baselines/reference/parserConstructorDeclaration1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration1.ts === +class C { +>C : Symbol(C, Decl(parserConstructorDeclaration1.ts, 0, 0)) + + public constructor() { } +} diff --git a/tests/baselines/reference/parserDebuggerStatement1.symbols b/tests/baselines/reference/parserDebuggerStatement1.symbols new file mode 100644 index 00000000000..bfc1785f927 --- /dev/null +++ b/tests/baselines/reference/parserDebuggerStatement1.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/parserDebuggerStatement1.ts === +debugger +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserDebuggerStatement2.symbols b/tests/baselines/reference/parserDebuggerStatement2.symbols new file mode 100644 index 00000000000..9916218897c --- /dev/null +++ b/tests/baselines/reference/parserDebuggerStatement2.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/parserDebuggerStatement2.ts === +debugger; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserDoStatement2.symbols b/tests/baselines/reference/parserDoStatement2.symbols new file mode 100644 index 00000000000..62790b49103 --- /dev/null +++ b/tests/baselines/reference/parserDoStatement2.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserDoStatement2.ts === +do{;}while(false)false +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserDoStatement2.types b/tests/baselines/reference/parserDoStatement2.types index 62790b49103..5affaa958d6 100644 --- a/tests/baselines/reference/parserDoStatement2.types +++ b/tests/baselines/reference/parserDoStatement2.types @@ -1,3 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/Statements/parserDoStatement2.ts === do{;}while(false)false -No type information for this code. \ No newline at end of file +>false : boolean +>false : boolean + diff --git a/tests/baselines/reference/parserES5ForOfStatement17.symbols b/tests/baselines/reference/parserES5ForOfStatement17.symbols new file mode 100644 index 00000000000..bf38276ebd7 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement17.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement17.ts === +for (var of; ;) { } +>of : Symbol(of, Decl(parserES5ForOfStatement17.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserES5ForOfStatement18.symbols b/tests/baselines/reference/parserES5ForOfStatement18.symbols new file mode 100644 index 00000000000..830c1010a27 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement18.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement18.ts === +for (var of of of) { } +>of : Symbol(of, Decl(parserES5ForOfStatement18.ts, 0, 8)) +>of : Symbol(of, Decl(parserES5ForOfStatement18.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserES5ForOfStatement19.symbols b/tests/baselines/reference/parserES5ForOfStatement19.symbols new file mode 100644 index 00000000000..93ba77e3db9 --- /dev/null +++ b/tests/baselines/reference/parserES5ForOfStatement19.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/parserES5ForOfStatement19.ts === +for (var of in of) { } +>of : Symbol(of, Decl(parserES5ForOfStatement19.ts, 0, 8)) +>of : Symbol(of, Decl(parserES5ForOfStatement19.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserEmptyFile1.symbols b/tests/baselines/reference/parserEmptyFile1.symbols new file mode 100644 index 00000000000..d48ac0a4841 --- /dev/null +++ b/tests/baselines/reference/parserEmptyFile1.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/parserEmptyFile1.ts === + +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserEmptyStatement1.symbols b/tests/baselines/reference/parserEmptyStatement1.symbols new file mode 100644 index 00000000000..f9d6ed35645 --- /dev/null +++ b/tests/baselines/reference/parserEmptyStatement1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/parserEmptyStatement1.ts === +; ; +var a = 1; +>a : Symbol(a, Decl(parserEmptyStatement1.ts, 1, 3)) + +; + diff --git a/tests/baselines/reference/parserEmptyStatement1.types b/tests/baselines/reference/parserEmptyStatement1.types index 585c87f202b..a581dd6e871 100644 --- a/tests/baselines/reference/parserEmptyStatement1.types +++ b/tests/baselines/reference/parserEmptyStatement1.types @@ -2,6 +2,7 @@ ; ; var a = 1; >a : number +>1 : number ; diff --git a/tests/baselines/reference/parserEnum6.symbols b/tests/baselines/reference/parserEnum6.symbols new file mode 100644 index 00000000000..baee1886f24 --- /dev/null +++ b/tests/baselines/reference/parserEnum6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum6.ts === +enum E { +>E : Symbol(E, Decl(parserEnum6.ts, 0, 0)) + + "A", "B", "C" +} diff --git a/tests/baselines/reference/parserEnumDeclaration1.symbols b/tests/baselines/reference/parserEnumDeclaration1.symbols new file mode 100644 index 00000000000..e3041443712 --- /dev/null +++ b/tests/baselines/reference/parserEnumDeclaration1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnumDeclaration1.ts === +enum E { +>E : Symbol(E, Decl(parserEnumDeclaration1.ts, 0, 0)) + + Foo = 1, +>Foo : Symbol(E.Foo, Decl(parserEnumDeclaration1.ts, 0, 8)) + + Bar +>Bar : Symbol(E.Bar, Decl(parserEnumDeclaration1.ts, 1, 10)) +} diff --git a/tests/baselines/reference/parserEnumDeclaration1.types b/tests/baselines/reference/parserEnumDeclaration1.types index 86ac928d20f..de99855b310 100644 --- a/tests/baselines/reference/parserEnumDeclaration1.types +++ b/tests/baselines/reference/parserEnumDeclaration1.types @@ -4,6 +4,7 @@ enum E { Foo = 1, >Foo : E +>1 : number Bar >Bar : E diff --git a/tests/baselines/reference/parserEnumDeclaration2.d.symbols b/tests/baselines/reference/parserEnumDeclaration2.d.symbols new file mode 100644 index 00000000000..0b222a59c7a --- /dev/null +++ b/tests/baselines/reference/parserEnumDeclaration2.d.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnumDeclaration2.d.ts === +declare enum E { +>E : Symbol(E, Decl(parserEnumDeclaration2.d.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parserEnumDeclaration3.symbols b/tests/baselines/reference/parserEnumDeclaration3.symbols new file mode 100644 index 00000000000..f0380b45030 --- /dev/null +++ b/tests/baselines/reference/parserEnumDeclaration3.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnumDeclaration3.ts === +declare enum E { +>E : Symbol(E, Decl(parserEnumDeclaration3.ts, 0, 0)) + + A = 1 +>A : Symbol(E.A, Decl(parserEnumDeclaration3.ts, 0, 16)) +} diff --git a/tests/baselines/reference/parserEnumDeclaration3.types b/tests/baselines/reference/parserEnumDeclaration3.types index a2a5542c060..b427a795eb6 100644 --- a/tests/baselines/reference/parserEnumDeclaration3.types +++ b/tests/baselines/reference/parserEnumDeclaration3.types @@ -4,4 +4,5 @@ declare enum E { A = 1 >A : E +>1 : number } diff --git a/tests/baselines/reference/parserEnumDeclaration5.symbols b/tests/baselines/reference/parserEnumDeclaration5.symbols new file mode 100644 index 00000000000..584f21e5e72 --- /dev/null +++ b/tests/baselines/reference/parserEnumDeclaration5.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnumDeclaration5.ts === +enum E { +>E : Symbol(E, Decl(parserEnumDeclaration5.ts, 0, 0)) + + A = 1, +>A : Symbol(E.A, Decl(parserEnumDeclaration5.ts, 0, 8)) + + B, +>B : Symbol(E.B, Decl(parserEnumDeclaration5.ts, 1, 10)) + + C = 2, +>C : Symbol(E.C, Decl(parserEnumDeclaration5.ts, 2, 6)) + + D +>D : Symbol(E.D, Decl(parserEnumDeclaration5.ts, 3, 10)) +} diff --git a/tests/baselines/reference/parserEnumDeclaration5.types b/tests/baselines/reference/parserEnumDeclaration5.types index be3559bd2b9..bbb596b7b0f 100644 --- a/tests/baselines/reference/parserEnumDeclaration5.types +++ b/tests/baselines/reference/parserEnumDeclaration5.types @@ -4,12 +4,14 @@ enum E { A = 1, >A : E +>1 : number B, >B : E C = 2, >C : E +>2 : number D >D : E diff --git a/tests/baselines/reference/parserExportAsFunctionIdentifier.symbols b/tests/baselines/reference/parserExportAsFunctionIdentifier.symbols new file mode 100644 index 00000000000..6d81e8fdae3 --- /dev/null +++ b/tests/baselines/reference/parserExportAsFunctionIdentifier.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/parser/ecmascript5/parserExportAsFunctionIdentifier.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(parserExportAsFunctionIdentifier.ts, 0, 0)) + + export(): string; +>export : Symbol(export, Decl(parserExportAsFunctionIdentifier.ts, 0, 15)) +} + +var f: Foo; +>f : Symbol(f, Decl(parserExportAsFunctionIdentifier.ts, 4, 3)) +>Foo : Symbol(Foo, Decl(parserExportAsFunctionIdentifier.ts, 0, 0)) + +var x = f.export(); +>x : Symbol(x, Decl(parserExportAsFunctionIdentifier.ts, 5, 3)) +>f.export : Symbol(Foo.export, Decl(parserExportAsFunctionIdentifier.ts, 0, 15)) +>f : Symbol(f, Decl(parserExportAsFunctionIdentifier.ts, 4, 3)) +>export : Symbol(Foo.export, Decl(parserExportAsFunctionIdentifier.ts, 0, 15)) + diff --git a/tests/baselines/reference/parserForOfStatement17.symbols b/tests/baselines/reference/parserForOfStatement17.symbols new file mode 100644 index 00000000000..d78fe45e237 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement17.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement17.ts === +for (var of; ;) { } +>of : Symbol(of, Decl(parserForOfStatement17.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserForOfStatement18.symbols b/tests/baselines/reference/parserForOfStatement18.symbols new file mode 100644 index 00000000000..db661546219 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement18.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement18.ts === +for (var of of of) { } +>of : Symbol(of, Decl(parserForOfStatement18.ts, 0, 8)) +>of : Symbol(of, Decl(parserForOfStatement18.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserForOfStatement19.symbols b/tests/baselines/reference/parserForOfStatement19.symbols new file mode 100644 index 00000000000..1e123349e13 --- /dev/null +++ b/tests/baselines/reference/parserForOfStatement19.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript6/Iterators/parserForOfStatement19.ts === +for (var of in of) { } +>of : Symbol(of, Decl(parserForOfStatement19.ts, 0, 8)) +>of : Symbol(of, Decl(parserForOfStatement19.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserFunctionDeclaration1.d.symbols b/tests/baselines/reference/parserFunctionDeclaration1.d.symbols new file mode 100644 index 00000000000..eaaa03c6bc0 --- /dev/null +++ b/tests/baselines/reference/parserFunctionDeclaration1.d.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration1.d.ts === +declare function F(); +>F : Symbol(F, Decl(parserFunctionDeclaration1.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/parserFunctionDeclaration5.symbols b/tests/baselines/reference/parserFunctionDeclaration5.symbols new file mode 100644 index 00000000000..9606dc35897 --- /dev/null +++ b/tests/baselines/reference/parserFunctionDeclaration5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration5.ts === +function foo(); +>foo : Symbol(foo, Decl(parserFunctionDeclaration5.ts, 0, 0), Decl(parserFunctionDeclaration5.ts, 0, 15)) + +function foo() { } +>foo : Symbol(foo, Decl(parserFunctionDeclaration5.ts, 0, 0), Decl(parserFunctionDeclaration5.ts, 0, 15)) + diff --git a/tests/baselines/reference/parserFunctionDeclaration8.symbols b/tests/baselines/reference/parserFunctionDeclaration8.symbols new file mode 100644 index 00000000000..feccbdc7c4f --- /dev/null +++ b/tests/baselines/reference/parserFunctionDeclaration8.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration8.ts === +declare module M { +>M : Symbol(M, Decl(parserFunctionDeclaration8.ts, 0, 0)) + + function foo(); +>foo : Symbol(foo, Decl(parserFunctionDeclaration8.ts, 0, 18)) +} diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment1.symbols b/tests/baselines/reference/parserFunctionPropertyAssignment1.symbols new file mode 100644 index 00000000000..01b555c5e85 --- /dev/null +++ b/tests/baselines/reference/parserFunctionPropertyAssignment1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment1.ts === +var v = { foo() { } }; +>v : Symbol(v, Decl(parserFunctionPropertyAssignment1.ts, 0, 3)) +>foo : Symbol(foo, Decl(parserFunctionPropertyAssignment1.ts, 0, 9)) + diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment2.symbols b/tests/baselines/reference/parserFunctionPropertyAssignment2.symbols new file mode 100644 index 00000000000..3cd2d8ab325 --- /dev/null +++ b/tests/baselines/reference/parserFunctionPropertyAssignment2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment2.ts === +var v = { 0() { } }; +>v : Symbol(v, Decl(parserFunctionPropertyAssignment2.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment3.symbols b/tests/baselines/reference/parserFunctionPropertyAssignment3.symbols new file mode 100644 index 00000000000..9b3135c5ed0 --- /dev/null +++ b/tests/baselines/reference/parserFunctionPropertyAssignment3.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment3.ts === +var v = { "foo"() { } }; +>v : Symbol(v, Decl(parserFunctionPropertyAssignment3.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment4.symbols b/tests/baselines/reference/parserFunctionPropertyAssignment4.symbols new file mode 100644 index 00000000000..2cb8b652e33 --- /dev/null +++ b/tests/baselines/reference/parserFunctionPropertyAssignment4.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment4.ts === +var v = { 0() { } }; +>v : Symbol(v, Decl(parserFunctionPropertyAssignment4.ts, 0, 3)) +>T : Symbol(T, Decl(parserFunctionPropertyAssignment4.ts, 0, 12)) + diff --git a/tests/baselines/reference/parserGenericClass1.symbols b/tests/baselines/reference/parserGenericClass1.symbols new file mode 100644 index 00000000000..68d5f0a20a8 --- /dev/null +++ b/tests/baselines/reference/parserGenericClass1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericClass1.ts === +class C { +>C : Symbol(C, Decl(parserGenericClass1.ts, 0, 0)) +>T : Symbol(T, Decl(parserGenericClass1.ts, 0, 8)) +} diff --git a/tests/baselines/reference/parserGenericClass2.symbols b/tests/baselines/reference/parserGenericClass2.symbols new file mode 100644 index 00000000000..38672494701 --- /dev/null +++ b/tests/baselines/reference/parserGenericClass2.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericClass2.ts === +class C { +>C : Symbol(C, Decl(parserGenericClass2.ts, 0, 0)) +>K : Symbol(K, Decl(parserGenericClass2.ts, 0, 8)) +>V : Symbol(V, Decl(parserGenericClass2.ts, 0, 10)) +} diff --git a/tests/baselines/reference/parserGenericConstraint1.symbols b/tests/baselines/reference/parserGenericConstraint1.symbols new file mode 100644 index 00000000000..ec6edf21257 --- /dev/null +++ b/tests/baselines/reference/parserGenericConstraint1.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint1.ts === +class C { +>C : Symbol(C, Decl(parserGenericConstraint1.ts, 0, 0)) +>T : Symbol(T, Decl(parserGenericConstraint1.ts, 0, 8)) +} diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.symbols b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.symbols new file mode 100644 index 00000000000..62100969e99 --- /dev/null +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity1.ts === +1 >> 2; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types index 451ff65cdd9..0449fdda85a 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity1.types @@ -1,4 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity1.ts === 1 >> 2; >1 >> 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.symbols b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.symbols new file mode 100644 index 00000000000..daf18ee868d --- /dev/null +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity10.ts === +1 +No type information for this code.// before +No type information for this code.>>> // after +No type information for this code.2; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types index f58be05c966..8b3d5dd2ba3 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types @@ -1,7 +1,10 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity10.ts === 1 >1 // before>>> // after2 : number +>1 : number // before >>> // after 2; +>2 : number + diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.symbols b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.symbols new file mode 100644 index 00000000000..f0ca1bc80c9 --- /dev/null +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity5.ts === +1 +No type information for this code.// before +No type information for this code.>> // after +No type information for this code.2; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types index 770d3fa611f..609901bfdd5 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types @@ -1,7 +1,10 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity5.ts === 1 >1 // before>> // after2 : number +>1 : number // before >> // after 2; +>2 : number + diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.symbols b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.symbols new file mode 100644 index 00000000000..4ea0d39b965 --- /dev/null +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.symbols @@ -0,0 +1,3 @@ +=== tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity6.ts === +1 >>> 2; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types index fc7616eef90..e7aa311113c 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity6.types @@ -1,4 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity6.ts === 1 >>> 2; >1 >>> 2 : number +>1 : number +>2 : number diff --git a/tests/baselines/reference/parserIndexMemberDeclaration1.symbols b/tests/baselines/reference/parserIndexMemberDeclaration1.symbols new file mode 100644 index 00000000000..d942f90f17f --- /dev/null +++ b/tests/baselines/reference/parserIndexMemberDeclaration1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration1.ts === +class C { +>C : Symbol(C, Decl(parserIndexMemberDeclaration1.ts, 0, 0)) + + [a: string]: number +>a : Symbol(a, Decl(parserIndexMemberDeclaration1.ts, 1, 4)) +} diff --git a/tests/baselines/reference/parserIndexMemberDeclaration2.symbols b/tests/baselines/reference/parserIndexMemberDeclaration2.symbols new file mode 100644 index 00000000000..1b42a8f8160 --- /dev/null +++ b/tests/baselines/reference/parserIndexMemberDeclaration2.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration2.ts === +class C { +>C : Symbol(C, Decl(parserIndexMemberDeclaration2.ts, 0, 0)) + + [a: string]: number +>a : Symbol(a, Decl(parserIndexMemberDeclaration2.ts, 1, 4)) + + public v: number +>v : Symbol(v, Decl(parserIndexMemberDeclaration2.ts, 1, 22)) +} diff --git a/tests/baselines/reference/parserIndexMemberDeclaration3.symbols b/tests/baselines/reference/parserIndexMemberDeclaration3.symbols new file mode 100644 index 00000000000..6961a37f497 --- /dev/null +++ b/tests/baselines/reference/parserIndexMemberDeclaration3.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration3.ts === +class C { +>C : Symbol(C, Decl(parserIndexMemberDeclaration3.ts, 0, 0)) + + [a: string]: number; +>a : Symbol(a, Decl(parserIndexMemberDeclaration3.ts, 1, 4)) + + public v: number +>v : Symbol(v, Decl(parserIndexMemberDeclaration3.ts, 1, 23)) +} diff --git a/tests/baselines/reference/parserIndexMemberDeclaration4.symbols b/tests/baselines/reference/parserIndexMemberDeclaration4.symbols new file mode 100644 index 00000000000..29b101d05d8 --- /dev/null +++ b/tests/baselines/reference/parserIndexMemberDeclaration4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/IndexMemberDeclarations/parserIndexMemberDeclaration4.ts === +class C { +>C : Symbol(C, Decl(parserIndexMemberDeclaration4.ts, 0, 0)) + + [a: string]: number; public v: number +>a : Symbol(a, Decl(parserIndexMemberDeclaration4.ts, 1, 4)) +>v : Symbol(v, Decl(parserIndexMemberDeclaration4.ts, 1, 23)) +} diff --git a/tests/baselines/reference/parserInterfaceKeywordInEnum.symbols b/tests/baselines/reference/parserInterfaceKeywordInEnum.symbols new file mode 100644 index 00000000000..159d21a96b7 --- /dev/null +++ b/tests/baselines/reference/parserInterfaceKeywordInEnum.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserInterfaceKeywordInEnum.ts === +enum Bar { +>Bar : Symbol(Bar, Decl(parserInterfaceKeywordInEnum.ts, 0, 0)) + + interface, +>interface : Symbol(Bar.interface, Decl(parserInterfaceKeywordInEnum.ts, 0, 10)) +} + diff --git a/tests/baselines/reference/parserInterfaceKeywordInEnum1.symbols b/tests/baselines/reference/parserInterfaceKeywordInEnum1.symbols new file mode 100644 index 00000000000..2bbb8b87ea1 --- /dev/null +++ b/tests/baselines/reference/parserInterfaceKeywordInEnum1.symbols @@ -0,0 +1,10 @@ +=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserInterfaceKeywordInEnum1.ts === +"use strict"; + +enum Bar { +>Bar : Symbol(Bar, Decl(parserInterfaceKeywordInEnum1.ts, 0, 13)) + + interface, +>interface : Symbol(Bar.interface, Decl(parserInterfaceKeywordInEnum1.ts, 2, 10)) +} + diff --git a/tests/baselines/reference/parserInterfaceKeywordInEnum1.types b/tests/baselines/reference/parserInterfaceKeywordInEnum1.types index f17bfeacf88..f6b613f3f60 100644 --- a/tests/baselines/reference/parserInterfaceKeywordInEnum1.types +++ b/tests/baselines/reference/parserInterfaceKeywordInEnum1.types @@ -1,5 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserInterfaceKeywordInEnum1.ts === "use strict"; +>"use strict" : string enum Bar { >Bar : Bar diff --git a/tests/baselines/reference/parserKeywordsAsIdentifierName1.symbols b/tests/baselines/reference/parserKeywordsAsIdentifierName1.symbols new file mode 100644 index 00000000000..67420930aff --- /dev/null +++ b/tests/baselines/reference/parserKeywordsAsIdentifierName1.symbols @@ -0,0 +1,14 @@ +=== tests/cases/conformance/parser/ecmascript5/parserKeywordsAsIdentifierName1.ts === +var big = { +>big : Symbol(big, Decl(parserKeywordsAsIdentifierName1.ts, 0, 3)) + + break : 0, +>break : Symbol(break, Decl(parserKeywordsAsIdentifierName1.ts, 0, 11)) + + super : 0, +>super : Symbol(super, Decl(parserKeywordsAsIdentifierName1.ts, 1, 13)) + + const : 0 +>const : Symbol(const, Decl(parserKeywordsAsIdentifierName1.ts, 2, 13)) +} + diff --git a/tests/baselines/reference/parserKeywordsAsIdentifierName1.types b/tests/baselines/reference/parserKeywordsAsIdentifierName1.types index e917dc76cf0..bc586e8a4bb 100644 --- a/tests/baselines/reference/parserKeywordsAsIdentifierName1.types +++ b/tests/baselines/reference/parserKeywordsAsIdentifierName1.types @@ -5,11 +5,14 @@ var big = { break : 0, >break : number +>0 : number super : 0, >super : number +>0 : number const : 0 >const : number +>0 : number } diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration4.symbols b/tests/baselines/reference/parserMemberAccessorDeclaration4.symbols new file mode 100644 index 00000000000..2750f28943e --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration4.ts === +class C { +>C : Symbol(C, Decl(parserMemberAccessorDeclaration4.ts, 0, 0)) + + set a(i) { } +>a : Symbol(a, Decl(parserMemberAccessorDeclaration4.ts, 0, 9)) +>i : Symbol(i, Decl(parserMemberAccessorDeclaration4.ts, 1, 8)) +} diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration5.symbols b/tests/baselines/reference/parserMemberAccessorDeclaration5.symbols new file mode 100644 index 00000000000..ac343ff02b1 --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration5.ts === +class C { +>C : Symbol(C, Decl(parserMemberAccessorDeclaration5.ts, 0, 0)) + + set "a"(i) { } +>i : Symbol(i, Decl(parserMemberAccessorDeclaration5.ts, 1, 10)) +} diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration6.symbols b/tests/baselines/reference/parserMemberAccessorDeclaration6.symbols new file mode 100644 index 00000000000..a4b4558e892 --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration6.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration6.ts === +class C { +>C : Symbol(C, Decl(parserMemberAccessorDeclaration6.ts, 0, 0)) + + set 0(i) { } +>i : Symbol(i, Decl(parserMemberAccessorDeclaration6.ts, 1, 8)) +} diff --git a/tests/baselines/reference/parserMethodSignature1.symbols b/tests/baselines/reference/parserMethodSignature1.symbols new file mode 100644 index 00000000000..2c12a156ef0 --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature1.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature1.ts, 0, 0)) + + A(); +>A : Symbol(A, Decl(parserMethodSignature1.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserMethodSignature10.symbols b/tests/baselines/reference/parserMethodSignature10.symbols new file mode 100644 index 00000000000..4cefa6c759e --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature10.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature10.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature10.ts, 0, 0)) + + 1?(); +} diff --git a/tests/baselines/reference/parserMethodSignature11.symbols b/tests/baselines/reference/parserMethodSignature11.symbols new file mode 100644 index 00000000000..3217eb47aec --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature11.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature11.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature11.ts, 0, 0)) + + 2(); +>T : Symbol(T, Decl(parserMethodSignature11.ts, 1, 4)) +} diff --git a/tests/baselines/reference/parserMethodSignature12.symbols b/tests/baselines/reference/parserMethodSignature12.symbols new file mode 100644 index 00000000000..364a89eb970 --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature12.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature12.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature12.ts, 0, 0)) + + 3?(); +>T : Symbol(T, Decl(parserMethodSignature12.ts, 1, 5)) +} diff --git a/tests/baselines/reference/parserMethodSignature2.symbols b/tests/baselines/reference/parserMethodSignature2.symbols new file mode 100644 index 00000000000..ba86c20293e --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature2.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature2.ts, 0, 0)) + + B?(); +>B : Symbol(B, Decl(parserMethodSignature2.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserMethodSignature3.symbols b/tests/baselines/reference/parserMethodSignature3.symbols new file mode 100644 index 00000000000..ce4c0f05561 --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature3.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature3.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature3.ts, 0, 0)) + + C(); +>C : Symbol(C, Decl(parserMethodSignature3.ts, 0, 13)) +>T : Symbol(T, Decl(parserMethodSignature3.ts, 1, 4)) +} diff --git a/tests/baselines/reference/parserMethodSignature4.symbols b/tests/baselines/reference/parserMethodSignature4.symbols new file mode 100644 index 00000000000..d1612bf2f4f --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature4.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature4.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature4.ts, 0, 0)) + + D?(); +>D : Symbol(D, Decl(parserMethodSignature4.ts, 0, 13)) +>T : Symbol(T, Decl(parserMethodSignature4.ts, 1, 5)) +} diff --git a/tests/baselines/reference/parserMethodSignature5.symbols b/tests/baselines/reference/parserMethodSignature5.symbols new file mode 100644 index 00000000000..8cf748ab50c --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature5.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature5.ts, 0, 0)) + + "E"(); +} diff --git a/tests/baselines/reference/parserMethodSignature6.symbols b/tests/baselines/reference/parserMethodSignature6.symbols new file mode 100644 index 00000000000..b15a3d9a4e2 --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature6.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature6.ts, 0, 0)) + + "F"?(); +} diff --git a/tests/baselines/reference/parserMethodSignature7.symbols b/tests/baselines/reference/parserMethodSignature7.symbols new file mode 100644 index 00000000000..3b275fa20cb --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature7.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature7.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature7.ts, 0, 0)) + + "G"(); +>T : Symbol(T, Decl(parserMethodSignature7.ts, 1, 6)) +} diff --git a/tests/baselines/reference/parserMethodSignature8.symbols b/tests/baselines/reference/parserMethodSignature8.symbols new file mode 100644 index 00000000000..9fe0a7d64e8 --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature8.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature8.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature8.ts, 0, 0)) + + "H"?(); +>T : Symbol(T, Decl(parserMethodSignature8.ts, 1, 7)) +} diff --git a/tests/baselines/reference/parserMethodSignature9.symbols b/tests/baselines/reference/parserMethodSignature9.symbols new file mode 100644 index 00000000000..2fb7aa56d3b --- /dev/null +++ b/tests/baselines/reference/parserMethodSignature9.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/MethodSignatures/parserMethodSignature9.ts === +interface I { +>I : Symbol(I, Decl(parserMethodSignature9.ts, 0, 0)) + + 0(); +} diff --git a/tests/baselines/reference/parserModifierOnPropertySignature2.symbols b/tests/baselines/reference/parserModifierOnPropertySignature2.symbols new file mode 100644 index 00000000000..ac17a3810bf --- /dev/null +++ b/tests/baselines/reference/parserModifierOnPropertySignature2.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnPropertySignature2.ts === +interface Foo{ +>Foo : Symbol(Foo, Decl(parserModifierOnPropertySignature2.ts, 0, 0)) + + public +>public : Symbol(public, Decl(parserModifierOnPropertySignature2.ts, 0, 14)) + + biz; +>biz : Symbol(biz, Decl(parserModifierOnPropertySignature2.ts, 1, 10)) +} + diff --git a/tests/baselines/reference/parserModuleDeclaration11.symbols b/tests/baselines/reference/parserModuleDeclaration11.symbols new file mode 100644 index 00000000000..370bd4f8f2b --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration11.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration11.ts === +declare module string { +>string : Symbol(string, Decl(parserModuleDeclaration11.ts, 0, 0)) + + interface X { } +>X : Symbol(X, Decl(parserModuleDeclaration11.ts, 0, 23)) + + export function foo(s: string); +>foo : Symbol(foo, Decl(parserModuleDeclaration11.ts, 1, 19)) +>s : Symbol(s, Decl(parserModuleDeclaration11.ts, 2, 24)) +} +string.foo("abc"); +>string.foo : Symbol(string.foo, Decl(parserModuleDeclaration11.ts, 1, 19)) +>string : Symbol(string, Decl(parserModuleDeclaration11.ts, 0, 0)) +>foo : Symbol(string.foo, Decl(parserModuleDeclaration11.ts, 1, 19)) + +var x: string.X; +>x : Symbol(x, Decl(parserModuleDeclaration11.ts, 5, 3)) +>string : Symbol(string, Decl(parserModuleDeclaration11.ts, 0, 0)) +>X : Symbol(string.X, Decl(parserModuleDeclaration11.ts, 0, 23)) + diff --git a/tests/baselines/reference/parserModuleDeclaration11.types b/tests/baselines/reference/parserModuleDeclaration11.types index bd66d638ddf..98075a505f7 100644 --- a/tests/baselines/reference/parserModuleDeclaration11.types +++ b/tests/baselines/reference/parserModuleDeclaration11.types @@ -14,9 +14,10 @@ string.foo("abc"); >string.foo : (s: string) => any >string : typeof string >foo : (s: string) => any +>"abc" : string var x: string.X; >x : string.X ->string : unknown +>string : any >X : string.X diff --git a/tests/baselines/reference/parserModuleDeclaration12.symbols b/tests/baselines/reference/parserModuleDeclaration12.symbols new file mode 100644 index 00000000000..7b4944c7442 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration12.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration12.ts === +module A.string { +>A : Symbol(A, Decl(parserModuleDeclaration12.ts, 0, 0)) +>string : Symbol(string, Decl(parserModuleDeclaration12.ts, 0, 9)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration12.types b/tests/baselines/reference/parserModuleDeclaration12.types index cffa3cba358..469cfe867fd 100644 --- a/tests/baselines/reference/parserModuleDeclaration12.types +++ b/tests/baselines/reference/parserModuleDeclaration12.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration12.ts === module A.string { ->A : unknown ->string : unknown +>A : any +>string : any } diff --git a/tests/baselines/reference/parserModuleDeclaration2.symbols b/tests/baselines/reference/parserModuleDeclaration2.symbols new file mode 100644 index 00000000000..340cee697f1 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration2.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration2.ts === +declare module "Foo" { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration3.d.symbols b/tests/baselines/reference/parserModuleDeclaration3.d.symbols new file mode 100644 index 00000000000..2994f85cc68 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration3.d.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration3.d.ts === +declare module M { +>M : Symbol(M, Decl(parserModuleDeclaration3.d.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration3.d.types b/tests/baselines/reference/parserModuleDeclaration3.d.types index 1fbd92c86af..21c6650a033 100644 --- a/tests/baselines/reference/parserModuleDeclaration3.d.types +++ b/tests/baselines/reference/parserModuleDeclaration3.d.types @@ -1,4 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration3.d.ts === declare module M { ->M : unknown +>M : any } diff --git a/tests/baselines/reference/parserModuleDeclaration4.symbols b/tests/baselines/reference/parserModuleDeclaration4.symbols new file mode 100644 index 00000000000..2ec1d639e72 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration4.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration4.ts === +module M { +>M : Symbol(M, Decl(parserModuleDeclaration4.ts, 0, 0)) + + declare module M1 { +>M1 : Symbol(M1, Decl(parserModuleDeclaration4.ts, 0, 10)) + + module M2 { +>M2 : Symbol(M2, Decl(parserModuleDeclaration4.ts, 1, 21)) + } + } +} diff --git a/tests/baselines/reference/parserModuleDeclaration4.types b/tests/baselines/reference/parserModuleDeclaration4.types index 165378e62fa..29f29a87fe7 100644 --- a/tests/baselines/reference/parserModuleDeclaration4.types +++ b/tests/baselines/reference/parserModuleDeclaration4.types @@ -1,12 +1,12 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration4.ts === module M { ->M : unknown +>M : any declare module M1 { ->M1 : unknown +>M1 : any module M2 { ->M2 : unknown +>M2 : any } } } diff --git a/tests/baselines/reference/parserModuleDeclaration6.symbols b/tests/baselines/reference/parserModuleDeclaration6.symbols new file mode 100644 index 00000000000..4c155afe594 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration6.ts === +module number { +>number : Symbol(number, Decl(parserModuleDeclaration6.ts, 0, 0)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration6.types b/tests/baselines/reference/parserModuleDeclaration6.types index 012ad6f8270..2ac05ec485e 100644 --- a/tests/baselines/reference/parserModuleDeclaration6.types +++ b/tests/baselines/reference/parserModuleDeclaration6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration6.ts === module number { ->number : unknown +>number : any } diff --git a/tests/baselines/reference/parserModuleDeclaration7.symbols b/tests/baselines/reference/parserModuleDeclaration7.symbols new file mode 100644 index 00000000000..4f3648b044a --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration7.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration7.ts === +module number.a { +>number : Symbol(number, Decl(parserModuleDeclaration7.ts, 0, 0)) +>a : Symbol(a, Decl(parserModuleDeclaration7.ts, 0, 14)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration7.types b/tests/baselines/reference/parserModuleDeclaration7.types index 38f1c29e642..38cf3f89623 100644 --- a/tests/baselines/reference/parserModuleDeclaration7.types +++ b/tests/baselines/reference/parserModuleDeclaration7.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration7.ts === module number.a { ->number : unknown ->a : unknown +>number : any +>a : any } diff --git a/tests/baselines/reference/parserModuleDeclaration8.symbols b/tests/baselines/reference/parserModuleDeclaration8.symbols new file mode 100644 index 00000000000..b4bd45b2889 --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration8.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration8.ts === +module a.number { +>a : Symbol(a, Decl(parserModuleDeclaration8.ts, 0, 0)) +>number : Symbol(number, Decl(parserModuleDeclaration8.ts, 0, 9)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration8.types b/tests/baselines/reference/parserModuleDeclaration8.types index 474e81dbda0..1c9a0e26650 100644 --- a/tests/baselines/reference/parserModuleDeclaration8.types +++ b/tests/baselines/reference/parserModuleDeclaration8.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration8.ts === module a.number { ->a : unknown ->number : unknown +>a : any +>number : any } diff --git a/tests/baselines/reference/parserModuleDeclaration9.symbols b/tests/baselines/reference/parserModuleDeclaration9.symbols new file mode 100644 index 00000000000..b092aab41ef --- /dev/null +++ b/tests/baselines/reference/parserModuleDeclaration9.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration9.ts === +module a.number.b { +>a : Symbol(a, Decl(parserModuleDeclaration9.ts, 0, 0)) +>number : Symbol(number, Decl(parserModuleDeclaration9.ts, 0, 9)) +>b : Symbol(b, Decl(parserModuleDeclaration9.ts, 0, 16)) +} diff --git a/tests/baselines/reference/parserModuleDeclaration9.types b/tests/baselines/reference/parserModuleDeclaration9.types index 1898d461290..28a272b4350 100644 --- a/tests/baselines/reference/parserModuleDeclaration9.types +++ b/tests/baselines/reference/parserModuleDeclaration9.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModuleDeclaration9.ts === module a.number.b { ->a : unknown ->number : unknown ->b : unknown +>a : any +>number : any +>b : any } diff --git a/tests/baselines/reference/parserObjectLiterals1.symbols b/tests/baselines/reference/parserObjectLiterals1.symbols new file mode 100644 index 00000000000..602c2dd5a3a --- /dev/null +++ b/tests/baselines/reference/parserObjectLiterals1.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/ObjectLiterals/parserObjectLiterals1.ts === +var v = { a: 1, b: 2 }; +>v : Symbol(v, Decl(parserObjectLiterals1.ts, 0, 3)) +>a : Symbol(a, Decl(parserObjectLiterals1.ts, 0, 9)) +>b : Symbol(b, Decl(parserObjectLiterals1.ts, 0, 15)) + diff --git a/tests/baselines/reference/parserObjectLiterals1.types b/tests/baselines/reference/parserObjectLiterals1.types index c38adbf55b6..b6bca18e360 100644 --- a/tests/baselines/reference/parserObjectLiterals1.types +++ b/tests/baselines/reference/parserObjectLiterals1.types @@ -3,5 +3,7 @@ var v = { a: 1, b: 2 }; >v : { a: number; b: number; } >{ a: 1, b: 2 } : { a: number; b: number; } >a : number +>1 : number >b : number +>2 : number diff --git a/tests/baselines/reference/parserObjectType1.symbols b/tests/baselines/reference/parserObjectType1.symbols new file mode 100644 index 00000000000..702cfbe4d87 --- /dev/null +++ b/tests/baselines/reference/parserObjectType1.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType1.ts === +var v: {}; +>v : Symbol(v, Decl(parserObjectType1.ts, 0, 3)) + diff --git a/tests/baselines/reference/parserObjectType2.symbols b/tests/baselines/reference/parserObjectType2.symbols new file mode 100644 index 00000000000..43728418166 --- /dev/null +++ b/tests/baselines/reference/parserObjectType2.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType2.ts === +var v: { x: number }; +>v : Symbol(v, Decl(parserObjectType2.ts, 0, 3)) +>x : Symbol(x, Decl(parserObjectType2.ts, 0, 8)) + diff --git a/tests/baselines/reference/parserObjectType3.symbols b/tests/baselines/reference/parserObjectType3.symbols new file mode 100644 index 00000000000..bb4b25d2a69 --- /dev/null +++ b/tests/baselines/reference/parserObjectType3.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType3.ts === +var v: { +>v : Symbol(v, Decl(parserObjectType3.ts, 0, 3)) + + x; +>x : Symbol(x, Decl(parserObjectType3.ts, 0, 8)) + + y +>y : Symbol(y, Decl(parserObjectType3.ts, 1, 4)) + +}; diff --git a/tests/baselines/reference/parserObjectType4.symbols b/tests/baselines/reference/parserObjectType4.symbols new file mode 100644 index 00000000000..f73e22de77c --- /dev/null +++ b/tests/baselines/reference/parserObjectType4.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType4.ts === +var v: { +>v : Symbol(v, Decl(parserObjectType4.ts, 0, 3)) + + x +>x : Symbol(x, Decl(parserObjectType4.ts, 0, 8)) + + y +>y : Symbol(y, Decl(parserObjectType4.ts, 1, 3)) + +}; diff --git a/tests/baselines/reference/parserOptionalTypeMembers1.symbols b/tests/baselines/reference/parserOptionalTypeMembers1.symbols new file mode 100644 index 00000000000..ce12a4ec19b --- /dev/null +++ b/tests/baselines/reference/parserOptionalTypeMembers1.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/parser/ecmascript5/parserOptionalTypeMembers1.ts === +interface PropertyDescriptor2 { +>PropertyDescriptor2 : Symbol(PropertyDescriptor2, Decl(parserOptionalTypeMembers1.ts, 0, 0)) + + configurable?: boolean; +>configurable : Symbol(configurable, Decl(parserOptionalTypeMembers1.ts, 0, 31)) + + enumerable?: boolean; +>enumerable : Symbol(enumerable, Decl(parserOptionalTypeMembers1.ts, 1, 27)) + + value?: any; +>value : Symbol(value, Decl(parserOptionalTypeMembers1.ts, 2, 25)) + + writable?: boolean; +>writable : Symbol(writable, Decl(parserOptionalTypeMembers1.ts, 3, 16)) + + get?(): any; +>get : Symbol(get, Decl(parserOptionalTypeMembers1.ts, 4, 23)) + + set?(v: any): void; +>set : Symbol(set, Decl(parserOptionalTypeMembers1.ts, 5, 16)) +>v : Symbol(v, Decl(parserOptionalTypeMembers1.ts, 6, 9)) +} diff --git a/tests/baselines/reference/parserParameterList10.js b/tests/baselines/reference/parserParameterList10.js index 4f85dec801c..7a4e8132868 100644 --- a/tests/baselines/reference/parserParameterList10.js +++ b/tests/baselines/reference/parserParameterList10.js @@ -8,7 +8,6 @@ var C = (function () { function C() { } C.prototype.foo = function () { - if (bar === void 0) { bar = 0; } var bar = []; for (var _i = 0; _i < arguments.length; _i++) { bar[_i - 0] = arguments[_i]; diff --git a/tests/baselines/reference/parserPropertySignature1.symbols b/tests/baselines/reference/parserPropertySignature1.symbols new file mode 100644 index 00000000000..6b8a26c4164 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature1.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature1.ts, 0, 0)) + + A; +>A : Symbol(A, Decl(parserPropertySignature1.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserPropertySignature10.symbols b/tests/baselines/reference/parserPropertySignature10.symbols new file mode 100644 index 00000000000..a6a755a0891 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature10.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature10.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature10.ts, 0, 0)) + + 1?; +} diff --git a/tests/baselines/reference/parserPropertySignature11.symbols b/tests/baselines/reference/parserPropertySignature11.symbols new file mode 100644 index 00000000000..960f16bf526 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature11.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature11.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature11.ts, 0, 0)) + + 2:any; +} diff --git a/tests/baselines/reference/parserPropertySignature12.symbols b/tests/baselines/reference/parserPropertySignature12.symbols new file mode 100644 index 00000000000..a6f0eb5faf8 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature12.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature12.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature12.ts, 0, 0)) + + 3?:any; +} diff --git a/tests/baselines/reference/parserPropertySignature2.symbols b/tests/baselines/reference/parserPropertySignature2.symbols new file mode 100644 index 00000000000..334c0655908 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature2.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature2.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature2.ts, 0, 0)) + + B?; +>B : Symbol(B, Decl(parserPropertySignature2.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserPropertySignature3.symbols b/tests/baselines/reference/parserPropertySignature3.symbols new file mode 100644 index 00000000000..c2b70b58be8 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature3.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature3.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature3.ts, 0, 0)) + + C:any; +>C : Symbol(C, Decl(parserPropertySignature3.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserPropertySignature4.symbols b/tests/baselines/reference/parserPropertySignature4.symbols new file mode 100644 index 00000000000..cd61b14d34c --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature4.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature4.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature4.ts, 0, 0)) + + D?:any; +>D : Symbol(D, Decl(parserPropertySignature4.ts, 0, 13)) +} diff --git a/tests/baselines/reference/parserPropertySignature5.symbols b/tests/baselines/reference/parserPropertySignature5.symbols new file mode 100644 index 00000000000..fa56ec75871 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature5.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature5.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature5.ts, 0, 0)) + + "E"; +} diff --git a/tests/baselines/reference/parserPropertySignature6.symbols b/tests/baselines/reference/parserPropertySignature6.symbols new file mode 100644 index 00000000000..1f3831e5610 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature6.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature6.ts, 0, 0)) + + "F"?; +} diff --git a/tests/baselines/reference/parserPropertySignature7.symbols b/tests/baselines/reference/parserPropertySignature7.symbols new file mode 100644 index 00000000000..840b302d6ac --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature7.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature7.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature7.ts, 0, 0)) + + "G":any; +} diff --git a/tests/baselines/reference/parserPropertySignature8.symbols b/tests/baselines/reference/parserPropertySignature8.symbols new file mode 100644 index 00000000000..e124b4c770c --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature8.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature8.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature8.ts, 0, 0)) + + "H"?:any; +} diff --git a/tests/baselines/reference/parserPropertySignature9.symbols b/tests/baselines/reference/parserPropertySignature9.symbols new file mode 100644 index 00000000000..3664160fad4 --- /dev/null +++ b/tests/baselines/reference/parserPropertySignature9.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/PropertySignatures/parserPropertySignature9.ts === +interface I { +>I : Symbol(I, Decl(parserPropertySignature9.ts, 0, 0)) + + 0; +} diff --git a/tests/baselines/reference/parserReturnStatement3.symbols b/tests/baselines/reference/parserReturnStatement3.symbols new file mode 100644 index 00000000000..6783ea1ac5c --- /dev/null +++ b/tests/baselines/reference/parserReturnStatement3.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/parser/ecmascript5/Statements/ReturnStatements/parserReturnStatement3.ts === +function f() { +>f : Symbol(f, Decl(parserReturnStatement3.ts, 0, 0)) + + return; +} diff --git a/tests/baselines/reference/parserS7.6.1.1_A1.10.symbols b/tests/baselines/reference/parserS7.6.1.1_A1.10.symbols new file mode 100644 index 00000000000..28441e36fe6 --- /dev/null +++ b/tests/baselines/reference/parserS7.6.1.1_A1.10.symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/parser/ecmascript5/parserS7.6.1.1_A1.10.ts === +// Copyright 2009 the Sputnik authors. All rights reserved. +No type information for this code.// This code is governed by the BSD license found in the LICENSE file. +No type information for this code. +No type information for this code./** +No type information for this code. * The "for" token can not be used as identifier +No type information for this code. * +No type information for this code. * @path ch07/7.6/7.6.1/7.6.1.1/S7.6.1.1_A1.10.js +No type information for this code. * @description Checking if execution of "for=1" fails +No type information for this code. * @negative +No type information for this code. */ +No type information for this code. +No type information for this code.//for = 1; +No type information for this code. +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserSbp_7.9_A9_T3.symbols b/tests/baselines/reference/parserSbp_7.9_A9_T3.symbols new file mode 100644 index 00000000000..0d6df58ed39 --- /dev/null +++ b/tests/baselines/reference/parserSbp_7.9_A9_T3.symbols @@ -0,0 +1,18 @@ +=== tests/cases/conformance/parser/ecmascript5/parserSbp_7.9_A9_T3.ts === +// Copyright 2009 the Sputnik authors. All rights reserved. +No type information for this code.// This code is governed by the BSD license found in the LICENSE file. +No type information for this code. +No type information for this code./** +No type information for this code. * Check Do-While Statement for automatic semicolon insertion +No type information for this code. * +No type information for this code. * @path bestPractice/Sbp_7.9_A9_T3.js +No type information for this code. * @description Execute do { \n ; \n }while(false) true +No type information for this code. */ +No type information for this code. +No type information for this code.//CHECK#1 +No type information for this code.do { +No type information for this code. ; +No type information for this code.} while (false) true +No type information for this code. +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserSbp_7.9_A9_T3.types b/tests/baselines/reference/parserSbp_7.9_A9_T3.types index 0d6df58ed39..5e1eed4dd98 100644 --- a/tests/baselines/reference/parserSbp_7.9_A9_T3.types +++ b/tests/baselines/reference/parserSbp_7.9_A9_T3.types @@ -1,18 +1,19 @@ === tests/cases/conformance/parser/ecmascript5/parserSbp_7.9_A9_T3.ts === // Copyright 2009 the Sputnik authors. All rights reserved. -No type information for this code.// This code is governed by the BSD license found in the LICENSE file. -No type information for this code. -No type information for this code./** -No type information for this code. * Check Do-While Statement for automatic semicolon insertion -No type information for this code. * -No type information for this code. * @path bestPractice/Sbp_7.9_A9_T3.js -No type information for this code. * @description Execute do { \n ; \n }while(false) true -No type information for this code. */ -No type information for this code. -No type information for this code.//CHECK#1 -No type information for this code.do { -No type information for this code. ; -No type information for this code.} while (false) true -No type information for this code. -No type information for this code. -No type information for this code. \ No newline at end of file +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Check Do-While Statement for automatic semicolon insertion + * + * @path bestPractice/Sbp_7.9_A9_T3.js + * @description Execute do { \n ; \n }while(false) true + */ + +//CHECK#1 +do { + ; +} while (false) true +>false : boolean +>true : boolean + + diff --git a/tests/baselines/reference/parserStrictMode16.symbols b/tests/baselines/reference/parserStrictMode16.symbols new file mode 100644 index 00000000000..655201fbea2 --- /dev/null +++ b/tests/baselines/reference/parserStrictMode16.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode16.ts === +"use strict"; +No type information for this code.delete this; +No type information for this code.delete 1; +No type information for this code.delete null; +No type information for this code.delete "a"; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode16.types b/tests/baselines/reference/parserStrictMode16.types index 6e68c0cbc6b..a7a68ab7811 100644 --- a/tests/baselines/reference/parserStrictMode16.types +++ b/tests/baselines/reference/parserStrictMode16.types @@ -1,15 +1,20 @@ === tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode16.ts === "use strict"; +>"use strict" : string + delete this; >delete this : boolean >this : any delete 1; >delete 1 : boolean +>1 : number delete null; >delete null : boolean +>null : null delete "a"; >delete "a" : boolean +>"a" : string diff --git a/tests/baselines/reference/parserSymbolProperty1.symbols b/tests/baselines/reference/parserSymbolProperty1.symbols new file mode 100644 index 00000000000..4d7a9b669e4 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty1.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty1.ts === +interface I { +>I : Symbol(I, Decl(parserSymbolProperty1.ts, 0, 0)) + + [Symbol.iterator]: string; +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31)) +} diff --git a/tests/baselines/reference/parserSymbolProperty2.symbols b/tests/baselines/reference/parserSymbolProperty2.symbols new file mode 100644 index 00000000000..ff110a6fe03 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty2.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty2.ts === +interface I { +>I : Symbol(I, Decl(parserSymbolProperty2.ts, 0, 0)) + + [Symbol.unscopables](): string; +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +} diff --git a/tests/baselines/reference/parserSymbolProperty3.symbols b/tests/baselines/reference/parserSymbolProperty3.symbols new file mode 100644 index 00000000000..b75a737af0a --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty3.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty3.ts === +declare class C { +>C : Symbol(C, Decl(parserSymbolProperty3.ts, 0, 0)) + + [Symbol.unscopables](): string; +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.d.ts, 1254, 24)) +} diff --git a/tests/baselines/reference/parserSymbolProperty4.symbols b/tests/baselines/reference/parserSymbolProperty4.symbols new file mode 100644 index 00000000000..122a46180d2 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty4.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty4.ts === +declare class C { +>C : Symbol(C, Decl(parserSymbolProperty4.ts, 0, 0)) + + [Symbol.toPrimitive]: string; +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +} diff --git a/tests/baselines/reference/parserSymbolProperty5.symbols b/tests/baselines/reference/parserSymbolProperty5.symbols new file mode 100644 index 00000000000..f6049c352e9 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty5.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty5.ts === +class C { +>C : Symbol(C, Decl(parserSymbolProperty5.ts, 0, 0)) + + [Symbol.toPrimitive]: string; +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +} diff --git a/tests/baselines/reference/parserSymbolProperty6.symbols b/tests/baselines/reference/parserSymbolProperty6.symbols new file mode 100644 index 00000000000..6f8a8d820be --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty6.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty6.ts === +class C { +>C : Symbol(C, Decl(parserSymbolProperty6.ts, 0, 0)) + + [Symbol.toStringTag]: string = ""; +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +} diff --git a/tests/baselines/reference/parserSymbolProperty6.types b/tests/baselines/reference/parserSymbolProperty6.types index 660cbf4e545..a802765cb4f 100644 --- a/tests/baselines/reference/parserSymbolProperty6.types +++ b/tests/baselines/reference/parserSymbolProperty6.types @@ -6,4 +6,5 @@ class C { >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol +>"" : string } diff --git a/tests/baselines/reference/parserSymbolProperty7.symbols b/tests/baselines/reference/parserSymbolProperty7.symbols new file mode 100644 index 00000000000..abcffb9a1fd --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty7.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty7.ts === +class C { +>C : Symbol(C, Decl(parserSymbolProperty7.ts, 0, 0)) + + [Symbol.toStringTag](): void { } +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24)) +} diff --git a/tests/baselines/reference/parserSymbolProperty8.symbols b/tests/baselines/reference/parserSymbolProperty8.symbols new file mode 100644 index 00000000000..4b2adf9c750 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty8.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty8.ts === +var x: { +>x : Symbol(x, Decl(parserSymbolProperty8.ts, 0, 3)) + + [Symbol.toPrimitive](): string +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +} diff --git a/tests/baselines/reference/parserSymbolProperty9.symbols b/tests/baselines/reference/parserSymbolProperty9.symbols new file mode 100644 index 00000000000..cca16d768e6 --- /dev/null +++ b/tests/baselines/reference/parserSymbolProperty9.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolProperty9.ts === +var x: { +>x : Symbol(x, Decl(parserSymbolProperty9.ts, 0, 3)) + + [Symbol.toPrimitive]: string +>Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21)) +} diff --git a/tests/baselines/reference/parserSyntaxWalker.generated.symbols b/tests/baselines/reference/parserSyntaxWalker.generated.symbols new file mode 100644 index 00000000000..dde34e06746 --- /dev/null +++ b/tests/baselines/reference/parserSyntaxWalker.generated.symbols @@ -0,0 +1,281 @@ +=== tests/cases/conformance/parser/ecmascript5/parserSyntaxWalker.generated.ts === +//declare module "fs" { +No type information for this code.// export class File { +No type information for this code.// constructor(filename: string); +No type information for this code.// public ReadAllText(): string; +No type information for this code.// } +No type information for this code.// export interface IFile { +No type information for this code.// [index: number]: string; +No type information for this code.// } +No type information for this code.//} +No type information for this code. +No type information for this code.//import fs = module("fs"); +No type information for this code. +No type information for this code. +No type information for this code.//module TypeScriptAllInOne { +No type information for this code.// export class Program { +No type information for this code.// static Main(...args: string[]) { +No type information for this code.// try { +No type information for this code.// var bfs = new BasicFeatures(); +No type information for this code.// var retValue: number = 0; +No type information for this code. +No type information for this code.// retValue = bfs.VARIABLES(); +No type information for this code.// if (retValue != 0) { +No type information for this code. +No type information for this code.// return 1; +No type information for this code.// } +No type information for this code. +No type information for this code.// retValue = bfs.STATEMENTS(4); +No type information for this code.// if (retValue != 0) { +No type information for this code. +No type information for this code.// return 1; +No type information for this code.// } +No type information for this code. +No type information for this code. +No type information for this code.// retValue = bfs.TYPES(); +No type information for this code.// if (retValue != 0) { +No type information for this code. +No type information for this code.// return 1; +No type information for this code.// } +No type information for this code. +No type information for this code.// retValue = bfs.OPERATOR(); +No type information for this code.// if (retValue != 0) { +No type information for this code. +No type information for this code.// return 1; +No type information for this code.// } +No type information for this code.// } +No type information for this code.// catch (e) { +No type information for this code.// console.log(e); +No type information for this code.// } +No type information for this code.// finally { +No type information for this code. +No type information for this code.// } +No type information for this code. +No type information for this code.// console.log('Done'); +No type information for this code. +No type information for this code.// return 0; +No type information for this code. +No type information for this code.// } +No type information for this code.// } +No type information for this code. +No type information for this code.// class BasicFeatures { +No type information for this code.// /// +No type information for this code.// /// Test various of variables. Including nullable,key world as variable,special format +No type information for this code.// /// +No type information for this code.// /// +No type information for this code.// public VARIABLES(): number { +No type information for this code.// var local = Number.MAX_VALUE; +No type information for this code.// var min = Number.MIN_VALUE; +No type information for this code.// var inf = Number.NEGATIVE_INFINITY; +No type information for this code.// var nan = Number.NaN; +No type information for this code.// var undef = undefined; +No type information for this code. +No type information for this code.// var п = local; +No type information for this code.// var м = local; +No type information for this code. +No type information for this code.// var local5 = null; +No type information for this code.// var local6 = local5 instanceof fs.File; +No type information for this code. +No type information for this code.// var hex = 0xBADC0DE, Hex = 0XDEADBEEF; +No type information for this code.// var float = 6.02e23, float2 = 6.02E-23 +No type information for this code.// var char = 'c', \u0066 = '\u0066', hexchar = '\x42'; +No type information for this code.// var quoted = '"', quoted2 = "'"; +No type information for this code.// var reg = /\w*/; +No type information for this code.// var objLit = { "var": number = 42, equals: function (x) { return x["var"] === 42; }, toString: () => 'objLit{42}' }; +No type information for this code.// var weekday = Weekdays.Monday; +No type information for this code. +No type information for this code.// var con = char + f + hexchar + float.toString() + float2.toString() + reg.toString() + objLit + weekday; +No type information for this code. +No type information for this code.// // +No type information for this code.// var any = 0; +No type information for this code.// var boolean = 0; +No type information for this code.// var declare = 0; +No type information for this code.// var constructor = 0; +No type information for this code.// var get = 0; +No type information for this code.// var implements = 0; +No type information for this code.// var interface = 0; +No type information for this code.// var let = 0; +No type information for this code.// var module = 0; +No type information for this code.// var number = 0; +No type information for this code.// var package = 0; +No type information for this code.// var private = 0; +No type information for this code.// var protected = 0; +No type information for this code.// var public = 0; +No type information for this code.// var set = 0; +No type information for this code.// var static = 0; +No type information for this code.// var string = 0; +No type information for this code.// var yield = 0; +No type information for this code. +No type information for this code.// var sum3 = any + boolean + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield; +No type information for this code. +No type information for this code.// return 0; +No type information for this code.// } +No type information for this code. +No type information for this code.// /// +No type information for this code.// /// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally +No type information for this code.// /// +No type information for this code.// /// +No type information for this code.// /// +No type information for this code.// STATEMENTS(i: number): number { +No type information for this code.// var retVal = 0; +No type information for this code.// if (i == 1) +No type information for this code.// retVal = 1; +No type information for this code.// else +No type information for this code.// retVal = 0; +No type information for this code.// switch (i) { +No type information for this code.// case 2: +No type information for this code.// retVal = 1; +No type information for this code.// break; +No type information for this code.// case 3: +No type information for this code.// retVal = 1; +No type information for this code.// break; +No type information for this code.// default: +No type information for this code.// break; +No type information for this code.// } +No type information for this code. +No type information for this code.// for (var x in { x: 0, y: 1 }) { +No type information for this code.// } +No type information for this code. +No type information for this code.// try { +No type information for this code.// throw null; +No type information for this code.// } +No type information for this code.// catch (Exception) { +No type information for this code.// } +No type information for this code.// finally { +No type information for this code.// try { } +No type information for this code.// catch (Exception) { } +No type information for this code.// } +No type information for this code. +No type information for this code.// return retVal; +No type information for this code.// } +No type information for this code. +No type information for this code.// /// +No type information for this code.// /// Test types in ts language. Including class,struct,interface,delegate,anonymous type +No type information for this code.// /// +No type information for this code.// /// +No type information for this code.// public TYPES(): number { +No type information for this code.// var retVal = 0; +No type information for this code.// var c = new CLASS(); +No type information for this code.// var xx: IF = c; +No type information for this code.// retVal += c.Property; +No type information for this code.// retVal += c.Member(); +No type information for this code.// retVal += xx ^= Foo() ? 0 : 1; +No type information for this code. +No type information for this code.// //anonymous type +No type information for this code.// var anony = { a: new CLASS() }; +No type information for this code. +No type information for this code.// retVal += anony.a.d(); +No type information for this code. +No type information for this code.// return retVal; +No type information for this code.// } +No type information for this code. +No type information for this code. +No type information for this code.// ///// +No type information for this code.// ///// Test different operators +No type information for this code.// ///// +No type information for this code.// ///// +No type information for this code.// public OPERATOR(): number { +No type information for this code.// var a: number[] = [1, 2, 3, 4, implements , ];/*[] bug*/ // YES [] +No type information for this code.// var i = a[1];/*[]*/ +No type information for this code.// i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/ +No type information for this code.// var b = true && false || true ^ false;/*& | ^*/ +No type information for this code.// b = !b;/*!*/ +No type information for this code.// i = ~i;/*~i*/ +No type information for this code.// b = i < (i - continue ) && (i + 1) > i;/*< && >*/ +No type information for this code.// var f = true ? 1 : 0;/*? :*/ // YES : +No type information for this code.// i++;/*++*/ +No type information for this code.// i--;/*--*/ +No type information for this code.// b = true && false || true;/*&& ||*/ +No type information for this code.// i = i << 5;/*<<*/ +No type information for this code.// i = i >> 5;/*>>*/ +No type information for this code.// var j = i; +No type information for this code.// b = i == j && i != j && i <= j && i >= j;/*= == && != <= >=*/ +No type information for this code.// i += 5.0;/*+=*/ +No type information for this code.// i -= i;/*-=*/ +No type information for this code.// i *= i;/**=*/ +No type information for this code.// if (i == 0) +No type information for this code.// i++; +No type information for this code.// i /= i;/*/=*/ +No type information for this code.// i %= i;/*%=*/ +No type information for this code.// i &= i;/*&=*/ +No type information for this code.// i |= i;/*|=*/ +No type information for this code.// i ^= i;/*^=*/ +No type information for this code.// i <<= i;/*<<=*/ +No type information for this code.// i >>= i;/*>>=*/ +No type information for this code. +No type information for this code.// if (i == 0 && !b && f == 1) +No type information for this code.// return 0; +No type information for this code.// else return 1; +No type information for this code.// } +No type information for this code. +No type information for this code.// } +No type information for this code. +No type information for this code.// interface IF { +No type information for this code.// Foo